Package com.agiletec.aps.system

Examples of com.agiletec.aps.system.RequestContext


public class FacetNodeTitleTag extends OutSupport {
 
  @Override
  public int doStartTag() throws JspException {
    ServletRequest request =  this.pageContext.getRequest();
    RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
    try {
      IFacetNavHelper facetNavHelper = (IFacetNavHelper) ApsWebApplicationUtils.getBean(JpFacetNavSystemConstants.CONTENT_FACET_NAV_HELPER, this.pageContext);
      ITreeNodeManager facetManager =  facetNavHelper.getTreeNodeManager();
      ITreeNode facetNode = facetManager.getNode(this.getFacetNodeCode());
      String separator = (this.getSeparator() == null) ? " / " : this.getSeparator();
      if (null != facetNode) {
        Lang currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
        String title = facetNode.getTitles().getProperty(currentLang.getCode());
        if (this.isFullTitle()) {
          title = facetNode.getFullTitle(currentLang.getCode(), separator);
        }
        if (null == title || title.trim().length() == 0) {
View Full Code Here


public class FacetNavResultTag extends AbstractFacetNavTag {
 
  @Override
  public int doStartTag() throws JspException {
    ServletRequest request =  this.pageContext.getRequest();
    RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
    try {
      List<String> requiredFacets = null;
      if (this.isExecuteExtractRequiredFacets()) {
        requiredFacets = this.getRequiredFacets();
        this.pageContext.setAttribute(this.getRequiredFacetsParamName(), requiredFacets);
View Full Code Here

   * Extract the typeCode from the current showlet.
   * @return The type code extracted from the showlet.
   */
  protected String extractTypeCode() {
    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(JpUserRegSystemConstants.TYPECODE_SHOWLET_PARAM);
          if (showletTypeCode!=null && showletTypeCode.trim().length()>0) {
View Full Code Here

  /**
   * End tag analysis.
   */
  public int doEndTag() throws JspException {
    ServletRequest req =  this.pageContext.getRequest();
    RequestContext reqCtx = (RequestContext) req.getAttribute(RequestContext.REQCTX);
    Object result;
    if (bodyContent == null || bodyContent.getString() == null) {
      result = "";
    } else {
      result = bodyContent.getString().trim();
    }
    reqCtx.addExtraParam(this.getVar(), result);
    return EVAL_PAGE;
  }
View Full Code Here

      if (null != descrAttr) {
        SyndContent description = new SyndContentImpl();
        description.setType(JpRssSystemConstants.SYNDCONTENT_TYPE_TEXTHTML);
        String inLang = descrAttr.getTextForLang(langCode);
        //TODO Ottimizzare!
        RequestContext requestContext = new RequestContext();
        requestContext.setRequest(req);
        requestContext.setResponse(resp);
        if (null != inLang && inLang.length() >0) {
          String textValue = this.getLinkResolver().resolveLinks(inLang, requestContext);
          if (null != textValue && textValue.trim().length()>0) {
            description.setValue(textValue);
          } else {
View Full Code Here

public class CustomPageTitleTag extends TagSupport {
 
  @Override
  public int doStartTag() throws JspException {
    ServletRequest request =  this.pageContext.getRequest();
    RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
    try {
      if (null != this.getTitle() && this.getTitle().trim().length() > 0) {
        reqCtx.addExtraParam(SystemConstants.EXTRAPAR_EXTRA_PAGE_TITLES, this.getTitle());
      } else if (null != this.getLabelKey() && this.getLabelKey().trim().length() > 0) {
        II18nManager i18nManager = (II18nManager) ApsWebApplicationUtils.getBean(SystemConstants.I18N_MANAGER, this.pageContext);
        ApsProperties titles = i18nManager.getLabelGroups().get(this.getLabelKey());
        if (null != titles) {
          reqCtx.addExtraParam(SystemConstants.EXTRAPAR_EXTRA_PAGE_TITLES, titles);
        } else {
          reqCtx.addExtraParam(SystemConstants.EXTRAPAR_EXTRA_PAGE_TITLES, this.getLabelKey());
        }
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "doStartTag");
      throw new JspException("Error during tag initialization", t);
View Full Code Here

    return pagerVo;
  }

  protected int getMaxElementForItem(int maxItems, ServletRequest request) {
    if (maxItems == 0) {
      RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
      if (reqCtx != null) {
        Widget showlet = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
        ApsProperties config = showlet.getConfig();
        String stringMax = (String) config.get("maxElemForItem");
        if (stringMax != null && stringMax.length() > 0) {
          maxItems = Integer.parseInt(stringMax);
        }
View Full Code Here

  }

  private String getPagerId(String pagerId, boolean pagerIdFromFrame, ServletRequest request) {
    String truePagerId = pagerId;
    if (null == truePagerId && pagerIdFromFrame) {
      RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
      if (reqCtx != null) {
        int currentFrame = this.getCurrentFrame(reqCtx);
        truePagerId = "frame" + currentFrame;
      }
    }
View Full Code Here

   * terminata la redazione del contenuto.
   * @param contentId The Content id.
   * @return Il path di destinazione finale.
   */
  protected String getDestForwardPath(String contentId) {
    RequestContext reqCtx = (RequestContext) this.getRequest().getAttribute(RequestContext.REQCTX);
    Lang currentLang = null;
    if (null != reqCtx) {
      currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
    } else {
      currentLang = this.getLangManager().getDefaultLang();
    }
    IPage pageDestCode = null;
    String pageDestCodeString = (String) this.getRequest().getSession().getAttribute(JpFastContentEditSystemConstants.FINAL_DEST_PAGE_PARAM_NAME);
View Full Code Here

    }
    return label;
  }
 
  public Lang getCurrentLang() {
    RequestContext reqCtx = (RequestContext) this.getRequest().getAttribute(RequestContext.REQCTX);
    Lang currentLang = null;
    if (null != reqCtx) {
      currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
    } else {
      currentLang = this.getLangManager().getDefaultLang();
    }
    return currentLang;
  }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.RequestContext

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.