Package uk.ac.bbsrc.tgac.miso.core.service.printing

Examples of uk.ac.bbsrc.tgac.miso.core.service.printing.DefaultPrintService


  }

  public JSONObject addPrintService(HttpSession session, JSONObject json) {
    try {
      BarcodableSchema barcodableSchema = printManager.getBarcodableSchema(json.getString("schema"));
      MisoPrintService printService = new DefaultPrintService();
      if ("Custom".equals(json.getString("serviceFor"))) {
        printService = new CustomPrintService();
      }
      printService.setName(json.getString("serviceName"));
      PrintContext pc = printManager.getPrintContext(json.getString("contextName"));
      JSONObject contextFields = JSONObject.fromObject(json.getString("contextFields"));
      PrintServiceUtils.mapJSONToContextFields(contextFields, pc);
      printService.setPrintContext(pc);
      printService.setBarcodableSchema(barcodableSchema);
      printService.setEnabled(true);
      if ("Custom".equals(json.getString("serviceFor"))) {
        printService.setPrintServiceFor(JSONObject.class);
      }
      else {
        printService.setPrintServiceFor(Class.forName(json.getString("serviceFor")).asSubclass(Barcodable.class));
      }
      printManager.storePrintService(printService);
      return JSONUtils.JSONObjectResponse("html", "OK");
    }
    catch (ClassNotFoundException e) {
View Full Code Here


          JSONObject contextFields = JSONObject.fromObject(rs.getString("contextFields"));
          PrintServiceUtils.mapJSONToContextFields(contextFields, pc);
        }
        else {
          printService = new DefaultPrintService();
          printService.setBarcodableSchema(barcodableSchema);

          printService.setServiceId(rs.getLong("serviceId"));
          printService.setName(rs.getString("serviceName"));
          printService.setEnabled(rs.getBoolean("enabled"));
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.miso.core.service.printing.DefaultPrintService

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.