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

Examples of uk.ac.bbsrc.tgac.miso.core.service.printing.context.PrintContext


      ServiceLoader<PrintContext> consumerLoader = ServiceLoader.load(PrintContext.class);
      Iterator<PrintContext> consumerIterator = consumerLoader.iterator();

      contextMap = new HashMap<String, PrintContext>();
      while (consumerIterator.hasNext()) {
        PrintContext p = consumerIterator.next();

        if (!contextMap.containsKey(p.getName())) {
          contextMap.put(p.getName(), p);
        }
        else {
          if (contextMap.get(p.getName()) != p) {
            String msg = "Multiple different PrintContexts with the same context name " +
                         "('" + p.getName() + "') are present on the classpath. Context names must be unique.";
            log.error(msg);
            throw new ServiceConfigurationError(msg);
          }
        }
      }
View Full Code Here


  }

  public JSONObject getContextFields(HttpSession session, JSONObject json) {
    try {
      if (json.has("contextName") && !json.get("contextName").equals("")) {
        PrintContext p = printManager.getPrintContext(json.getString("contextName"));
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("contextFields", PrintServiceUtils.mapContextFieldsToJSON(p));
        return JSONUtils.JSONObjectResponse(map);
      }
      else {
View Full Code Here

      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);
View Full Code Here

  public JSONObject editPrinterService(HttpSession session, JSONObject json) {
    try {
      if (json.has("serviceName") && !json.get("serviceName").equals("")) {
        MisoPrintService bps = printManager.getPrintService(json.getString("serviceName"));
        if (bps != null) {
          PrintContext pc = bps.getPrintContext();
          JSONObject contextFields = new JSONObject();
          contextFields.put("host", json.getString("host"));
          PrintServiceUtils.mapJSONToContextFields(contextFields, pc);
          bps.setPrintContext(pc);
          printManager.storePrintService(bps);
View Full Code Here

  public class MisoPrintServiceMapper implements RowMapper<MisoPrintService> {
    public MisoPrintService mapRow(ResultSet rs, int rowNum) throws SQLException {
      try {
        MisoPrintService printService;

        PrintContext pc = printManager.getPrintContext(rs.getString("contextName"));
        BarcodableSchema barcodableSchema = printManager.getBarcodableSchema(rs.getString("printSchema"));
        if (barcodableSchema !=null){
        barcodableSchema.getBarcodeLabelFactory().setFilesManager(misoFilesManager);
        barcodableSchema.getBarcodeLabelFactory().setSecurityManager(securityManager);
        }
View Full Code Here

TOP

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

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.