You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 12:30:40 UTC

[myfaces-trinidad] 17/36: TRINIDAD-1714 Mark the skin as dirty if DesignTime mode and org.apache.myfaces.trinidad.skin.id is set. This is reverting the change I made for TRINIDAD-1637 always check for file modification if in DesignTime mode regardless of web.xml setting This essentially does the same thing, but it doesn't check the file for modification. It always recomputes the Skin and its css file.

This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 4d686bcaee9b7117a5b0d69c29c6372dfd03a5c3
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Feb 9 19:27:26 2010 +0000

    TRINIDAD-1714 Mark the skin as dirty if DesignTime mode and org.apache.myfaces.trinidad.skin.id is set.
    This is reverting the change I made for TRINIDAD-1637 always check for file modification if in DesignTime mode regardless of web.xml setting
    This essentially does the same thing, but it doesn't check the file for modification. It always recomputes the Skin and its css file.
---
 .../renderkit/core/StyleContextImpl.java           | 30 ++++++++++++----------
 .../style/cache/FileSystemStyleCache.java          |  4 +--
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
index 9eb7305..c74f34e 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
@@ -113,20 +113,6 @@ class StyleContextImpl implements StyleContext
   }
   public boolean checkStylesModified()
   {
-    if (Beans.isDesignTime())
-    {
-      // In Design Time mode, if we have a skin-id on the request scope,
-      // then this means we want to check if the skin css files are modified.
-      // This is an alternative to the initParam (CHECK_TIMESTAMP_PARAM) which
-      // is set in web.xml. Design Time cannot set the web.xml file.
-      FacesContext context = FacesContext.getCurrentInstance();
-      Object requestSkinId = 
-        ((CoreRenderingContext) _arc).getRequestMapSkinId(context);
-      if (requestSkinId != null)
-        return true;
-
-    }
-    
     FacesContext context = FacesContext.getCurrentInstance();
     String checkTimestamp =
       context.getExternalContext().getInitParameter(Configuration.CHECK_TIMESTAMP_PARAM);
@@ -137,6 +123,22 @@ class StyleContextImpl implements StyleContext
    */
   public boolean isDirty()
   {
+    if (Beans.isDesignTime())
+    {
+      // In Design Time mode, if we have a skin-id on the request scope,
+      // then this means the Design Time wants the skin to regenerate. To do this,
+      // we say the skin is dirtys
+      FacesContext context = FacesContext.getCurrentInstance();
+      Object requestSkinId = 
+        ((CoreRenderingContext) _arc).getRequestMapSkinId(context);
+      if (requestSkinId != null)
+      {
+        // set the skin to dirty as well for double insurance, like if someone checks the 
+        // skin directly to see if it is dirty.
+        _arc.getSkin().setDirty(true); 
+        return true;
+      }
+    }
     return _arc.getSkin().isDirty();
   }
 
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
index 0c17937..383f729 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
@@ -290,9 +290,7 @@ public class FileSystemStyleCache implements StyleProvider
     StyleSheetDocument document = null;
     Map<String, String> shortStyleClassMap = null;
     String[] namespacePrefixes = null;
-    RenderingContext arc = RenderingContext.getCurrentInstance();
-    Skin skin = arc.getSkin();
-    boolean isDirty = skin.isDirty();
+    boolean isDirty = context.isDirty();
     boolean checkModified  = context.checkStylesModified();
 
     // Synchronize while set up the _cache, _entryCache, _document, etc...

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.