congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ReferenceService
Code IndexAdd Tabnine to your IDE (free)

How to use
ReferenceService
in
net.sf.taverna.t2.reference

Best Java code snippets using net.sf.taverna.t2.reference.ReferenceService (Showing top 20 results out of 315)

origin: net.sf.taverna.t2.activities/wsdl-activity

  private Map<String,Object> buildInputMap(Map<String, T2Reference> data,ReferenceService referenceService) throws ReferenceServiceException {
    Map<String,Object> result = new HashMap<String, Object>();
    for (String inputName : data.keySet()) {
      T2Reference id = data.get(inputName);
      result.put(inputName, referenceService.renderIdentifier(id,String.class, callback.getContext()));
    }
    return result;
  }
});
origin: net.sf.taverna.t2.activities/wsdl-activity

private Map<String, T2Reference> createOutputData(
    Map<String, String> outputMap,ReferenceService referenceService) throws ReferenceServiceException {
  Map<String,T2Reference> result = new HashMap<String, T2Reference>();
  for (String outputName : outputMap.keySet()) {
    String xmlOut = outputMap.get(outputName);
    result.put(outputName, referenceService.register(xmlOut, 0, true, callback.getContext()));
  }
  return result;
}
origin: net.sf.taverna.t2.component/component-activity

/**
 * @param originalCallback
 * @param invocationContext
 * @param exceptionHandling2
 */
public ProxyCallback(AsynchronousActivityCallback originalCallback,
    InvocationContext invocationContext,
    ExceptionHandling exceptionHandling2) {
  super();
  this.originalCallback = originalCallback;
  this.exceptionHandling = exceptionHandling2;
  context = invocationContext;
  referenceService = context.getReferenceService();
  listService = referenceService.getListService();
  errorService = referenceService.getErrorDocumentService();
}
origin: net.sf.taverna.t2.integration-testing/integration-testing-common

public void resultTokenProduced(WorkflowDataToken dataToken, String portname) {
  if (dataToken.getIndex().length == 0) {
    T2Reference reference = dataToken.getData();
    System.out.println("Output reference made = " + reference);
    Object value = reference;
    if (reference.containsErrors()) {
      System.out.println("Contains errors!");
      printAllErrors(context.getReferenceService().resolveIdentifier(
          reference, null, context));
    } else {
      try {
        value = context.getReferenceService().renderIdentifier(
            reference, Object.class, context);
      } catch (ReferenceServiceException ex) {
        ex.printStackTrace();
      }
    }
    resultMap.put(portname, value);
    synchronized (this) {
      outputCount--;
    }
  }
}
origin: net.sf.taverna.t2.ui-exts/renderers-exts

try {
  ReferenceSet refSet = referenceService
      .getReferenceSetService()
      .getReferenceSet(reference);
  approximateSizeInBytes = refSet.getApproximateSizeInBytes()
try {
  resolve = (String) referenceService.renderIdentifier(
      reference, String.class, null);
} catch (Exception e) {
origin: net.sf.taverna.t2.activities/sadi-activity

try {
  List<?> inputNodes = (List<RDFNode>) referenceService.renderIdentifier(
      inputReference, RDFNode.class, context);
  inputPortMapping.get(portName).setValues(inputUri, inputNodes);
} catch (ReferenceServiceException e) {
  List<?> inputValues = (List<String>) referenceService.renderIdentifier(
      inputReference, String.class, context);
  inputPortMapping.get(portName).setValues(inputUri, inputValues);
outputData.put(outputPort.getName(), referenceService.register(outputPort
    .getValues(inputUri), outputPort.getDepth(), true, context));
outputPort.clearValues(inputUri);
origin: net.sf.taverna.t2.activities/jsonpath-activity

String jsonInput = (String) referenceService.renderIdentifier(inputs.get(IN_JSON), String.class, context);
Object jsonValue;
if (outNodesText.isEmpty()) {
  ErrorDocumentService errorDocService = referenceService.getErrorDocumentService();
  ErrorDocumentService errorDocService = referenceService.getErrorDocumentService();
T2Reference firstNodeAsText = referenceService.register(textValue, 0, true, context);
T2Reference firstNodeAsJson = referenceService.register(jsonValue, 0, true, context);
outputs.put(SINGLE_VALUE_TEXT, firstNodeAsText);
outputs.put(SINGLE_VALUE_JSON, firstNodeAsJson);
  T2Reference outNodesAsText = referenceService.register(outNodesText, 1, true, context);
  outputs.put(OUT_TEXT, outNodesAsText);
  T2Reference outNodesAsXML = referenceService.register(outNodesJSON, 1, true, context);
  outputs.put(OUT_JSON, outNodesAsXML);
origin: net.sf.taverna.t2.activities/activity-test-utils

Object val = inputs.get(inputName);
int depth = getDepth(val);
inputEntities.put(inputName, referenceService.register(val, depth, true, callback.getContext()));
    result = referenceService.resolveIdentifier(id, null, callback.getContext());
    results.put(output.getKey(), result);
    result = referenceService.renderIdentifier(id, output.getValue(), callback.getContext());
    results.put(output.getKey(), result);
origin: net.sf.taverna.t2.lang/results

ReferenceSet rs = referenceService.getReferenceSetService().getReferenceSet(reference);
if (rs == null) {
  throw new ReferenceServiceException("Could not find ReferenceSet " + reference);
try{
  if (dataNature.equals(ReferencedDataNature.TEXT)) {
    dataValue = referenceService.renderIdentifier(reference, String.class, context);
  } else {
    dataValue = referenceService.renderIdentifier(reference, byte[].class, context);
ErrorDocument errorDocument = (ErrorDocument)referenceService.resolveIdentifier(reference, null, context);
String errorString = ResultsUtils.buildErrorDocumentString(errorDocument, context);
return errorString;
IdentifiedList<T2Reference> identifiedList = referenceService.getListService().getList(reference);
List<Object> list = new ArrayList<Object>();
origin: net.sf.taverna.t2.workbench.views/results

  dataValue = context.getReferenceService().renderIdentifier(reference, Object.class, context);
ErrorDocument errorDocument = (ErrorDocument)context.getReferenceService().resolveIdentifier(reference, null, context);
String errorString = ResultsUtils.buildErrorDocumentString(errorDocument, context);
return errorString;
.getReferenceService().getListService().getList(reference);
List<Object> list = new ArrayList<Object>();
origin: net.sf.taverna.t2/provenance-client

Object value = getInvocationContext().getReferenceService().renderIdentifier(
    getInvocationContext().getReferenceService().referenceFromString(bindings.get(0).getValue()), Object.class, getInvocationContext());
      T2Reference ref = getInvocationContext().getReferenceService().referenceFromString(record.getValue());
      Object o = getInvocationContext().getReferenceService().renderIdentifier(ref, Object.class, getInvocationContext()); 
      logger.info("\t\t\tvalue: "+o);
origin: net.sf.taverna.t2.activities/external-tool-activity

  results.put(cur.getKey(), ref);
} else {
  ErrorDocument ed = referenceService.getErrorDocumentService().registerError("No result for " + cur.getKey(), 0, getContext());
  results.put(cur.getKey(), ed);
origin: net.sf.taverna.t2.core/workflowmodel-impl

List<T2Reference> idlist = listItems.get(outputName);
newDataMap.put(outputName, context.getReferenceService()
    .getListService().registerList(idlist, context).getId());
origin: net.sf.taverna.t2.activities/external-tool-activity

if (input.isList()) {
  IdentifiedList<T2Reference> listOfReferences = (IdentifiedList<T2Reference>) referenceService
      .getListService().getList(t2Reference);
    listFile.setTag(input.getTag());
    T2Reference listFileContentReference = referenceService
        .register(listFileContent, 0, true, invocationContext);
        .register(filenamesFileContent, 0, true, null);
    tags.put(listFile.getTag(), setOneInput(referenceService,
        filenamesFileContentReference, listFile));
            .register(outputStream.toByteArray(), 0, true,
                invocationContext);
        tags.put(input.getTag(), setOneInput(referenceService,
            .register(outputStream.toByteArray(), 0, true,
                invocationContext);
        tags.put(input.getTag(), setOneInput(referenceService,
origin: net.sf.taverna.t2.core/provenanceconnector

ErrorDocument error = referenceService.getErrorDocumentService()
    .getError(reference);
element.setAttribute("id", reference.toString());
ReferenceSet referenceSet = referenceService
    .getReferenceSetService().getReferenceSet(reference);
Set<ExternalReferenceSPI> externalReferences = referenceSet
    .getExternalReferences();
  T2ReferenceType.IdentifiedList)) {
IdentifiedList<T2Reference> list = referenceService
    .getListService().getList(reference);
origin: net.sf.taverna.t2.activities/external-tool-activity

private FileReference getAsFileReference(ReferenceService referenceService, T2Reference t2Reference) {
  Identified identified = referenceService.resolveIdentifier(t2Reference, null, null);
  if (identified instanceof ReferenceSet) {
    for (ExternalReferenceSPI ref : ((ReferenceSet) identified).getExternalReferences()) {
      if (ref instanceof FileReference) {
        return (FileReference) ref;
      }
    }
  }
  return null;
}
origin: net.sf.taverna.t2.ui-components/results-view

private File writeDataObject(File destination, String name,
    T2Reference ref, String defaultExtension) throws IOException {
  Identified identified = referenceService.resolveIdentifier(ref, null,
      context);
    targetDir.mkdir();
    int count = 0;
    List<T2Reference> elements = referenceService.getListService().getList(ref);
    for (T2Reference subRef : elements) {
      writeDataObject(targetDir, "" + count++, subRef,
origin: net.sf.taverna.t2.activities/wsdl-activity

for (String key : data.keySet()) {
  Object renderIdentifier = referenceService
      .renderIdentifier(data.get(key), String.class,
          callback.getContext());
  if (isWsrfService()
    if (depth != null) {
      outputData.put(outputName, referenceService
          .register(value, depth, true, callback
              .getContext()));
    } else {
          .register(value, 0, true, callback
              .getContext()));
origin: net.sf.taverna.t2.ui-activities/rest-activity

 for (String inputName : configBean.getActivityInputs().keySet()) {
  urlParameters.put(inputName,
           (String) referenceService.renderIdentifier(inputs.get(inputName), 
              configBean.getActivityInputs().get(inputName), context)
       );
 inputMessageBody = referenceService.renderIdentifier(
               inputs.get(IN_BODY), 
               configBean.getOutgoingDataFormat().getDataFormat(), context);
if (requestResponse.hasServerError()) {
 ErrorDocument errorDocument = referenceService.getErrorDocumentService().registerError(requestResponse.getResponseBody().toString(), 0, context);
 responseBodyRef = referenceService.register(errorDocument, 0, true, context);
 responseBodyRef = referenceService.register(requestResponse.getResponseBody(), 0, true, context);
 responseBodyRef = referenceService.register("", 0, true, context);
T2Reference statusRef = referenceService.register(requestResponse.getStatusCode(), 0, true, context);
outputs.put(OUT_STATUS, statusRef);
 T2Reference redirectionRef = referenceService.register(requestResponse.getRedirectionURL(), 0, true, context);
 outputs.put(OUT_REDIRECTION, redirectionRef);
origin: net.sf.taverna.t2.workbench.views/results

Identified identified = context.getReferenceService().resolveIdentifier(resultReference, null, context);
MagicMatch magicMatch = null;
    data = context.getReferenceService().renderIdentifier(resultReference, Object.class, context);
net.sf.taverna.t2.referenceReferenceService

Javadoc

Top level access point to the reference manager for client code which is aware of references and error documents. Provides methods to store and retrieve instances of ReferenceSet, IdentifiedList<T2Reference> and ErrorDocument. Acts as an integration layer for the three sub-component service, providing in addition collection traversal and retrieval of lists of identified entities (ReferenceSet, IdentifiedList<Identified> and ErrorDocument) from a T2Reference identifying a list.

Also provides registration and retrieval logic for POJOs where supported by appropriate plug-in instances, these methods can be used by code which is not 'reference aware' to store and retrieve value types transparently.

Resolution of collections can happen at three different levels:

  1. The embedded ListService resolves the collection ID to a list of child IDs, and doesn't traverse these children if they are themselves lists. Use the #getListService(). ListService#getList(T2Reference)to call this method directly on the list service if you need this functionality, returning a list of T2Reference
  2. The #resolveIdentifier(T2Reference,Set,ReferenceContext)method in this service instead resolves to a fully realized collection of the entities which those IDs reference, and does recursively apply this to child lists, resulting in a nested collection structure where the leaf nodes are ReferenceSet and ErrorDocument instances and non-leaf are IdentifiedList of Identified (the super-interface for IdentifiedList, ReferenceSet and ErrorDocument). Use this method if you want to access the ExternalReferenceSPI and ErrorDocument entities directly because your code can act on a particular reference type - in general in these cases you would also be using the augmentation system to ensure that the required reference type was actually present in the collection structure.
  3. The third level of resolution is to render the identifier through #renderIdentifier(T2Reference,Class,ReferenceContext)to a nested structure as in #resolveIdentifier(T2Reference,Set,ReferenceContext)but where the structure consists of POJOs of the specified type and lists or either list or the leaf type. This is used when your code is reference agnostic and just requires the values in an easy to consume fashion. Note that because this involves pulling the entire structure into memory it may not be suitable for large data, use with caution. This method will, unlike #resolveIdentifier(T2Reference,Set,ReferenceContext), fail if the reference contains or is an error.

Most used methods

  • renderIdentifier
    Resolve the given identifier, building a POJO structure where the non-list items are of the desired
  • register
    The top level registration method is used to register either as yet unregistered ErrorDocuments and
  • getErrorDocumentService
    Returns the ErrorDocumentService this ReferenceService uses, use this when you need functionality fr
  • getListService
    Returns the ListService this ReferenceService uses, use this when you need functionality from that s
  • resolveIdentifier
    Perform recursive identifier resolution, building a collection structure of Identified objects, any
  • getReferenceSetService
    Returns the ReferenceSetService this ReferenceService uses, use this when you need functionality fro
  • referenceFromString
  • traverseFrom
    Initiates a traversal of the specified t2reference, traversing to whatever level of depth is require

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now