Examples of SkinService


Examples of org.exoplatform.portal.resource.SkinService

      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

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

      //
      if (uri.endsWith(".css"))
      {
//     Check if cached resource has not been modifed, return 304 code     
         long cssLastModified = skinService.getLastModified(uri);
         if (isNotModified(ifModifiedSince, cssLastModified)) {
            httpResponse.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
            return;
         }
         response.setContentType("text/css; charset=UTF-8");
        
         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");
               }

               long lastModified = skinService.getLastModified(uri);
               processIfModified(lastModified, httpResponse);
            }
         };

         //
         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

        uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_DESCRIPTION, FIELD_DESCRIPTION, null));
        uiSettingSet.addUIFormInput(new UIFormSelectBox(FIELD_LOCALE, FIELD_LOCALE, languages)
                .addValidator(MandatoryValidator.class));

        List<SelectItemOption<String>> listSkin = new ArrayList<SelectItemOption<String>>();
        SkinService skinService = getApplicationComponent(SkinService.class);
        List<String> skinNames = new ArrayList<String>(skinService.getAvailableSkinNames());
        Collections.sort(skinNames);
        for (String skin : skinNames) {
            SelectItemOption<String> skinOption = new SelectItemOption<String>(skin, skin);
            listSkin.add(skinOption);
        }
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();
      final SkinService skinService = (SkinService) portalContainer.getComponentInstanceOfType(SkinService.class);
      long ifModifiedSince = httpRequest.getDateHeader(IF_MODIFIED_SINCE);

      //
      if (uri.endsWith(".css"))
      {
//     Check if cached resource has not been modifed, return 304 code     
         long cssLastModified = skinService.getLastModified(uri);
         if (isNotModified(ifModifiedSince, cssLastModified)) {
            httpResponse.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
            return;
         }
         response.setContentType("text/css; charset=UTF-8");
        
         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");
               }

               long lastModified = skinService.getLastModified(uri);
               processIfModified(lastModified, httpResponse);
            }
         };

         //
         try
         {
            skinService.renderCSS(renderer, uri);
            if (log.isDebugEnabled())
            {
               log.debug("Use a merged CSS: " + uri);
            }
         }
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.