Package com.esri.gpt.framework.collection

Examples of com.esri.gpt.framework.collection.StringAttributeMap


   */
  public String[] readKeys(HttpServletRequest request, RequestContext context, boolean useCartMaximum)
    throws Exception {
    String[] keys = Val.chkStr(request.getParameter("keys")).split(",");
    if (useCartMaximum && (keys.length > 0)) {
      StringAttributeMap cfg = context.getCatalogConfiguration().getParameters();
      int nMax = Val.chkInt(cfg.getValue("catalog.cart.maxItems"),10);
      if (keys.length > nMax) {
        throw new Exception("Too many keys.");
      }
    }
    return keys;
View Full Code Here


        request.setCharacterEncoding("UTF-8");
      }
      context = RequestContext.extract(request);
     
      /// estabish the publisher
      StringAttributeMap params = context.getCatalogConfiguration().getParameters();
      String autoAuthenticate = Val.chkStr(params.getValue("BaseServlet.autoAuthenticate"));
      if (!autoAuthenticate.equalsIgnoreCase("false")) {
        Credentials credentials = getCredentials(request);
        if (credentials != null) {
          this.authenticate(context,credentials);
        }
View Full Code Here

    this.flags = flags;
  }

  @Override
  public StringAttributeMap getAttributeMap() {
    StringAttributeMap attributes = new StringAttributeMap();
    attributes.add(new StringAttribute(SOAP_URL, soapUrl));
    return attributes;
  }
View Full Code Here

  private HrRecord extractRegistrationInfo(HttpServletRequest request) {
    ApplicationContext appCtx = ApplicationContext.getInstance();
    ApplicationConfiguration appCfg = appCtx.getConfiguration();

    HrRecord record = new HrRecord();
    StringAttributeMap attributes = new StringAttributeMap();
    boolean updateContent = true;
    boolean updateDefinition = true;
    boolean autoApprove = true;

    for (String paramName : new EnumerationAdapter<String>(request.getParameterNames())) {
      String paramValue = request.getParameter(paramName);
      if (paramName.equalsIgnoreCase("uuid")) {
        record.setUuid(paramValue);
      }
      if (paramName.equalsIgnoreCase("name")) {
        record.setName(paramValue);
      }
      else if (paramName.equalsIgnoreCase("url")) {
        record.setHostUrl(paramValue);
      }
      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());
View Full Code Here

    TreeMap<String,Object> args = new TreeMap<String,Object>();
    tableAlias = (tableAlias!=null? tableAlias+".": "");

    // determine if the database is case sensitive
    StringAttributeMap params  = ApplicationContext.getInstance().getConfiguration().getCatalogConfiguration().getParameters();
    String s = Val.chkStr(params.getValue("database.isCaseSensitive"));
    boolean isDbCaseSensitive = !s.equalsIgnoreCase("false");
   
    // document title
    String sTitle = getTitle();
    if (sTitle.length() > 0) {
View Full Code Here

    }
   
    // determine spatialRelevance parameters
    // (original defaults were queryPower=2.0, targetPower=0.5)
    RequestContext rc = this.getQueryAdapter().getIndexAdapter().getRequestContext();
    StringAttributeMap params = rc.getCatalogConfiguration().getParameters();
    double queryPower = Val.chkDbl(params.getValue("spatialRelevance.queryPower"),1.0);
    double targetPower = Val.chkDbl(params.getValue("spatialRelevance.targetPower"),1.0);
    String rankingOption = Val.chkStr(params.getValue("spatialRelevance.ranking.enabled"));
    int rankingMaxDoc = Val.chkInt(params.getValue("spatialRelevance.ranking.maxDoc"),50000);
    boolean bUseSpatialRanking = false;
    if (rankingOption.equalsIgnoreCase("true")) {
      bUseSpatialRanking = true;
    } else if (rankingOption.equalsIgnoreCase("false")) {
      bUseSpatialRanking = false;
View Full Code Here

    String protocolName = "";
    long flags = 0;
    List<String> vDest = null;
    String sAddHoc = "";
    StringAttributeMap properties = new StringAttributeMap();
    NodeList protocolNL = doc.getElementsByTagName("protocol");

    if (protocolNL.getLength() >= 1) {
      Node protocolN = protocolNL.item(0);

      NamedNodeMap attributes = protocolN.getAttributes();

      Node protocolTypeN = attributes.getNamedItem("type");
      protocolName = Val.chkStr(protocolTypeN!=null? protocolTypeN.getNodeValue(): "");

      Node flagsN = attributes.getNamedItem("flags");
      flags = flagsN!=null? Val.chkLong(Val.chkStr(flagsN.getNodeValue()), 0): 0;
     
      Node destinationsN = attributes.getNamedItem("destinations");
      String sDest = destinationsN!=null? Val.chkStr(destinationsN.getNodeValue()): null;
      vDest = sDest!=null? Arrays.asList(sDest.split(",")): null;
     
      Node addHocN = attributes.getNamedItem("adHoc");
      sAddHoc = addHocN!=null? Val.chkStr(addHocN.getNodeValue()): "";

      NodeList propertiesNL = protocolN.getChildNodes();
      for (int i = 0; i < propertiesNL.getLength(); i++) {
        Node property = propertiesNL.item(i);
        String propertyName = property.getNodeName();
        String propertyValue = property.getTextContent();
        properties.set(propertyName, propertyValue);
      }
    }

    ProtocolFactory protocolFactory = get(protocolName);
    if (protocolFactory == null) {
View Full Code Here

  sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
  if (protocol!=null) {
    String sDest = getDestinations(protocol);
    sb.append("<protocol type=\"").append(protocol.getKind()).append("\" flags=\"").append(protocol.getFlags()).append("\"").append(sDest!=null? " destinations=\"" +sDest+ "\"": "").append(" adHoc=\"" +protocol.getAdHoc()+ "\"").append(">");

    StringAttributeMap attributes = protocol.extractAttributeMap();
    for (String key : attributes.keySet()) {
      StringAttribute value = attributes.get(key);
      sb.append("<").append(key).append(">").append(value.getValue()).
          append("</").append(key).append(">");
    }

    sb.append("</protocol>");
View Full Code Here

}
 
private int getMaxAttempts() {
  ApplicationContext appCtx = ApplicationContext.getInstance();
  ApplicationConfiguration appCfg = appCtx.getConfiguration();
  StringAttributeMap parameters = appCfg.getCatalogConfiguration().getParameters();
  return Val.chkInt(parameters.getValue("webharvester.maxAttempts"),DEFAULT_MAX_ATTEMPTS);
}
View Full Code Here

   * Determine if collections are in use.
   * @return <code>true</code> if collections are in use
   */
  public boolean getUseCollections() {
    RequestContext context = this.getRequestContext();
    StringAttributeMap params = context.getCatalogConfiguration().getParameters();
    String s = Val.chkStr(params.getValue("catalog.useCollections"));
    return s.equalsIgnoreCase("true");
  }
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.collection.StringAttributeMap

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.