You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jw...@apache.org on 2010/01/18 23:56:53 UTC

svn commit: r900598 - in /myfaces/trinidad/branches/1.2.12.2-branch: trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/ trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/ trinidad-examples/trinidad-demo/src/main/we...

Author: jwaldman
Date: Mon Jan 18 22:56:52 2010
New Revision: 900598

URL: http://svn.apache.org/viewvc?rev=900598&view=rev
Log:
TRINIDAD-1687 add a Skin api that will clear the skin file(s) and reload at runtime
The api is
  /**
   * Check to see if this Skin has been marked dirty.
   * The only way to mark a Skin dirty is to call setDirty(true).
   * @return true if the Skin is marked dirty.
   */
  abstract public boolean isDirty();

  /**
   * Sets the dirty flag of the Skin. Use this if you want to regenerate the skin.
   * During rendering, if isDirty is true,
   * the skin's css file will be reprocessed regardless of whether the css file has been modified
   * or if the CHECK_FILE_MODIFICATION flag was set.
   * The Skinning Framework calls setDirty(false) after the skin has been reprocessed.
   */
  abstract public void setDirty(boolean dirty); 

Added:
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java
Modified:
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java Mon Jan 18 22:56:52 2010
@@ -186,5 +186,21 @@
    * @return List a List of SkinAdditions.
    */
   abstract public List<SkinAddition> getSkinAdditions ();
+  
+  /**
+   * Check to see if this Skin has been marked dirty. 
+   * The only way to mark a Skin dirty is to call setDirty(true).
+   * @return true if the Skin is marked dirty. 
+   */
+  abstract public boolean isDirty();
+
+  /**
+   * Sets the dirty flag of the Skin. Use this if you want to regenerate the skin. 
+   * During rendering, if isDirty is true, 
+   * the skin's css file will be reprocessed regardless of whether the css file has been modified 
+   * or if the CHECK_FILE_MODIFICATION flag was set. 
+   * The Skinning Framework calls setDirty(false) after the skin has been reprocessed.
+   */
+  abstract public void setDirty(boolean dirty);
     
 }

Added: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java?rev=900598&view=auto
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java (added)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java Mon Jan 18 22:56:52 2010
@@ -0,0 +1,46 @@
+package org.apache.myfaces.trinidaddemo;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.context.RequestContext;
+
+/**
+ * This class is used in panelPageSkinDemo.jspx. It sets the Skin to dirty so that if you
+ * change a skin css file it gets picked up immediately without the need to set the web.xml
+ * CHECK_FILE_MODIFICATION flag.
+ */
+public class SkinDirtyPhaseListener
+  implements PhaseListener
+{
+  public SkinDirtyPhaseListener()
+  {
+    super();
+  }
+
+  public void afterPhase(PhaseEvent phaseEvent)
+  {
+  }
+
+  public void beforePhase(PhaseEvent phaseEvent)
+  {
+    // Add event code here...
+    System.out.println("***PhaseTracker: Before Phase: " + phaseEvent.getPhaseId());
+    RenderingContext rContext = RenderingContext.getCurrentInstance();
+    if (rContext != null)
+    {
+      System.out.println("Set Skin to dirty");
+      rContext.getSkin().setDirty(true);
+    }
+    else
+      System.out.println("rContext in _beforePhase is null!");
+
+  }
+
+  public PhaseId getPhaseId()
+  {
+    return PhaseId.ANY_PHASE;
+  }
+}

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml Mon Jan 18 22:56:52 2010
@@ -3065,5 +3065,9 @@
     <managed-bean-class>org.apache.myfaces.trinidaddemo.DemoAccessibilityProfileBean</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
-
+  <managed-bean>
+    <managed-bean-name>skinDirty</managed-bean-name>
+    <managed-bean-class>org.apache.myfaces.trinidaddemo.SkinDirtyPhaseListener</managed-bean-class>
+    <managed-bean-scope>request</managed-bean-scope>
+  </managed-bean>
 </faces-config>

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx Mon Jan 18 22:56:52 2010
@@ -24,7 +24,7 @@
           xmlns:trh="http://myfaces.apache.org/trinidad/html"
           xmlns:tr="http://myfaces.apache.org/trinidad">
   <jsp:directive.page contentType="text/html;charset=utf-8"/>
-  <f:view>
+  <f:view beforePhase="#{skinDirty.beforePhase}">
     <trh:html>
       <trh:head title="Skin Demo">
         <!-- the beach skin is defined in beach.css. If you want to add your own

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java Mon Jan 18 22:56:52 2010
@@ -132,6 +132,13 @@
       context.getExternalContext().getInitParameter(Configuration.CHECK_TIMESTAMP_PARAM);
     return "true".equals(checkTimestamp);
   }
+  /*
+   * checks to see if the Skin is dirty by calling skin.isDirty()
+   */
+  public boolean isDirty()
+  {
+    return _arc.getSkin().isDirty();
+  }
 
   public boolean disableStandardsMode()
   {

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java Mon Jan 18 22:56:52 2010
@@ -312,6 +312,17 @@
 
     return ((DocumentProviderSkin)_skin).getStyleSheetDocument(styleContext);
   }
+  
+  @Override
+  public boolean isDirty()
+  {
+    return _skin.isDirty();
+  }
+  @Override
+  public void setDirty(boolean dirty)
+  {
+    _skin.setDirty(dirty);
+  }
 
   // Returns request-specific map of icon names to Icons
   private Map<String, Icon> _getRequestIcons()

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java Mon Jan 18 22:56:52 2010
@@ -548,6 +548,21 @@
       return _fullStyleSheetDocument;
     }
   }
+  
+  /**
+   * Set the skin to be dirty. This will force the skin's css file to
+   * be reprocessed regardless of whether the css file has been modified 
+   * or if the CHECK_FILE_MODIFICATION flag was set.
+   * The Skinning Framework sets the dirty flag back to 
+   * false once it has reprocessed the skin.
+   */
+  @Override
+  public void setDirty(boolean dirty)
+  {
+    super.setDirty(dirty);
+    // also, set the base skin's dirty flag
+    getBaseSkin().setDirty(dirty);
+  }
 
   /**
    * Find the actual icon

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java Mon Jan 18 22:56:52 2010
@@ -386,6 +386,31 @@
     SkinAddition addition = new SkinAddition(styleSheetName);
     addSkinAddition(addition);
   }
+  
+  /**
+   * Check to see if this Skin has been marked dirty. 
+   * The only way to mark a Skin dirty is to call setDirty(true).
+   * @return true if the Skin is marked dirty. 
+   * 
+   */
+  @Override
+  public boolean isDirty()
+  {
+    return _dirty;
+  }
+
+  /**
+   * Sets the dirty flag of the Skin. Use this if you want to regenerate the skin. 
+   * During rendering, if isDirty is true, 
+   * the skin's css file will be reprocessed regardless of whether the css file has been modified 
+   * or if the CHECK_FILE_MODIFICATION flag was set. 
+   * The Skinning Framework calls setDirty(false) after the skin has been reprocessed.
+   */
+   @Override
+  public void setDirty(boolean dirty)
+  {
+    _dirty = dirty;
+  }
 
   /**
    * Returns a translated value in the LocaleContext's translation Locale, or null
@@ -489,10 +514,11 @@
   abstract protected ValueExpression getTranslationSourceValueExpression();
 
   // Checks to see whether any of our style sheets have been updated
+  // or if the skin has been marked dirty
   private boolean _checkStylesModified(
     StyleContext context
     )
-  {
+  {    
     boolean modified = false;
 
     if (_skinStyleSheet != null)
@@ -1157,6 +1183,7 @@
   // HashMap of Skin properties
   private ConcurrentHashMap<Object, Object> _properties= new ConcurrentHashMap<Object, Object>();
 
-
+  private boolean _dirty;
+  
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(SkinImpl.class);
 }

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java Mon Jan 18 22:56:52 2010
@@ -78,9 +78,10 @@
         return null;
 
       // We either create a plain old StyleSheetEntry or a special
-      // subclass of StyleSheetEntry that can check for modifications
-      // depending on the Configuration settings
-      if (context.checkStylesModified())
+      // subclass of StyleSheetEntry that will recalculate the StyleSheetEntry
+      // if the skin is dirty or if there are file modifications
+      // and the Configuration settings say to check for file modifications.
+      if (context.checkStylesModified() || context.isDirty())
         return new CheckModifiedEntry(styleSheetName,
                                       skinStyleSheet.getDocument(),
                                       resolver);
@@ -269,8 +270,8 @@
   }
 
 
-  // Subclass of StyleSheetEntry which checks for updates
-  // to the underlying style sheet files.
+  // Subclass of StyleSheetEntry which recreates the StyleSheetEntry
+  // if the skin is marked dirty (skin.isDirty()) or if the underlying source files have been modified.
   private static class CheckModifiedEntry extends StyleSheetEntry
   {
     public CheckModifiedEntry(
@@ -294,7 +295,7 @@
     {
       // We would synchronize here, but at the moment synchronization
       // is provided by Skin.getStyleSheetDocument().
-      if ((_provider != null) && (_provider.hasSourceChanged()))
+      if (context.isDirty() || ((_provider != null) && (_provider.hasSourceChanged())))
       {
         // Throw away the old InputStreamProvider and StyleSheetDocument
         _provider = null;

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java Mon Jan 18 22:56:52 2010
@@ -53,4 +53,5 @@
   public AccessibilityProfile getAccessibilityProfile();
   public boolean isPortletMode();
   public boolean isDisableStyleCompression();
+  public boolean isDirty();
 }

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java Mon Jan 18 22:56:52 2010
@@ -290,7 +290,9 @@
     StyleSheetDocument document = null;
     Map<String, String> shortStyleClassMap = null;
     String[] namespacePrefixes = null;
-
+    RenderingContext arc = RenderingContext.getCurrentInstance();
+    Skin skin = arc.getSkin();
+    boolean isDirty = skin.isDirty();
     boolean checkModified  = context.checkStylesModified();
 
     // Synchronize while set up the _cache, _entryCache, _document, etc...
@@ -298,7 +300,7 @@
     {
       // If checking for modified files, then check to see if the XSS or CSS
       // document has been modified.  If so, we dump our in-memory style cache.
-      if (checkModified && hasSourceDocumentChanged(context))
+      if (isDirty || (checkModified && hasSourceDocumentChanged(context)))
       {
         _cache = null;
         _entryCache = null;
@@ -356,7 +358,8 @@
                         entryCache,
                         shortStyleClassMap,
                         namespacePrefixes,
-                        checkModified);
+                        checkModified, 
+                        isDirty);
   }
 
   private Entry _getEntry(
@@ -422,7 +425,8 @@
     ConcurrentMap<Object, Entry> entryCache,
     Map<String, String>          shortStyleClassMap,
     String[]                     namespacePrefixes,
-    boolean                      checkModified)
+    boolean                      checkModified,
+    boolean                      isDirty)
   {
     // Next, get the fully resolved styles for this context. This will be
     // those StyleNodes that match the locale, direction, browser, portlet mode
@@ -445,7 +449,8 @@
                                        styleNodes,
                                        shortStyleClassMap,
                                        namespacePrefixes,
-                                       checkModified);
+                                       checkModified,
+                                       isDirty);
 
     _LOG.fine("Finished processing stylesheet {0}", uris);
 
@@ -469,6 +474,11 @@
     // Also, cache the new entry in the entry cache
     DerivationKey derivationKey = _getDerivationKey(context, document);
     entryCache.put(derivationKey, entry);
+    
+    // just in case, clear the dirty flag.
+    RenderingContext arc = RenderingContext.getCurrentInstance();
+    Skin skin = arc.getSkin();
+    skin.setDirty(false);
 
     return entry;
   }
@@ -655,17 +665,21 @@
     StyleNode[]         styles,
     Map<String, String> shortStyleClassMap,
     String[]            namespacePrefixes,
-    boolean             checkModified)
+    boolean             checkModified,
+    boolean             isDirty)
   {
+
     // Get the current files
     List<File> outputFiles = _getOutputFiles(context, document);
 
     // If at least one output file exists, check the last modified time.
     if (!outputFiles.isEmpty())
     {
-      if (checkModified)
+      // If the skin is marked dirty, we regenerate the css even if the document's timestamp has not
+      // changed.
+      if (checkModified || isDirty)
       {
-        if (!_checkSourceModified(document, outputFiles.get(0)))
+        if (!isDirty && (checkModified && !_checkSourceModified(document, outputFiles.get(0))))
         {
           return _getFileNames(outputFiles);
         }
@@ -740,7 +754,15 @@
     {
       if (file.exists())
       {
-        file.delete();
+        boolean success = file.delete();
+        // add warning if success is false, but continue on.
+        // I've seen the delete fail when we try to delete right after the file was created -
+        // like if the skin css file is modified and the page refreshed immediately after the
+        // app was initially run.
+        if (!success && _LOG.isWarning())
+        {
+          _LOG.warning("COULD_NOT_DELETE_FILE", file.getName());
+        }
       }
     }
   }
@@ -813,6 +835,9 @@
       if (parentFile != null)
         parentFile.mkdirs();
 
+      // This throws a FileNotFoundException if it wasn't successfully deleted earlier, most likely
+      // due to creating, then deleting too soon after.
+      // Since the file has the hashcode in the name, it's not bad that it doesn't rewrite it.
       FileOutputStream fos = new FileOutputStream(file);
       OutputStreamWriter writer = null;
 
@@ -835,6 +860,8 @@
     }
     catch (IOException e)
     {
+      // This might happen if we couldn't delete the css file that was already there, so we 
+      // are unable to recreate it.
       if (_LOG.isWarning())
         _LOG.warning("IOEXCEPTION_OPENNING_FILE", file);
         _LOG.warning(e);
@@ -1434,7 +1461,7 @@
       }
 
       File outputFile = _getOutputFile(_baseFilename, _files.size() + 1);
-      // We never want to do anything other then read it or delete it:
+      // We never want to do anything other than read it or delete it:
       outputFile.setReadOnly();
 
       _files.add(outputFile);
@@ -1500,7 +1527,6 @@
    * names do not contain html, whereas our internal style selector
    * names may. We write out the shortened version of the mapped
    * selector names to the css file.
-   * jmw.
    * @todo Need to find a better spot for this, like the skin?
    */
   private static final Map<String, String> _STYLE_KEY_MAP;

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts?rev=900598&r1=900597&r2=900598&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts Mon Jan 18 22:56:52 2010
@@ -1076,4 +1076,5 @@
 <!-- INVALID_LOCALE_VARIANT_HAS_SLASH  -->
 <resource key="INVALID_LOCALE_VARIANT_HAS_SLASH">Invalid variant for Locale identifier {0} - cannot contain slashes to avoid XSS attack. Will use empty string for variant.</resource>
 
+<resource key="COULD_NOT_DELETE_FILE">Could not delete the file {0}</resource>
 </resources>