Package org.osforce.spring4me.web.widget.config

Examples of org.osforce.spring4me.web.widget.config.PageConfig


    this.resourceLoader = resourceLoader;
  }

  public PageConfig getPageConfig(String path, Locale locale) throws Exception {
    String key = path + "T" + locale.toString();
    PageConfig pageConfig = simpleCache.get(key);
    if(cache && pageConfig!=null) {
      return pageConfig;
    }
    //
    File xmlPage = findPageFile(path, locale);
    Map<String, String> paramMap = getParamMap(path);
    pageConfig = configParser.parse(xmlPage, paramMap);
    if(StringUtils.isNotBlank(pageConfig.getParent())) {
       xmlPage = findPageFile(pageConfig.getParent(), locale);
       PageConfig parentPageConfig = configParser.parse(xmlPage, paramMap);
       pageConfig = mergePageConfig(parentPageConfig, pageConfig);
    }
    //
    if(cache && pageConfig!=null) {
      simpleCache.put(key, pageConfig);
View Full Code Here


  }
 
  protected PageConfig parseToPageConfig(Element pageEle) {
    String parentP = XMLUtil.getAttribute(pageEle, "parent");
    String qualifierP = XMLUtil.getAttribute(pageEle, "qualifier");
    PageConfig pageConfig = new PageConfig(parentP, qualifierP);
    List<Element> placeholderEles = XMLUtil.getChildElements(pageEle, "placeholder");
    for(Element placeholderEle : placeholderEles) {
      String nameP = XMLUtil.getAttribute(placeholderEle, "name");
      List<Element> widgetEles = XMLUtil.getChildElements(placeholderEle, "widget");
      for(Element widgetEle : widgetEles) {
        String nameW = XMLUtil.getAttribute(widgetEle, "name");
        String pathW = XMLUtil.getAttribute(widgetEle, "path");
        String cssClassW = XMLUtil.getAttribute(widgetEle, "cssClass");
        String cacheW = XMLUtil.getAttribute(widgetEle, "cache");
        WidgetConfig widgetConfig = new WidgetConfig(nameW, pathW, cssClassW, cacheW);
        //
        Element titleEle = XMLUtil.getChildElement(widgetEle, "title");
        if(titleEle!=null) {
          String titleW = XMLUtil.getValue(titleEle);
          widgetConfig.setTitle(titleW);
        }
        //
        Element prefsEle = XMLUtil.getChildElement(widgetEle, "prefs");
        if(prefsEle!=null) {
        List<Element> prefEles = XMLUtil.getChildElements(prefsEle);
          for(Element prefEle : prefEles) {
            String key = XMLUtil.getName(prefEle);
            String value = XMLUtil.getValue(prefEle);
            widgetConfig.addPref(key, value);
          }
        }
        pageConfig.add(nameP, widgetConfig);
      }
    }
    return pageConfig;
  }
View Full Code Here

      String viewName = getViewName(beanName, request);
      ConfigFactory configFactory = getConfigFactory();
      //
      String theme = (String) request.getAttribute("theme");
      Locale locale = RequestContextUtils.getLocale(request);
      PageConfig pageConfig = configFactory.getPageConfig(viewName, locale);
      request.setAttribute(PageConfig.KEY, pageConfig);
      //
      Boolean popup = request.getAttribute("popup")!=null;
      return getLayout(theme, popup);
    }
View Full Code Here

    this.closeWith = closeWith;
  }

  @Override
  public int doEndTag() throws JspException {
    PageConfig pageConfig = (PageConfig) pageContext
        .getRequest().getAttribute(PageConfig.KEY);
    List<WidgetConfig> widgetConfigList = pageConfig.getWidgetConfigs(name);
    if(widgetConfigList==null || widgetConfigList.isEmpty()) {
      return EVAL_PAGE;
    }
    //
    StringBuffer buffer = new StringBuffer();
View Full Code Here

TOP

Related Classes of org.osforce.spring4me.web.widget.config.PageConfig

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.