Package com.agiletec.aps.util

Examples of com.agiletec.aps.util.ApsProperties


  @Override
  public String resetConfig() {
    try {
      this.createValuedShowlet();
      ApsProperties config = this.getWidget().getConfig();
      config.remove("pageCodeParam");
      config.remove("frameIdParam");
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "resetConfig");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here


  private Boolean extractShowletParam(HttpServletRequest request) {
    Boolean hasParam = false;
    RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
    Widget showlet = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
    ApsProperties config = showlet.getConfig();

    String param = this.getParam();
    if (param.equalsIgnoreCase("allowComment")) param = ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ACTIVE;
    if (param.equalsIgnoreCase("allowAnonymousComment")) param = ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ANONYMOUS;
    if (param.equalsIgnoreCase("allowRateContent")) param = ContentFeedbackWidgetAction.WIDGET_PARAM_RATE_CONTENT;
    if (param.equalsIgnoreCase("allowRateComment")) param = ContentFeedbackWidgetAction.WIDGET_PARAM_RATE_COMMENT;

    if (null != config && this.getParam()!=null && this.getParam().length()>0) {
      String value = config.getProperty(this.getParam());
      if (value!= null && value.equalsIgnoreCase("true")) {
        hasParam = true;
      }
    }
    return hasParam;
View Full Code Here

    }
  }

  protected void addLabelGroups(String key, String defaultValue) throws ApsSystemException {
    try {
      ApsProperties properties = new ApsProperties();
      Lang defaultLang = super.getLangManager().getDefaultLang();
      properties.put(defaultLang.getCode(), defaultValue);
      this.getI18nManager().addLabelGroup(key, properties);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "addLabelGroups");
      throw new RuntimeException("Error adding label groups - key '" + key + "'", t);
    }
View Full Code Here

      HttpServletRequest request = (null != this.getRequest()) ? this.getRequest() : ServletActionContext.getRequest();
      RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
      if (null != reqCtx) {
        Widget widget = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
        if (null != widget) {
          ApsProperties config = widget.getConfig();
          if (null != config) {
            String widgetParam = config.getProperty(paramName);
            if (widgetParam != null && widgetParam.trim().length() > 0) {
              value = widgetParam.trim();
            }
          }
        }
View Full Code Here

    }
    try {
      for (int i = 0; i < types.size(); i++) {
        SmallMessageType smallMessageType = types.get(i);
        String labelKey = "jpwebdynamicform_TITLE_" + smallMessageType.getCode();
        ApsProperties labelGroup = this.getI18nManager().getLabelGroup(labelKey);
        if (null == labelGroup) {
          this.addLabelGroups(labelKey, smallMessageType.getDescr());
        }
      }
    } catch (Throwable t) {
View Full Code Here

    }
  }
 
  protected void addLabelGroups(String key, String defaultValue) throws ApsSystemException {
    try {
      ApsProperties properties = new ApsProperties();
      Lang defaultLang = super.getLangManager().getDefaultLang();
      properties.put(defaultLang.getCode(), defaultValue);
      this.getI18nManager().addLabelGroup(key, properties);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "addLabelGroups");
      throw new RuntimeException("Error adding label groups - key '" + key + "'", t);
    }
View Full Code Here

    String typeCode = null;
    RequestContext reqCtx = (RequestContext) this.getRequest().getAttribute(RequestContext.REQCTX);
    if (reqCtx!=null) {
      Widget showlet = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
      if (showlet!=null) {
        ApsProperties config = showlet.getConfig();
        if (null!=config) {
          String showletTypeCode = config.getProperty(JpwebdynamicformSystemConstants.TYPECODE_SHOWLET_PARAM);
          if (showletTypeCode!=null && showletTypeCode.trim().length()>0) {
            typeCode = showletTypeCode.trim();
          }
        }
      }
View Full Code Here

      Widget widget = new Widget();
            IWidgetTypeManager widgetTypeMan =
              (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
            WidgetType WidgetType = widgetTypeMan.getWidgetType("content_feedback_viewer");
            widget.setType(WidgetType);
            ApsProperties prop = new ApsProperties();
            prop.put("contentId", contentId);
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ACTIVE, "true");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_MODERATED, "false");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ANONYMOUS, "false");
            widget.setConfig(prop);
            widget.setPublishedContent(contentId);

            List<String> listaIds = this._commentManager.searchCommentIds(null);
      assertEquals(0, listaIds.size());
View Full Code Here

      Widget showlet = new Widget();
            IWidgetTypeManager showletTypeMan =
              (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
            WidgetType WidgetType = showletTypeMan.getWidgetType("content_feedback_viewer");
            showlet.setType(WidgetType);
            ApsProperties prop = new ApsProperties();
            prop.put("contentId", contentId);
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ACTIVE, "true");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_MODERATED, "false");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ANONYMOUS, "false");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_RATE_COMMENT, "true");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_RATE_CONTENT, "true");
            showlet.setConfig(prop);
            showlet.setPublishedContent(contentId);

            RequestContext e = new RequestContext();
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, showlet);
View Full Code Here

      Widget showlet = new Widget();
            IWidgetTypeManager showletTypeMan =
              (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
            WidgetType WidgetType = showletTypeMan.getWidgetType("content_feedback_viewer");
            showlet.setType(WidgetType);
            ApsProperties prop = new ApsProperties();
            prop.put("contentId", contentId);
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ACTIVE, "true");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_MODERATED, "false");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_COMMENT_ANONYMOUS, "false");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_RATE_COMMENT, "true");
            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_RATE_CONTENT, "true");
            showlet.setConfig(prop);

            RequestContext e = new RequestContext();
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, showlet);
            Lang lang = new Lang();
View Full Code Here

TOP

Related Classes of com.agiletec.aps.util.ApsProperties

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.