本文整理汇总了Java中org.apache.taverna.scufl2.api.configurations.Configuration.setType方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.setType方法的具体用法?Java Configuration.setType怎么用?Java Configuration.setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.taverna.scufl2.api.configurations.Configuration
的用法示例。
在下文中一共展示了Configuration.setType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIdenticalConfigurableTypes
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Test
public void testIdenticalConfigurableTypes() {
Configuration configuration = new Configuration();
Activity a = new Activity();
URI tavernaUri = null;
try {
tavernaUri = new URI("http://www.taverna.org.uk");
} catch (URISyntaxException e) {
return;
}
configuration.setConfigures(a);
configuration.setType(tavernaUri);
a.setType(tavernaUri);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(configuration, false, rcvl);
Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
assertEquals(0, mismatchConfigurableTypeProblems.size());
}
示例2: getActivityConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration getActivityConfiguration() {
Configuration configuration = new Configuration();
configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
ObjectNode json = (ObjectNode) configuration.getJson();
ObjectNode requestNode = json.objectNode();
requestNode.put("httpMethod", RESTActivity.HTTP_METHOD.GET.name());
requestNode.put("absoluteURITemplate", "http://www.uniprot.org/uniprot/{id}.xml");
ArrayNode headersNode = requestNode.arrayNode();
headersNode.addObject().put("header", "Accept").put("value", "application/xml");
headersNode.addObject().put("header", "Content-Type").put("value", "application/xml");
requestNode.set("headers", headersNode);
json.set("request", requestNode);
json.put("outgoingDataFormat", RESTActivity.DATA_FORMAT.String.name());
json.put("showRedirectionOutputPort", false);
json.put("showActualURLPort", false);
json.put("showResponseHeadersPort", false);
json.put("escapeParameters", true);
return configuration;
}
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:24,代码来源:GenericRESTTemplateService.java
示例3: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
ComponentConfig config = unmarshallConfig(t2FlowParser, configBean,
"xstream", ComponentConfig.class);
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(ACTIVITY_URI.resolve("#Config"));
json.put("registryBase", config.getRegistryBase());
json.put("familyName", config.getFamilyName());
json.put("componentName", config.getComponentName());
if (config.getComponentVersion() != null)
json.put("componentVersion", (int) config.getComponentVersion());
return configuration;
}
示例4: getActivityConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration getActivityConfiguration() {
Configuration configuration = new Configuration();
configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
ObjectNode json = configuration.getJsonAsObjectNode();
json.put("ogcServiceUri", ogcServiceUri.toASCIIString());
json.put("processIdentifier", processIdentifier);
return configuration;
}
示例5: createConfigurationFor
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public Configuration createConfigurationFor(Activity activity,
URI configType) {
Profile profile = activity.getParent();
Configuration config = new Configuration(activity.getName());
profile.getConfigurations().addWithUniqueName(config);
config.setParent(profile);
config.setConfigures(activity);
config.setType(configType);
return config;
}
示例6: getConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public Configuration getConfiguration() {
Configuration c = new Configuration();
c.getJsonAsObjectNode().put(REGISTRY_BASE,
registryBase.toExternalForm());
c.getJsonAsObjectNode().put(FAMILY_NAME, familyName);
c.setType(providerId);
return c;
}
开发者ID:apache,项目名称:incubator-taverna-plugin-component,代码行数:9,代码来源:ComponentServiceProviderConfig.java
示例7: makeConfig
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
private static Configuration makeConfig(String registryUrl,
String familyName) {
ObjectNode cfg = JsonNodeFactory.instance.objectNode();
cfg.put(REGISTRY_BASE, registryUrl);
cfg.put(FAMILY_NAME, familyName);
Configuration conf = new Configuration();
conf.setJson(cfg);
conf.setType(providerId);
return conf;
}
示例8: getActivityConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration getActivityConfiguration() {
Configuration configuration = new Configuration();
configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
configuration.getJsonAsObjectNode().put("script", "");
configuration.getJsonAsObjectNode().put("classLoaderSharing", "workflow");
return configuration;
}
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:9,代码来源:BeanshellTemplateService.java
示例9: getActivityConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration getActivityConfiguration() {
Configuration configuration = new Configuration();
configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
String queryText = new XMLOutputter().outputString(new Document(martQuery));
((ObjectNode) configuration.getJson()).put("martQuery", queryText);
return configuration;
}
开发者ID:apache,项目名称:incubator-taverna-plugin-bioinformatics,代码行数:9,代码来源:BiomartServiceDescription.java
示例10: getActivityConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration getActivityConfiguration() {
Configuration configuration = new Configuration();
configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
ObjectNode json = (ObjectNode) configuration.getJson();
json.put("xpathExpression", "/");
return configuration;
}
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:9,代码来源:XPathTemplateService.java
示例11: getActivityConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration getActivityConfiguration() {
Configuration configuration = new Configuration();
configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
((ObjectNode) configuration.getJson()).put("string", DEFAULT_VALUE);
return configuration;
}
示例12: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
SoaplabConfig soaplabConfig = unmarshallConfig(t2FlowParser,
configBean, "xstream", SoaplabConfig.class);
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(scufl2Uri.resolve("#Config"));
String endpoint = soaplabConfig.getEndpoint();
if (endpoint == null || endpoint.isEmpty())
throw new ReaderException("Soablab config has no endpoint set");
json.put("endpoint", endpoint);
double pollingBackoff = soaplabConfig.getPollingBackoff();
json.put("pollingBackoff", pollingBackoff);
BigInteger pollingInterval = soaplabConfig.getPollingInterval();
if (pollingInterval != null)
json.put("pollingInterval", pollingInterval.intValue());
BigInteger pollingIntervalMax = soaplabConfig.getPollingIntervalMax();
if (pollingIntervalMax != null)
json.put("pollingIntervalMax", pollingIntervalMax.intValue());
return configuration;
}
示例13: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(ACTIVITY_URI.resolve("#Config"));
json.put("martQuery",
T2FlowParser.elementToXML((Element) configBean.getAny()));
return configuration;
}
示例14: testName
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Test
public void testName() throws Exception {
// Workflow
WorkflowBundle wb = new WorkflowBundleIO().createBundle();
Workflow wf = wb.getMainWorkflow();
wf.setName("test_wf");
InputWorkflowPort raw = new InputWorkflowPort(wf, "RAW");
OutputWorkflowPort msconvert_log = new OutputWorkflowPort(wf, "MSCONVERT_LOG");
OutputWorkflowPort cmd = new OutputWorkflowPort(wf, "cmd");
// processor
Processor msconvert = new Processor(wf, "MSCONVERT");
InputProcessorPort ms_raw = new InputProcessorPort(msconvert, "raw");
OutputProcessorPort ms_out = new OutputProcessorPort(msconvert, "out");
OutputProcessorPort ms_cmd = new OutputProcessorPort(msconvert, "cmd");
// links
new DataLink(wf, raw, ms_raw);
new DataLink(wf, ms_out, msconvert_log);
new DataLink(wf, ms_cmd, cmd);
// Beanshell script
Activity script = new Activity("msconvert");
script.setType(BEANSHELL);
Profile profile = wb.getMainProfile();
script.setParent(profile);
profile.getActivities().add(script);
scufl2Tools.createActivityPortsFromProcessor(script, msconvert);
scufl2Tools.bindActivityToProcessorByMatchingPorts(script, msconvert);
Configuration config = new Configuration();
config.setConfigures(script);
config.setType(BEANSHELL.resolve("#Config"));
((ObjectNode)config.getJson()).put("script",
"blablalbal");
profile.getConfigurations().add(config);
// Save to file (or System.out ? )
File file = File.createTempFile("test", ".wfbundle");
bundleIo.writeBundle(wb, file, bundleType);
System.out.println(file);
}
示例15: actionPerformed
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
try {
Activity activity = new Activity();
activity.setType(STRING_CONSTANT);
Configuration configuration = new Configuration();
configuration.setType(STRING_CONSTANT.resolve("#Config"));
configuration.getJsonAsObjectNode().put("string", "");
configuration.setConfigures(activity);
StringConstantConfigView configView = new StringConstantConfigView(activity,
configuration, serviceRegistry);
int answer = JOptionPane.showConfirmDialog(component, configView,
"Text constant value", JOptionPane.OK_CANCEL_OPTION);
if (answer != JOptionPane.CANCEL_OPTION) {
configView.noteConfiguration();
configuration.setJson(configView.getJson());
Profile profile = selectionManager.getSelectedProfile();
Processor processor = new Processor();
processor.setName(inputPort.getName() + "_value");
CrossProduct crossProduct = new CrossProduct();
crossProduct.setParent(processor.getIterationStrategyStack());
ProcessorBinding processorBinding = new ProcessorBinding();
processorBinding.setBoundProcessor(processor);
processorBinding.setBoundActivity(activity);
// create activity port
OutputActivityPort activityPort = new OutputActivityPort(activity, "value");
activityPort.setDepth(0);
activityPort.setGranularDepth(0);
// create processor port
OutputProcessorPort processorPort = new OutputProcessorPort(processor,
activityPort.getName());
processorPort.setDepth(0);
processorPort.setGranularDepth(0);
// add a new port binding
new ProcessorOutputPortBinding(processorBinding, activityPort, processorPort);
// Add a data link between the string constant processor's output port
// and the processor containing the passed inputPort.
DataLink datalink = new DataLink();
datalink.setReceivesFrom(processorPort);
datalink.setSendsTo(inputPort);
List<Edit<?>> editList = new ArrayList<Edit<?>>();
editList.add(new AddChildEdit<Profile>(profile, activity));
editList.add(new AddChildEdit<Profile>(profile, configuration));
editList.add(new AddChildEdit<Profile>(profile, processorBinding));
editList.add(new AddProcessorEdit(dataflow, processor));
editList.add(new AddDataLinkEdit(dataflow, datalink));
editManager.doDataflowEdit(dataflow.getParent(), new CompoundEdit(editList));
}
} catch (EditException ex) {
logger.error("Adding default value for input port failed", ex);
}
}