Esempio n. 1
0
  public void setLookAndFeel(Theme theme, ColorScheme colorScheme) {
    _theme = theme;
    _colorScheme = colorScheme;

    if ((theme != null) && (colorScheme != null)) {
      String themeStaticResourcePath = theme.getStaticResourcePath();

      String cdnBaseURL = getCDNBaseURL();

      setPathColorSchemeImages(
          cdnBaseURL + themeStaticResourcePath + colorScheme.getColorSchemeImagesPath());

      String dynamicResourcesHost = getCDNDynamicResourcesHost();

      if (Validator.isNull(dynamicResourcesHost)) {
        String portalURL = getPortalURL();

        if (getServerName() != null) {
          try {
            portalURL = PortalUtil.getPortalURL(getLayout(), this);
          } catch (Exception e) {
            _log.error(e, e);
          }
        }

        dynamicResourcesHost = portalURL;
      }

      setPathThemeCss(dynamicResourcesHost + themeStaticResourcePath + theme.getCssPath());

      setPathThemeImages(cdnBaseURL + themeStaticResourcePath + theme.getImagesPath());
      setPathThemeJavaScript(cdnBaseURL + themeStaticResourcePath + theme.getJavaScriptPath());
      setPathThemeRoot(themeStaticResourcePath + theme.getRootPath());
      setPathThemeTemplates(cdnBaseURL + themeStaticResourcePath + theme.getTemplatesPath());
    }
  }