[gatein-commits] gatein SVN: r4876 - portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Oct 30 07:57:04 EDT 2010


Author: julien_viet
Date: 2010-10-30 07:57:04 -0400 (Sat, 30 Oct 2010)
New Revision: 4876

Modified:
   portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
Log:
attunement


Modified: portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
--- portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java	2010-10-30 09:54:44 UTC (rev 4875)
+++ portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java	2010-10-30 11:57:04 UTC (rev 4876)
@@ -64,9 +64,7 @@
 import javax.servlet.ServletContext;
 
 @Managed
- at NameTemplate({
-   @Property(key = "view", value = "portal"),
-   @Property(key = "service", value = "management"),
+ at NameTemplate({@Property(key = "view", value = "portal"), @Property(key = "service", value = "management"),
    @Property(key = "type", value = "skin")})
 @ManagedDescription("Skin service")
 @RESTEndpoint(path = "skinservice")
@@ -170,17 +168,12 @@
       };
 
       //
-      FutureExoCache<String, CachedStylesheet, Orientation> ltCache = new FutureExoCache<String, CachedStylesheet, Orientation>(loader, new ConcurrentFIFOExoCache<String, CachedStylesheet>(200));
-      FutureExoCache<String, CachedStylesheet, Orientation> rtCache = new FutureExoCache<String, CachedStylesheet, Orientation>(loader, new ConcurrentFIFOExoCache<String, CachedStylesheet>(200));
-
-
-      //
       this.compressor = compressor;
       portalSkins_ = new LinkedHashMap<SkinKey, SkinConfig>();
       skinConfigs_ = new LinkedHashMap<SkinKey, SkinConfig>(20);
       availableSkins_ = new HashSet<String>(5);
-      this.ltCache = ltCache;
-      this.rtCache = rtCache;
+      ltCache = new FutureExoCache<String, CachedStylesheet, Orientation>(loader, new ConcurrentFIFOExoCache<String, CachedStylesheet>(200));
+      rtCache = new FutureExoCache<String, CachedStylesheet, Orientation>(loader, new ConcurrentFIFOExoCache<String, CachedStylesheet>(200));
       portletThemes_ = new HashMap<String, Set<String>>();
       portalContainerName = context.getPortalContainerName();
       mainResolver = new MainResourceResolver(portalContainerName, skinConfigs_);
@@ -274,8 +267,6 @@
             log.debug("Adding Portal skin : Bind " + key + " to " + skinConfig);
          }
       }
-
-      //
       ltCache.remove(cssPath);
       rtCache.remove(cssPath);
    }
@@ -353,12 +344,17 @@
 
    /**
     * 
-    * Register the Skin for available portal Skins. Do not replace existing skin.
+    * Register the Skin for available portal Skins. Do not replace existed Skin
     * 
-    * @param module skin module identifier
-    * @param skinName skin name
-    * @param cssPath path uri to the css file. This is relative to the root context, use leading '/'
-    * @param cssData the data
+    * @param module
+    *           skin module identifier
+    * @param skinName
+    *           skin name
+    * @param cssPath
+    *           path uri to the css file. This is relative to the root context,
+    *           use leading '/'
+    * @param scontext
+    *           the webapp's {@link javax.servlet.ServletContext}
     */
    public void addSkin(String module, String skinName, String cssPath, String cssData)
    {
@@ -369,8 +365,6 @@
       {
          skinConfigs_.put(key, new SimpleSkin(this, module, skinName, cssPath));
       }
-
-      // Evict
       ltCache.remove(cssPath);
       rtCache.remove(cssPath);
    }
@@ -474,6 +468,7 @@
          //
          FutureExoCache<String, CachedStylesheet, Orientation> cache = orientation == Orientation.LT ? ltCache : rtCache;
          CachedStylesheet cachedCss = cache.get(orientation, path);
+
          cachedCss.writeTo(renderer.getOutput());
       }
       else
@@ -493,7 +488,7 @@
     */
    public String getMergedCSS(String cssPath)
    {
-      CachedStylesheet stylesheet = ltCache.get(null, cssPath);
+      CachedStylesheet stylesheet = ltCache.get(Orientation.LT, cssPath);
       return stylesheet != null ? stylesheet.getText() : null;
    }
 
@@ -780,7 +775,7 @@
 
    /**
     * Get Suffix of Orientation
-    * @param orientation the orientation
+    * @param orientation
     * @return Suffix of Orientation
     */
    String getSuffix(Orientation orientation)



More information about the gatein-commits mailing list