本文整理汇总了Java中org.apache.taverna.scufl2.api.configurations.Configuration.getJsonAsObjectNode方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getJsonAsObjectNode方法的具体用法?Java Configuration.getJsonAsObjectNode怎么用?Java Configuration.getJsonAsObjectNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.taverna.scufl2.api.configurations.Configuration
的用法示例。
在下文中一共展示了Configuration.getJsonAsObjectNode方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState) throws ReaderException {
DataflowConfig dataflowConfig = unmarshallConfig(t2FlowParser,
configBean, "dataflow", DataflowConfig.class);
Configuration configuration = new Configuration();
configuration.setType(nestedUri.resolve("#Config"));
String wfId = dataflowConfig.getRef();
URI wfUri = WORKFLOW_ROOT.resolve(wfId + "/");
Workflow wf = (Workflow) getUriTools().resolveUri(wfUri, parserState.getCurrentWorkflowBundle());
if (wf == null)
throw new ReaderException("Can't find nested workflow with id " + wfId);
ObjectNode json = configuration.getJsonAsObjectNode();
json.put("nestedWorkflow", wf.getName());
return configuration;
}
示例2: whichLayers
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Test
public void whichLayers() throws Exception {
Processor parallelise = processors.getByName("retries");
// As inspected in /scufl2-t2flow/src/test/resources/dispatchlayers-xsd.t2flow
// List<String> expectedNames = Arrays.asList(PARALLELIZE, ERRORBOUNCE, FAILOVER, RETRY, INVOKE);
// NOTE: Only those with configuration are present
List<String> expectedNames = Arrays.asList(RETRY);
Configuration config = scufl2Tools.configurationFor(parallelise, profile);
ObjectNode json = config.getJsonAsObjectNode();
for (String name : expectedNames) {
assertTrue("Could not find config for dispatch layer " + name,
json.has(name)); }
assertEquals("Additional dispatch layer configurations found",
expectedNames.size(), json.size());
}
示例3: defaultConfig
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
private static Configuration defaultConfig() {
Configuration c = new Configuration();
ObjectNode conf = c.getJsonAsObjectNode();
conf.put("osgiServiceUri", "http://localhost:8080/geoserver/ows");
conf.put("processIdentifier", "gs:StringConcatWPS");
return c;
}
示例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: parseSimpleTell
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Test
public void parseSimpleTell() throws Exception {
WorkflowBundle researchObj = parseWorkflow(WF_SIMPLE_COMPONENT);
Profile profile = researchObj.getMainProfile();
assertNotNull("could not find profile in bundle", profile);
Processor comp = researchObj.getMainWorkflow().getProcessors()
.getByName("combiner");
assertNotNull("could not find processor 'combiner'", comp);
Configuration config = scufl2Tools
.configurationForActivityBoundToProcessor(comp, profile);
Activity act = (Activity) config.getConfigures();
assertEquals(ACTIVITY_URI, act.getType());
ObjectNode resource = config.getJsonAsObjectNode();
assertEquals(ACTIVITY_URI.resolve("#Config"), config.getType());
int length = 0;
Iterator<?> i = resource.fieldNames();
while (i.hasNext()) {
i.next();
length++;
}
assertEquals("must be exactly 4 items in the translated component", 4,
length);
assertEquals("http://www.myexperiment.org", resource
.get("registryBase").textValue());
assertEquals("SCAPE Utility Components", resource.get("familyName")
.textValue());
assertEquals("MeasuresDocCombiner", resource.get("componentName")
.textValue());
assertEquals(1, resource.get("componentVersion").asInt());
assertEquals(2, comp.getInputPorts().size());
assertEquals(1, comp.getOutputPorts().size());
}
示例6: parseSimpleTell
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Test
public void parseSimpleTell() throws Exception {
WorkflowBundle researchObj = parseWorkflow(WF_SIMPLE_TELL);
NamedSet<Profile> profiles = researchObj.getProfiles();
Profile profile = profiles.getByName("taverna-biodiversity-2.5.0");
assertNotNull("Could not find profile", profile);
Processor tell = researchObj.getMainWorkflow().getProcessors()
.getByName("tell");
assertNotNull("Could not find processor tell", tell);
Configuration tellConfig = scufl2Tools
.configurationForActivityBoundToProcessor(tell, profile);
Activity tellAct = (Activity) tellConfig.getConfigures();
assertEquals(ACTIVITY_URI, tellAct.getType());
ObjectNode tellResource = tellConfig.getJsonAsObjectNode();
assertEquals(ACTIVITY_URI.resolve("#Config"), tellConfig.getType());
String presentationOrigin = tellResource.get("presentationOrigin").textValue();
assertEquals("tell", presentationOrigin);
String interactionActivityType = tellResource.get("interactionActivityType").textValue();
assertEquals("VelocityTemplate", interactionActivityType);
boolean progressNotification = tellResource.get("progressNotification").booleanValue();
assertFalse(progressNotification);
}
示例7: parseMultipleChoice
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Test
public void parseMultipleChoice() throws Exception {
WorkflowBundle researchObj = parseWorkflow(WF_MULTIPLE_CHOICE);
NamedSet<Profile> profiles = researchObj.getProfiles();
Profile profile = profiles.getByName("taverna-biodiversity-2.5.0");
assertNotNull("Could not find profile", profile);
Processor interaction = researchObj.getMainWorkflow().getProcessors()
.getByName("Interaction");
assertNotNull("Could not find processor Interaction", interaction);
Configuration interactionConfig = scufl2Tools
.configurationForActivityBoundToProcessor(interaction, profile);
Activity interactionAct = (Activity) interactionConfig.getConfigures();
assertEquals(ACTIVITY_URI, interactionAct.getType());
ObjectNode interactionResource = interactionConfig.getJsonAsObjectNode();
assertEquals(ACTIVITY_URI.resolve("#Config"), interactionConfig.getType());
String presentationOrigin = interactionResource.get("presentationOrigin").textValue();
assertEquals("http://build.mygrid.org.uk/taverna/internal/biovel/multiple_selection.html", presentationOrigin);
String interactionActivityType = interactionResource.get("interactionActivityType").textValue();
assertEquals("LocallyPresentedHtml", interactionActivityType);
boolean progressNotification = interactionResource.get("progressNotification").booleanValue();
assertFalse(progressNotification);
}
示例8: installConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public void installConfiguration(Activity a) {
Configuration conf = a.createConfiguration(ACTIVITY_URI);
ObjectNode json = conf.getJsonAsObjectNode();
json.put(REGISTRY_BASE, getRegistryBase().toExternalForm());
json.put(FAMILY_NAME, getFamilyName());
json.put(COMPONENT_NAME, getComponentName());
json.put(COMPONENT_VERSION, getComponentVersion());
}
开发者ID:apache,项目名称:incubator-taverna-plugin-component,代码行数:9,代码来源:ComponentActivityConfigurationBean.java
示例9: Conf
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
Conf(Configuration config) throws MalformedURLException {
ObjectNode node = config.getJsonAsObjectNode();
JsonNode item = node.get(REGISTRY_BASE);
if (item != null && !item.isNull())
registryBase = URI.create(item.textValue()).toURL();
item = node.get(FAMILY_NAME);
if (item != null && !item.isNull())
familyName = item.textValue();
}
示例10: installActivityConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
/**
* Update the given configuration to have the fields for the component that
* this class identifies.
*/
public void installActivityConfiguration(Configuration config) {
ObjectNode c = config.getJsonAsObjectNode();
ID id = getIdentification();
c.put(REGISTRY_BASE, id.getRegistryBase().toExternalForm());
c.put(FAMILY_NAME, id.getFamilyName());
c.put(COMPONENT_NAME, id.getComponentName());
c.put(COMPONENT_VERSION, id.getComponentVersion());
config.setJson(c);
}
示例11: parseDispatchStack
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
protected void parseDispatchStack(DispatchLayer dispatchLayer)
throws ReaderException {
URI typeUri = mapTypeFromRaven(dispatchLayer.getRaven(),
dispatchLayer.getClazz());
ObjectNode procConfig = parserState.get().getCurrentConfiguration().getJsonAsObjectNode();
try {
Configuration dispatchConfig = parseConfiguration(dispatchLayer.getConfigBean());
URI relUri = INTERNAL_DISPATCH_PREFIX.relativize(typeUri);
String name;
if (!relUri.isAbsolute()) {
/*
* It's an internal layer. We'll put it under the name which
* we'll cleverly fish out of the URI path, eg. "retry" or
* "parallelize"
*/
name = relUri.getPath().toLowerCase();
if (dispatchConfig != null && dispatchConfig.getJson().size() > 0)
// But only if non-empty (non-default)
procConfig.put(name, dispatchConfig.getJson());
} else {
ObjectNode json;
if (dispatchConfig != null && dispatchConfig.getJson().isObject())
json = dispatchConfig.getJsonAsObjectNode();
else {
/*
* We'll still need to create an objectNode to keep _type
* and _below
*/
json = procConfig.objectNode();
if (dispatchConfig != null)
// We'll put the non-objectnode here
json.put("_config", dispatchConfig.getJson());
}
/*
* Not really much to go from here, we don't want to use the
* typeUri as the name as third-party layers in theory could be
* added several times for same type
*/
name = randomUUID().toString();
json.put("_type", typeUri.toString());
// Might be null - meaning "top"
json.put("_below", parserState.get()
.getPreviousDispatchLayerName());
procConfig.put(name, json);
}
parserState.get().setPreviousDispatchLayerName(name);
} catch (JAXBException ex) {
String message = "Can't parse configuration for dispatch layer in "
+ parserState.get().getCurrentProcessor();
if (isStrict())
throw new ReaderException(message, ex);
logger.log(WARNING, message, ex);
}
}