Package org.wso2.carbon.dataservices.core.engine

Examples of org.wso2.carbon.dataservices.core.engine.DataService


        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


   */
  public void testLocalOperationInvocation1() {
    TestUtils.showMessage("testLocalOperationInvocation1");
    try {
      String filePath = this.getTestDBSDirectory() + "H2BasicService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.invokeOperation(dataService, "select_op_given_fields",
              new HashMap<String, ParamValue>());
      assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

   */
  public void testLocalOperationInvocation2() {
    TestUtils.showMessage("testLocalOperationInvocation2");
    try {
      String filePath = this.getTestDBSDirectory() + "H2InputMappingService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      Map<String, ParamValue> params = new HashMap<String, ParamValue>();
      params.put("orderNumber", new ParamValue("10242"));
      params.put("orderDate", new ParamValue("2004-04-20"));
      OMElement result = DSTools.invokeOperation(dataService, "select_input_mappings_op1", params);
      assertTrue(TestUtils.validateResultStructure(result,
View Full Code Here

   */
  public void testLocalOperationInvocation3() {
    TestUtils.showMessage("testLocalOperationInvocation3");
    try {
      String filePath = this.getTestDBSDirectory() + "CSVService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.invokeOperation(dataService, "customer_list_op",
          new HashMap<String, ParamValue>());
      assertTrue(TestUtils.validateResultStructure(result,
          TestUtils.CUSTOMER_XSD_PATH));
      String val = TestUtils.getFirstValue(result,
View Full Code Here

   */
  public void testLocalOperationInvocation4() {
    TestUtils.showMessage("testLocalOperationInvocation4");
    try {
      String filePath = this.getTestDBSDirectory() + "ExcelService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.invokeOperation(dataService, "excel_old_noheader_with_ints_op",
          new HashMap<String, ParamValue>());
      assertTrue(TestUtils.validateResultStructure(result,
          TestUtils.CUSTOMER_XSD_PATH));
    } catch (Exception e) {
View Full Code Here

   */
  public void testLocalResourceAccess1() {
    TestUtils.showMessage("testLocalResourceAccess1");
    try {
      String filePath = this.getTestDBSDirectory() + "H2BasicService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.accessResource(dataService, "customers1",
              new HashMap<String, ParamValue>(), "GET");
      assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

   * Return the generated service name
   */
  public String getDSService(String dataSourceId, String dbName, String[] schemas,
      String[] tableNames, boolean singleService,String serviceName,String serviceNamespace) throws AxisFault {
    DSGenerator generator = new DSGenerator(dataSourceId, dbName, schemas, tableNames, true,serviceNamespace,serviceName);
    DataService dataservice = generator.getGeneratedService();
    OMElement element = DataServiceSerializer.serializeDataService(dataservice);
    this.saveDataService(dataservice.getName(),  null, element.toString());
    return generator.getGeneratedService().getName();
  }
View Full Code Here

   * Populates the given axis service schema with the data service information it encapsulates.
   * @param axisService The target service
   * @throws DataServiceFault
   */
  public static void populateServiceSchema(AxisService axisService) throws DataServiceFault {
    DataService dataservice = (DataService) axisService.getParameter(
        DBConstants.DATA_SERVICE_OBJECT).getValue();
    CommonParams cparams = new CommonParams(axisService, dataservice);
   
    List<List<Operation>> allOps = extractOperations(dataservice);
    List<Operation> normalOperations = allOps.get(0);
View Full Code Here

    AxisOperation axisOp = msgContext.getAxisOperation();
    OMElement inputMessage = msgContext.getEnvelope().getBody().getFirstElement();
    /* get operation/request name */
    String requestName = axisOp.getName().getLocalPart();
    /* retrieve the DataService object representing the current data service */
    DataService dataService = (DataService) axisService.getParameter(
        DBConstants.DATA_SERVICE_OBJECT).getValue();
   
    DataServiceRequest dsRequest;
    /* check if batch or single request */
    if (isBatchRequest(inputMessage)) {
View Full Code Here

  /**
   * @see DataServiceRequest#processRequest()
   */
  @Override
  public OMElement processRequest() throws DataServiceFault {
    DataService dataService = this.getDataService();
    boolean inTx = false;
    /* not inside a nested transaction, i.e. boxcarring/batch-requests  */
    if (!dataService.isInTransaction()) {
      /* an active transaction has already started by the transaction manager,
       * e.g. external JMS transaction */
      if (dataService.isEnableXA() && !dataService.getDSSTxManager().hasNoActiveTransaction()) {
        /* signal we are inside a transaction */
        dataService.beginTransaction();
        inTx = true;
      }
    }
    OMElement result = processSingleRequest();
    if (inTx) {
      /* signal the end of transaction, this wont necessarily commit the
       * transaction, it will be done by the external transaction creator */
      dataService.endTransaction();
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.dataservices.core.engine.DataService

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.