Examples of SkinService


Examples of org.exoplatform.portal.resource.SkinService

        StandaloneAppRequestContext context = WebuiRequestContext.getCurrentInstance();
        return service.getJSConfig(context.getControllerContext(), context.getLocale());
    }

    public Collection<Skin> getPortalSkins() {
        SkinService skinService = getApplicationComponent(SkinService.class);
        Collection<Skin> skins = new ArrayList<Skin>(skinService.getPortalSkins(skin_));
        return skins;
    }
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

     * - skin for portlets that belongs to portal (not in the page).
     * Those portlet skins will be merged into one css resource called CompositeSkin <br/>
     * we are using ajax to change navigation, if only page is change, only the skin of portlet in page is changed (not the portlet belongs to portal)
     */
    public Collection<Skin> getPortalSkins() {
        SkinService skinService = getApplicationComponent(SkinService.class);

        //
        Collection<Skin> skins = new ArrayList<Skin>(skinService.getPortalSkins(skin_));

        //
        SkinConfig skinConfig = skinService.getSkin(Util.getUIPortal().getName(), skin_);
        if (skinConfig != null) {
            skins.add(skinConfig);
        }

        //
        Set<SkinConfig> portletConfigs = getPortalPortletSkins();
        // don't merge portlet if portlet not available
        if (!portletConfigs.isEmpty()) {
            skins.add(skinService.merge(portletConfigs));
        }
        //
        return skins;
    }
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

    public void setSkin(String skin) {
        this.skin_ = skin;
    }

    private SkinConfig getSkin(String module, String skin) {
        SkinService skinService = getApplicationComponent(SkinService.class);
        return skinService.getSkin(module, skin);
    }
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

                    uiContainer.findComponentOfType(uiportlets, UIPortlet.class);
                }
            }
        }
        List<SkinConfig> skins = new ArrayList<SkinConfig>();
        SkinService skinService = getApplicationComponent(SkinService.class);
        for (UIPortlet uiPortlet : uiportlets) {
            String skinId = uiPortlet.getSkinId();
            if (skinId != null) {
                SkinConfig skinConfig = skinService.getSkin(skinId, skin_);
                if (skinConfig != null)
                    skins.add(skinConfig);
            }
        }
        StringBuilder b = new StringBuilder(1000);
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

            uiPortalApp.localizeNavigations();
         }
         uiPortalApp.setSkin(editPortal.getSkin());
      }
      prContext.refreshResourceBundle();
      SkinService skinService = getApplicationComponent(SkinService.class);
      skinService.invalidatePortalSkinCache(editPortal.getName(), editPortal.getSkin());
   }
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

            StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class).setEditable(false))
         .addUIFormInput(
            new UIFormSelectBox(FIELD_LOCALE, FIELD_LOCALE, languages).addValidator(MandatoryValidator.class));

      List<SelectItemOption<String>> listSkin = new ArrayList<SelectItemOption<String>>();
      SkinService skinService = getApplicationComponent(SkinService.class);
      for (String skin : skinService.getAvailableSkinNames())
      {
         SelectItemOption<String> skinOption = new SelectItemOption<String>(skin, skin);
         if (uiPortal.getSkin().equals(skin))
         {
            skinOption.setSelected(true);
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

   public UISkinSelector() throws Exception
   {
      name_ = "UIChangeSkin";
      UIPortal uiPortal = Util.getUIPortal();
      List<SelectItemCategory> itemCategories = new ArrayList<SelectItemCategory>();
      SkinService skinService = uiPortal.getApplicationComponent(SkinService.class);
      for (String skin : skinService.getAvailableSkinNames())
      {
         SelectItemCategory skinCategory = new SelectItemCategory(skin, false);
         skinCategory.addSelectItemOption(new SelectItemOption(skin, skin, skin));
         itemCategories.add(skinCategory);
      }
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

   {
      HttpServletRequest httpRequest = (HttpServletRequest)request;
      final String uri = URLDecoder.decode(httpRequest.getRequestURI(), "UTF-8");
      final HttpServletResponse httpResponse = (HttpServletResponse)response;
      ExoContainer portalContainer = getContainer();
      SkinService skinService = (SkinService)portalContainer.getComponentInstanceOfType(SkinService.class);

      //
      if (uri.endsWith(".css"))
      {
         final OutputStream out = response.getOutputStream();
         final BinaryOutput output = new BinaryOutput()
         {
            public Charset getCharset()
            {
               return UTF_8;
            }
            public void write(byte b) throws IOException
            {
               out.write(b);
            }
            public void write(byte[] bytes) throws IOException
            {
               out.write(bytes);
            }
            public void write(byte[] bytes, int off, int len) throws IOException
            {
               out.write(bytes, off, len);
            }
         };
         ResourceRenderer renderer = new ResourceRenderer()
         {
            public BinaryOutput getOutput() throws IOException
            {
               return output;
            }
            public void setExpiration(long seconds)
            {
               if (seconds > 0)
               {
                  httpResponse.addHeader("Cache-Control", "max-age=" + seconds + ",s-maxage=" + seconds);
               }
               else
               {
                  httpResponse.setHeader("Cache-Control", "no-cache");
               }
            }
         };

         //
         try
         {
            skinService.renderCSS(renderer, uri);
            if (log.isDebugEnabled())
            {
               log.debug("Use a merged CSS: " + uri);
            }
         }
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

      addUIFormInput(uiSettingSet);
      UIFormInputIconSelector uiIconSelector = new UIFormInputIconSelector("Icon", "icon");
      addUIFormInput(uiIconSelector);

      UIFormInputThemeSelector uiThemeSelector = new UIFormInputThemeSelector(FIELD_THEME, null);
      SkinService skinService = getApplicationComponent(SkinService.class);
      uiThemeSelector.getChild(UIItemThemeSelector.class).setValues(skinService.getPortletThemes());
      addUIFormInput(uiThemeSelector);

      UIListPermissionSelector uiListPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, null);
      uiListPermissionSelector.configure("UIAccessPermission", "accessPermissions");
      uiListPermissionSelector.addValidator(EmptyIteratorValidator.class);
View Full Code Here

Examples of org.exoplatform.portal.resource.SkinService

      return service.getAvailableScriptsPaths();
   }

   public Collection<Skin> getPortalSkins()
   {
      SkinService skinService = getApplicationComponent(SkinService.class);

      //
      Collection<Skin> skins = new ArrayList<Skin>(skinService.getPortalSkins(skin_));

      //
      SkinConfig skinConfig = skinService.getSkin(Util.getUIPortal().getName(), skin_);
      if (skinConfig != null)
      {
         skins.add(skinConfig);
      }

      //
      Set<SkinConfig> portletConfigs = getPortalPortletSkins();
      // don't merge portlet if portlet not available
      if (!portletConfigs.isEmpty())
      {
         skins.add(skinService.merge(portletConfigs));
      }
      //
      return skins;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.