Package com.esri.gpt.control.webharvest.protocol

Examples of com.esri.gpt.control.webharvest.protocol.ProtocolFactory


    NodeList lstProtocol = (NodeList) xpath.evaluate("protocol", ndProtocols, XPathConstants.NODESET);
    for (Node ndProto : new NodeListAdapter(lstProtocol)) {
      String factoryClass = (String) xpath.evaluate("@factoryClass", ndProto, XPathConstants.STRING);
      try {
        Class fc = Class.forName(factoryClass);
        ProtocolFactory factory = (ProtocolFactory) fc.newInstance();
        ProtocolInitializer.init(factory, ndProto);
        String resourceKey = Val.chkStr((String) xpath.evaluate("@resourceKey", ndProto, XPathConstants.STRING));
        factories.put(factory.getName(), factory, resourceKey);
      } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Error loading protocol: "+factoryClass, ex);
      }
     
      String validatorFactoryClass = Val.chkStr((String) xpath.evaluate("validator/@factoryClass", ndProto, XPathConstants.STRING));
View Full Code Here


  ApplicationContext appCtx = ApplicationContext.getInstance();
  ApplicationConfiguration appCfg = appCtx.getConfiguration();
  ProtocolFactories protocolFactories = appCfg.getProtocolFactories();
  protocols.add(new SelectItem("", msgBroker.retrieveMessage("catalog.harvest.manage.edit.protocol.any")));
  for (String key: protocolFactories.getKeys()) {
    ProtocolFactory pf = protocolFactories.get(key);
    if (pf instanceof AgpProtocolFactory && !AGSProcessorConfig.isAvailable()) continue;
    String resourceKey = protocolFactories.getResourceKey(key);
    SelectItem item = new SelectItem(key.toLowerCase(), msgBroker.retrieveMessage(resourceKey));
    protocols.add(item);
  }
View Full Code Here

      }
      else if (paramName.equalsIgnoreCase("soapurl")) {
        attributes.add(new StringAttribute(ArcGISProtocol.SOAP_URL,paramValue));
      }
      else if (paramName.equalsIgnoreCase("protocol")) {
        ProtocolFactory factory = appCfg.getProtocolFactories().get(paramValue);
        if (factory!=null) {
          record.setProtocol(factory.newProtocol());
        }
      }
      else if (paramName.equalsIgnoreCase("frequency")) {
        record.setHarvestFrequency(HarvestFrequency.checkValueOf(paramValue));
      }
      else if (paramName.equalsIgnoreCase("sendNotification")) {
        record.setSendNotification(Val.chkBool(paramValue, false));
      }
      else if (paramName.equalsIgnoreCase("updateContent")) {
        updateContent = Val.chkBool(paramValue, true);
      }
      else if (paramName.equalsIgnoreCase("updateDefinition")) {
        updateDefinition = Val.chkBool(paramValue, true);
      }
      else if (paramName.equalsIgnoreCase("autoApprove")) {
        autoApprove = Val.chkBool(paramValue, true);
      }
      else if (paramName.equalsIgnoreCase("findable")) {
        record.setFindable(Val.chkBool(paramValue, true));
      }
      else if (paramName.equalsIgnoreCase("searchable")) {
        record.setSearchable(Val.chkBool(paramValue, true));
      }
      else if (paramName.equalsIgnoreCase("synchronizable")) {
        record.setSynchronizable(Val.chkBool(paramValue, true));
      }
      else {
        attributes.add(new StringAttribute(paramName,paramValue));
      }
    }

    if (record.getProtocol()==null || record.getProtocol().getKind().equalsIgnoreCase(ProtocolType.None.name())) {
      ProtocolFactory factory = appCfg.getProtocolFactories().get(ProtocolType.RES.name());
      if (factory!=null) {
        record.setProtocol(factory.newProtocol());
      }
    }
   
    if (record.getProtocol()!=null) {
      record.getProtocol().setAttributeMap(attributes);
View Full Code Here

    MessageBroker msgBroker = getContextBroker().extractMessageBroker();
    ApplicationContext appCtx = ApplicationContext.getInstance();
    ApplicationConfiguration appCfg = appCtx.getConfiguration();
    ProtocolFactories protocolFactories = appCfg.getProtocolFactories();
    for (String key : protocolFactories.getKeys()) {
      ProtocolFactory pf = protocolFactories.get(key);
      if (pf instanceof AgpProtocolFactory && !AGSProcessorConfig.isAvailable()) {
        continue;
      }
      String resourceKey = protocolFactories.getResourceKey(key);
      SelectItem item = new SelectItem(key.toLowerCase(), msgBroker.retrieveMessage(resourceKey));
View Full Code Here

TOP

Related Classes of com.esri.gpt.control.webharvest.protocol.ProtocolFactory

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.