Package com.esri.gpt.framework.collection

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


      throws Exception {
    ResponseWriter rsWriter;
    statReqContext.setResponseString(new StringBuilder());
    HttpServletResponse response = statReqContext.getResponse();
    PrintWriter writer = response.getWriter();
    StringAttributeMap attrMap = statReqContext.getStatQueryParams();
    String outputFormat = Val.chkStr(attrMap.getValue("f"));
    if (outputFormat.equalsIgnoreCase("json")
        && statReqContext.getRequestType().equalsIgnoreCase(
            StatisticsTypes.HARVESTER.toString())) {
      response.setContentType("text/plain; charset=UTF-8");
      rsWriter = new JSONWriter(writer,
View Full Code Here


      HttpServletResponse response, RequestContext context) {
   
    String sTmp;
    int nTmp = 0;
    this.setRequestContext(context);
    StringAttributeMap params = context.getCatalogConfiguration().getParameters();
   
    String baseContextPath = RequestContext.resolveBaseContextPath(request);
    this.baseUrl = baseContextPath+"/sitemap";
    this.startRecord = Val.chkInt(request.getParameter("startRecord"),-1);
    response.setContentType("text/xml; charset=UTF-8");
   
   
    sTmp = Val.chkStr(params.getValue("sitemap.baseUrl"));
    if (sTmp.length() > 0) this.baseUrl = sTmp;
    if (this.baseUrl.endsWith("&")) {
      this.baseUrl = this.baseUrl.substring(0,this.baseUrl.length() - 1);
    }
    if (this.baseUrl.endsWith("?")) {
      this.baseUrl = this.baseUrl.substring(0,this.baseUrl.length() - 1);
    }
   
    sTmp = Val.chkStr(params.getValue("sitemap.documentUrlPattern"));
    if (sTmp.length() > 0) this.documentUrlPattern = sTmp;
    if (!this.documentUrlPattern.startsWith("http")) {
      if (!this.documentUrlPattern.startsWith("/")) {
        this.documentUrlPattern = "/"+this.documentUrlPattern;
      }
      this.documentUrlPattern = baseContextPath+this.documentUrlPattern;
    }
   
    nTmp = Val.chkInt(params.getValue("sitemap.urlsPerIndexFile"),0);
    if ((nTmp > 0) && (nTmp < 1000)) this.urlsPerIndexFile = nTmp;
   
    nTmp = Val.chkInt(params.getValue("sitemap.urlsPerSitemapFile"),0);
    if ((nTmp > 0) && (nTmp < 50000)) this.urlsPerSitemapFile = nTmp;
   
    sTmp = Val.chkStr(params.getValue("sitemap.namespaceUri"));
    if (sTmp.length() > 0) this.namespaceUri = sTmp;
   
    sTmp = Val.chkStr(params.getValue("sitemap.changefreq"));
    if (sTmp.length() > 0) this.changefreq = sTmp;
   
    sTmp = Val.chkStr(params.getValue("sitemap.priority"));
    if (sTmp.length() > 0) this.priority = sTmp;
   

    // error check
    String errPfx = "gpt.xml: gptConfig/catalog/parameter/";
View Full Code Here

   
    if (response.length() > 0) {
     
      // first try ArcGIS Server
      boolean interrofgateAGS = true;
      StringAttributeMap params = context.getRequestContext().getCatalogConfiguration().getParameters();
      if (Val.chkStr(params.getValue("AGSProcessor.interrogation.enabled")).equalsIgnoreCase("false")) {
        interrofgateAGS = false;
      } else if (!AGSProcessorConfig.isAvailable()) {
        interrofgateAGS = false;
      }
      if (interrofgateAGS) {
View Full Code Here

  } catch (XPathExpressionException e) {
    e.printStackTrace(System.err);
  }

  StringAttributeMap params = appConfig.getCatalogConfiguration().getParameters();
  String param = Val.chkStr(params.getValue("catalog.echoConfigOnStartup"));
  boolean bEchoConfig = !param.equalsIgnoreCase("false");
  if (bEchoConfig) {
    getLogger().info(appConfig.toString());
  }
}
View Full Code Here

   
  }

  loadMetadataAccessPolicyConfiguration(appConfig, root);

  StringAttributeMap params = appConfig.getCatalogConfiguration().getParameters();
  String param = Val.chkStr(params.getValue("catalog.loadSchemasOnStartup"));
  boolean bLoadSchemas = param.equalsIgnoreCase("true");
  if (bLoadSchemas) {
    appConfig.getCatalogConfiguration().getConfiguredSchemas();
  }
}
View Full Code Here

    String sDelay = Val.chkStr(xpath.evaluate("@delay", ndThread));
    String sPeriod = Val.chkStr(xpath.evaluate("@period", ndThread));
    String sAt = Val.chkStr(xpath.evaluate("@at", ndThread));

    // read parameters
    StringAttributeMap parameters = new StringAttributeMap();
    populateParameters(parameters, ndThread);

    // add definition
    tsConfig.addDefinition(sClass, sDelay, sPeriod, sAt, parameters);
  }
View Full Code Here

/**
* Loads harvester configuration.
* @param appConfig application configuration
*/
private void loadHarvesterConfiguration(ApplicationConfiguration appConfig, Document dom, Node root) throws XPathExpressionException {
  StringAttributeMap parameters = appConfig.getCatalogConfiguration().getParameters();
  HarvesterConfiguration cfg = appConfig.getHarvesterConfiguration();

  String active = Val.chkStr(parameters.getValue("webharvester.active"));
  String suspended = Val.chkStr(parameters.getValue("webharvester.suspended"));
  String queueEnabled = Val.chkStr(parameters.getValue("webharvester.queueEnabled"));
  String poolsize = Val.chkStr(parameters.getValue("webharvester.poolSize"));
  String autoselectfrequency = Val.chkStr(parameters.getValue("webharvester.autoSelectFrequency"));
  String watchdogfrequency = Val.chkStr(parameters.getValue("webharvester.watchDogFrequency"));
  String basecontextpath = Val.chkStr(parameters.getValue("webharvester.baseContextPath"));
  String maxRepRecords = Val.chkStr(parameters.getValue("webharvester.maxRepRecords"));
  String maxRepErrors = Val.chkStr(parameters.getValue("webharvester.maxRepErrors"));
  String resourceAutoApprove = Val.chkStr(parameters.getValue("webharvester.resource.autoApprove"));

  Logger logger = getLogger();

  if (Val.chkBool(active, true)) {
    cfg.setActive(true);
    cfg.setQueueEnabled(true);
  } else {
    cfg.setActive(false);
    cfg.setQueueEnabled(false);
  }

  if (Val.chkBool(suspended, false)) {
    cfg.setSuspended(true);
  } else {
    cfg.setSuspended(false);
  }

  if (queueEnabled.length()>0) {
    cfg.setQueueEnabled(Val.chkBool(queueEnabled, cfg.getQueueEnabled()) || cfg.getActive());
  }

  if (poolsize.length() > 0) {
    try {
      int num = Integer.parseInt(poolsize);
      if (num <= 0) {
        logger.info("[SYNCHRONIZER] Parameter \"webharvester.poolSize\" less or equal to zero. No harvestig will be performed.");
      }
      cfg.setPoolSize(num);
    } catch (NumberFormatException ex) {
      logger.log(Level.INFO, "[SYNCHRONIZER] Invalid \"webharvester.poolSize\" parameter. Default {0} will be used instead.", HarvesterConfiguration.DEFAULT_POOL_SIZE);
      cfg.setPoolSize(HarvesterConfiguration.DEFAULT_POOL_SIZE);
    }
  } else {
    logger.log(Level.INFO, "[SYNCHRONIZER] Missing \"webharvester.poolSize\" parameter. Default {0} will be used instead.", HarvesterConfiguration.DEFAULT_POOL_SIZE);
    cfg.setPoolSize(HarvesterConfiguration.DEFAULT_POOL_SIZE);
  }

  if (autoselectfrequency.length() > 0) {
    try {
      TimePeriod tp = TimePeriod.parseValue(autoselectfrequency);
      cfg.setAutoSelectFrequency(tp);
    } catch (NumberFormatException ex) {
      logger.log(Level.INFO, "[SYNCHRONIZER] Invalid \"webharvester.autoSelectFrequency\" parameter. Default {0} will be used instead.", HarvesterConfiguration.AUTOSELECT_FREQUENCY);
      cfg.setAutoSelectFrequency(new TimePeriod(HarvesterConfiguration.AUTOSELECT_FREQUENCY));
    }
  } else {
    logger.log(Level.INFO, "[SYNCHRONIZER] Missing \"webharvester.autoSelectFrequency\" parameter. Default {0} will be used instead.", HarvesterConfiguration.AUTOSELECT_FREQUENCY);
    cfg.setAutoSelectFrequency(new TimePeriod(HarvesterConfiguration.AUTOSELECT_FREQUENCY));
  }

  if (watchdogfrequency.length() > 0) {
    try {
      TimePeriod tp = TimePeriod.parseValue(watchdogfrequency);
      cfg.setWatchDogFrequency(tp);
    } catch (NumberFormatException ex) {
      logger.log(Level.INFO, "[SYNCHRONIZER] Invalid \"webharvester.watchDogFrequency\" parameter. Default {0} will be used instead.", HarvesterConfiguration.WATCHDOG_FREQUENCY);
      cfg.setWatchDogFrequency(new TimePeriod(HarvesterConfiguration.WATCHDOG_FREQUENCY));
    }
  } else {
    logger.log(Level.INFO, "[SYNCHRONIZER] Missing \"webharvester.watchDogFrequency\" parameter. Default {0} will be used instead.", HarvesterConfiguration.WATCHDOG_FREQUENCY);
    cfg.setWatchDogFrequency(new TimePeriod(HarvesterConfiguration.WATCHDOG_FREQUENCY));
  }

  if (basecontextpath.length() > 0) {
    cfg.setBaseContextPath(basecontextpath);
  } else {
    String reverseProxyPath = Val.chkStr(parameters.getValue("reverseProxy.baseContextPath"));
    if (reverseProxyPath.length() > 0) {
      logger.info("[SYNCHRONIZER] Missing \"webharvester.baseContextPath\" parameter. Value of \"reverseProxy.baseContextPath\" will be used instead.");
    } else {
      logger.info("[SYNCHRONIZER] Missing \"webharvester.baseContextPath\" parameter. Harvest notification messages will be sent without information about harvest report.");
    }
View Full Code Here

    }
    return "";
  }
 
  private String makeMetadataViewUrl(String id) {
    StringAttributeMap params = ApplicationContext.getInstance().getConfiguration().getCatalogConfiguration().getParameters();
    String basePath = Val.chkStr(params.getValue("reverseProxy.baseContextPath"));
    if (basePath.length()>0) {
      return basePath + "/catalog/search/resource/details.page?uuid=" + formatUuid(id);
    }
    return "";
  }
View Full Code Here

   *
   * @param request
   * @return StringAttributeMap
   */
  public static StringAttributeMap collectQuery(final HttpServletRequest request) {
    StringAttributeMap params = new StringAttributeMap();
    for (Enumeration<String> paramnames = request.getParameterNames(); paramnames.hasMoreElements();) {
      String name = (String) paramnames.nextElement();
      String val = Val.chkStr(request.getParameter(name));
      params.set(name,val);
    }
    return params;
  }
View Full Code Here

   *
   * @param request
   * @return StringAttributeMap
   */
  public static StringAttributeMap collectHeader(final HttpServletRequest request) {
    StringAttributeMap headers = new StringAttributeMap();
    for (Enumeration<String> headernames = request.getHeaderNames(); headernames.hasMoreElements();) {
      String name = (String) headernames.nextElement();
      String val = Val.chkStr(request.getHeader(name));
      headers.set(name,val);
    }
    return headers;
  }
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.