Package com.esri.gpt.framework.context

Examples of com.esri.gpt.framework.context.ApplicationConfiguration


   * @param paramName parameter name
   * @return parameter value
   */
  protected static String getConfigParam(String paramName) {
    ApplicationContext appCtx = ApplicationContext.getInstance();
    ApplicationConfiguration appCfg = appCtx.getConfiguration();
    return Val.chkStr(appCfg.getCatalogConfiguration().getParameters().getValue(paramName));
  }
View Full Code Here


   */
  public static ValidatorFactory getInstance() {
    if (instance==null) {
      LOGGER.fine("Creating singleton instance of protcol validator factory...");
      ApplicationContext appCtx = ApplicationContext.getInstance();
      ApplicationConfiguration appCfg = appCtx.getConfiguration();
      StringAttributeMap parameters = appCfg.getCatalogConfiguration().getParameters();
      String validatorFactoryClassName = Val.chkStr(parameters.getValue("webharvester.validatorFactory.class"));
      if (!validatorFactoryClassName.isEmpty()) {
        try {
          Class validatorFactoryClass = Class.forName(validatorFactoryClassName);
          instance = (ValidatorFactory)validatorFactoryClass.newInstance();
View Full Code Here

  public Agp2AgpValidator(String url, HarvestProtocolAgp2Agp protocol) {
    this.url = url;
    this.protocol = protocol;

    ApplicationContext appCtx = ApplicationContext.getInstance();
    ApplicationConfiguration appCfg = appCtx.getConfiguration();

    String sArcgisDotComAllowed = appCfg.getCatalogConfiguration().getParameters().getValue("webharvester.agp2agp.arcgisDotCom.allowed");
    this.arcgisDotComAllowed = Val.chkBool(sArcgisDotComAllowed, false);


    String sCrossAllowed = appCfg.getCatalogConfiguration().getParameters().getValue("webharvester.agp2agp.sameDomain.allowed");
    this.crossAllowed = Val.chkBool(sCrossAllowed, false);
  }
View Full Code Here

* Gets AGP2AGP max items.
* @return return AGP2AGP max items
*/
public static Long getAgp2AgpMaxItems() {
  ApplicationContext appCtx = ApplicationContext.getInstance();
  ApplicationConfiguration appCfg = appCtx.getConfiguration();
 
  String sMaxItems = appCfg.getCatalogConfiguration().getParameters().getValue(DEFAULT_MAX_ITEMS_AGP2AGP_KEY);
 
  return Val.chkLong(sMaxItems, DEFAULT_MAX_ITEMS_AGP2AGP);
}
View Full Code Here

   * @return singleton instance of the cache
   */
  public static DcatCache getInstance() {
    if (instance==null) {
      ApplicationContext appCtx = ApplicationContext.getInstance();
      ApplicationConfiguration appCfg = appCtx.getConfiguration();
      StringAttributeMap parameters = appCfg.getCatalogConfiguration().getParameters();
      String dcatCachePath = Val.chkStr(parameters.getValue("dcat.cache.path"),getDefaultDCATPath());
      File root = new File(dcatCachePath);
     
      instance = new DcatCache(root);
    }
View Full Code Here

   * Creates instance as configured in gpt.xml.
   * @return instance of the service
   */
  public static GeometryService createDefaultInstance() {
    ApplicationContext appCtx = ApplicationContext.getInstance();
    ApplicationConfiguration appCfg = appCtx.getConfiguration();
    return new GeometryService(appCfg.getInteractiveMap().getGeometryServiceUrl());
  }
View Full Code Here

   * Gets encryption key.
   * @return encryption key
   */
  private String getEncKey() {
    ApplicationContext appCtx = ApplicationContext.getInstance();
    ApplicationConfiguration appCfg = appCtx.getConfiguration();
    return appCfg.getIdentityConfiguration().getEncKey();
  }
View Full Code Here

* Gets download configuration.
* @return download configuration
*/
private DownloadConfiguration getConfiguration() {
  ApplicationContext appCtx = ApplicationContext.getInstance();
  ApplicationConfiguration appCfg = appCtx.getConfiguration();
  return appCfg.getDownloadDataConfiguration();
}
View Full Code Here

      String[] args = new String[2];
      args[0] = sUsername;
      args[1] = sPassword;
      String sSubject = msgBroker.retrieveMessage("identity.forgotPassword.email.subject");
      String sBody = msgBroker.retrieveMessage("identity.forgotPassword.email.body",args);
      ApplicationConfiguration appConfig = context.getApplicationConfiguration();
      MailRequest mailReq = appConfig.getMailConfiguration().newOutboundRequest();
      mailReq.setToAddress(sEmail);
      mailReq.setSubject(sSubject);
      mailReq.setBody(sBody);
      mailReq.send();
     
View Full Code Here

* @throws Exception if an exception occurs
*/
private void executeSendFeedback(ActionEvent event, RequestContext context)
  throws Exception {
  MessageBroker msgBroker = extractMessageBroker();
  ApplicationConfiguration appConfig = context.getApplicationConfiguration();
  FeedbackMessage msg = getFeedbackMessage();
 
  // validate parameters
  boolean bOk = true;
  String sName = msg.getFromName();
  String sEmail = msg.getFromAddress();
  String sBody = msg.getBody();
  String sSender = sEmail;
  if (!Val.chkEmail(sEmail)) {
    bOk = false;
    msgBroker.addErrorMessage("identity.feedback.err.email");
  } else if (sBody.length() == 0) {
    bOk = false;
    msgBroker.addErrorMessage("identity.feedback.err.body");
  } else if (sName.length() > 0) {
    sSender = sName;
  }
 
  // send mail if ok
  if (bOk) {
   
    // try to filter out mischievous content
    sSender = sSender.replaceAll("<", "&lt;");
    sBody = sBody.replaceAll("<", "&lt;");
   
    // build the message subject and body
    String[] args = new String[3];
    args[0] = sSender;
    args[1] = sBody;
    args[2] = RequestContext.resolveBaseContextPath((HttpServletRequest) context.getServletRequest());
    String sSubject = msgBroker.retrieveMessage("identity.feedback.email.subject");
    sBody = msgBroker.retrieveMessage("identity.feedback.email.body",args);
   
    // send the message to the site
    MailRequest mailReq = appConfig.getMailConfiguration().newInboundRequest();
    mailReq.setFromAddress(sEmail);
    mailReq.setSubject(sSubject);
    mailReq.setBody(sBody);
    mailReq.send();
   
    // send a copy of the message to the user
    MailRequest mailReqCopy = appConfig.getMailConfiguration().newOutboundRequest();
    mailReqCopy.setToAddress(sEmail);
    mailReqCopy.setSubject(sSubject);
    mailReqCopy.setBody(sBody);
    mailReqCopy.send();     
   
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.context.ApplicationConfiguration

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.