Package org.wso2.carbon.dataservices.core.description.operation

Examples of org.wso2.carbon.dataservices.core.description.operation.Operation


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

        }
      }
      /* add necessary equivalent batch operation for the above defined operation */
      if (dataService.isBatchRequestsEnabled()) {
        List<Operation> tmpOpList = new ArrayList<Operation>();
        Operation operation;
        for (String opName : dataService.getOperationNames()) {
          if (isBoxcarringOps(opName)) {
            /* skip boxcarring operations */
            continue;
          }
          operation = dataService.getOperation(opName);
          if (isBatchCompatible(operation)) {
            /* this is a batch operation and the parent operation is also given */
            Operation batchOp = new Operation(
                operation.getDataService(),
                operation.getName()  + DBConstants.BATCH_OPERATON_NAME_SUFFIX,
                "batch operation for '" + operation.getName() + "'",
                operation.getCallQueryGroup(), true,
                operation, operation.isDisableStreamingRequest(),
                operation.isDisableStreamingEffective());
            batchOp.setReturnRequestStatus(operation.isReturnRequestStatus());
            tmpOpList.add(batchOp);
          }
        }
        /* the operations are added outside the loop that iterates the operation list,
         * if we add it inside the loop while iterating, we will get a concurrent modification exception */
 
View Full Code Here

      /* set element type */
      inputElement.setType(inputComplexType);
      /* batch requests */
      if (request instanceof Operation && ((Operation) request).isBatchRequest()) {
        XmlSchemaElement nestedEl = new XmlSchemaElement();
        Operation parentOp = ((Operation) request).getParentOperation()
            if (parentOp != null) {
              nestedEl.setRefName(cparams.getRequestInputElementMap().get(
                  parentOp.getRequestName()));
              nestedEl.setMaxOccurs(Long.MAX_VALUE);
              addElementToComplexTypeSequence(cparams, inputComplexType, query.getInputNamespace(),
                  nestedEl, false);
            } else {
          throw new DataServiceFault("No parent operation for batch request: "
View Full Code Here

   * @return [0] - Normal operation list, [1] - Batch operation list
   */
  private static List<List<Operation>> extractOperations(DataService dataservice) {
    List<Operation> normalOperations = new ArrayList<Operation>();
    List<Operation> batchOperations = new ArrayList<Operation>();   
    Operation tmpOp;
    for (String opName : dataservice.getOperationNames()) {
      tmpOp = dataservice.getOperation(opName);
      if (tmpOp.isBatchRequest()) {
        batchOperations.add(tmpOp);
      } else {
        normalOperations.add(tmpOp);
      }
    }   
View Full Code Here

    }
    return list.toArray(new String[0]);
  }
 
  public String getQueryIdFromOperationName(String operationName) {
    Operation op = this.getDataService().getOperation(operationName);
    if (op != null) {
      return op.getCallQueryGroup().getDefaultCallQuery().getQueryId();
    } else {
      return null;
    }
  }
View Full Code Here

          DBConstants.CONTRACT_FIRST_DUMMY_SQL, queryParams,
          getResultFromAxisOperation(dataService, axisOperation), null, null,
          new HashMap<String, String>(),
          dataService.getServiceNamespace()));
      /* operation */
      dataService.addOperation(new Operation(dataService, operationName, null,
          getOperationCallQueryGroupFromQueryParams(dataService, queryId, queryParams),
          false, null, false, false));
    }
    return dataService;
  }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.dataservices.core.description.operation.Operation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.