Examples of OComposableProcessor


Examples of com.orientechnologies.orient.core.processor.OComposableProcessor

        path = cfg.value;
      else if ("extension".equalsIgnoreCase(cfg.name))
        extension = cfg.value;
    }

    OProcessorManager.getInstance().register("composable", new OComposableProcessor().setPath(path).setExtension(extension));
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.processor.OComposableProcessor

      final String debugMode = iRequest.getParameter("debug");
      if (debugMode != null && Boolean.parseBoolean(debugMode))
        context.setVariable("debugMode", Boolean.TRUE);

      final OComposableProcessor processEngine = (OComposableProcessor) OProcessorManager.getInstance().get("composable");
      Object result = processEngine.processFromFile(name, context, iRequest.httpMethod.equals("GET"));

      if (result instanceof ODocument)
        result = ((ODocument) result).field("result");

      iResponse.writeResult(result, "", iRequest.contentType);
View Full Code Here

Examples of com.orientechnologies.orient.core.processor.OComposableProcessor

    }
    return res;
  }

  public Object process(final String iType, final String iName, final Object... iParameters) {
    final OComposableProcessor process = (OComposableProcessor) OProcessorManager.getInstance().get(iType);
    if (process == null)
      throw new OProcessException("Process type '" + iType + "' is undefined");

    final OBasicCommandContext context = new OBasicCommandContext();
    if (iParameters != null) {
      int argIdx = 0;
      for (Object p : iParameters)
        context.setVariable("arg" + (argIdx++), p);
    }

    Object res;

    try {
      res = process.processFromFile(iName, context, false);
    } catch (Exception e) {
      throw new OProcessException("Error on processing '" + iName + "' field of '" + getName() + "' block", e);
    }

    return res;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.