myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwald...@apache.org
Subject svn commit: r1153208 - in /myfaces/trinidad/trunk/trinidad-impl/src/main: java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/ java/org/apache/myfaces/trinidadinternal/share/config/ java/org/apache/myfaces/trinidadinternal/share/xml/ java/org/...
Date Tue, 02 Aug 2011 17:19:20 GMT
Author: jwaldman
Date: Tue Aug  2 17:19:17 2011
New Revision: 1153208

URL: http://svn.apache.org/viewvc?rev=1153208&view=rev
Log:
TRINIDAD-1926 code cleanup: remove skinning XSS code when there are no more XSS skinning files
being used
thanks to Anand Nath for the patch

Removed:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/BaseDesktopSkin.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/MinimalPortletSkinExtension.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/config/Configuration.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/BaseDesktopSkin.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/BaseDesktopSkin.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/BaseDesktopSkin.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/BaseDesktopSkin.java
Tue Aug  2 17:19:17 2011
@@ -87,7 +87,7 @@ public class BaseDesktopSkin extends Xht
   @Override
   public String getStyleSheetName()
   {
-    return "base-desktop.xss";
+    return "base-desktop.css";
   }
 
   // Customizable LAF Icons

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/MinimalPortletSkinExtension.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/MinimalPortletSkinExtension.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/MinimalPortletSkinExtension.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/skin/MinimalPortletSkinExtension.java
Tue Aug  2 17:19:17 2011
@@ -40,7 +40,7 @@ import org.apache.myfaces.trinidadintern
            "minimal.portlet",
            TrinidadRenderingConstants.MINIMAL_SKIN_FAMILY,
            TrinidadRenderingConstants.OUTPUT_MODE_PORTLET,
-           "META-INF/adf/styles/simple-portlet.xss");
+           "META-INF/adf/styles/simple-portlet.css");
    }
 
  }

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/config/Configuration.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/config/Configuration.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/config/Configuration.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/config/Configuration.java
Tue Aug  2 17:19:17 2011
@@ -111,16 +111,6 @@ abstract public class Configuration
   static public final Object LOOK_AND_FEEL_MANAGER = "lookAndFeelManager";
 
   /**
-   * Key for the XSS style sheet name property.  Any value
-   * registered here will be used as the default stylesheet
-   * for all UIX projects.  The stylesheet will be looked
-   * for in the directory specified by the STYLES_DIRECTORY
-   * key.
-   */
-  // THE VALUE OF THIS STRING MATTERS: IT IS USED IN XML PARSING
-  static public final Object STYLE_SHEET_NAME = "styleSheetName";
-
-  /**
    * Key for the RendererManager property.  Any UIX Components RendererManager
    * stored at this key will be used by UIX Components's ServletRenderingContext
    * if none is explicitly attached.

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
Tue Aug  2 17:19:17 2011
@@ -51,70 +51,6 @@ import org.apache.myfaces.trinidadintern
 public class XMLUtils
 {
   /**
-   * Parses an XML file, like the skinning .xss file.  For includes, see parseInclude().
-   * @param context the current ParseContext, which will be cloned
-   * @param xmlProvider an XML provider
-   * @param manager a ParserManager
-   * @param resolver a NameResolver to locate the target
-   * @param sourceName the name of the target, relative to the current file
-   * @param expectedType the expected Java type of the target.
-   */
-  static public Object parseSource(
-    ParseContext  context,
-    XMLProvider   xmlProvider,
-    ParserManager manager,
-    NameResolver  resolver,
-    String        sourceName,
-    Class<?>      expectedType) throws IOException, SAXException
-  {
-    if (manager == null)
-      throw new NullPointerException();
-    if (expectedType == null)
-      throw new NullPointerException();
-    if (resolver == null)
-      throw new NullPointerException();
-    if (sourceName == null)
-      throw new NullPointerException();
-    if (context == null)
-      throw new NullPointerException();
-
-    if (xmlProvider == null)
-      xmlProvider = new JaxpXMLProvider();
-
-    InputStreamProvider provider = resolver.getProvider(sourceName);
-    Object cached = provider.getCachedResult();
-    if ((cached != null) && expectedType.isInstance(cached))
-      return cached;
-
-    TreeBuilder builder = new TreeBuilder(manager, expectedType);
-    InputStream stream = provider.openInputStream();
-
-    try
-    {
-      InputSource source = new InputSource(stream);
-      source.setSystemId(sourceName);
-
-      // Store a resolver relative to the file we're about to parse. This will be used for
imports.
-      setResolver(context, resolver.getResolver(sourceName));
-      setInputStreamProvider(context, provider);
-
-      // Step 6. Parse!
-      Object value = builder.parse(xmlProvider, source, context);
-
-      // Step 7. Store the cached result (if successful)
-      if (value != null)
-        provider.setCachedResult(value);
-
-      return value;
-    }
-    finally
-    {
-      stream.close();
-    }
-  }
-
-
-  /**
    * Parses an include of an XML file.  The include will be located using
    * an already-stored NameResolver object.
    *

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java
Tue Aug  2 17:19:17 2011
@@ -55,73 +55,6 @@ public final class AgentAtRuleMatcher
     /** The Match matched the agent version */
     VERSION
   };
-    
-  /**
-   * Constructor used by bogus XSS files to create a version matcher for a list of browsers
and
-   * versions. Since XSS has no syntax to specify separate versions for each browser, all
-   * browsers share the same version and only Version equality comparison is supported, though
-   * since Version equality comparisons support wild-cards, this isn't as limiting as it
might
-   * seem.
-   * @param browsers List of TrinidadAgent.Applications representing the browsers that this
matcher
-   * matches
-   * @param versions Optional array of Version objects of the Versions to match
-   */
-  public AgentAtRuleMatcher(List<TrinidadAgent.Application> browsers, Version[] versions)
-  {
-    //
-    // create the Set of VersionMatchers shared by all of the browsers
-    //
-    int versionCount = (versions != null) ? versions.length : 0;
-    
-    AgentMatcher[] versionMatchers;
-    
-    if (versionCount == 0)
-    {
-      versionMatchers = null;
-    }
-    else
-    {
-      versionMatchers = new AgentMatcher[versionCount];
-      
-      for (int i = 0; i < versionCount; i++)
-      {
-        // XSS only supports equals comparisons
-        versionMatchers[i] = new VersionMatcher(versions[i], Comparison.EQUALS);
-      }
-    }
-      
-    Set<AgentMatcher> versionSet = CollectionUtils.asSet(versionMatchers);
-    
-    //
-    // Create the Map from TrinidadAgent.Application to the Set of AgentMatchers we created
-    // above.  Since the most common cases are to have 0 or  1 entry, we special case to
reduce
-    // memory consumption.
-    // ==-= btsulliv Actually, we should really further optimize the 0 case and create a
single
-    //               constant empty matcher and check for that case and return it at the
top
-    //               of this function.
-    int browserCount = browsers.size();
-    
-    Map<TrinidadAgent.Application, Set<AgentMatcher>> browserMap;
-    
-    if (browserCount == 0)
-      browserMap = Collections.emptyMap();
-    else if (browserCount == 1)
-      browserMap = Collections.singletonMap(browsers.get(0), versionSet);
-    else
-    {
-      browserMap = new HashMap<TrinidadAgent.Application, Set<AgentMatcher>>(browserCount);
-
-      //in XSS there's now way of having multiple browsers and multiple versions
-      //if encountered, we map all versions to each browser (it works for 1 browser)
-      for (int i=0; i < browserCount ; i++)
-      {
-        browserMap.put(browsers.get(i), versionSet);
-      }
-    }
-    
-    _selectorAgents = browserMap;
-    _hashCode = _calculateStableHashCode(browserMap);
-  }
 
   /**
    * Creates an AgentAtRuleMatcher from an @agent query string.  if the @agent rule were

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
Tue Aug  2 17:19:17 2011
@@ -236,30 +236,17 @@ class StyleSheetEntry
     )
   {
 
-    StyleSheetEntry skinStyleSheet;
+    StyleSheetEntry skinStyleSheet = null;
 
-    if (!styleSheetName.endsWith(".css"))
-    {
-
-      // Parse the style sheet to create the StyleSheetDocument
-      StyleSheetDocument document = _createStyleSheetDocumentFromXSS(resolver,
-                                                              styleSheetName);
-      if (document == null)
-        skinStyleSheet = null;
-      else
-      {
-        skinStyleSheet = new StyleSheetEntry(styleSheetName,
-                                             document);
-      }
-
-    }
-    else
+    if (styleSheetName.endsWith(".css"))
     {
       // this will parse a skin css file which allows icons, properties,
       // and styles.
         skinStyleSheet =  _createSkinStyleSheetFromCSS(resolver,
                                                        styleSheetName);
-
+    } else {
+      String message = _LOG.getMessage("INVALID_STYLESHEET_TYPE", new Object[]{styleSheetName});
+      _LOG.severe(message);
     }
 
     return skinStyleSheet;
@@ -297,34 +284,6 @@ class StyleSheetEntry
       return null;
   }
 
-  // Creates the StyleSheetDocument from a skinning file that ends in .xss, like base-desktop.xss
-  private static StyleSheetDocument _createStyleSheetDocumentFromXSS(
-    NameResolver     resolver,
-    String           styleSheetName
-    )
-  {
-
-    XMLProvider xmlProvider = new JaxpXMLProvider();
-
-    try
-    {
-      // this will parse the xss file adn return a StyleSheetDocument
-      return StyleSheetDocumentUtils.createStyleSheetDocument(xmlProvider,
-                                                              resolver,
-                                                              styleSheetName);
-    }
-    catch (Exception e)
-    {
-      if (_LOG.isSevere())
-        _LOG.severe("CANNOT_LOAD_STYLESHEET", styleSheetName);
-        _LOG.severe(e);
-    }
-
-    return null;
-  }
-
-
-
   // Returns the NameResolver to use for locating and loading style sheet file.
   // Depending upon what the styleSheetName is, we load the file different way: local file,
   // url, etc.

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
Tue Aug  2 17:19:17 2011
@@ -55,69 +55,6 @@ import org.apache.myfaces.trinidad.loggi
 public class StyleSheetDocumentUtils
 {
   /**
-   * Creates a StyleSheetDocument from the specified InputSource (.xss file)
-   *
-   * @param provider The XMLProvider to use to parse the source document
-   * @param source The InputSource for the source document.  The system
-   *         id of the InputSource must be the file system path of the
-   *         source document.
-   */
-  public static StyleSheetDocument createStyleSheetDocument(
-    XMLProvider  provider,
-    InputSource  source
-    ) throws IOException, SAXException
-  {
-    // Make sure we've got a source file
-    String sourceName = source.getSystemId();
-    if ((sourceName == null)) 
-    {
-      throw new IllegalArgumentException(_LOG.getMessage(
-        "NULL_SOURCENAME"));
-    }
-
-    return createStyleSheetDocument(
-                          provider,
-                          new DefaultNameResolver(new File(sourceName), null),
-                          sourceName);
-
-  }
-
-  /**
-   * Creates a StyleSheetDocument from the specified InputSource (.xss file)
-   * @param xmlProvider The XMLProvider to use to parse the source document
-   * @param resolver The NameResolver to use to locate the source document.
-   *                 This must be a non-null instance.
-   * @param sourceName The name of the source XSS document.  This value
-   *                 must resolve to a valid document via the provided
-   *                 NameResolver.
-   */
-  public static StyleSheetDocument createStyleSheetDocument(
-    XMLProvider  xmlProvider,
-    NameResolver resolver,
-    String       sourceName
-    ) throws IOException, SAXException
-  {
-    // We always require a source name and a resolver
-    if ((sourceName == null)||(resolver == null)) 
-    {
-      throw new NullPointerException(_LOG.getMessage(
-        "NULL_ARGUMENT"));
-    }
-
-    // Gather all of the the objects that we need for the parse
-    ParserManager manager = _getDefaultParserManager();
-    ParseContextImpl parseContext = new ParseContextImpl();
-
-    // Parse it!
-    return (StyleSheetDocument)XMLUtils.parseSource(parseContext,
-                                                    xmlProvider,
-                                                    manager,
-                                                    resolver,
-                                                    sourceName,
-                                                    StyleSheetDocument.class);
-  }
-
-  /**
    * Merges two StyleSheetDocuments to produce a new StyleSheetDocuments
    * which combines styles from both documents.  If styles appear in
    * both documents, the style properties in the second StyleSheetDocument

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
Tue Aug  2 17:19:17 2011
@@ -42,10 +42,8 @@ import org.apache.myfaces.trinidadintern
  * browsers, direction, versions, platforms and mode.  In addition, the StyleSheetNode
  * provides access to IconNodes representing the icons which were defined within
  * the context of this style sheet. StyleSheetNodes are contained in StyleSheetDocuments.
- * And a StyleSheetNode is created for both .xss skin files and .css files.
- * .xss skin files create StyleSheetNodes via StyleSheetNodeParser
+ * And a StyleSheetNode is created for .css files.
  * .css skin files create StyleSheetNodes via SkinStyleSheetParserUtils
- * @see StyleSheetNodeParser
  * @see org.apache.myfaces.trinidadinternal.skin.SkinStyleSheetParserUtils
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/StyleSheetNode.java#0
$) $Date: 10-nov-2005.18:58:46 $
  */
@@ -606,9 +604,7 @@ public class StyleSheetNode
 
   // This special platform constant is used to indicate that the style sheet
   // is Unix-specific, but not specific to a particular Unix OS.  It is
-  // package private, as StyleSheetNodeParser references this when
-  // creating the int[] platforms array that gets passed in to StyleSheetNode.
-  // Agent.OS constants start from 0.  We use Integer.MAX_VALUE to avoid
-  // collisions
+  // package private. Agent.OS constants start from 0.
+  // We use Integer.MAX_VALUE to avoid collisions
   static final int __OS_UNIX = Integer.MAX_VALUE;
 }

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/desktop/BaseDesktopLookAndFeel.java
Tue Aug  2 17:19:17 2011
@@ -68,7 +68,7 @@ public class BaseDesktopLookAndFeel exte
    */
   public String getStyleSheetName()
   {
-    return "META-INF/adf/styles/base-desktop.xss";
+    return "META-INF/adf/styles/base-desktop.css";
   }
 
   @Override

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts?rev=1153208&r1=1153207&r2=1153208&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
Tue Aug  2 17:19:17 2011
@@ -1150,4 +1150,6 @@ The skin {0} specified on the requestMap
 <!-- SESSION_SERIALIZATION_ATTRIBUTE -->
 <resource key="SESSION_SERIALIZATION_ATTRIBUTE">Session attribute:{0} </resource>
 
+<resource key="INVALID_STYLESHEET_TYPE">Parsing error: Unknown type of stylesheet '{0}'.
Style sheets other than css are not supported. </resource>
+
 </resources>



Mime
View raw message