当前位置: 首页>>代码示例>>Java>>正文


Java Configuration.getJson方法代码示例

本文整理汇总了Java中org.apache.taverna.scufl2.api.configurations.Configuration.getJson方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getJson方法的具体用法?Java Configuration.getJson怎么用?Java Configuration.getJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.taverna.scufl2.api.configurations.Configuration的用法示例。


在下文中一共展示了Configuration.getJson方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
		ConfigBean configBean, ParserState parserState)
		throws ReaderException {
	ParallelizeConfig parallelConfig = unmarshallConfig(t2FlowParser,
			configBean, "xstream", ParallelizeConfig.class);
	Configuration c = new Configuration();
	c.setType(scufl2Uri.resolve("#Config"));

	BigInteger maxJobs = parallelConfig.getMaxJobs();
	if (maxJobs != null && maxJobs.intValue() > 0
			&& maxJobs.intValue() != Defaults.maxJobs) {
		ObjectNode json = (ObjectNode) c.getJson();
		json.put("maxJobs", maxJobs.intValue());
	}
	return c;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:18,代码来源:ParallelizeParser.java

示例2: actionPerformed

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
/**
 * If the localworker has not been changed it pops up a {@link JOptionPane} warning the user
 * that they change things at their own risk. Otherwise just show the config view
 */
public void actionPerformed(ActionEvent e) {
	Object[] options = { "Continue", "Cancel" };
	Configuration configuration = scufl2Tools.configurationFor(activity, activity.getParent());
	JsonNode json = configuration.getJson();
	if (!json.get("isAltered").booleanValue()) {
		int n = JOptionPane
				.showOptionDialog(
						null,
						"Changing the properties of a Local Worker may affect its behaviour. Do you want to continue?",
						"WARNING", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,
						null, // do not use a
						// custom Icon
						options, options[0]);

		if (n == 0) {
			// continue was clicked so prepare for config
			openDialog();
		} else {
			// do nothing
		}
	} else {
		openDialog();
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:29,代码来源:LocalworkerActivityConfigurationAction.java

示例3: initialise

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
private void initialise() {
	if (panel == null) {
		panel = createPanel();
	} else {
		panel.removeAll();
	}

	JTextArea textArea = new ReadOnlyTextArea();
	textArea.setEditable(false);
	String maxJobs = "1";
	for (Configuration configuration : scufl2Tools.configurationsFor(processor, selectionManager.getSelectedProfile())) {
		JsonNode processorConfig = configuration.getJson();
		if (processorConfig.has("parallelize")) {
			JsonNode parallelizeConfig = processorConfig.get("parallelize");
			if (parallelizeConfig.has("maximumJobs")) {
				maxJobs = parallelizeConfig.get("maximumJobs").asText();
			}
		}
	}
	textArea.setText("The maximum number of jobs is " + maxJobs);
	textArea.setBackground(panel.getBackground());
	panel.add(textArea, BorderLayout.CENTER);
	revalidate();
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:25,代码来源:ParallelizeContextualView.java

示例4: 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;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:22,代码来源:ComponentActivityParser.java

示例5: refreshView

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
/**
 * Typically called when the activity configuration has changed.
 */
@Override
public void refreshView() {
	Configuration configuration = scufl2Tools.configurationFor(activity, activity.getParent());
	RESTActivityConfigurationBean configurationBean = new RESTActivityConfigurationBean(configuration.getJson());

	// toggle visibility of the elements that do not always appear
	HTTP_METHOD httpMethod = configurationBean.getHttpMethod();
	jlContentType.setVisible(httpMethod == HTTP_METHOD.POST || httpMethod == HTTP_METHOD.PUT);
	tfContentTypeHeader.setVisible(httpMethod == HTTP_METHOD.POST || httpMethod == HTTP_METHOD.PUT);
	jlSendDataAs.setVisible(httpMethod == HTTP_METHOD.POST || httpMethod == HTTP_METHOD.PUT);
	tfSendDataAs.setVisible(httpMethod == HTTP_METHOD.POST || httpMethod == HTTP_METHOD.PUT);
	jlSendHTTPExpectRequestHeader.setVisible(httpMethod == HTTP_METHOD.POST || httpMethod == HTTP_METHOD.PUT);
	tfSendHTTPExpectRequestHeader.setVisible(httpMethod == HTTP_METHOD.POST || httpMethod == HTTP_METHOD.PUT);
	jpMainPanel.revalidate();

	tfHTTPMethod.setText("" + configurationBean.getHttpMethod());
	taURLSignature.setText(configurationBean.getUrlSignature());
	tfAcceptHeader.setText(configurationBean.getAcceptsHeaderValue());
	tfContentTypeHeader.setText(configurationBean.getContentTypeForUpdates());
	tfSendDataAs.setText("" + configurationBean.getOutgoingDataFormat());
	tfSendHTTPExpectRequestHeader.setText("" + configurationBean.getSendHTTPExpectRequestHeader());
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:26,代码来源:RESTActivityMainContextualView.java

示例6: 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

示例7: refreshView

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
/**
 * Typically called when the activity configuration has changed.
 */
@Override
public void refreshView() {
	Configuration configuration = scufl2Tools.configurationFor(activity, activity.getParent());
	JsonNode json = configuration.getJson();

	// Set XPath Expression
	tfXPathExpression.setText(json.get("xpathExpression").asText());

	// Populate Namespace Mappings
	xpathNamespaceMappingsTableModel.getDataVector().removeAllElements();
	if (json.has("xpathNamespaceMap")) {
		for (JsonNode mapping : json.get("xpathNamespaceMap")) {
			xpathNamespaceMappingsTableModel.addRow(new Object[] {
					mapping.get("prefix").asText(), mapping.get("uri").asText() });
		}
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:21,代码来源:XPathActivityMainContextualView.java

示例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"));
	ObjectNode json = (ObjectNode) configuration.getJson();
	json.put("xpathExpression", "/");
	return configuration;
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:9,代码来源:XPathTemplateService.java

示例9: makeConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public Configuration makeConfiguration() {
	Configuration configuration = new Configuration("Hello");
	configuration.setConfigures(activity);

	configuration
			.setType(
					URI.create("http://ns.taverna.org.uk/2010/activity/beanshell#Config"));
	ObjectNode json = (ObjectNode) configuration.getJson();
	json.put("script",
			"hello = \"Hello, \" + personName;\n"
							+ "JOptionPane.showMessageDialog(null, hello);");
	return configuration;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:14,代码来源:ExampleWorkflow.java

示例10: parseConfiguration

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
		ConfigBean configBean, ParserState parserState)
		throws ReaderException {
	RetryConfig config = unmarshallConfig(t2FlowParser, configBean,
			"xstream", RetryConfig.class);

	Configuration c = new Configuration();
	c.setType(scufl2Uri.resolve("#Config"));

	ObjectNode json = (ObjectNode) c.getJson();

	BigInteger maxRetries = config.getMaxRetries();
	if (maxRetries != null
			&& (maxRetries.longValue() != MAX_RETRIES || maxRetries
					.longValue() < 0))
		json.put("maxRetries", maxRetries.longValue());

	if (maxRetries != null && maxRetries.longValue() != 0) {
		// Neither of these makes sense if retries are disabled

		if (config.getInitialDelay() != INITIAL_DELAY
				&& config.getInitialDelay() > -1)
			json.put("initialDelay", config.getInitialDelay());

		if (config.getMaxDelay() != MAX_DELAY && config.getMaxDelay() > -1)
			json.put("maxDelay", config.getMaxDelay());

		double delta = Math.abs(config.getBackoffFactor() - BACKOFF_FACTOR);
		if (config.getBackoffFactor() > 0 && delta > 1e-14)
			json.put("backoffFactor", config.getBackoffFactor());
	}
	return c;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:35,代码来源:RetryParser.java

示例11: parseAndAddOutputPortDefinition

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
protected ObjectNode parseAndAddOutputPortDefinition(
			ActivityPortDefinitionBean portBean, Configuration configuration,
			Activity activity) {
		ObjectNode configResource = (ObjectNode) configuration.getJson();
		OutputActivityPort outputPort = new OutputActivityPort();

		outputPort.setName(getPortElement(portBean, "name", String.class));
		outputPort.setParent(activity);

		BigInteger depth = getPortElement(portBean, "depth", BigInteger.class);
		if (depth != null)
			outputPort.setDepth(depth.intValue());
		
		BigInteger granularDepth = getPortElement(portBean, "granularDepth",
				BigInteger.class);
		if (granularDepth != null)
			outputPort.setGranularDepth(granularDepth.intValue());
		
		ObjectNode portConfig = configResource.objectNode();
//		PropertyResource portConfig = configResource.addPropertyAsNewResource(
//				Scufl2Tools.PORT_DEFINITION.resolve("#outputPortDefinition"),
//				Scufl2Tools.PORT_DEFINITION.resolve("#OutputPortDefinition"));

		@SuppressWarnings("unused")
		URI portUri = new URITools().relativeUriForBean(outputPort, configuration);
//		portConfig.addPropertyReference(Scufl2Tools.PORT_DEFINITION.resolve("#definesOutputPort"), portUri);

	      // Legacy duplication of port details for XMLSplitter activities
        portConfig.put("name", outputPort.getName());
        portConfig.put("depth", outputPort.getDepth());
        portConfig.put("granularDepth", outputPort.getDepth());
		
		parseMimeTypes(portBean, portConfig);
		return portConfig;
	}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:36,代码来源:AbstractActivityParser.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:32,代码来源:SoaplabActivityParser.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:16,代码来源:BiomartActivityParser.java

示例14: 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 operation = json.objectNode();
	json.put("operation", operation);
	operation.put("wsdl", getURI().toString());
	operation.put("name", getOperation());
	return configuration;
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:12,代码来源:WSDLServiceDescription.java

示例15: setUp

import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
	a=new Activity();
	Configuration configuration = new Configuration();
	ObjectNode json = (ObjectNode) configuration.getJson();
	ObjectNode operation = json.objectNode();
	operation.put("name", "getReport");
	json.set("operation", operation);
	String wsdlUrl=TestWSDLActivityContextualView.class.getResource("/GMService.wsdl").toExternalForm();
	operation.put("wsdl", wsdlUrl);
	configuration.setConfigures(a);
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:13,代码来源:TestWSDLActivityContextualView.java


注:本文中的org.apache.taverna.scufl2.api.configurations.Configuration.getJson方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。