Package org.wso2.carbon.business.messaging.paypal.mediator

Examples of org.wso2.carbon.business.messaging.paypal.mediator.Input


    }

    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

   * @return an instance of Input.
   */
  @SuppressWarnings("unchecked")
  private Input createInput(OMElement inputElement) {

    Input input = new Input();
    OMAttribute typeAttr = inputElement.getAttribute(ATTR_TYPE);
    if (null == typeAttr || null == typeAttr.getAttributeValue()) {
      input.setName(inputElement.getAttribute(ATTR_NAME)
          .getAttributeValue());
    } else {
      input.setType(typeAttr.getAttributeValue());
      for (Iterator<OMElement> itr = inputElement
          .getChildrenWithName(ELEM_INPUT); itr.hasNext();) {
        input.getSubInputs().add(createInput(itr.next()));
      }
    }

    return input;
  }
View Full Code Here

            if(!inputAttribute.getLocalName().trim().equals("ref") &&
               !inputAttribute.getLocalName().trim().startsWith("xmlns:") &&
               !inputAttribute.getLocalName().equals("xmlns") &&
               !inputAttribute.getQName().equals(ATT_CURRENCY)){
                Input parameter = new Input();
                String inputName = inputAttribute.getLocalName();
                parameter.setName(inputName);
                parameter.setSourceXPath(getXPath(opElement,new QName(inputName),true));
                parameter.setSourceValue(getValue(opElement,new QName(inputName),true));
                registeredInputs.add(parameter);
            }else if(inputAttribute.getLocalName().trim().equals("ref")){
                String refElementName = inputAttribute.getAttributeValue();
                Input parameter = new Input();
                parameter.setType(refElementName);
                OMElement refOMElement = opElement.getFirstChildWithName(
                        new QName(XMLConfigConstants.SYNAPSE_OMNAMESPACE.getNamespaceURI(),refElementName));
                List inlineInputs = extractInputs(refOMElement);
                Iterator iteratorInlines = inlineInputs.iterator();
                while(iteratorInlines.hasNext()){
                    Input inlineInput = (Input) iteratorInlines.next();
                    parameter.getSubInputs().add(inlineInput);
                }
                registeredInputs.add(parameter);
            }
        }
View Full Code Here

   * @return
   */
  @SuppressWarnings("unchecked")
  protected Input createInput(OMElement inputElement) {

    Input parameter = new Input();
    OMAttribute parameterNameAttr = inputElement.getAttribute(ATT_NAME);
    OMAttribute srcXPathAttr = inputElement.getAttribute(ATT_SOURCE_XPATH);
    OMAttribute typeAttr = inputElement.getAttribute(ATT_TYPE);
    OMAttribute srcValueAttr = inputElement.getAttribute(ATT_SOURCE_VALUE);

    if (null != typeAttr && null != typeAttr.getAttributeValue()) {
      parameter.setType(typeAttr.getAttributeValue());

      for (Iterator<OMElement> itr = inputElement
          .getChildrenWithName(Q_INPUT); itr.hasNext();) {
        parameter.getSubInputs().add(createInput(itr.next()));
      }
    } else {
      if (null == parameterNameAttr
          || null == parameterNameAttr.getAttributeValue()) {
        handleException("Input without the name attribute has been found, but it is required to have the name attribute for all inputs");
      }

      parameter.setName(parameterNameAttr.getAttributeValue());

      if ((null == srcXPathAttr || null == srcXPathAttr
          .getAttributeValue())
          && (null == srcValueAttr || null == srcValueAttr
              .getAttributeValue())) {
        handleException(String
            .format(
                "Input parameter %s: has no source-xpath or source-value attribute, "
                    + "but it is required to have source-xpath or source-value attribute for all inputs",
                parameter.getName()));
      }
      if (null != srcXPathAttr
          && null != srcXPathAttr.getAttributeValue()) {
        try {
          parameter.setSourceXPath(SynapseXPathFactory
              .getSynapseXPath(inputElement, ATT_SOURCE_XPATH));
        } catch (JaxenException e) {
          handleException(
              String
                  .format(
                      "Input parameter %s: couldn't build the source-xpath from the expression: %s",
                      parameter.getName(), srcXPathAttr
                          .getAttributeValue()), e);
        }

      } else {
        parameter.setSourceValue(srcValueAttr.getAttributeValue());
      }
    }
    return parameter;
  }
View Full Code Here

        } else if (scheme.equals(ClusteringConstants.MembershipScheme.MULTICAST_BASED)) {
            membershipScheme = new MulticastBasedMembershipScheme(parameters, primaryDomain,
                                                                  nwConfig.getJoin().getMulticastConfig());
            membershipScheme.init();
        } else if (scheme.equals(HazelcastConstants.AWS_MEMBERSHIP_SCHEME)) {
            membershipScheme = new AWSBasedMembershipScheme(parameters, primaryDomain,
                                                            nwConfig.getJoin().getAwsConfig());
            membershipScheme.init();
        } else {
            String msg = "Invalid membership scheme '" + scheme +
                         "'. Supported schemes are multicast & wka";
View Full Code Here

                } catch (InterruptedException ignored) {
                }
                membershipScheme.init();
            }
        } else if (scheme.equals(ClusteringConstants.MembershipScheme.MULTICAST_BASED)) {
            membershipScheme = new MulticastBasedMembershipScheme(parameters, primaryDomain,
                                                                  nwConfig.getJoin().getMulticastConfig());
            membershipScheme.init();
        } else if (scheme.equals(HazelcastConstants.AWS_MEMBERSHIP_SCHEME)) {
            membershipScheme = new AWSBasedMembershipScheme(parameters, primaryDomain,
                                                            nwConfig.getJoin().getAwsConfig());
View Full Code Here

TOP

Related Classes of org.wso2.carbon.business.messaging.paypal.mediator.Input

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.