[jira] [Updated] (TRINIDAD-2515) Avoid caching skins from external SkinProviders and make LRU cache concurrent
[ https://issues.apache.org/jira/browse/TRINIDAD-2515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2515: Resolution: Fixed Status: Resolved (was: Patch Available) Committed in r1632265. Avoid caching skins from external SkinProviders and make LRU cache concurrent - Key: TRINIDAD-2515 URL: https://issues.apache.org/jira/browse/TRINIDAD-2515 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.1.0-core Reporter: Anand V Nath Attachments: jira-2515.patch, test-skin-and-images.zip Problem statement: SkinProvider SPI allows creation of external skin repositories and plug it into trinidad skin framework. Skin framework should allow such skins to be managed (created, cached, destroyed) by the SkinProvider. Currently this is not happening. Internal problem description: When user requests a Skin, skin framework creates a StyleProvider for it. This StyleProvider is cached at application level and reused for subsequent requests for the same Skin. Since the StyleProvider contains the Skin, it effectively caches the Skin also. Solution: Don't cache StyleProvider associated with Skins served from external SkinProviders. For achieveing this introduce isCacheable API on SkinImpl and implement it in SkinExtension: {code} /** * Used by SkinStyleProvider to decide whether to cache the StyleProvider or not. * @return true if skin is internal to the framework. */ public abstract boolean isCacheable(); {code} In SkinExtension introduce overloaded constructor for handling internal Skin creation and external Skin creation (through SkinFactory.createSkin) {code} /** * Creates SkinExtension from SkinMetadata and base Skin * This constructor is used for creating skins for external SkinProvider implementations. * We keep skins thus created as not-cacheable. * @see org.apache.myfaces.trinidadinternal.skin.SkinFactoryImpl * @param baseSkin * @param skinMetadata */ public SkinExtension(Skin baseSkin, SkinMetadata skinMetadata) { this(baseSkin, skinMetadata, false); } /** * Creates SkinExtension from SkinMetadata, base Skin and cacheability * This constructor is used only for INTERNAL skins * @see org.apache.myfaces.trinidadinternal.skin.provider.TrinidadSkinProvider * @param baseSkin * @param skinMetadata */ public SkinExtension(Skin baseSkin, SkinMetadata skinMetadata, boolean isCacheable) { // existing code: // read values from skinMetadata and set _isCacheable = isCacheable; } {code} Check SkinImpl.isCacheable() before caching the StyleProvider. For solving the concurrency issue in LRU cache used for caching StyleProviders, introduce new CopyOnWriteArrayMap and use it. For testing add SkinProvider test cases, CopyOnWriteArrayMap test cases. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRINIDAD-2509) For date pattern=yyyy:DDD HH:mm:ss, validation error is thrown even when the date is selected from popup and is correct
[ https://issues.apache.org/jira/browse/TRINIDAD-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14166687#comment-14166687 ] Andy Schwartz commented on TRINIDAD-2509: - Checked in the updated version of the patch at r1630638. For date pattern=:DDD HH:mm:ss, validation error is thrown even when the date is selected from popup and is correct --- Key: TRINIDAD-2509 URL: https://issues.apache.org/jira/browse/TRINIDAD-2509 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.1.0-core Environment: Issue occurs on all platforms Reporter: Anshu Jain Fix For: 2.1.1-core Attachments: TRINIDAD-2509.patch, TRINIDAD-2509_1.patch For a date component, the pattern is set to :DDD HH:mm:ss. On opening the calendar popup and selecting a date, a validation error is thrown: Error: The date or time entered is not valid. The date in the date filed is in correct format at this time. But, the validation error is incorrectly thrown. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (TRINIDAD-2510) make SkinTestCase more extendable
[ https://issues.apache.org/jira/browse/TRINIDAD-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2510: Resolution: Fixed Fix Version/s: 2.1.1-core Assignee: Andy Schwartz Status: Resolved (was: Patch Available) Committed fix in r1630639. make SkinTestCase more extendable - Key: TRINIDAD-2510 URL: https://issues.apache.org/jira/browse/TRINIDAD-2510 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Affects Versions: 2.1.0-core Reporter: Anand V Nath Assignee: Andy Schwartz Priority: Minor Fix For: 2.1.1-core Attachments: jira-2510-modified.patch, jira-2510-new.patch, jira-2510.patch SkinTestCase which is part of trinidad-impl/test, works with TestSkin enum which does not offer flexibility. The change proposed is to add an overloaded method for visiting skins where the skin resource path can be passed as a String. This will enable test cases extending SkinTestCase to work with any skin of their choice. The proposed change is to add this method in SkinTestCase: /** * Performs a visit of all style sheet nodes in the specified test * skin. This overloaded method is useful in extending SkinTestCase to * create more test cases since TestSkin does not provide all the skins * that test needs. */ protected final void visitStyleSheets(String skinResourcePath, StyleSheetVisitor visitor) { StyleSheetDocument document = SkinTestUtils.parseSkin(skinResourcePath); StyleSheetVisitUtils.visitStyleSheets(document.getStyleSheetsAsCollection(), visitor); } -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRINIDAD-2513) NullpointException running Trinidad with Tomcat 8
[ https://issues.apache.org/jira/browse/TRINIDAD-2513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14166175#comment-14166175 ] Andy Schwartz commented on TRINIDAD-2513: - Seems like this might be the same issue as TRINIDAD-2483. NullpointException running Trinidad with Tomcat 8 - Key: TRINIDAD-2513 URL: https://issues.apache.org/jira/browse/TRINIDAD-2513 Project: MyFaces Trinidad Issue Type: Bug Components: Infrastructure Affects Versions: 2.1.0-core Environment: Tomcat 8 Reporter: Pervasync Priority: Blocker We have a Apache Trinidad based app that runs fine with Tomcat 6 and 7. The same app throws the following exception on Tomcat 8. Trinidad lib version was 2.1.0 and MyFaces lib version was 2.1.16. org.apache.jasper.JasperException: An exception occurred processing JSP page /login.jspx at line 14 11: link rel=shortcut icon href=/pervasync/images/pvs_logo_32_32.ico/ 12: /trh:head 13: trh:body 14: tr:document title=... 15: head 16: link rel=shortcut icon type=image/png href=/pervasync/images/pvs_logo_32_32.png/ 17: /head Stacktrace: at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:335) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) ... Caused by: java.lang.NullPointerException at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:113) at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.setProperty(UIXComponentELTag.java:297) at org.apache.myfaces.trinidadinternal.taglib.core.CoreDocumentTag.setProperties(CoreDocumentTag.java:179) at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.setProperties(UIXComponentELTag.java:284) at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:98) at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.createComponent(UIXComponentELTag.java:223) at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:1195) at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:514) at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:113) at org.apache.jsp.login_jspx._jspx_meth_tr_005fdocument_005f0(login_jspx.java:282) at org.apache.jsp.login_jspx._jspx_meth_trh_005fbody_005f0(login_jspx.java:250) at org.apache.jsp.login_jspx._jspx_meth_trh_005fhtml_005f0(login_jspx.java:175) at org.apache.jsp.login_jspx._jspx_meth_f_005fview_005f0(login_jspx.java:135) at org.apache.jsp.login_jspx._jspService(login_jspx.java:96) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) ... 56 more -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRINIDAD-2510) make SkinTestCase more extendable
[ https://issues.apache.org/jira/browse/TRINIDAD-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14163900#comment-14163900 ] Andy Schwartz commented on TRINIDAD-2510: - Since this is in trinidadinternal, I think it is fine to tweak these protected methods. Let's change the getSkinDocument() hook to take the resource name String instead of TestSkin. make SkinTestCase more extendable - Key: TRINIDAD-2510 URL: https://issues.apache.org/jira/browse/TRINIDAD-2510 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Affects Versions: 2.1.0-core Reporter: Anand V Nath Priority: Minor Attachments: jira-2510-modified.patch, jira-2510.patch SkinTestCase which is part of trinidad-impl/test, works with TestSkin enum which does not offer flexibility. The change proposed is to add an overloaded method for visiting skins where the skin resource path can be passed as a String. This will enable test cases extending SkinTestCase to work with any skin of their choice. The proposed change is to add this method in SkinTestCase: /** * Performs a visit of all style sheet nodes in the specified test * skin. This overloaded method is useful in extending SkinTestCase to * create more test cases since TestSkin does not provide all the skins * that test needs. */ protected final void visitStyleSheets(String skinResourcePath, StyleSheetVisitor visitor) { StyleSheetDocument document = SkinTestUtils.parseSkin(skinResourcePath); StyleSheetVisitUtils.visitStyleSheets(document.getStyleSheetsAsCollection(), visitor); } -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRINIDAD-2510) make SkinTestCase more extendable
[ https://issues.apache.org/jira/browse/TRINIDAD-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14160868#comment-14160868 ] Andy Schwartz commented on TRINIDAD-2510: - Thanks for the patch. I see that this introduces a new protected (final) method: /** * Performs a visit of all style sheet nodes in the specified test * skin. This overloaded method is useful in extending SkinTestCase to * create more test cases since TestSkin does not provide all the skins * that test needs. */ protected final void visitStyleSheets(String skinResourcePath, StyleSheetVisitor visitor) { StyleSheetDocument document = SkinTestUtils.parseSkin(skinResourcePath); StyleSheetVisitUtils.visitStyleSheets(document.getStyleSheetsAsCollection(), visitor); } That is an overload of this protected method that is already present: /** * Performs a visit of all style sheet nodes in the specified test * skin */ protected void visitStyleSheets(TestSkin testSkin, StyleSheetVisitor visitor) { StyleSheetDocument document = getSkinDocument(testSkin); StyleSheetVisitUtils.visitStyleSheets(document.getStyleSheetsAsCollection(), visitor); } The new protected method that takes the String resource path looks like the more primitive method, and thus would make more sense as the non-final hook. What do you think about doing this: 1. Change the old TestSkin-based method such that it looks up its resource path and then calls the new String-based method with this value. 2. Make the old TestSkin-based method final. 3. Make the new String-based method non-final. This also has the nice side effect of avoiding the duplicate call to StyleSheetVisitUtils.visitStyleSheets(). make SkinTestCase more extendable - Key: TRINIDAD-2510 URL: https://issues.apache.org/jira/browse/TRINIDAD-2510 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Affects Versions: 2.1.0-core Reporter: Anand V Nath Priority: Minor Attachments: jira-2510-modified.patch, jira-2510.patch SkinTestCase which is part of trinidad-impl/test, works with TestSkin enum which does not offer flexibility. The change proposed is to add an overloaded method for visiting skins where the skin resource path can be passed as a String. This will enable test cases extending SkinTestCase to work with any skin of their choice. The proposed change is to add this method in SkinTestCase: /** * Performs a visit of all style sheet nodes in the specified test * skin. This overloaded method is useful in extending SkinTestCase to * create more test cases since TestSkin does not provide all the skins * that test needs. */ protected final void visitStyleSheets(String skinResourcePath, StyleSheetVisitor visitor) { StyleSheetDocument document = SkinTestUtils.parseSkin(skinResourcePath); StyleSheetVisitUtils.visitStyleSheets(document.getStyleSheetsAsCollection(), visitor); } -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (TRINIDAD-2509) For date pattern=yyyy:DDD HH:mm:ss, validation error is thrown even when the date is selected from popup and is correct
[ https://issues.apache.org/jira/browse/TRINIDAD-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2509: Resolution: Fixed Fix Version/s: 2.1.1-core Status: Resolved (was: Patch Available) Committed fix in r1628732. For date pattern=:DDD HH:mm:ss, validation error is thrown even when the date is selected from popup and is correct --- Key: TRINIDAD-2509 URL: https://issues.apache.org/jira/browse/TRINIDAD-2509 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.1.0-core Environment: Issue occurs on all platforms Reporter: Anshu Jain Fix For: 2.1.1-core Attachments: TRINIDAD-2509.patch For a date component, the pattern is set to :DDD HH:mm:ss. On opening the calendar popup and selecting a date, a validation error is thrown: Error: The date or time entered is not valid. The date in the date filed is in correct format at this time. But, the validation error is incorrectly thrown. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (TRINIDAD-2511) rounding mode is not honoured on the client while using number converter
[ https://issues.apache.org/jira/browse/TRINIDAD-2511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2511: Resolution: Fixed Fix Version/s: 2.1.1-core Status: Resolved (was: Patch Available) Fixed in r1628735. rounding mode is not honoured on the client while using number converter Key: TRINIDAD-2511 URL: https://issues.apache.org/jira/browse/TRINIDAD-2511 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.1.0-core Reporter: Ashwin Prabhu Fix For: 2.1.1-core Attachments: TRINIDAD-2511.patch Original Estimate: 24h Remaining Estimate: 24h When rounding mode is specified on af:convertNumber, decimal truncation affected by min/max fraction digits should be governed by the rounding mode specified. Currently client side number converter (TrNumberConverter) performs decimal truncation when maxFractionDigits is specified without considering the rounding mode chosen. This leads to data inconsistencies when af:convertNumber is attached to input components. For ex: tr:inputText label=Label 1 id=it1 tr:convertNumber type=number roundingMode=UP maxFractionDigits=2/ /tr:inputText the above converts 5.551 to 5.55, wheras the correct rounding should have been 5.56, since the rounding mode is UP. However, since he server side converter correctly implements rounding, the issue does not arise when the converter is attached to output components. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRINIDAD-2510) make SkinTestCase more extendable
[ https://issues.apache.org/jira/browse/TRINIDAD-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14154943#comment-14154943 ] Andy Schwartz commented on TRINIDAD-2510: - On applying the patch, I see this output: patch -p0 -i ~/patches/jira-2510.patch (Stripping trailing CRs from patch.) patching file trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/skin/SkinTestCase.java patch unexpectedly ends in middle of line Hunk #1 succeeded at 76 with fuzz 2. The patch unexpectedly ends in middle of line message makes me worried that something might be wrong. Can you double-check that the patch is correct and/or provide a new patch that does not show this message when applied to the Trinidad trunk? make SkinTestCase more extendable - Key: TRINIDAD-2510 URL: https://issues.apache.org/jira/browse/TRINIDAD-2510 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Affects Versions: 2.1.0-core Reporter: Anand V Nath Priority: Minor Attachments: jira-2510.patch SkinTestCase which is part of trinidad-impl/test, works with TestSkin enum which does not offer flexibility. The change proposed is to add an overloaded method for visiting skins where the skin resource path can be passed as a String. This will enable test cases extending SkinTestCase to work with any skin of their choice. The proposed change is to add this method in SkinTestCase: /** * Performs a visit of all style sheet nodes in the specified test * skin. This overloaded method is useful in extending SkinTestCase to * create more test cases since TestSkin does not provide all the skins * that test needs. */ protected final void visitStyleSheets(String skinResourcePath, StyleSheetVisitor visitor) { StyleSheetDocument document = SkinTestUtils.parseSkin(skinResourcePath); StyleSheetVisitUtils.visitStyleSheets(document.getStyleSheetsAsCollection(), visitor); } -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (TRINIDAD-2508) JSF 2.2 @MultipartConfig on FacesServlet breaks Trinidad file upload
Andy Schwartz created TRINIDAD-2508: --- Summary: JSF 2.2 @MultipartConfig on FacesServlet breaks Trinidad file upload Key: TRINIDAD-2508 URL: https://issues.apache.org/jira/browse/TRINIDAD-2508 Project: MyFaces Trinidad Issue Type: Bug Reporter: Andy Schwartz Assignee: Andy Schwartz I have been testing Trinidad against JSF 2.2. So far everything looks good with one exception: Trinidad's file upload feature is broken. I traced this down to a conflict between Java EE's multipart form support and Trinidad file upload. Both Java EE and Trinidad are capable of processing multipart forms. However, the multipart request input stream can only be read once, which means that only one layer gets to do this work. Trinidad processes multipart forms in its FileUploadConfiguratorImpl, which is run from inside TrinidadFilterImpl.doFilter(). However, when running against JSF 2.2, the servlet engine (WLS in my case) is reading the request input stream before we get this far. I found that this was happening in response to servlet request parameter lookups that are made by other Configurators. The change in behavior from JSF 2.1 to JSF 2.2 is this: prior to JSF 2.2 - and specifically, prior to the introduction of the @MultipartConfig annotation to FacesServlet, request parameter lookups that are made before the FileUploadConfiguratorImpl processes the multipart data would fail - ie. would return null without reading the request input stream. After upgrading to JSF 2.2, the presence of the @MultipartConfig now tells the servlet engine that it is responsible for reading multipart form data. Thus, request parameter lookups which previously behaved as no-ops are now causing the request input stream to be read. As a result, by the time FileUploadConfiguratorImpl is invoked, there is no data left on the request input stream and Trinidad does not recognize that there are uploaded files. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (TRINIDAD-2499) ChangeManager provides incorrect document location for dynamic components
[ https://issues.apache.org/jira/browse/TRINIDAD-2499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2499: Resolution: Fixed Fix Version/s: 2.1.1-core Assignee: Andy Schwartz Status: Resolved (was: Patch Available) Fixed in r1617943. Thanks Prakash! ChangeManager provides incorrect document location for dynamic components - Key: TRINIDAD-2499 URL: https://issues.apache.org/jira/browse/TRINIDAD-2499 Project: MyFaces Trinidad Issue Type: Bug Components: Archetype Affects Versions: 2.1.0-core Reporter: Prakash Udupa Assignee: Andy Schwartz Fix For: 2.1.1-core Attachments: TRINIDAD-2499.patch Original Estimate: 2h Remaining Estimate: 2h In TRINIDAD-2397, enhancement was provided to obtain the document location of components are are dynamically added. There is a bug in this code that in some cases the location is not provided correctly, as explained in the following example: Consider this page structure: jsp:root foo:three foo:insertingComponent = Step #2: This subtree is inserted from fragment2.jsff jsp:root foo:dynamicLayout foo:two = Step #1: defined in fargment1.jsff foo:one = Customization target, this inserted component is defined in fragment1.jsff In this example, the search for location is expected to stop at step #1 and location returned as 'fragment1.jsff', instead the look up extends until step #2 and returns incorrect location 'fragment2.jsff'. This causes the wrong document being searched for the customization target here, customization failed therefore. The bug is in org.apache.myfaces.trinidad.util.ComponentUtils.getDocumentLocationForComponent() Will provide a fix patch soon. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (TRINIDAD-2488) NPE in TrinidadSkinProvider when base skin is not included in skin def in trinidad-skins.xml
[ https://issues.apache.org/jira/browse/TRINIDAD-2488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2488: Resolution: Fixed Fix Version/s: 2.1.1-core Assignee: Andy Schwartz Status: Resolved (was: Patch Available) Committed in r1606219. Thanks for the fix Prakash! NPE in TrinidadSkinProvider when base skin is not included in skin def in trinidad-skins.xml Key: TRINIDAD-2488 URL: https://issues.apache.org/jira/browse/TRINIDAD-2488 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.1.0-core Reporter: Prakash Udupa Assignee: Andy Schwartz Fix For: 2.1.1-core Attachments: TRINIDAD-2488.trunk.patch Original Estimate: 1h Remaining Estimate: 1h In our application, we encountered this NPE, whenever base skin is not mentioned in the skin definition in trinidad-skins.xml (trivial to build a test-case thus). This needs to be fixed, because Trinidad framework is supposed to assume the default base skin based on renderkit or otherwise default to Trinidad's simple.desktop skin. == # java.lang.NullPointerException # at org.apache.myfaces.trinidadinternal.skin.provider.TrinidadSkinProvider.loadAvailableSkin(TrinidadSkinProvider.java:163) # at org.apache.myfaces.trinidadinternal.skin.provider.BaseSkinProvider._getMatchingSkin(BaseSkinProvider.java:216) # at org.apache.myfaces.trinidadinternal.skin.provider.BaseSkinProvider.getSkin(BaseSkinProvider.java:60) # at org.apache.myfaces.trinidadinternal.skin.provider.SkinProviderRegistry.getSkin(SkinProviderRegistry.java:116) # at org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderingContext._initializeSkin(CoreRenderingContext.java:635) # at org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderingContext.init(CoreRenderingContext.java:89) -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (TRINIDAD-2486) SELECTOR OF KIND IMG[SRC*=/ADF/IMAGES/T.GIF] BREAKS IF SKIN COMPRESSION IS ON
[ https://issues.apache.org/jira/browse/TRINIDAD-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2486: Resolution: Fixed Fix Version/s: 2.1.1-core Assignee: Andy Schwartz Status: Resolved (was: Patch Available) Committed the fix in r1605316. SELECTOR OF KIND IMG[SRC*=/ADF/IMAGES/T.GIF] BREAKS IF SKIN COMPRESSION IS ON --- Key: TRINIDAD-2486 URL: https://issues.apache.org/jira/browse/TRINIDAD-2486 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.1.0-core Reporter: Anand V Nath Assignee: Andy Schwartz Fix For: 2.1.1-core Attachments: jira-2486-on-trunk.patch With selector of kind X[attr = foo.gif] is used and skin compression is on, the generated css is malformed. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Resolved] (TRINIDAD-2484) Threadsafety issue in SkinStyleProvider leading to missing styles and distorted ui
[ https://issues.apache.org/jira/browse/TRINIDAD-2484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz resolved TRINIDAD-2484. - Resolution: Fixed Fix Version/s: 2.1.1-core Assignee: Andy Schwartz Committed in r1604869. Thanks for the fix, Prakash! Threadsafety issue in SkinStyleProvider leading to missing styles and distorted ui -- Key: TRINIDAD-2484 URL: https://issues.apache.org/jira/browse/TRINIDAD-2484 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.1.0-core Reporter: Prakash Udupa Assignee: Andy Schwartz Fix For: 2.1.1-core Attachments: TRINIDAD-2484-trunk.patch Original Estimate: 24h Remaining Estimate: 24h We have seen that soon after server start, when there are almost concurrent requests from IE, in random occurrences, there will be only one link encoded in the HTML, while there are two css files generated. Consequently, styles for some components in the page could go missing, ending up in distorted UI in certain sections of the rendered page. We suspect the cause to be a thread safety issue in SkinStyleProvider implementation where we construct style providers and save it in map keyed by skin and the directory path of the css. The issue is in _getProviders() implementation, where the variable _sSharedProviders is not accessed in threadsafe manner. This leads to possibility of the providers map being overwritten. This further leads to constructing two SkinStyleProviders for the same skin. While one request could use one provider (P1) that is in process of writing out one css file with the second one pending, there could be other request that ends up using a different provider (P2) that would see a single file written, and end up adding single URI in its Entry map. All requests later could end up using P2 and sufferring from only one link being rendered, while there are two stylesheets actually generated. Proposed fix is to eliminate _sSharedProviders, and instead use the application scoped concurrent map hanging off of request scope to store the provider map. We can then leverage on the putIfAbsent in there to ensure there is only one copy of providers map for an application. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Resolved] (TRINIDAD-2478) FileSystemStyleCache file modification checking not working
[ https://issues.apache.org/jira/browse/TRINIDAD-2478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz resolved TRINIDAD-2478. - Resolution: Fixed Fix Version/s: 2.1.1-core Committed fix in r1599782. FileSystemStyleCache file modification checking not working --- Key: TRINIDAD-2478 URL: https://issues.apache.org/jira/browse/TRINIDAD-2478 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.1.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Trivial Fix For: 2.1.1-core I introduced a minor regression in my fix for Trinidad-2468. The bug is here: FutureEntry f = cache.get(key); Entry entry = _getEntryFromFuture(context, document, cache, key, f); if ((entry != null) !_validateEntry(entry, checkModified)) { // atomically remove the key from the cache if it currently points to the entry cache.remove(key, entry); entry = null; } The cache.remove() call should be removing the Future, not the Entry. So: cache.remove(key, entry); Should be: cache.remove(key, f); The impact of this bug is that, when org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION is enabled, we won't actually clear out our in-memory cache, and won't re-generate the .css files, if we detect that the generated .css files have been blown away out from under us. A server bounce is now required. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (TRINIDAD-2478) FileSystemStyleCache file modification checking not working
Andy Schwartz created TRINIDAD-2478: --- Summary: FileSystemStyleCache file modification checking not working Key: TRINIDAD-2478 URL: https://issues.apache.org/jira/browse/TRINIDAD-2478 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.1.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Trivial I introduced a minor regression in my fix for Trinidad-2468. The bug is here: FutureEntry f = cache.get(key); Entry entry = _getEntryFromFuture(context, document, cache, key, f); if ((entry != null) !_validateEntry(entry, checkModified)) { // atomically remove the key from the cache if it currently points to the entry cache.remove(key, entry); entry = null; } The cache.remove() call should be removing the Future, not the Entry. So: cache.remove(key, entry); Should be: cache.remove(key, f); The impact of this bug is that, when org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION is enabled, we won't actually clear out our in-memory cache, and won't re-generate the .css files, if we detect that the generated .css files have been blown away out from under us. A server bounce is now required. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TRINIDAD-2476) MApplication.java needs to override subscribeToEvent
[ https://issues.apache.org/jira/browse/TRINIDAD-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14009650#comment-14009650 ] Andy Schwartz commented on TRINIDAD-2476: - Committed fix in r1597776. Thanks Kevin. MApplication.java needs to override subscribeToEvent Key: TRINIDAD-2476 URL: https://issues.apache.org/jira/browse/TRINIDAD-2476 Project: MyFaces Trinidad Issue Type: Improvement Reporter: Kevin Jackson Fix For: 2.1.1-core Attachments: MApplication.java.diff, trinidad-2476-take2.patch The ADF unit tests fails with JSF 2.2 without override of subscribeToEvent -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (TRINIDAD-2476) MApplication.java needs to override subscribeToEvent
[ https://issues.apache.org/jira/browse/TRINIDAD-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2476: Resolution: Fixed Fix Version/s: 2.1.1-core Assignee: Andy Schwartz Status: Resolved (was: Patch Available) MApplication.java needs to override subscribeToEvent Key: TRINIDAD-2476 URL: https://issues.apache.org/jira/browse/TRINIDAD-2476 Project: MyFaces Trinidad Issue Type: Improvement Reporter: Kevin Jackson Assignee: Andy Schwartz Fix For: 2.1.1-core Attachments: MApplication.java.diff, trinidad-2476-take2.patch The ADF unit tests fails with JSF 2.2 without override of subscribeToEvent -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Comment Edited] (TRINIDAD-2476) MApplication.java needs to override subscribeToEvent
[ https://issues.apache.org/jira/browse/TRINIDAD-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14007661#comment-14007661 ] Andy Schwartz edited comment on TRINIDAD-2476 at 5/23/14 8:31 PM: -- This patch: https://issues.apache.org/jira/secure/attachment/12646593/trinidad-2476-take2.patch Adds a little clean up on top of Kevin's patch. Reformatted some method parameter lists, added a little comment, move the subscribe/unsubscribe methods next to the existing publish event methods. was (Author: andy.schwartz): Just a little clean up on top of Kevin's patch. Reformatted some method parameter lists, added a little comment, move the subscribe/unsubscribe methods next to the existing publish event methods. MApplication.java needs to override subscribeToEvent Key: TRINIDAD-2476 URL: https://issues.apache.org/jira/browse/TRINIDAD-2476 Project: MyFaces Trinidad Issue Type: Improvement Reporter: Kevin Jackson Attachments: MApplication.java.diff, trinidad-2476-take2.patch The ADF unit tests fails with JSF 2.2 without override of subscribeToEvent -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
[ https://issues.apache.org/jira/browse/TRINIDAD-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13998869#comment-13998869 ] Andy Schwartz commented on TRINIDAD-2468: - This is a new version of the fix: https://issues.apache.org/jira/secure/attachment/12645030/trinidad-2468-take3.patch That modifies the case where FileSystemStyleCache._createEntry() fails because there are no matching style nodes found. Before my fix, this failed silently. In the first two versions of my fix, this fails with a NullPointerException. After discussing with Blake, we decided that it is best to make this case fail in a more obvious way. This now fails with an IllegalStateException with a more useful error message. FileSystemStyleCache: split style sheet concurrency issue - Key: TRINIDAD-2468 URL: https://issues.apache.org/jira/browse/TRINIDAD-2468 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2468-hack-delays-on-top-of-fix.patch, trinidad-2468-hack-delays.patch, trinidad-2468-take2.patch, trinidad-2468-take3.patch, trinidad-2468.patch Due to IE’s per-file style rule limit, documented here: http://support.microsoft.com/kb/262161 In particular: “All style rules after the first 4,095 rules are not applied.” Trinidad’s skinning framework breaks up large style sheets into multiple files, each with a maximum of 4,095 rules. That is, a generated style sheet of the form: - foo-desktop-gecko.css Might be result in the generation of two style sheets on IE: - foo-desktop-ie.css - foo-desktop-ie2.css We are running into thread safety problems with the current implementation of this multi-file solution. Under certain circumstances, we see the style sheet (correctly) being split across two files, but only a single style sheet link is rendered in the HTML contents. As a result, the styles from the second file are missing, which typically has fatal results. This only happens under a somewhat unusual case: the client who is reporting this behavior is running a test which upon start up immediately hits the server with two concurrent requests from IE. This triggers the following sequence: - Request 1 enters FileSystemStyleCache._createEntry(). - Request 1 generates the first of two files that make up the IE-specific style sheet. - Request 2 arrives and, finding FileSystemStyleCache’s entry cache empty, also enters _createEntry(). - Upon entry to _createEntry(), Request 2 checks to see whether any files have already been generated for the requested style sheet. - Request 2 finds the first of two files and assumes that the style sheet is composed of a single file. - Request 1 finishes generating the second style sheet. - Request 1 populates the FileSystemStyleCache’s entry cache with an Entry instance that correctly references both generated files. - Request 2 blows away the previously installed Entry and replaces it with a bogus Entry that only references the first of two style sheet files. On all subsequent requests, StyleSheetRenderer retrieves data from the bogus (single file) Entry, and thus only renders a single link. The fix is to control access to _createEntry() for individual style sheets. That is, we want to allow concurrent access to _createEntry() for style sheets with different variants (ie. it should be possible to generate the IE style sheets and Gecko style sheets concurrently). However, if a request is in the middle of generating files for a particular style sheet, other requests that want access to the same style sheet must wait until the first request completes its work (instead of possibly trampling over the work of the first request). -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
[ https://issues.apache.org/jira/browse/TRINIDAD-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13970674#comment-13970674 ] Andy Schwartz commented on TRINIDAD-2468: - I have put together a patch file that can be applied to trinidad-trunk to help simulate the problem: https://issues.apache.org/jira/secure/attachment/12640452/trinidad-2468-hack-delays.patch This patch does the following: - Introduces a delay after the first file of a two part style sheet is written. - Introduces a second delay when a second request detects that a single file is present on the file system. - Tweaks our logic for deciding when to split style sheet files to make it easier to hit the split style sheet file case. - Adds logging that includes the thread id. We can now simulate the problem by: 1. Applying the patch to trinidad-trunk. 2. Fire up trinidad-demo 3. Make sure that the trinidad-demo’s style sheet cache is empty. 4. Hit the demo via curl, eg: curl localhost:8080/trinidad-demo/faces/index.jspx 5. Wait a few seconds, and then hit the demo a second time via curl. Without the fix, we see the following sequence: SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u.css {thread:12} SEVERE: !! I have written one output file. Going to sleep for a while. {thread:12} SEVERE: !! Entering _createEntry {thread:16} SEVERE: !! I found one output file. Going to sleep for a while! {thread:16} SEVERE: !! Done sleeping. Ready write more output files. {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u2.css {thread:12} SEVERE: !! Exiting _createEntry. Entry now has 2 file(s) {thread:12} SEVERE: !! Just one output file here. Waking up. {thread:16} SEVERE: !! Got output files: 1 {thread:16} SEVERE: !! Exiting _createEntry. Entry now has 1 file(s) {thread:16} At this point the entry cache contains an Entry instance with a single file reference, even though two files were written. All requests from here on out result in a single style sheet link being rendered. I have also uploaded a second patch that can be applied on top of my fix (required some tweaking): https://issues.apache.org/jira/secure/attachment/12640453/trinidad-2468-hack-delays-on-top-of-fix.patch When running the same steps against the fix, we now see output like this: SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-2468-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u.css {thread:12} SEVERE: !! I have written one output file. Going to sleep for a while. {thread:12} SEVERE: !! Getting entry from Future {thread:16} SEVERE: !! Done sleeping. Ready write more output files. {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-2468-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u2.css {thread:12} SEVERE: !! Exiting _createEntry. Entry now has 2 file(s) {thread:12} SEVERE: !! Got entry with 2 file(s) from Future {thread:16} SEVERE: !! Got entry with 2 file(s) from Future {thread:12} The second thread now waits on Future.get() until the first thread has completed generating both style sheets. And now everyone has a consistent view of the world. FileSystemStyleCache: split style sheet concurrency issue - Key: TRINIDAD-2468 URL: https://issues.apache.org/jira/browse/TRINIDAD-2468 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2468-hack-delays-on-top-of-fix.patch, trinidad-2468-hack-delays.patch, trinidad-2468.patch Due to IE’s per-file style rule limit, documented here: http://support.microsoft.com/kb/262161 In particular: “All style rules after the first 4,095 rules are not applied.” Trinidad’s skinning framework breaks up large style sheets into multiple files, each with a maximum of 4,095 rules. That is, a generated style sheet of the form: - foo-desktop-gecko.css Might be result in the generation of two style sheets on IE: - foo-desktop-ie.css - foo-desktop-ie2.css We are running into thread safety problems with the current implementation of this multi-file solution. Under certain circumstances, we see the style sheet (correctly) being
[jira] [Comment Edited] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
[ https://issues.apache.org/jira/browse/TRINIDAD-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13970674#comment-13970674 ] Andy Schwartz edited comment on TRINIDAD-2468 at 4/16/14 11:15 AM: --- I have put together a patch file that can be applied to trinidad-trunk to help simulate the problem: https://issues.apache.org/jira/secure/attachment/12640452/trinidad-2468-hack-delays.patch This patch does the following: - Introduces a delay after the first file of a two part style sheet is written. - Introduces a second delay when a second request detects that a single file is present on the file system. - Tweaks our logic for deciding when to split style sheet files to make it easier to hit the split style sheet file case. - Adds logging that includes the thread id. We can now simulate the problem by: 1. Applying the patch to trinidad-trunk. 2. Fire up trinidad-demo 3. Make sure that the trinidad-demo’s style sheet cache is empty. 4. Hit the demo via curl, eg: curl localhost:8080/trinidad-demo/faces/index.jspx 5. Wait a few seconds, and then hit the demo a second time via curl. Without the fix, we see the following sequence: {noformat} SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u.css {thread:12} SEVERE: !! I have written one output file. Going to sleep for a while. {thread:12} SEVERE: !! Entering _createEntry {thread:16} SEVERE: !! I found one output file. Going to sleep for a while! {thread:16} SEVERE: !! Done sleeping. Ready write more output files. {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u2.css {thread:12} SEVERE: !! Exiting _createEntry. Entry now has 2 file(s) {thread:12} SEVERE: !! Just one output file here. Waking up. {thread:16} SEVERE: !! Got output files: 1 {thread:16} SEVERE: !! Exiting _createEntry. Entry now has 1 file(s) {thread:16} {noformat} At this point the entry cache contains an Entry instance with a single file reference, even though two files were written. All requests from here on out result in a single style sheet link being rendered. I have also uploaded a second patch that can be applied on top of my fix (required some tweaking): https://issues.apache.org/jira/secure/attachment/12640453/trinidad-2468-hack-delays-on-top-of-fix.patch When running the same steps against the fix, we now see output like this: {noformat} SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-2468-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u.css {thread:12} SEVERE: !! I have written one output file. Going to sleep for a while. {thread:12} SEVERE: !! Getting entry from Future {thread:16} SEVERE: !! Done sleeping. Ready write more output files. {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-2468-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u2.css {thread:12} SEVERE: !! Exiting _createEntry. Entry now has 2 file(s) {thread:12} SEVERE: !! Got entry with 2 file(s) from Future {thread:16} SEVERE: !! Got entry with 2 file(s) from Future {thread:12} {noformat} The second thread now waits on Future.get() until the first thread has completed generating both style sheets. And now everyone has a consistent view of the world. was (Author: andy.schwartz): I have put together a patch file that can be applied to trinidad-trunk to help simulate the problem: https://issues.apache.org/jira/secure/attachment/12640452/trinidad-2468-hack-delays.patch This patch does the following: - Introduces a delay after the first file of a two part style sheet is written. - Introduces a second delay when a second request detects that a single file is present on the file system. - Tweaks our logic for deciding when to split style sheet files to make it easier to hit the split style sheet file case. - Adds logging that includes the thread id. We can now simulate the problem by: 1. Applying the patch to trinidad-trunk. 2. Fire up trinidad-demo 3. Make sure that the trinidad-demo’s style sheet cache is empty. 4. Hit the demo via curl, eg: curl localhost:8080/trinidad-demo/faces/index.jspx 5. Wait a few seconds, and then hit the demo a second time via curl. Without the fix, we see the following sequence: {noformat} SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12
[jira] [Comment Edited] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
[ https://issues.apache.org/jira/browse/TRINIDAD-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13970674#comment-13970674 ] Andy Schwartz edited comment on TRINIDAD-2468 at 4/16/14 11:15 AM: --- I have put together a patch file that can be applied to trinidad-trunk to help simulate the problem: https://issues.apache.org/jira/secure/attachment/12640452/trinidad-2468-hack-delays.patch This patch does the following: - Introduces a delay after the first file of a two part style sheet is written. - Introduces a second delay when a second request detects that a single file is present on the file system. - Tweaks our logic for deciding when to split style sheet files to make it easier to hit the split style sheet file case. - Adds logging that includes the thread id. We can now simulate the problem by: 1. Applying the patch to trinidad-trunk. 2. Fire up trinidad-demo 3. Make sure that the trinidad-demo’s style sheet cache is empty. 4. Hit the demo via curl, eg: curl localhost:8080/trinidad-demo/faces/index.jspx 5. Wait a few seconds, and then hit the demo a second time via curl. Without the fix, we see the following sequence: {noformat} SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u.css {thread:12} SEVERE: !! I have written one output file. Going to sleep for a while. {thread:12} SEVERE: !! Entering _createEntry {thread:16} SEVERE: !! I found one output file. Going to sleep for a while! {thread:16} SEVERE: !! Done sleeping. Ready write more output files. {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u2.css {thread:12} SEVERE: !! Exiting _createEntry. Entry now has 2 file(s) {thread:12} SEVERE: !! Just one output file here. Waking up. {thread:16} SEVERE: !! Got output files: 1 {thread:16} SEVERE: !! Exiting _createEntry. Entry now has 1 file(s) {thread:16} {noformat} At this point the entry cache contains an Entry instance with a single file reference, even though two files were written. All requests from here on out result in a single style sheet link being rendered. I have also uploaded a second patch that can be applied on top of my fix (required some tweaking): https://issues.apache.org/jira/secure/attachment/12640453/trinidad-2468-hack-delays-on-top-of-fix.patch When running the same steps against the fix, we now see output like this: SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-2468-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u.css {thread:12} SEVERE: !! I have written one output file. Going to sleep for a while. {thread:12} SEVERE: !! Getting entry from Future {thread:16} SEVERE: !! Done sleeping. Ready write more output files. {thread:12} SEVERE: !! Creating output file: /scratch/anschwar/dev/trinidad/trinidad-2468-trunk/trinidad-examples/trinidad-demo/target/work/adf/styles/cache/casablanca-desktop-mjyt4t--d-d-d-d-ltr-d--s-n-u2.css {thread:12} SEVERE: !! Exiting _createEntry. Entry now has 2 file(s) {thread:12} SEVERE: !! Got entry with 2 file(s) from Future {thread:16} SEVERE: !! Got entry with 2 file(s) from Future {thread:12} The second thread now waits on Future.get() until the first thread has completed generating both style sheets. And now everyone has a consistent view of the world. was (Author: andy.schwartz): I have put together a patch file that can be applied to trinidad-trunk to help simulate the problem: https://issues.apache.org/jira/secure/attachment/12640452/trinidad-2468-hack-delays.patch This patch does the following: - Introduces a delay after the first file of a two part style sheet is written. - Introduces a second delay when a second request detects that a single file is present on the file system. - Tweaks our logic for deciding when to split style sheet files to make it easier to hit the split style sheet file case. - Adds logging that includes the thread id. We can now simulate the problem by: 1. Applying the patch to trinidad-trunk. 2. Fire up trinidad-demo 3. Make sure that the trinidad-demo’s style sheet cache is empty. 4. Hit the demo via curl, eg: curl localhost:8080/trinidad-demo/faces/index.jspx 5. Wait a few seconds, and then hit the demo a second time via curl. Without the fix, we see the following sequence: SEVERE: !! Entering _createEntry {thread:12} SEVERE: !! Got output files: 0 {thread:12} SEVERE: !! Creating output file
[jira] [Commented] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
[ https://issues.apache.org/jira/browse/TRINIDAD-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13971531#comment-13971531 ] Andy Schwartz commented on TRINIDAD-2468: - Uploaded a new version of the fix: https://issues.apache.org/jira/secure/attachment/12640471/trinidad-2468-take2.patch That includes some minor InterruptedException handling tweaks. FileSystemStyleCache: split style sheet concurrency issue - Key: TRINIDAD-2468 URL: https://issues.apache.org/jira/browse/TRINIDAD-2468 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2468-hack-delays-on-top-of-fix.patch, trinidad-2468-hack-delays.patch, trinidad-2468-take2.patch, trinidad-2468.patch Due to IE’s per-file style rule limit, documented here: http://support.microsoft.com/kb/262161 In particular: “All style rules after the first 4,095 rules are not applied.” Trinidad’s skinning framework breaks up large style sheets into multiple files, each with a maximum of 4,095 rules. That is, a generated style sheet of the form: - foo-desktop-gecko.css Might be result in the generation of two style sheets on IE: - foo-desktop-ie.css - foo-desktop-ie2.css We are running into thread safety problems with the current implementation of this multi-file solution. Under certain circumstances, we see the style sheet (correctly) being split across two files, but only a single style sheet link is rendered in the HTML contents. As a result, the styles from the second file are missing, which typically has fatal results. This only happens under a somewhat unusual case: the client who is reporting this behavior is running a test which upon start up immediately hits the server with two concurrent requests from IE. This triggers the following sequence: - Request 1 enters FileSystemStyleCache._createEntry(). - Request 1 generates the first of two files that make up the IE-specific style sheet. - Request 2 arrives and, finding FileSystemStyleCache’s entry cache empty, also enters _createEntry(). - Upon entry to _createEntry(), Request 2 checks to see whether any files have already been generated for the requested style sheet. - Request 2 finds the first of two files and assumes that the style sheet is composed of a single file. - Request 1 finishes generating the second style sheet. - Request 1 populates the FileSystemStyleCache’s entry cache with an Entry instance that correctly references both generated files. - Request 2 blows away the previously installed Entry and replaces it with a bogus Entry that only references the first of two style sheet files. On all subsequent requests, StyleSheetRenderer retrieves data from the bogus (single file) Entry, and thus only renders a single link. The fix is to control access to _createEntry() for individual style sheets. That is, we want to allow concurrent access to _createEntry() for style sheets with different variants (ie. it should be possible to generate the IE style sheets and Gecko style sheets concurrently). However, if a request is in the middle of generating files for a particular style sheet, other requests that want access to the same style sheet must wait until the first request completes its work (instead of possibly trampling over the work of the first request). -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
Andy Schwartz created TRINIDAD-2468: --- Summary: FileSystemStyleCache: split style sheet concurrency issue Key: TRINIDAD-2468 URL: https://issues.apache.org/jira/browse/TRINIDAD-2468 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Due to IE’s per-file style rule limit, documented here: http://support.microsoft.com/kb/262161 In particular: “All style rules after the first 4,095 rules are not applied.” Trinidad’s skinning framework breaks up large style sheets into multiple files, each with a maximum of 4,095 rules. That is, a generated style sheet of the form: - foo-desktop-gecko.css Might be result in the generation of two style sheets on IE: - foo-desktop-ie.css - foo-desktop-ie2.css We are running into thread safety problems with the current implementation of this multi-file solution. Under certain circumstances, we see the style sheet (correctly) being split across two files, but only a single style sheet link is rendered in the HTML contents. As a result, the styles from the second file are missing, which typically has fatal results. This only happens under a somewhat unusual case: the client who is reporting this behavior is running a test which upon start up immediately hits the server with two concurrent requests from IE. This triggers the following sequence: - Request 1 enters FileSystemStyleCache._createEntry(). - Request 1 generates the first of two files that make up the IE-specific style sheet. - Request 2 arrives and, finding FileSystemStyleCache’s entry cache empty, also enters _createEntry(). - Upon entry to _createEntry(), Request 2 checks to see whether any files have already been generated for the requested style sheet. - Request 2 finds the first of two files and assumes that the style sheet is composed of a single file. - Request 1 finishes generating the second style sheet. - Request 1 populates the FileSystemStyleCache’s entry cache with an Entry instance that correctly references both generated files. - Request 2 blows away the previously installed Entry and replaces it with a bogus Entry that only references the first of two style sheet files. On all subsequent requests, StyleSheetRenderer retrieves data from the bogus (single file) Entry, and thus only renders a single link. The fix is to control access to _createEntry() for individual style sheets. That is, we want to allow concurrent access to _createEntry() for style sheets with different variants (ie. it should be possible to generate the IE style sheets and Gecko style sheets concurrently). However, if a request is in the middle of generating files for a particular style sheet, other requests that want access to the same style sheet must wait until the first request completes its work (instead of possibly trampling over the work of the first request). -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
[ https://issues.apache.org/jira/browse/TRINIDAD-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2468: Status: Patch Available (was: Open) FileSystemStyleCache: split style sheet concurrency issue - Key: TRINIDAD-2468 URL: https://issues.apache.org/jira/browse/TRINIDAD-2468 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2468.patch Due to IE’s per-file style rule limit, documented here: http://support.microsoft.com/kb/262161 In particular: “All style rules after the first 4,095 rules are not applied.” Trinidad’s skinning framework breaks up large style sheets into multiple files, each with a maximum of 4,095 rules. That is, a generated style sheet of the form: - foo-desktop-gecko.css Might be result in the generation of two style sheets on IE: - foo-desktop-ie.css - foo-desktop-ie2.css We are running into thread safety problems with the current implementation of this multi-file solution. Under certain circumstances, we see the style sheet (correctly) being split across two files, but only a single style sheet link is rendered in the HTML contents. As a result, the styles from the second file are missing, which typically has fatal results. This only happens under a somewhat unusual case: the client who is reporting this behavior is running a test which upon start up immediately hits the server with two concurrent requests from IE. This triggers the following sequence: - Request 1 enters FileSystemStyleCache._createEntry(). - Request 1 generates the first of two files that make up the IE-specific style sheet. - Request 2 arrives and, finding FileSystemStyleCache’s entry cache empty, also enters _createEntry(). - Upon entry to _createEntry(), Request 2 checks to see whether any files have already been generated for the requested style sheet. - Request 2 finds the first of two files and assumes that the style sheet is composed of a single file. - Request 1 finishes generating the second style sheet. - Request 1 populates the FileSystemStyleCache’s entry cache with an Entry instance that correctly references both generated files. - Request 2 blows away the previously installed Entry and replaces it with a bogus Entry that only references the first of two style sheet files. On all subsequent requests, StyleSheetRenderer retrieves data from the bogus (single file) Entry, and thus only renders a single link. The fix is to control access to _createEntry() for individual style sheets. That is, we want to allow concurrent access to _createEntry() for style sheets with different variants (ie. it should be possible to generate the IE style sheets and Gecko style sheets concurrently). However, if a request is in the middle of generating files for a particular style sheet, other requests that want access to the same style sheet must wait until the first request completes its work (instead of possibly trampling over the work of the first request). -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TRINIDAD-2468) FileSystemStyleCache: split style sheet concurrency issue
[ https://issues.apache.org/jira/browse/TRINIDAD-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13970350#comment-13970350 ] Andy Schwartz commented on TRINIDAD-2468: - The provided patch: https://issues.apache.org/jira/secure/attachment/12640377/trinidad-2468.patch Fixes the thread safety issues by converting the FileSystemStyleCache's entry cache over to the efficient, scalable result cache solution described in JCIP section 5.6. This solution uses Future instances as cache entries to constrain access to each entry value. The first request into the cache for a particular key puts a Future instance into the cache and then kicks off the computation of the Future's value. (In FileSystemStyleCache's case, this includes generating the files corresponding to the cache entry.) Each subsequent cache access is routed through a call to Future.get(), which will block until the Future's value is computed. Requests for other cache entries can happily proceed in parallel. As a result, we get thread-safety on a per-entry basis with no loss of concurrency across entries. FileSystemStyleCache: split style sheet concurrency issue - Key: TRINIDAD-2468 URL: https://issues.apache.org/jira/browse/TRINIDAD-2468 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2468.patch Due to IE’s per-file style rule limit, documented here: http://support.microsoft.com/kb/262161 In particular: “All style rules after the first 4,095 rules are not applied.” Trinidad’s skinning framework breaks up large style sheets into multiple files, each with a maximum of 4,095 rules. That is, a generated style sheet of the form: - foo-desktop-gecko.css Might be result in the generation of two style sheets on IE: - foo-desktop-ie.css - foo-desktop-ie2.css We are running into thread safety problems with the current implementation of this multi-file solution. Under certain circumstances, we see the style sheet (correctly) being split across two files, but only a single style sheet link is rendered in the HTML contents. As a result, the styles from the second file are missing, which typically has fatal results. This only happens under a somewhat unusual case: the client who is reporting this behavior is running a test which upon start up immediately hits the server with two concurrent requests from IE. This triggers the following sequence: - Request 1 enters FileSystemStyleCache._createEntry(). - Request 1 generates the first of two files that make up the IE-specific style sheet. - Request 2 arrives and, finding FileSystemStyleCache’s entry cache empty, also enters _createEntry(). - Upon entry to _createEntry(), Request 2 checks to see whether any files have already been generated for the requested style sheet. - Request 2 finds the first of two files and assumes that the style sheet is composed of a single file. - Request 1 finishes generating the second style sheet. - Request 1 populates the FileSystemStyleCache’s entry cache with an Entry instance that correctly references both generated files. - Request 2 blows away the previously installed Entry and replaces it with a bogus Entry that only references the first of two style sheet files. On all subsequent requests, StyleSheetRenderer retrieves data from the bogus (single file) Entry, and thus only renders a single link. The fix is to control access to _createEntry() for individual style sheets. That is, we want to allow concurrent access to _createEntry() for style sheets with different variants (ie. it should be possible to generate the IE style sheets and Gecko style sheets concurrently). However, if a request is in the middle of generating files for a particular style sheet, other requests that want access to the same style sheet must wait until the first request completes its work (instead of possibly trampling over the work of the first request). -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (TRINIDAD-2463) Concurrency issues in CachingResourceLoader
Andy Schwartz created TRINIDAD-2463: --- Summary: Concurrency issues in CachingResourceLoader Key: TRINIDAD-2463 URL: https://issues.apache.org/jira/browse/TRINIDAD-2463 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.1.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor I am seeing intermittent failures when serving up skin-generated .css files via the Trinidad ResourceServlet. When the failure occurs, the ResourceServlet sends a response with conflicting information: the response specifies a Content-Length header that does not match the number of bytes of data that are sent. In particular, the Content-Length header specifies the correct size of the .css file as it appears on the file system, but the content that is sent back to the browser is truncated. Although I haven’t been able to reproduce the problem in a debugger, I suspect that the problem is due to the unsafe way in which CachingResourceLoader.URLStreamHandlerImpl deals with withs cached state. One obvious issue with this code is that it is not thread safe. It performs non-atomic operations (check and set) of the _contents and _contentsModified fields without synchronization (or without any other scheme to ensure thread safety). Additionally, there is nothing protecting against these fields being modified concurrently. Also, there is no attempt to ensure that the values assigned to these fields are published safely. This is bad. Another possible concern is that in theory we could end up reading the .css file contents off of the file system while this file is being written to by a second thread. In this case, our cached contents may not reflect the full contents of the file as it (eventually) appears on the file system. However, since we always retrieve the value for the Content-Length response header from the file system, we always send the latest file size, even if this does not match the number of bytes that we have cached. This could explain the mismatch that I am seeing between the Content-Length header and the size of our response payload. We need to do two things: 1. Make CachingResourceLoader.URLStreamHandlerImpl thread safe. 2. Make CachingResourceLoader more tolerant of content length changes. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Updated] (TRINIDAD-2463) Concurrency issues in CachingResourceLoader
[ https://issues.apache.org/jira/browse/TRINIDAD-2463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2463: Status: Patch Available (was: Open) Concurrency issues in CachingResourceLoader --- Key: TRINIDAD-2463 URL: https://issues.apache.org/jira/browse/TRINIDAD-2463 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.1.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2463.patch I am seeing intermittent failures when serving up skin-generated .css files via the Trinidad ResourceServlet. When the failure occurs, the ResourceServlet sends a response with conflicting information: the response specifies a Content-Length header that does not match the number of bytes of data that are sent. In particular, the Content-Length header specifies the correct size of the .css file as it appears on the file system, but the content that is sent back to the browser is truncated. Although I haven’t been able to reproduce the problem in a debugger, I suspect that the problem is due to the unsafe way in which CachingResourceLoader.URLStreamHandlerImpl deals with withs cached state. One obvious issue with this code is that it is not thread safe. It performs non-atomic operations (check and set) of the _contents and _contentsModified fields without synchronization (or without any other scheme to ensure thread safety). Additionally, there is nothing protecting against these fields being modified concurrently. Also, there is no attempt to ensure that the values assigned to these fields are published safely. This is bad. Another possible concern is that in theory we could end up reading the .css file contents off of the file system while this file is being written to by a second thread. In this case, our cached contents may not reflect the full contents of the file as it (eventually) appears on the file system. However, since we always retrieve the value for the Content-Length response header from the file system, we always send the latest file size, even if this does not match the number of bytes that we have cached. This could explain the mismatch that I am seeing between the Content-Length header and the size of our response payload. We need to do two things: 1. Make CachingResourceLoader.URLStreamHandlerImpl thread safe. 2. Make CachingResourceLoader more tolerant of content length changes. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (TRINIDAD-2463) Concurrency issues in CachingResourceLoader
[ https://issues.apache.org/jira/browse/TRINIDAD-2463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13947400#comment-13947400 ] Andy Schwartz commented on TRINIDAD-2463: - The attached patch addresses this: 1. Make CachingResourceLoader.URLStreamHandlerImpl thread safe. By storing URLStreamHandlerImpl's mutable state in a new immutable CachedContents class that is managed via an AtomicReference. And this: 2. Make CachingResourceLoader more tolerant of content length changes. By adding checks for content length vs. cached content size mismatches. In the event that a mismatch is detected, we a) clear our cached data, which should allow the cache to recover on subsequent requests and b) send an error back to the browser, which seems like an improvement over sending the potentially bogus contents. Concurrency issues in CachingResourceLoader --- Key: TRINIDAD-2463 URL: https://issues.apache.org/jira/browse/TRINIDAD-2463 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.1.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2463.patch I am seeing intermittent failures when serving up skin-generated .css files via the Trinidad ResourceServlet. When the failure occurs, the ResourceServlet sends a response with conflicting information: the response specifies a Content-Length header that does not match the number of bytes of data that are sent. In particular, the Content-Length header specifies the correct size of the .css file as it appears on the file system, but the content that is sent back to the browser is truncated. Although I haven’t been able to reproduce the problem in a debugger, I suspect that the problem is due to the unsafe way in which CachingResourceLoader.URLStreamHandlerImpl deals with withs cached state. One obvious issue with this code is that it is not thread safe. It performs non-atomic operations (check and set) of the _contents and _contentsModified fields without synchronization (or without any other scheme to ensure thread safety). Additionally, there is nothing protecting against these fields being modified concurrently. Also, there is no attempt to ensure that the values assigned to these fields are published safely. This is bad. Another possible concern is that in theory we could end up reading the .css file contents off of the file system while this file is being written to by a second thread. In this case, our cached contents may not reflect the full contents of the file as it (eventually) appears on the file system. However, since we always retrieve the value for the Content-Length response header from the file system, we always send the latest file size, even if this does not match the number of bytes that we have cached. This could explain the mismatch that I am seeing between the Content-Length header and the size of our response payload. We need to do two things: 1. Make CachingResourceLoader.URLStreamHandlerImpl thread safe. 2. Make CachingResourceLoader more tolerant of content length changes. -- This message was sent by Atlassian JIRA (v6.2#6252)
Re: [Trinidad] New API addition for Trinidad's UIXEditableValueTemplate
+1 Andy On Mar 21, 2014, at 5:07 PM, Gabrielle Crawford gabrielle.crawf...@oracle.com wrote: +1 On Mar 19, 2014, at 1:25 PM, Ji Kim wrote: For note = This is to allow components and etcetera to listen to this event by adding a listener in the new UIXEditableValueTemplate.addValueUpdatedListener API. The pro of adding this event + listener is that various components can then listen when the value has been updated in the model. This is beneficial in 1) Clearing up any data that would have been persisted for some reason [i.e. if the app wished to keep a temporary value of a component using some kind of polling from client to server to not lose any dirty data {i.e. how confluence wiki allows users to preserves the old states}]. 2) To avoid sending a certain asynchronous dirty data from the client to the server Thanks! On 3/19/2014 12:44 PM, Ji Kim wrote: So as requested I am sending out a separate email to get responses from the crowd regarding this JIRA [https://issues.apache.org/jira/browse/TRINIDAD-2459]. The change is to add 2 new APIs to Trinidad's UIXEditableValueTemplate = public void addValueUpdatedListener(ValueUpdatedListener listener) { super.addFacesListener (listener); } public void removeValueUpdatedListener (ValueUpdatedListener listener) { super.removeFacesListener (listener); } where ValueUpdatedEvent is queued within the updateModel method/phase. public void updateModel(FacesContext context) { ... try { Object localValue = getLocalValue(); expression.setValue(context.getELContext(), localValue); setValue(null); setLocalValueSet(false); (new ValueUpdatedEvent(this)).queue(); ... } Thanks!
[jira] [Updated] (TRINIDAD-2447) UIComponent.isCompositeComponent() is slow for UIXComponents
[ https://issues.apache.org/jira/browse/TRINIDAD-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2447: Resolution: Fixed Fix Version/s: 2.1.1-core Status: Resolved (was: Patch Available) Implemented fix as described above. UIComponent.isCompositeComponent() is slow for UIXComponents Key: TRINIDAD-2447 URL: https://issues.apache.org/jira/browse/TRINIDAD-2447 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.1.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Fix For: 2.1.1-core Attachments: trinidad-2447.patch The JSF implementations hammer on UIComponent.isCompositeComponent () - eg. this is called for each time the pushComponentToEL()/popComponentFromEL() methods are called, which is all of the time. isCompositeComponent() performs the following check: component.getAttributes().containsKey(Resource.COMPONENT_RESOURCE_KEY); Unfortunately, this operation is slower than it should be for Trinidad-based UIXComponents. There reason for this is the non-optimal implementation of containsKey in Trinidad's ValueMap: public boolean containsKey(Object key) { if (key == null) throw new NullPointerException(); PropertyKey propertyKey = _getPropertyKey(key); if (_bean.keySet().contains(propertyKey)) return true; else return _bean.bindingKeySet().contains(propertyKey); } We're creating key sets for both the FacesBean properties and value expressions. Aside from the overhead of creating these key sets, this also means that we bypass optimizations in FlaggedPropertyMap. This is showing up as a hot spot in JProfiler, so would like to see this optimized. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Created] (TRINIDAD-2447) UIComponent.isCompositeComponent() is slow for UIXComponents
Andy Schwartz created TRINIDAD-2447: --- Summary: UIComponent.isCompositeComponent() is slow for UIXComponents Key: TRINIDAD-2447 URL: https://issues.apache.org/jira/browse/TRINIDAD-2447 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.1.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor The JSF implementations hammer on UIComponent.isCompositeComponent () - eg. this is called for each time the pushComponentToEL()/popComponentFromEL() methods are called, which is all of the time. isCompositeComponent() performs the following check: component.getAttributes().containsKey(Resource.COMPONENT_RESOURCE_KEY); Unfortunately, this operation is slower than it should be for Trinidad-based UIXComponents. There reason for this is the non-optimal implementation of containsKey in Trinidad's ValueMap: public boolean containsKey(Object key) { if (key == null) throw new NullPointerException(); PropertyKey propertyKey = _getPropertyKey(key); if (_bean.keySet().contains(propertyKey)) return true; else return _bean.bindingKeySet().contains(propertyKey); } We're creating key sets for both the FacesBean properties and value expressions. Aside from the overhead of creating these key sets, this also means that we bypass optimizations in FlaggedPropertyMap. This is showing up as a hot spot in JProfiler, so would like to see this optimized. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Comment Edited] (TRINIDAD-2447) UIComponent.isCompositeComponent() is slow for UIXComponents
[ https://issues.apache.org/jira/browse/TRINIDAD-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13878834#comment-13878834 ] Andy Schwartz edited comment on TRINIDAD-2447 at 1/22/14 5:09 PM: -- The proposed fix does two things: 1. It optimizes ValueMap.containsKey() to use FacesBean.getRawProperty(). 2. It registers a PropertyKey for Resource.COMPONENT_RESOURCE_KEY. #1 avoids the unnecessary key set creation. #2 makes COMPONENT_RESOURCE_KEY an indexed property, thus allowing FlaggedPropertyMap to optimize gets. was (Author: andy.schwartz): Proposed fix. UIComponent.isCompositeComponent() is slow for UIXComponents Key: TRINIDAD-2447 URL: https://issues.apache.org/jira/browse/TRINIDAD-2447 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.1.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2447.patch The JSF implementations hammer on UIComponent.isCompositeComponent () - eg. this is called for each time the pushComponentToEL()/popComponentFromEL() methods are called, which is all of the time. isCompositeComponent() performs the following check: component.getAttributes().containsKey(Resource.COMPONENT_RESOURCE_KEY); Unfortunately, this operation is slower than it should be for Trinidad-based UIXComponents. There reason for this is the non-optimal implementation of containsKey in Trinidad's ValueMap: public boolean containsKey(Object key) { if (key == null) throw new NullPointerException(); PropertyKey propertyKey = _getPropertyKey(key); if (_bean.keySet().contains(propertyKey)) return true; else return _bean.bindingKeySet().contains(propertyKey); } We're creating key sets for both the FacesBean properties and value expressions. Aside from the overhead of creating these key sets, this also means that we bypass optimizations in FlaggedPropertyMap. This is showing up as a hot spot in JProfiler, so would like to see this optimized. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Updated] (TRINIDAD-2447) UIComponent.isCompositeComponent() is slow for UIXComponents
[ https://issues.apache.org/jira/browse/TRINIDAD-2447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2447: Status: Patch Available (was: Open) UIComponent.isCompositeComponent() is slow for UIXComponents Key: TRINIDAD-2447 URL: https://issues.apache.org/jira/browse/TRINIDAD-2447 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.1.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2447.patch The JSF implementations hammer on UIComponent.isCompositeComponent () - eg. this is called for each time the pushComponentToEL()/popComponentFromEL() methods are called, which is all of the time. isCompositeComponent() performs the following check: component.getAttributes().containsKey(Resource.COMPONENT_RESOURCE_KEY); Unfortunately, this operation is slower than it should be for Trinidad-based UIXComponents. There reason for this is the non-optimal implementation of containsKey in Trinidad's ValueMap: public boolean containsKey(Object key) { if (key == null) throw new NullPointerException(); PropertyKey propertyKey = _getPropertyKey(key); if (_bean.keySet().contains(propertyKey)) return true; else return _bean.bindingKeySet().contains(propertyKey); } We're creating key sets for both the FacesBean properties and value expressions. Aside from the overhead of creating these key sets, this also means that we bypass optimizations in FlaggedPropertyMap. This is showing up as a hot spot in JProfiler, so would like to see this optimized. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Updated] (TRINIDAD-2443) Reduce severity of component binding reuse message
[ https://issues.apache.org/jira/browse/TRINIDAD-2443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2443: Resolution: Fixed Fix Version/s: 2.1.1-core Status: Resolved (was: Patch Available) Reduced the logger level to INFO. Reduce severity of component binding reuse message -- Key: TRINIDAD-2443 URL: https://issues.apache.org/jira/browse/TRINIDAD-2443 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Fix For: 2.1.1-core Attachments: TRINIDAD-2443-take2.patch, TRINIDAD-2443.patch As part of our changes for: TRINIDAD-2409 improve diagnostics during tag execution component binding failures We added some logging to UIXComponentELTag.createComponent() when we detect a newly created component with a stale parent. The idea behind this logging is that it should help catch cases where the component tree is being pinned in memory, typically by using a component binding that references a long-lived (eg. session scope. However, it turns out that we're detecting (and logging the severe message for) other cases. For example: - A page fragment defines a component with a binding that points to a request scoped bean. - The page fragment is jsp:included into both page1.jspx and page2.jspx. - The user navigates from page1.jspx to page2.jspx (with no redirect). At this point we see the severe message, even though there is no risk of component tree pinning. Unfortunately, we don't just see the message once, but repeatedly on every navigation. And since the message is being logged as severe, it will likely show up in (and bloat) logs for production deployments. I think that this message is still useful, but more for debugging purposes than for production error reporting. As such, opening this issue to request that we crank the severity down. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Created] (TRINIDAD-2443) Reduce severity of component binding reuse message
Andy Schwartz created TRINIDAD-2443: --- Summary: Reduce severity of component binding reuse message Key: TRINIDAD-2443 URL: https://issues.apache.org/jira/browse/TRINIDAD-2443 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor As part of our changes for: TRINIDAD-2409 improve diagnostics during tag execution component binding failures We added some logging to UIXComponentELTag.createComponent() when we detect a newly created component with a stale parent. The idea behind this logging is that it should help catch cases where the component tree is being pinned in memory, typically by using a component binding that references a long-lived (eg. session scope. However, it turns out that we're detecting (and logging the severe message for) other cases. For example: - A page fragment defines a component with a binding that points to a request scoped bean. - The page fragment is jsp:included into both page1.jspx and page2.jspx. - The user navigates from page1.jspx to page2.jspx (with no redirect). At this point we see the severe message, even though there is no risk of component tree pinning. Unfortunately, we don't just see the message once, but repeatedly on every navigation. And since the message is being logged as severe, it will likely show up in (and bloat) logs for production deployments. I think that this message is still useful, but more for debugging purposes than for production error reporting. As such, opening this issue to request that we crank the severity down. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Updated] (TRINIDAD-2443) Reduce severity of component binding reuse message
[ https://issues.apache.org/jira/browse/TRINIDAD-2443?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2443: Status: Patch Available (was: Open) Reduce severity of component binding reuse message -- Key: TRINIDAD-2443 URL: https://issues.apache.org/jira/browse/TRINIDAD-2443 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: TRINIDAD-2443.patch As part of our changes for: TRINIDAD-2409 improve diagnostics during tag execution component binding failures We added some logging to UIXComponentELTag.createComponent() when we detect a newly created component with a stale parent. The idea behind this logging is that it should help catch cases where the component tree is being pinned in memory, typically by using a component binding that references a long-lived (eg. session scope. However, it turns out that we're detecting (and logging the severe message for) other cases. For example: - A page fragment defines a component with a binding that points to a request scoped bean. - The page fragment is jsp:included into both page1.jspx and page2.jspx. - The user navigates from page1.jspx to page2.jspx (with no redirect). At this point we see the severe message, even though there is no risk of component tree pinning. Unfortunately, we don't just see the message once, but repeatedly on every navigation. And since the message is being logged as severe, it will likely show up in (and bloat) logs for production deployments. I think that this message is still useful, but more for debugging purposes than for production error reporting. As such, opening this issue to request that we crank the severity down. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
Re: [VOTE] Release of Trinidad Maven Plugins 2.0.8
Hey Scott - I attempted to do a clean Trinidad build against the new plugins. I happened to notice this exception during the build: [INFO] --- maven-faces-plugin:2.0.8:generate-jsp-taglibs (default) @ trinidad-impl --- [INFO] ClassNotFound error resolving type org.apache.myfaces.trinidad.model.DateListProvider java.lang.ClassNotFoundException: org.apache.myfaces.trinidad.model.DateListProvider at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.apache.myfaces.trinidadbuild.plugin.faces.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:86) at org.apache.myfaces.trinidadbuild.plugin.faces.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:47) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.AbstractTagGenerator.resolveType(AbstractTagGenerator.java:247) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.TrinidadValidatorTagGenerator.writeSetProperty(TrinidadValidatorTagGenerator.java:115) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.AbstractValidatorTagGenerator.writeSetProperties(AbstractValidatorTagGenerator.java:185) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.AbstractValidatorTagGenerator.generateTagHandler(AbstractValidatorTagGenerator.java:62) at org.apache.myfaces.trinidadbuild.plugin.faces.GenerateJspTaglibsMojo._generateTagHandlers(GenerateJspTaglibsMojo.java:794) at org.apache.myfaces.trinidadbuild.plugin.faces.GenerateJspTaglibsMojo.execute(GenerateJspTaglibsMojo.java:104) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [INFO] Generated 145 JSP tag(s) I have no idea whether this exception in new in 2.0.8. Is this something that we should look at before rolling out the plugins release? Andy On Mon, Nov 4, 2013 at 4:29 PM, Scott O'Bryan darkar...@gmail.com wrote: I was running the tasks needed to release the Trinidad Maven Plugins version 2.0.8 which is needed as a prerequisite to a Trinidad release. I have compiled the Release Notes[1] for the 2.0.8 release. I have generated the tag [2] and have deployed the built artifacts to nexus [3]. Lastly I have included a source archive [4]. I've done preliminary testing and building, updated the plugins to comply with checkstyle, and made sure the build passed rat:check. Please take a look at the Trinidad Maven Plugins 2.0.8 release artifacts now and vote. Please note: This vote is majority approval with a minimum of three +1 votes (see [5]). [ ] +1 for community members who have reviewed the bits [ ] +0 [ ] -1 for fatal flaws that should cause these bits not to be released, and why.. Thanks, Scott O'Bryan [1] https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310661version=12319290 [2]
Re: [VOTE] Release of Trinidad Maven Plugins 2.0.8
Hey Scott - Great, thanks for tracking this down. +1 for me then. Andy On Wed, Nov 6, 2013 at 12:55 PM, Scott O'Bryan darkar...@gmail.com wrote: I'm changing my vote to +1. I was able to fix this issue in the trinidad poms by adding: dependencies dependency groupIdorg.apache.myfaces.trinidad/groupId artifactIdtrinidad-api/artifactId version${project.version}/version /dependency /dependencies To the maven-faces plugin definition in trinidad-impl. So I'll handle the ticket under trinidad and make sure its part of the next release. The key was found in the maven class loading guide: http://maven.apache.org/guides/mini/guide-maven-classloading.html I noticed that the error was being issued in the impl package which should have had access to the api. But the dependencies are only explicitly available to the javacc plugin or can be referenced manually by the mojo. Our mojo doesn't handle dependencies, so the configuration is necessary. Might be nice to add it at some point though. Andy, does this work for you? -- Scott O'Bryan On November 6, 2013 at 8:32:00 AM, Scott O'Bryan (darkar...@gmail.com//darkar...@gmail.com) wrote: Andy, Yeah, I was seeing this too. I was trying to track this as part of my work for the next Trinidad release, but I think your right. This may be handled better in the plugin. At the very least we should evaluate it. What's happening here is a new check was added to test if a class for an attribute happens to be an enumeration. In the case where we get the error, DateListProvider hasn't been built yet since the plugins generate the source BEFORE the plugins are built. I'm going to generate a JIRA ticket and I for one think we need to fix this issue before releasing the plugins. As such. my vote is a -1 pending this issue. -- Scott O'Bryan On November 6, 2013 at 7:42:03 AM, Andy Schwartz ( andy.g.schwa...@gmail.com //andy.g.schwa...@gmail.com) wrote: Hey Scott - I attempted to do a clean Trinidad build against the new plugins. I happened to notice this exception during the build: [INFO] --- maven-faces-plugin:2.0.8:generate-jsp-taglibs (default) @ trinidad-impl --- [INFO] ClassNotFound error resolving type org.apache.myfaces.trinidad.model.DateListProvider java.lang.ClassNotFoundException: org.apache.myfaces.trinidad.model.DateListProvider at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.apache.myfaces.trinidadbuild.plugin.faces.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:86) at org.apache.myfaces.trinidadbuild.plugin.faces.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:47) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.AbstractTagGenerator.resolveType(AbstractTagGenerator.java:247) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.TrinidadValidatorTagGenerator.writeSetProperty(TrinidadValidatorTagGenerator.java:115) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.AbstractValidatorTagGenerator.writeSetProperties(AbstractValidatorTagGenerator.java:185) at org.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib.AbstractValidatorTagGenerator.generateTagHandler(AbstractValidatorTagGenerator.java:62) at org.apache.myfaces.trinidadbuild.plugin.faces.GenerateJspTaglibsMojo._generateTagHandlers(GenerateJspTaglibsMojo.java:794) at org.apache.myfaces.trinidadbuild.plugin.faces.GenerateJspTaglibsMojo.execute(GenerateJspTaglibsMojo.java:104) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537
[jira] [Updated] (TRINIDAD-2410) LOCAL_VALUE_SET_KEY and SUBMITTED_VALUE_KEY should specify CAP_NOT_BOUND
[ https://issues.apache.org/jira/browse/TRINIDAD-2410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2410: Resolution: Fixed Fix Version/s: 2.1.0-core Status: Resolved (was: Patch Available) LOCAL_VALUE_SET_KEY and SUBMITTED_VALUE_KEY should specify CAP_NOT_BOUND Key: TRINIDAD-2410 URL: https://issues.apache.org/jira/browse/TRINIDAD-2410 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Fix For: 2.1.0-core Attachments: trinidad-2410.patch UIXEditableValue includes the following two property key definitions: static public final PropertyKey LOCAL_VALUE_SET_KEY = TYPE.registerKey(localValueSet, Boolean.class); static public final PropertyKey SUBMITTED_VALUE_KEY = TYPE.registerKey(submittedValue); Note that although neither of these property keys support EL binding, the property key definitions fail to specify the PropertyKey.CAP_NOT_BOUND capability. We should specify this to avoid unnecessary lookups in the ValueExpression map. -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] [Created] (TRINIDAD-2410) LOCAL_VALUE_SET_KEY and SUBMITTED_VALUE_KEY should specify CAP_NOT_BOUND
Andy Schwartz created TRINIDAD-2410: --- Summary: LOCAL_VALUE_SET_KEY and SUBMITTED_VALUE_KEY should specify CAP_NOT_BOUND Key: TRINIDAD-2410 URL: https://issues.apache.org/jira/browse/TRINIDAD-2410 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor UIXEditableValue includes the following two property key definitions: static public final PropertyKey LOCAL_VALUE_SET_KEY = TYPE.registerKey(localValueSet, Boolean.class); static public final PropertyKey SUBMITTED_VALUE_KEY = TYPE.registerKey(submittedValue); Note that although neither of these property keys support EL binding, the property key definitions fail to specify the PropertyKey.CAP_NOT_BOUND capability. We should specify this to avoid unnecessary lookups in the ValueExpression map. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2410) LOCAL_VALUE_SET_KEY and SUBMITTED_VALUE_KEY should specify CAP_NOT_BOUND
[ https://issues.apache.org/jira/browse/TRINIDAD-2410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2410: Status: Patch Available (was: Open) LOCAL_VALUE_SET_KEY and SUBMITTED_VALUE_KEY should specify CAP_NOT_BOUND Key: TRINIDAD-2410 URL: https://issues.apache.org/jira/browse/TRINIDAD-2410 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2410.patch UIXEditableValue includes the following two property key definitions: static public final PropertyKey LOCAL_VALUE_SET_KEY = TYPE.registerKey(localValueSet, Boolean.class); static public final PropertyKey SUBMITTED_VALUE_KEY = TYPE.registerKey(submittedValue); Note that although neither of these property keys support EL binding, the property key definitions fail to specify the PropertyKey.CAP_NOT_BOUND capability. We should specify this to avoid unnecessary lookups in the ValueExpression map. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[Trinidad] Anyone care to review fix for TRINIDAD-2410?
Gang - I encountered this issue with UIXEditableValue recently: https://issues.apache.org/jira/browse/TRINIDAD-2410 UIXEditableValue includes the following two property key definitions: static public final PropertyKey LOCAL_VALUE_SET_KEY = TYPE.registerKey(localValueSet, Boolean.class); static public final PropertyKey SUBMITTED_VALUE_KEY = TYPE.registerKey(submittedValue); Note that although neither of these property keys support EL binding, the property key definitions fail to specify the PropertyKey.CAP_NOT_BOUND capability. We should specify this to avoid unnecessary lookups in the ValueExpression map. Anyone want to review the patch here: https://issues.apache.org/jira/secure/attachment/12599951/trinidad-2410.patch Before I commit? Seems like a trivial issue and fix, but wouldn't mind a second pair of eyes on it. Andy
[jira] [Created] (TRINIDAD-2404) UIXEditableValue property keys missing CAP_NOT_BOUND
Andy Schwartz created TRINIDAD-2404: --- Summary: UIXEditableValue property keys missing CAP_NOT_BOUND Key: TRINIDAD-2404 URL: https://issues.apache.org/jira/browse/TRINIDAD-2404 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Priority: Minor The following property keys in UIXEditableValue: static public final PropertyKey LOCAL_VALUE_SET_KEY = TYPE.registerKey(localValueSet, Boolean.class); static public final PropertyKey SUBMITTED_VALUE_KEY = TYPE.registerKey(submittedValue); Do not support EL binding and as such should specify the PropertyKey.CAP_NOT_BOUND capability. This will avoid unnecessary attempts to locate a ValueExpression for these properties. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2404) UIXEditableValue property keys missing CAP_NOT_BOUND
[ https://issues.apache.org/jira/browse/TRINIDAD-2404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2404: Status: Patch Available (was: Open) UIXEditableValue property keys missing CAP_NOT_BOUND Key: TRINIDAD-2404 URL: https://issues.apache.org/jira/browse/TRINIDAD-2404 Project: MyFaces Trinidad Issue Type: Bug Components: Components Reporter: Andy Schwartz Priority: Minor Attachments: TRINIDAD-2404.patch The following property keys in UIXEditableValue: static public final PropertyKey LOCAL_VALUE_SET_KEY = TYPE.registerKey(localValueSet, Boolean.class); static public final PropertyKey SUBMITTED_VALUE_KEY = TYPE.registerKey(submittedValue); Do not support EL binding and as such should specify the PropertyKey.CAP_NOT_BOUND capability. This will avoid unnecessary attempts to locate a ValueExpression for these properties. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2355) The error message displayed for a large file uploaded is not view locale dependent
[ https://issues.apache.org/jira/browse/TRINIDAD-2355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2355: Resolution: Fixed Fix Version/s: 2.1.0-core Assignee: Andy Schwartz Status: Resolved (was: Patch Available) Commit Anshu's patch in r1454406. The error message displayed for a large file uploaded is not view locale dependent -- Key: TRINIDAD-2355 URL: https://issues.apache.org/jira/browse/TRINIDAD-2355 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.0.0-core, 2.0.1-core, 2.1.0-core Environment: The bug occurs across environments. Reporter: Anshu Jain Assignee: Andy Schwartz Fix For: 2.1.0-core Attachments: TRINIDAD-2355.patch, TRINIDAD-2355.patch, TRINIDAD-2355_Updated.patch When using inputFile component to upload a too large file, the error message The file could not be uploaded because it is too large popups up. But this message is rendered in the default locale set in the server and not in the view/browser locale. The message should appear according to the view/browser locale. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2360) Size of the pop-up window does not honor the width and height parameters provided in IE
[ https://issues.apache.org/jira/browse/TRINIDAD-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2360: Resolution: Fixed Fix Version/s: 2.1.0-core Status: Resolved (was: Patch Available) Size of the pop-up window does not honor the width and height parameters provided in IE --- Key: TRINIDAD-2360 URL: https://issues.apache.org/jira/browse/TRINIDAD-2360 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.0.0-core, 2.0.1-core, 2.1.0-core Environment: The issue occurs only in Internet Explorer. Reporter: Anshu Jain Assignee: Andy Schwartz Priority: Minor Fix For: 2.1.0-core Attachments: TRINIDAD-2360-code-review.patch, TRINIDAD-2360-code-review-take2.patch, TRINIDAD-2360.patch, TRINIDAD-2360_Updated.patch If the width and height of a pop-up window is passed on as parameters, the pop-up on opening is not of the provided size. The width is slightly more and the height is reduced from the provided parameters. This behaviors occurs only in IE. For other browsers like Chrome and Firefox, the popup is of correct size as passed through the parameters. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2360) Size of the pop-up window does not honor the width and height parameters provided in IE
[ https://issues.apache.org/jira/browse/TRINIDAD-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13589605#comment-13589605 ] Andy Schwartz commented on TRINIDAD-2360: - I committed this version of the fix to trunk: https://issues.apache.org/jira/secure/attachment/12570150/TRINIDAD-2360-code-review-take2.patch Thanks for working on this issue Anshu! Size of the pop-up window does not honor the width and height parameters provided in IE --- Key: TRINIDAD-2360 URL: https://issues.apache.org/jira/browse/TRINIDAD-2360 Project: MyFaces Trinidad Issue Type: Bug Components: Components Affects Versions: 2.0.0-core, 2.0.1-core, 2.1.0-core Environment: The issue occurs only in Internet Explorer. Reporter: Anshu Jain Assignee: Andy Schwartz Priority: Minor Attachments: TRINIDAD-2360-code-review.patch, TRINIDAD-2360-code-review-take2.patch, TRINIDAD-2360.patch, TRINIDAD-2360_Updated.patch If the width and height of a pop-up window is passed on as parameters, the pop-up on opening is not of the provided size. The width is slightly more and the height is reduced from the provided parameters. This behaviors occurs only in IE. For other browsers like Chrome and Firefox, the popup is of correct size as passed through the parameters. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2359) ClearRequestExternalContext wrapper applied unnecessarily
Andy Schwartz created TRINIDAD-2359: --- Summary: ClearRequestExternalContext wrapper applied unnecessarily Key: TRINIDAD-2359 URL: https://issues.apache.org/jira/browse/TRINIDAD-2359 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor GlobalConfiguratorImpl wraps the ExternalContext with a ClearRequestExternalContext if it detects that Mojarra issue 493 (fixed back in Mojarra 1.2.04) is present. The Mojarra issue is described here: http://java.net/jira/browse/JAVASERVERFACES-493 setRequest does not reset request maps Two problems with this: 1. This issue was fixed in 2007, so it is unclear whether we should ever bother applying this workaround. 2. The code which detects the presence of this Mojarra issue is buggy. As a result of #2, GlobalConfiguratorImpl always adds a ClearRequestExternalContext wrapper, regardless of whether the old Mojarra issue is present or not. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2359) ClearRequestExternalContext wrapper applied unnecessarily
[ https://issues.apache.org/jira/browse/TRINIDAD-2359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13570626#comment-13570626 ] Andy Schwartz commented on TRINIDAD-2359: - More details on #2 above... GlobalConfiguratorImpl._isSetRequestBugPresent() performs the following test: // Call getInitParameterMap() up front ec.getInitParameterMap(); ec.setRequest(new TestRequest(orig)); _sHasSetRequestBug = !TestRequest.isTestParamPresent(ec); Where TestRequest looks like this: static private class TestRequest extends ServletRequestWrapper { public TestRequest(ServletRequest request) { super(request); } @Override public String getParameter(String string) { if (_TEST_PARAM.equals(string)) { return passed; } return super.getParameter(string); } static public final boolean isTestParamPresent(ExternalContext ec) { return RequestStateMap.getInstance(ec).get(_TEST_PARAM) != null; } static private String _TEST_PARAM = TestRequest.class.getName() + .TEST_PARAM; } TestRequest.isTestParamPresent() is checking for the presence of this _TEST_PARAM in the RequestStateMap. However, the _TEST_PARAM lives in the ServletRequest's parameter map. As far as I can tell, these are different things - ie. the RequestStateMap does not actually delegate through to the ServletRequest's parameter map. Thus isTestParamPresent() will always return false, even when the _TEST_PARAM is accessible via the request parameter map. ClearRequestExternalContext wrapper applied unnecessarily - Key: TRINIDAD-2359 URL: https://issues.apache.org/jira/browse/TRINIDAD-2359 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor GlobalConfiguratorImpl wraps the ExternalContext with a ClearRequestExternalContext if it detects that Mojarra issue 493 (fixed back in Mojarra 1.2.04) is present. The Mojarra issue is described here: http://java.net/jira/browse/JAVASERVERFACES-493 setRequest does not reset request maps Two problems with this: 1. This issue was fixed in 2007, so it is unclear whether we should ever bother applying this workaround. 2. The code which detects the presence of this Mojarra issue is buggy. As a result of #2, GlobalConfiguratorImpl always adds a ClearRequestExternalContext wrapper, regardless of whether the old Mojarra issue is present or not. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2359) ClearRequestExternalContext wrapper applied unnecessarily
[ https://issues.apache.org/jira/browse/TRINIDAD-2359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13570630#comment-13570630 ] Andy Schwartz commented on TRINIDAD-2359: - This patch: https://issues.apache.org/jira/secure/attachment/12567885/trinidad-2359.patch Fixes the isTestParamPresent() present by looking for the test parameter in the ExternalContext's request parameter map instead of in the RequestStateMap. I suppose we could rip this code out altogether, though perhaps this test could be useful for catching future regressions? ClearRequestExternalContext wrapper applied unnecessarily - Key: TRINIDAD-2359 URL: https://issues.apache.org/jira/browse/TRINIDAD-2359 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2359.patch GlobalConfiguratorImpl wraps the ExternalContext with a ClearRequestExternalContext if it detects that Mojarra issue 493 (fixed back in Mojarra 1.2.04) is present. The Mojarra issue is described here: http://java.net/jira/browse/JAVASERVERFACES-493 setRequest does not reset request maps Two problems with this: 1. This issue was fixed in 2007, so it is unclear whether we should ever bother applying this workaround. 2. The code which detects the presence of this Mojarra issue is buggy. As a result of #2, GlobalConfiguratorImpl always adds a ClearRequestExternalContext wrapper, regardless of whether the old Mojarra issue is present or not. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [Trinidad] Query regarding the popup window size in IE
Hi Anshu - (Adding [Trinidad] to the subject to clarify that this issue is Trinidad-specific.) On Fri, Dec 14, 2012 at 5:19 AM, Anshu Jain anshu.x.j...@oracle.com wrote: Hi, I noticed a strange behavior in when a dialog box is opened having a fixed size. In this example, the width of the popup window is set to 600 px and height 600 px. When the popup is opened using a button, the size of the popup window in IE (7, 8 and 9) is 640x684. Also, the frame size inside the popup is 626x594. For the same case, in Mozilla Firefox and Chrome, the frame size opens to be 600x600. On analysis, I found that in the _sizeWin() method in Window.js, no execution is done for Chrome and Firefox, since the body object is null. I am confused why this would be the case. window.document.body should be non-null by the time _sizeWin() is called in the onload handler. Can you double-check that window.document.body is definitely null and not that some other logic in the method is diverging across browsers? ... var body = theWindow.document.body; if (body) { ... ... } } But, in case of IE body object is not null, and newWidth and newHeight are calculated and the window is resized to an this new size which seems to be incorrect. Because of this part of the code, the popup window is never opened in the size defined and IE behaves in a different way than Friefox and Chrome. I tried bypassing this entire code and checked the popup window size, and found that without this code execution, the IE behaves in the same way as Firefox and Chrome and opens a popup with frame size as defined in the parameters. My query was that is there a special reason that this calculation is done for IE with Windows? Is the reason valid even in case of newer versions of IE like IE8 and IE9? The intent of this (very old) sizing code is to attempt to ensure that there is sufficient space to display the full contents of the window. I don't believe that there was ever an intention for this sizing logic to be limited to IE. Andy
[jira] [Updated] (TRINIDAD-2344) Maven-faces-plugin faces-config.xml generation support for pass through component types
[ https://issues.apache.org/jira/browse/TRINIDAD-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2344: Status: Patch Available (was: Open) Maven-faces-plugin faces-config.xml generation support for pass through component types --- Key: TRINIDAD-2344 URL: https://issues.apache.org/jira/browse/TRINIDAD-2344 Project: MyFaces Trinidad Issue Type: Improvement Components: Build Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2344.patch Trinidad's GenerateFacesConfigMojo filters out any faces-config.xml component entries that do not match the typePrefix parameter. This can be annoying, since in some cases it may be necessary to override component implementations for component types that are outside of the normal typePrefix. We addressed this in a one-off fashion here: TRINIDAD-1656 Maven-faces-plugin faces-config.xml generation does not allow ViewRoot replacement But this solution is too constrained, as it only allows the javax.faces.ViewRoot component type to be replaced. Logging this issue to request that we add some more generic solution. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2345) Clean up maven-faces-plugin transform xsl duplication
Andy Schwartz created TRINIDAD-2345: --- Summary: Clean up maven-faces-plugin transform xsl duplication Key: TRINIDAD-2345 URL: https://issues.apache.org/jira/browse/TRINIDAD-2345 Project: MyFaces Trinidad Issue Type: Task Components: Build Reporter: Andy Schwartz Priority: Minor The trinidad-maven/maven-faces-plugin uses the following XSLT style sheets to manipulate a base faces-config.xml document: ./maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform20.xsl ./maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform.xsl ./maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform21.xsl ./maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl There is an unreasonable amount of duplication across these files, which makes any sort of maintenance way more difficult than necessary. Logging this issue to track the fact that we need to clean this up. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2343) Hook for overriding UIXCollection temp var storage
[ https://issues.apache.org/jira/browse/TRINIDAD-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13506740#comment-13506740 ] Andy Schwartz commented on TRINIDAD-2343: - Committed fix to trunk in r1415347. Hook for overriding UIXCollection temp var storage -- Key: TRINIDAD-2343 URL: https://issues.apache.org/jira/browse/TRINIDAD-2343 Project: MyFaces Trinidad Issue Type: Improvement Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Fix For: 2.1.0-core Attachments: trinidad-2343.patch UIXCollection uses the following private method for storing temporary variables (eg. var and varStatus values): private Object _setELVar(String varName, Object newData) { if (varName == null) return null; // we need to place each row at an EL reachable place so that it // can be accessed via the 'var' variable. Let's place it on the // requestMap: return TableUtils.setupELVariable(getFacesContext(), varName, newData); } I need to override this behavior in my subclasses of UIXCollection as I have my own mechanism for managing temporary variables. Logging this issue to request that we expose a protected hook that subclasses can override to provide alternate implementations of temporary variable storage. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2343) Hook for overriding UIXCollection temp var storage
[ https://issues.apache.org/jira/browse/TRINIDAD-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2343: Resolution: Fixed Fix Version/s: 2.1.0-core Status: Resolved (was: Patch Available) Hook for overriding UIXCollection temp var storage -- Key: TRINIDAD-2343 URL: https://issues.apache.org/jira/browse/TRINIDAD-2343 Project: MyFaces Trinidad Issue Type: Improvement Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Fix For: 2.1.0-core Attachments: trinidad-2343.patch UIXCollection uses the following private method for storing temporary variables (eg. var and varStatus values): private Object _setELVar(String varName, Object newData) { if (varName == null) return null; // we need to place each row at an EL reachable place so that it // can be accessed via the 'var' variable. Let's place it on the // requestMap: return TableUtils.setupELVariable(getFacesContext(), varName, newData); } I need to override this behavior in my subclasses of UIXCollection as I have my own mechanism for managing temporary variables. Logging this issue to request that we expose a protected hook that subclasses can override to provide alternate implementations of temporary variable storage. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2343) Hook for overriding UIXCollection temp var storage
Andy Schwartz created TRINIDAD-2343: --- Summary: Hook for overriding UIXCollection temp var storage Key: TRINIDAD-2343 URL: https://issues.apache.org/jira/browse/TRINIDAD-2343 Project: MyFaces Trinidad Issue Type: Improvement Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor UIXCollection uses the following private method for storing temporary variables (eg. var and varStatus values): private Object _setELVar(String varName, Object newData) { if (varName == null) return null; // we need to place each row at an EL reachable place so that it // can be accessed via the 'var' variable. Let's place it on the // requestMap: return TableUtils.setupELVariable(getFacesContext(), varName, newData); } I need to override this behavior in my subclasses of UIXCollection as I have my own mechanism for managing temporary variables. Logging this issue to request that we expose a protected hook that subclasses can override to provide alternate implementations of temporary variable storage. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (TRINIDAD-2343) Hook for overriding UIXCollection temp var storage
[ https://issues.apache.org/jira/browse/TRINIDAD-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13504672#comment-13504672 ] Andy Schwartz edited comment on TRINIDAD-2343 at 11/27/12 3:23 PM: --- The attached patch replaces the private _setTempVar() method with the following protected API: /** * Called by UIXCollection to set values for the var and * varStatus EL variables. * * @param context the FacesContext for the current request * @param name the non-null name of the EL variable * @param value the value of the EL variable * @return the previous value of the EL variable, or null if * the value was not previously set. */ protected Object setupELVariable( FacesContext context, String name, Object value ) was (Author: andy.schwartz): Proposed fix. Hook for overriding UIXCollection temp var storage -- Key: TRINIDAD-2343 URL: https://issues.apache.org/jira/browse/TRINIDAD-2343 Project: MyFaces Trinidad Issue Type: Improvement Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2343.patch UIXCollection uses the following private method for storing temporary variables (eg. var and varStatus values): private Object _setELVar(String varName, Object newData) { if (varName == null) return null; // we need to place each row at an EL reachable place so that it // can be accessed via the 'var' variable. Let's place it on the // requestMap: return TableUtils.setupELVariable(getFacesContext(), varName, newData); } I need to override this behavior in my subclasses of UIXCollection as I have my own mechanism for managing temporary variables. Logging this issue to request that we expose a protected hook that subclasses can override to provide alternate implementations of temporary variable storage. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[Trinidad] API: UIXCollection.setupELVariable()
Gang - As described in the following issue: TRINIDAD-2343 Hook for overriding UIXCollection temp var storage https://issues.apache.org/jira/browse/TRINIDAD-2343 I would like to expose a protected hook allow subclasses to provide alternate storage for the temporary EL variables that are set up by UIXCollection - ie. I want to provide a protected replacement for this existing private method: private Object _setELVar(String varName, Object newData) { if (varName == null) return null; // we need to place each row at an EL reachable place so that it // can be accessed via the 'var' variable. Let's place it on the // requestMap: return TableUtils.setupELVariable(getFacesContext(), varName, newData); } My proposal is to add the following new UIXCollection API: /** * Called by UIXCollection to set values for the var and * varStatus EL variables. * * @param context the FacesContext for the current request * @param name the non-null name of the EL variable * @param value the value of the EL variable * @return the previous value of the EL variable, or null if * the value was not previously set. */ protected Object setupELVariable( FacesContext context, String name, Object value ) (I picked the method name to match the related utility method on TableUitls.) If anyone has questions/comments on this new hook, please let me know. Andy
[jira] [Created] (TRINIDAD-2344) Maven-faces-plugin faces-config.xml generation support for pass through component types
Andy Schwartz created TRINIDAD-2344: --- Summary: Maven-faces-plugin faces-config.xml generation support for pass through component types Key: TRINIDAD-2344 URL: https://issues.apache.org/jira/browse/TRINIDAD-2344 Project: MyFaces Trinidad Issue Type: Improvement Components: Build Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Trinidad's GenerateFacesConfigMojo filters out any faces-config.xml component entries that do not match the typePrefix parameter. This can be annoying, since in some cases it may be necessary to override component implementations for component types that are outside of the normal typePrefix. We addressed this in a one-off fashion here: TRINIDAD-1656 Maven-faces-plugin faces-config.xml generation does not allow ViewRoot replacement But this solution is too constrained, as it only allows the javax.faces.ViewRoot component type to be replaced. Logging this issue to request that we add some more generic solution. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2343) Hook for overriding UIXCollection temp var storage
[ https://issues.apache.org/jira/browse/TRINIDAD-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2343: Status: Patch Available (was: Open) Hook for overriding UIXCollection temp var storage -- Key: TRINIDAD-2343 URL: https://issues.apache.org/jira/browse/TRINIDAD-2343 Project: MyFaces Trinidad Issue Type: Improvement Components: Components Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-2343.patch UIXCollection uses the following private method for storing temporary variables (eg. var and varStatus values): private Object _setELVar(String varName, Object newData) { if (varName == null) return null; // we need to place each row at an EL reachable place so that it // can be accessed via the 'var' variable. Let's place it on the // requestMap: return TableUtils.setupELVariable(getFacesContext(), varName, newData); } I need to override this behavior in my subclasses of UIXCollection as I have my own mechanism for managing temporary variables. Logging this issue to request that we expose a protected hook that subclasses can override to provide alternate implementations of temporary variable storage. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2340) LocaleElementsResourceLoader init dependency on request path
[ https://issues.apache.org/jira/browse/TRINIDAD-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13502151#comment-13502151 ] Andy Schwartz commented on TRINIDAD-2340: - Committed the following fix to trunk: http://svn.apache.org/viewvc?view=revisionrevision=1412206 LocaleElementsResourceLoader init dependency on request path Key: TRINIDAD-2340 URL: https://issues.apache.org/jira/browse/TRINIDAD-2340 Project: MyFaces Trinidad Issue Type: Bug Components: Infrastructure Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Fix For: 2.0.2-core Attachments: trinidad-2340.patch The LocaleElementsResourceLoader static initializer attempts to derive a locale elements library uri: static private final ResourceLoader[] _ResourceLoaders = { new ClassLoaderResourceLoader(), new TrTranslationsResourceLoader(CoreRenderKitResourceLoader.getLocaleElementsURI(Translations, false)) }; The call to getLocaleElementsURI() ends up calling CoreRenderKitResourceLoader.getLocale(), which in turn does the following: static public String getLocale() { String path = ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getPathInfo(); String locStr = ; int locIndex = path.indexOf(LocaleElements)+ LocaleElements_.length(); int index = path.indexOf(_VERSION); if (index 0) index = path.indexOf(.js); if(index = 0) locStr = path.substring(locIndex, index); return locStr; } Note that this code assumes that the request path returned from getPathInfo() corresponds to a LocaleElements library request. While this true during normal resource request processing (ie. when ResourceLoader.getResource() is called), this is not necessarily true when called from the LocaleElementsResourceLoader static initializer. Depending on when the LocaleElementsResourceLoader is initialized, a call to getLocale() can result in: 1. A NullPointerException, if the FacesContext is not available, or if getRequest() happens to return null. 2. A StringIndexOutOfBoundsException from the substring() call, if the request path happens to be short. 3. A garbage return value, if one of the above two exceptions are not thrown. As such, it is not safe for LocaleElementsResourceLoader to call into getLocaleElementsURI() from its static initializer. Although this seems like a trivial issue, I specified the priority as major as we are seeing #2 in production environments. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2340) LocaleElementsResourceLoader init dependency on request path
[ https://issues.apache.org/jira/browse/TRINIDAD-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2340: Resolution: Fixed Fix Version/s: 2.0.2-core Status: Resolved (was: Patch Available) Avoid calling CoreRenderKitResourceLoader.getLocaleElementsURI() during resource loader initialization, as it is not safe to depend on the request uri at this time. Fortunately, this call was entirely unnecessary, so we can simply remove it with no negative impact. Added a small unit test that verifies that the CoreRenderKitResourceLoader (and thus the LocaleElementsResourceLoader) can be instantiated without access to a FacesContext (and thus is not dependent on any request-specific state). LocaleElementsResourceLoader init dependency on request path Key: TRINIDAD-2340 URL: https://issues.apache.org/jira/browse/TRINIDAD-2340 Project: MyFaces Trinidad Issue Type: Bug Components: Infrastructure Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Fix For: 2.0.2-core Attachments: trinidad-2340.patch The LocaleElementsResourceLoader static initializer attempts to derive a locale elements library uri: static private final ResourceLoader[] _ResourceLoaders = { new ClassLoaderResourceLoader(), new TrTranslationsResourceLoader(CoreRenderKitResourceLoader.getLocaleElementsURI(Translations, false)) }; The call to getLocaleElementsURI() ends up calling CoreRenderKitResourceLoader.getLocale(), which in turn does the following: static public String getLocale() { String path = ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getPathInfo(); String locStr = ; int locIndex = path.indexOf(LocaleElements)+ LocaleElements_.length(); int index = path.indexOf(_VERSION); if (index 0) index = path.indexOf(.js); if(index = 0) locStr = path.substring(locIndex, index); return locStr; } Note that this code assumes that the request path returned from getPathInfo() corresponds to a LocaleElements library request. While this true during normal resource request processing (ie. when ResourceLoader.getResource() is called), this is not necessarily true when called from the LocaleElementsResourceLoader static initializer. Depending on when the LocaleElementsResourceLoader is initialized, a call to getLocale() can result in: 1. A NullPointerException, if the FacesContext is not available, or if getRequest() happens to return null. 2. A StringIndexOutOfBoundsException from the substring() call, if the request path happens to be short. 3. A garbage return value, if one of the above two exceptions are not thrown. As such, it is not safe for LocaleElementsResourceLoader to call into getLocaleElementsURI() from its static initializer. Although this seems like a trivial issue, I specified the priority as major as we are seeing #2 in production environments. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2340) LocaleElementsResourceLoader init dependency on request path
Andy Schwartz created TRINIDAD-2340: --- Summary: LocaleElementsResourceLoader init dependency on request path Key: TRINIDAD-2340 URL: https://issues.apache.org/jira/browse/TRINIDAD-2340 Project: MyFaces Trinidad Issue Type: Bug Components: Infrastructure Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz The LocaleElementsResourceLoader static initializer attempts to derive a locale elements library uri: static private final ResourceLoader[] _ResourceLoaders = { new ClassLoaderResourceLoader(), new TrTranslationsResourceLoader(CoreRenderKitResourceLoader.getLocaleElementsURI(Translations, false)) }; The call to getLocaleElementsURI() ends up calling CoreRenderKitResourceLoader.getLocale(), which in turn does the following: static public String getLocale() { String path = ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getPathInfo(); String locStr = ; int locIndex = path.indexOf(LocaleElements)+ LocaleElements_.length(); int index = path.indexOf(_VERSION); if (index 0) index = path.indexOf(.js); if(index = 0) locStr = path.substring(locIndex, index); return locStr; } Note that this code assumes that the request path returned from getPathInfo() corresponds to a LocaleElements library request. While this true during normal resource request processing (ie. when ResourceLoader.getResource() is called), this is not necessarily true when called from the LocaleElementsResourceLoader static initializer. Depending on when the LocaleElementsResourceLoader is initialized, a call to getLocale() can result in: 1. A NullPointerException, if the FacesContext is not available, or if getRequest() happens to return null. 2. A StringIndexOutOfBoundsException from the substring() call, if the request path happens to be short. 3. A garbage return value, if one of the above two exceptions are not thrown. As such, it is not safe for LocaleElementsResourceLoader to call into getLocaleElementsURI() from its static initializer. Although this seems like a trivial issue, I specified the priority as major as we are seeing #2 in production environments. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2340) LocaleElementsResourceLoader init dependency on request path
[ https://issues.apache.org/jira/browse/TRINIDAD-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13501415#comment-13501415 ] Andy Schwartz commented on TRINIDAD-2340: - The attached patch: https://issues.apache.org/jira/secure/attachment/12554395/trinidad-2340.patch Fixes the issue by removing the unnecessary call to getLocaleElementsURI(). It also adds a test case that verifies that the CoreRenderKitResourceLoader (and thus the LocaleElementsResourceLoader) can be constructed without access to a FacesContext. LocaleElementsResourceLoader init dependency on request path Key: TRINIDAD-2340 URL: https://issues.apache.org/jira/browse/TRINIDAD-2340 Project: MyFaces Trinidad Issue Type: Bug Components: Infrastructure Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2340.patch The LocaleElementsResourceLoader static initializer attempts to derive a locale elements library uri: static private final ResourceLoader[] _ResourceLoaders = { new ClassLoaderResourceLoader(), new TrTranslationsResourceLoader(CoreRenderKitResourceLoader.getLocaleElementsURI(Translations, false)) }; The call to getLocaleElementsURI() ends up calling CoreRenderKitResourceLoader.getLocale(), which in turn does the following: static public String getLocale() { String path = ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getPathInfo(); String locStr = ; int locIndex = path.indexOf(LocaleElements)+ LocaleElements_.length(); int index = path.indexOf(_VERSION); if (index 0) index = path.indexOf(.js); if(index = 0) locStr = path.substring(locIndex, index); return locStr; } Note that this code assumes that the request path returned from getPathInfo() corresponds to a LocaleElements library request. While this true during normal resource request processing (ie. when ResourceLoader.getResource() is called), this is not necessarily true when called from the LocaleElementsResourceLoader static initializer. Depending on when the LocaleElementsResourceLoader is initialized, a call to getLocale() can result in: 1. A NullPointerException, if the FacesContext is not available, or if getRequest() happens to return null. 2. A StringIndexOutOfBoundsException from the substring() call, if the request path happens to be short. 3. A garbage return value, if one of the above two exceptions are not thrown. As such, it is not safe for LocaleElementsResourceLoader to call into getLocaleElementsURI() from its static initializer. Although this seems like a trivial issue, I specified the priority as major as we are seeing #2 in production environments. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2340) LocaleElementsResourceLoader init dependency on request path
[ https://issues.apache.org/jira/browse/TRINIDAD-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2340: Status: Patch Available (was: Open) LocaleElementsResourceLoader init dependency on request path Key: TRINIDAD-2340 URL: https://issues.apache.org/jira/browse/TRINIDAD-2340 Project: MyFaces Trinidad Issue Type: Bug Components: Infrastructure Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2340.patch The LocaleElementsResourceLoader static initializer attempts to derive a locale elements library uri: static private final ResourceLoader[] _ResourceLoaders = { new ClassLoaderResourceLoader(), new TrTranslationsResourceLoader(CoreRenderKitResourceLoader.getLocaleElementsURI(Translations, false)) }; The call to getLocaleElementsURI() ends up calling CoreRenderKitResourceLoader.getLocale(), which in turn does the following: static public String getLocale() { String path = ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()).getPathInfo(); String locStr = ; int locIndex = path.indexOf(LocaleElements)+ LocaleElements_.length(); int index = path.indexOf(_VERSION); if (index 0) index = path.indexOf(.js); if(index = 0) locStr = path.substring(locIndex, index); return locStr; } Note that this code assumes that the request path returned from getPathInfo() corresponds to a LocaleElements library request. While this true during normal resource request processing (ie. when ResourceLoader.getResource() is called), this is not necessarily true when called from the LocaleElementsResourceLoader static initializer. Depending on when the LocaleElementsResourceLoader is initialized, a call to getLocale() can result in: 1. A NullPointerException, if the FacesContext is not available, or if getRequest() happens to return null. 2. A StringIndexOutOfBoundsException from the substring() call, if the request path happens to be short. 3. A garbage return value, if one of the above two exceptions are not thrown. As such, it is not safe for LocaleElementsResourceLoader to call into getLocaleElementsURI() from its static initializer. Although this seems like a trivial issue, I specified the priority as major as we are seeing #2 in production environments. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[Trinidad] Generate JDev unit test projects?
Gang - The mvn jdev:jdev plugin will only generate unit test .jpr files if it finds the following property in the project's pom.xml: properties jdev.project.has.teststrue/jdev.project.has.tests /properties We don't currently specify this property for the trinidad-api and trinidad-impl projects, which makes it difficult to run the unit tests in JDev (ie. need to manually hack the poms). Is there any reason why this property is not specified? Any objections to adding it? Andy
[jira] [Created] (TRINIDAD-2250) Skin pregeneration missing agent versions
Skin pregeneration missing agent versions - Key: TRINIDAD-2250 URL: https://issues.apache.org/jira/browse/TRINIDAD-2250 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.0.2-core Reporter: Andy Schwartz Assignee: Andy Schwartz In cases where skins specify overlapping version ranges, skin pregeneration may fail to generate certain style sheets. For example, imagine the skin specifies @agent rules for the following version ranges: 1. min-version:1 2. max:version:3 3. min-version:8 With our current implementation, we only attempt to generate style sheets for the start and end of each version range. For the above example, this would be: - 0 (start of #2) - 1 (start of #1 - 3 (end of #2) - 8 (start of #3) - Integer.MAX_VALUE (end of #1 and #3) If the actual agent version is 7, we should use a style sheet that matches #1, but not #2 or #3. However, we since we only use the start/end points of each version range to determine which style sheets to pregenerate, we fail to pregenerate such a style sheet. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2250) Skin pregeneration missing agent versions
[ https://issues.apache.org/jira/browse/TRINIDAD-2250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13236685#comment-13236685 ] Andy Schwartz commented on TRINIDAD-2250: - This patch: https://issues.apache.org/jira/secure/attachment/12519643/trinidad-2250.patch Solves the problem by adding two new methods to Version: + /** + * Converts this Version to the previous version just before this + * version. For example, new Version(1.9).toPreviousVersion() + * results in the version 1.8. + * + * The resulting version is guaranteed to be concrete - ie. + * will contain no wildcards. + * + * Calling toPreviousVersion() on Version.MIN_VERSION returns + * Version.MIN_VERSION. + * + * @return the Version instance corresponding to the version just + * before this version. + */ + public Version toPreviousVersion() + /** + * Converts this Version to the next version just after this + * version. For example, new Version(1.9).toPreviousVersion() + * results in the version 1.10. + * + * The resulting version is guaranteed to be concrete - ie. + * will contain no wildcards. + * + * Calling toNextVersion() on Version.MAX_VERSION returns + * Version.MAX_VERSION. + * + * @return the Version instance corresponding to the version just + * after this version. + */ + public Version toNextVersion() We use these to expand the set of agent versions that we pregenerate - ie. in addition to the start/end of each @agent version range, we also attempt to pregenerate: - The version just previous to the start of the range. - The version just after the end of the range. Looking back at the example above, this means that we would pregenerate for: - 0 (start of #2) - 1 (start of #1 - 3 (end of #2) - 4 (end.toNextVersion() of #2) - 7 (start.toPreviousVersion() of #3) - 8 (start of #3) - Integer.MAX_VALUE (end of #1 and #3) And thus cover the case where we match range #1 but not #2 or #3. Skin pregeneration missing agent versions - Key: TRINIDAD-2250 URL: https://issues.apache.org/jira/browse/TRINIDAD-2250 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.0.2-core Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2250.patch In cases where skins specify overlapping version ranges, skin pregeneration may fail to generate certain style sheets. For example, imagine the skin specifies @agent rules for the following version ranges: 1. min-version:1 2. max:version:3 3. min-version:8 With our current implementation, we only attempt to generate style sheets for the start and end of each version range. For the above example, this would be: - 0 (start of #2) - 1 (start of #1 - 3 (end of #2) - 8 (start of #3) - Integer.MAX_VALUE (end of #1 and #3) If the actual agent version is 7, we should use a style sheet that matches #1, but not #2 or #3. However, we since we only use the start/end points of each version range to determine which style sheets to pregenerate, we fail to pregenerate such a style sheet. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2251) Invalid parameter in CANNOT_FIND_FILE message
Invalid parameter in CANNOT_FIND_FILE message - Key: TRINIDAD-2251 URL: https://issues.apache.org/jira/browse/TRINIDAD-2251 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.0.1-core Reporter: Andy Schwartz Priority: Minor The trinidad-impl LoggerBundle.xrts defines the following message: resource key=CANNOT_FIND_FILECould not find {1}/resource The substitution for {1} fails as this should be {0}. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2250) Skin pregeneration missing agent versions
[ https://issues.apache.org/jira/browse/TRINIDAD-2250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13236875#comment-13236875 ] Andy Schwartz commented on TRINIDAD-2250: - New version of the patch: https://issues.apache.org/jira/secure/attachment/12519683/trinidad-2250-take2.patch With code review changes recommended by Blake. Skin pregeneration missing agent versions - Key: TRINIDAD-2250 URL: https://issues.apache.org/jira/browse/TRINIDAD-2250 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.0.2-core Reporter: Andy Schwartz Assignee: Andy Schwartz Attachments: trinidad-2250-take2.patch, trinidad-2250.patch In cases where skins specify overlapping version ranges, skin pregeneration may fail to generate certain style sheets. For example, imagine the skin specifies @agent rules for the following version ranges: 1. min-version:1 2. max:version:3 3. min-version:8 With our current implementation, we only attempt to generate style sheets for the start and end of each version range. For the above example, this would be: - 0 (start of #2) - 1 (start of #1 - 3 (end of #2) - 8 (start of #3) - Integer.MAX_VALUE (end of #1 and #3) If the actual agent version is 7, we should use a style sheet that matches #1, but not #2 or #3. However, we since we only use the start/end points of each version range to determine which style sheets to pregenerate, we fail to pregenerate such a style sheet. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[Trinidad] [API] Version.toPreviousVersion()/toNextVersion()
Gang - As part of this bug fix: https://issues.apache.org/jira/browse/TRINIDAD-2250 I am planning to add two more new methods to org.apache.myfaces.trinidad.context.Version: + /** + * Converts this Version to the previous version just before this + * version. For example, new Version(1.9).toPreviousVersion() + * results in the version 1.8. + * + * The resulting version is guaranteed to be concrete - ie. + * will contain no wildcards. + * + * Calling toPreviousVersion() on Version.MIN_VERSION returns + * Version.MIN_VERSION. + * + * @return the Version instance corresponding to the version just + * before this version. + */ + public Version toPreviousVersion() + /** + * Converts this Version to the next version just after this + * version. For example, new Version(1.9).toPreviousVersion() + * results in the version 1.10. + * + * The resulting version is guaranteed to be concrete - ie. + * will contain no wildcards. + * + * Calling toNextVersion() on Version.MAX_VERSION returns + * Version.MAX_VERSION. + * + * @return the Version instance corresponding to the version just + * after this version. + */ + public Version toNextVersion() Nothing too exciting, but wanted to send out a heads up in case anyone has comments. Andy
[jira] [Commented] (TRINIDAD-2234) Pregeneration of skin style sheets
[ https://issues.apache.org/jira/browse/TRINIDAD-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13234788#comment-13234788 ] Andy Schwartz commented on TRINIDAD-2234: - One more rev: https://issues.apache.org/jira/secure/attachment/12519277/trinidad-skin-pregen-take4.patch This patch simplifies our configuration API by: - Enabling stable style sheet file names by default. And... - Only allowing stable names to be disabled via an internal context parameter. If we run into use cases where using the old non-stable names is critical, we can re-evaluate. Pregeneration of skin style sheets -- Key: TRINIDAD-2234 URL: https://issues.apache.org/jira/browse/TRINIDAD-2234 Project: MyFaces Trinidad Issue Type: New Feature Components: Skinning Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-skin-pregen-take2.patch, trinidad-skin-pregen-take3.patch, trinidad-skin-pregen-take4.patch, trinidad-skin-pregen.patch Trinidad skinning dynamically generates style sheets at runtime to meet context-specific (ie. platform/agent/locale/accessibility-specific) skinning requirements. While dynamic generation of style sheets is beneficial in that it allows fine tuning of which styles are delivered for particular contexts, it can complicate some use cases. One case that dynamic generation makes particularly difficult is where the application and its resources are split across separate hosts/domains. In this case, resources are typically hosted on a dedicated server that can be: a) Shared across multiple applications, thus improving the likelihood of browser cache hits. And... b) More easily fronted by a CDN (without also having to route all application traffic through a CDN ). Since a single skin definition can result in an arbitrary number of generated style sheets, it is not possible to host Trinidad skin/style sheets on a dedicated server - ie. there is currently no reliable way to pre-generate all possible variants of any given skin. This issue requests that we add a new skin pregeneration feature that would allow all style sheet variants for any skin to be generated prior to application deployment. This would facilitate the the split application/resources scenario described above. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [Trinidad] Skin pregeneration enhancements
Okay, one more update before I commit. Blake and Jeanne convinced me that my proposed stable naming context parameter: org.apache.myfaces.trinidad.STYLE_SHEET_NAMING_STRATEGY Is not necessary and that instead we should simply cut over to stable names by default and avoid polluting our configuration APIs. I have implemented this here: https://issues.apache.org/jira/secure/attachment/12519277/trinidad-skin-pregen-take4.patch It is still possible to revert to the old naming strategy via this internal context parameter: org.apache.myfaces.trinidadinternal.STYLE_SHEET_NAMING_STRATEGY But the goal is to be able to rip out our old style sheet naming code at some point. I still might want to revisit this decision (ie. before we roll out the next Trinidad release), though seems like a reasonable place to start. Should be committing all of this to the Trinidad trunk soon (finally)! Andy
[jira] [Commented] (TRINIDAD-2234) Pregeneration of skin style sheets
[ https://issues.apache.org/jira/browse/TRINIDAD-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13234875#comment-13234875 ] Andy Schwartz commented on TRINIDAD-2234: - Okay, one last patch: https://issues.apache.org/jira/secure/attachment/12519287/trinidad-skin-pregen-take5.patch This tweaks the view id from: /-pregenerate-skins to -tr-pregenerate-skins. The -tr prefix further reduces the potential for name collisions and also makes it clear(er) that this is a Trinidad service. Pregeneration of skin style sheets -- Key: TRINIDAD-2234 URL: https://issues.apache.org/jira/browse/TRINIDAD-2234 Project: MyFaces Trinidad Issue Type: New Feature Components: Skinning Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-skin-pregen-take2.patch, trinidad-skin-pregen-take3.patch, trinidad-skin-pregen-take4.patch, trinidad-skin-pregen-take5.patch, trinidad-skin-pregen.patch Trinidad skinning dynamically generates style sheets at runtime to meet context-specific (ie. platform/agent/locale/accessibility-specific) skinning requirements. While dynamic generation of style sheets is beneficial in that it allows fine tuning of which styles are delivered for particular contexts, it can complicate some use cases. One case that dynamic generation makes particularly difficult is where the application and its resources are split across separate hosts/domains. In this case, resources are typically hosted on a dedicated server that can be: a) Shared across multiple applications, thus improving the likelihood of browser cache hits. And... b) More easily fronted by a CDN (without also having to route all application traffic through a CDN ). Since a single skin definition can result in an arbitrary number of generated style sheets, it is not possible to host Trinidad skin/style sheets on a dedicated server - ie. there is currently no reliable way to pre-generate all possible variants of any given skin. This issue requests that we add a new skin pregeneration feature that would allow all style sheet variants for any skin to be generated prior to application deployment. This would facilitate the the split application/resources scenario described above. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2246) Skin pregeneration: verbose response output
Skin pregeneration: verbose response output --- Key: TRINIDAD-2246 URL: https://issues.apache.org/jira/browse/TRINIDAD-2246 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Currently when the skin pregeneration service completes successfully, it sends a small 200 response back to the client to indicate success. We should look at enhancing this response to include links to each of the generated style sheet files, since this will give (non-script) users a better sense of what work was performed. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2247) Skin pregeneration: provide style sheet name regular expression sample
Skin pregeneration: provide style sheet name regular expression sample -- Key: TRINIDAD-2247 URL: https://issues.apache.org/jira/browse/TRINIDAD-2247 Project: MyFaces Trinidad Issue Type: Task Components: Documentation Reporter: Andy Schwartz Assignee: Andy Schwartz In the new skin pregeneration section in the Skinning chapter of the dev guide, we discuss the fact that applications may need to write regular expressions that target generated style sheet file names. We should add a more explicit sample (including a sample regular expression) to make it clearer how this is done. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [Trinidad] Skin pregeneration enhancements
Hey All - Just wanted to send one more update... I have incorporated some feedback from Blake and Jeanne and have updated a new patch here: https://issues.apache.org/jira/secure/attachment/12519010/trinidad-skin-pregen-take3.patch Hoping to check in soon. Of course, if you have any comments/questions, please let me know! Andy
[jira] [Commented] (TRINIDAD-2234) Pregeneration of skin style sheets
[ https://issues.apache.org/jira/browse/TRINIDAD-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13229804#comment-13229804 ] Andy Schwartz commented on TRINIDAD-2234: - New feature complete patch: https://issues.apache.org/jira/secure/attachment/12518405/trinidad-skin-pregen-take2.patch Pregeneration of skin style sheets -- Key: TRINIDAD-2234 URL: https://issues.apache.org/jira/browse/TRINIDAD-2234 Project: MyFaces Trinidad Issue Type: New Feature Components: Skinning Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-skin-pregen-take2.patch, trinidad-skin-pregen.patch Trinidad skinning dynamically generates style sheets at runtime to meet context-specific (ie. platform/agent/locale/accessibility-specific) skinning requirements. While dynamic generation of style sheets is beneficial in that it allows fine tuning of which styles are delivered for particular contexts, it can complicate some use cases. One case that dynamic generation makes particularly difficult is where the application and its resources are split across separate hosts/domains. In this case, resources are typically hosted on a dedicated server that can be: a) Shared across multiple applications, thus improving the likelihood of browser cache hits. And... b) More easily fronted by a CDN (without also having to route all application traffic through a CDN ). Since a single skin definition can result in an arbitrary number of generated style sheets, it is not possible to host Trinidad skin/style sheets on a dedicated server - ie. there is currently no reliable way to pre-generate all possible variants of any given skin. This issue requests that we add a new skin pregeneration feature that would allow all style sheet variants for any skin to be generated prior to application deployment. This would facilitate the the split application/resources scenario described above. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [Trinidad] Skin pregeneration enhancements
Gang - I am getting closer to finishing this work. A new (feature-complete) patch is available here: https://issues.apache.org/jira/secure/attachment/12518405/trinidad-skin-pregen-take2.patch Some more details on the new APIs… The most interesting API is the uri structure for the skin pregeneration service/internal view. This is described in detail in the class doc for org.apache.myfaces.trinidadinternal.skin.pregen.SkinPregenerationService [1], but important enough that I'll inline the doc here: /** * InternalView implementation that provides skin pregeneration service. * * Skin pregeneration is enabled by specifying the following system * property: * * -Dorg.apache.myfaces.trinidad.SKIN_PREGENERATION_SERVICE=on * * When enabled, a request to the -pregenerate-skins view id can be * used to force pregeneration for specific skins. Each request must * specifiy a single id query parameter. The value of this query parameter * must be an id of one of the skins registered with trinidad (eg. via * an id element in a trinidad-skins.xml file). * * For example, in an application that uses prefix mapping for the FacesServlet, * enabling the skin pregeneration service exposes the following uri: * * - /context root/faces/-pregenerate-skins?id=minimal.desktop * * Which triggers pregeneration of style sheets for the minimal.desktop skin * when hit. * * By default, only style sheets for common variant values are generated. * In particular: * * - plaform: android | iphone | linux | macos | windows * - agent: ie | gecko | webkit * - locale: default (unmatched) locale * - reading direction: ltr * - accessibility: standard contrast, medium fonts * * The variants request parameter can be used to force generation of all * possible variants, eg: * *- /context root/faces/-pregenerate-skins?id=minimal.desktop?variants=all * * The following optional request parameters may also be used to provide contextual * information about how the pregeneration should be performed: * * - containerType: servlet | portlet. (Defaults to servlet.) * - requestType: nonsecure | secure. (Defaults to nonsecure.) * - styleClassType: compressed | uncompressed. (Defaults to compressed.) * * All of the contextual request parameters support multiple values. For example, * the following request: * * /-pregenerate-skins?id=minimal.desktopstyleClassType=compressedstyleClassType=uncompressed * * Pregenerates both servlet and portlet style sheets for the common variants of the the * minimal.desktop skin. * * By default, pregenerated style sheets are written into the web application's * style sheet cache directory (typically, tmpdir/adf/styles/cache). However, * a target directory for the pregenerated output can be specified via the * following system property: * * -Dorg.apache.myfaces.trinidad.SKIN_PREGENERATION_SERVICE_TARGET_DIRECTORY=directory path * * * Requests that result in successful skin pregeneration result in status 200 * responses. Failed requests (eg. for invalid skin ids) result in non-200 * status codes. * * For security purposes, pregeneration must never be enabled in end user facing, * production deployments - ie. skin pregeneration is CPU and I/O intensive, and * must not be exposed to arbitrary users. To avoid the potential for abuse, * enabling skin pregeneration has the side effect of disabling the rest of the * application. As such, applications that are enabled for skin pregeneration * can only be used for this single purpose. */ The other particularly interesting API is the new stable file name structure for generated style sheets. This is described in the class doc for StableNameUtils [2], and reproduced here: /** * This class serves one purpose: it provides a replacement for NameUtils.getContextName() * that produces stable file names. This ensures that generated style sheets will be * named in a consistent manner that is not dependent on the order in which requests arrives. * * With NameUtils.getContextName(), a skin that contains the following locale-specific * definition: * * @locale ja, cz, ko { ... } * * May share a generated .css file across Japanese, Chinese and Korean end users. The name * of this generated style sheet depends on which locale is specified when the style sheet is * first generated. For example, if the style sheet is generated in response from a request * for a Korean-locale user, the file name will include the ko locale token. This file * will then be shared by Japanese, Chinese and Korean end users. However, if the server is * subsequently bounced and the first post-bounce request is from a Japanese end user, the file * will be re-generated with the ja token. * * As a result of this behavior, file names are not predictable across runs. The lack of * stable file names makes it difficult/impossible to support use cases where we want to * share generated style sheets across applications - eg. by
[jira] [Commented] (TRINIDAD-2234) Pregeneration of skin style sheets
[ https://issues.apache.org/jira/browse/TRINIDAD-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13225490#comment-13225490 ] Andy Schwartz commented on TRINIDAD-2234: - I have implemented a solution that exposes a skin pregeneration service via an internal view. Requests into this internal view cause skin pregeneration to kick in. The new API is fairly small: - A couple of system properties for enabling this service. - The internal view name. - Request parameters for tweaking pregeneration behavior. I will upload a patch shortly and provide more details on the design/implementation. Pregeneration of skin style sheets -- Key: TRINIDAD-2234 URL: https://issues.apache.org/jira/browse/TRINIDAD-2234 Project: MyFaces Trinidad Issue Type: New Feature Components: Skinning Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Trinidad skinning dynamically generates style sheets at runtime to meet context-specific (ie. platform/agent/locale/accessibility-specific) skinning requirements. While dynamic generation of style sheets is beneficial in that it allows fine tuning of which styles are delivered for particular contexts, it can complicate some use cases. One case that dynamic generation makes particularly difficult is where the application and its resources are split across separate hosts/domains. In this case, resources are typically hosted on a dedicated server that can be: a) Shared across multiple applications, thus improving the likelihood of browser cache hits. And... b) More easily fronted by a CDN (without also having to route all application traffic through a CDN ). Since a single skin definition can result in an arbitrary number of generated style sheets, it is not possible to host Trinidad skin/style sheets on a dedicated server - ie. there is currently no reliable way to pre-generate all possible variants of any given skin. This issue requests that we add a new skin pregeneration feature that would allow all style sheet variants for any skin to be generated prior to application deployment. This would facilitate the the split application/resources scenario described above. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2234) Pregeneration of skin style sheets
[ https://issues.apache.org/jira/browse/TRINIDAD-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13225499#comment-13225499 ] Andy Schwartz commented on TRINIDAD-2234: - The attached patch: https://issues.apache.org/jira/secure/attachment/12517604/trinidad-skin-pregen.patch Provides a solution for both this issue as well as for: TRINIDAD-2235 Skinning: stable names for generated style sheets Still more work to do (mostly code cleanup) but very close to fully functional. The class doc for SkinPregenerationService provides most of the API details: /** * InternalView implementation that provides skin pregeneration service. * * Skin pregeneration is enabled by specifying the following system * property: * * -Dorg.apache.myfaces.trinidad.SKIN_PREGENERATION_SERVICE=on * * When enabled, a request to the -pregenerate-skins view id can be * used to force pregeneration for specific skins. Each request must * specifiy a single id query parameter. The value of this query parameter * must be an id of one of the skins registered with trinidad (eg. via * an id element in a trinidad-skins.xml file). * * For example, in an application that uses prefix mapping for the FacesServlet, * enabling the skin pregeneration service exposes the following uri: * * - /context root/faces/-pregenerate-skins?id=minimal.desktop * * Which triggers pregeneration of style sheets for the minimal.desktop skin * when hit. * * By default, only style sheets for common variant values are generated. * In particular: * * - plaform: android | iphone | linux | macos | windows * - agent: ie | gecko | webkit * - locale: default (unmatched) locale * - reading direction: ltr * - accessibility: standard contrast, medium fonts * * The variants request parameter can be used to force generation of all * possible variants, eg: * *- /context root/faces/-pregenerate-skins?id=minimal.desktop?variants=all * * The following optional request parameters may also be used to provide contextual * information about how the pregeneration should be performed: * * - containerType: servlet | portlet. (Defaults to servlet.) * - requestType: nonsecure | secure. (Defaults to nonsecure.) * - styleClassType: compressed | uncompressed. (Defaults to compressed.) * * All of the contextual request parameters support multiple values. For example, * the following request: * * /-pregenerate-skins?id=minimal.desktopstyleClassType=compressedstyleClassType=uncompressed * * Pregenerates both servlet and portlet style sheets for the common variants of the the * minimal.desktop skin. * * By default, pregenerated style sheets are written into the web application's * style sheet cache directory (typically, tmpdir/adf/styles/cache). However, * a target directory for the pregenerated output can be specified via the * following system property: * * -Dorg.apache.myfaces.trinidad.SKIN_PREGENERATION_SERVICE_TARGET_DIRECTORY=directory path * * * Requests that result in successful skin pregeneration result in status 200 * responses. Failed requests (eg. for invalid skin ids) result in non-200 * status codes. * * For security purposes, pregeneration must never be enabled in end user facing, * production deployments - ie. skin pregeneration is CPU and I/O intensive, and * must not be exposed to arbitrary users. To avoid the potential for abuse, * enabling skin pregeneration has the side effect of disabling the rest of the * application. As such, applications that are enabled for skin pregeneration * can only be used for this single purpose. */ There are some other minor new APIs, including: - Stable names APIs (see TRINIDAD-2235) - A new enums-related utility class: org.apache.myfaces.trinidad.util.Enums. - A couple of minor additions to org.apache.myfaces.trinidad.context.Version (toConcreteVersion(), MAX/MIN_VERSION constants). Also: - Fixed up Version.compareTo to properly handle numeric version comparisons. (Before this, new Version(10).compareTo(new Version9) would return 0.) - Started adding some skin-related test infrastructure. (More to do on this.) Pregeneration of skin style sheets -- Key: TRINIDAD-2234 URL: https://issues.apache.org/jira/browse/TRINIDAD-2234 Project: MyFaces Trinidad Issue Type: New Feature Components: Skinning Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Attachments: trinidad-skin-pregen.patch Trinidad skinning dynamically generates style sheets at runtime to meet context-specific (ie. platform/agent/locale/accessibility-specific) skinning requirements. While dynamic generation of style sheets is beneficial in that it allows fine tuning
[jira] [Commented] (TRINIDAD-2235) Skinning: stable names for generated style sheets
[ https://issues.apache.org/jira/browse/TRINIDAD-2235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13225507#comment-13225507 ] Andy Schwartz commented on TRINIDAD-2235: - The patch for TRINIDAD-2234: https://issues.apache.org/jira/secure/attachment/12517604/trinidad-skin-pregen.patch Provides the solution for this issue as well. The javadoc for the new StableNameUtils class describes this solution: /** * This class serves one purpose: it provides a replacement for NameUtils.getContextName() * that produces stable file names. This ensures that generated style sheets will be * named in a consistent manner that is not dependent on the order in which requests arrives. * * With NameUtils.getContextName(), a skin that contains the following locale-specific * definition: * * @locale ja, cz, ko { ... } * * May share a generated .css file across Japanese, Chinese and Korean end users. The name * of this generated style sheet depends on which locale is specified when the style sheet is * first generated. For example, if the style sheet is generated in response from a request * for a Korean-locale user, the file name will include the ko locale token. This file * will then be shared by Japanese, Chinese and Korean end users. However, if the server is * subsequently bounced and the first post-bounce request is from a Japanese end user, the file * will be re-generated with the ja token. * * As a result of this behavior, file names are not predictable across runs. The lack of * stable file names makes it difficult/impossible to support use cases where we want to * share generated style sheets across applications - eg. by pregenerating style sheets * and deploying them to some common server (or a CDN). * * StableNameUtils.getContextName() solves this problem by producing names for generated * style sheet files that are not dependent on request ordering. * * The file names produced by StableNameUtils.getContextName() are broken up into three * major sections: * * 1. The skin identifier. * 2. Variant identifiers (eg. agent, locale, etc...) * 3. Contextual identifiers (eg. portlet vs. servlet) * * These major sections are separated by double dashes (--). * * Within each major section, minor subsections appear in a predictable order, separated * by single dashs (-). * * The skin identifier section (section #1) contains the following subsections: * * id-hash * * Where: * * - id: the skin id. Note that the skin id itself may include dash characters * (eg. simple-desktop). * - hash: a hash of the skin contents * * The variant identifiers section (section #2) contains the following subsections: * * platform-agent-version-locale-direction-accessibility * * Where: * * - platform: the platform name (eg. linux, windows, iphone) * - agent: the agent name (eg. ie, gecko, safari) * - version: the agent version (eg. 7, 1.9.2, 534) * - locale: the locale (eg. en, en_US, ja). * - direction: the reading direction (ltr|rtl) * - accessibility: accessibility profile preferences (hc|lf|hclf for high contrast| * large fonts|high contrast + large fonts). * * These fields all support two additional values: * * - Default: in the event that no @-rule variant is expicitly matched, only default styles *(ie. styles that apply to all requests) are included in the generated style sheet. * The token d is used to identify this case. For example, if the skin does not * define any @locale rules, the locale portion of the file name will be d. * * - Multiple: In some cases it is not possible to determine a unique value * for a particular variant, because only @-rules that specify multiple values * are matched. The token x is used to identify such cases. For example, if the * skin defines a single @locale rule matching the ja, cz, and ko locales, the * locale portion of the file name for generated style sheets corresponding to these * locales will be x. * * The contextual identifiers section (section #3) contains the following subsections: * * - container type: identifies whether the application is hosted within a servlet or * portlet (s|p). * - request type: identifies whether the style sheet is used for a secure or non-secure * request (s|n). * - style class type: identifies whether the style sheet is generated with compressed or * uncompressed style classes (c|u). * * In case where skins are pregenerated and shared across applications, it may be necessary * to write regular expressions against the above format in order to rewrite style sheet * uris to point to some other host. When doing so, the following recommendations should * be observed: * * - The identifier section contains a variable number of subsection separators: skin * ids may contain dashes
[Trinidad] Skin pregeneration enhancements
Gang - Just wanted to send out a heads up that I am working on a couple of Trinidad skinning enhancements: TRINIDAD-2234 Pregeneration of skin style sheets TRINIDAD-2235 Skinning: stable names for generated style sheets The goal is to add support for pregenerating Trinidad skin style sheet files, which currently must be generated dynamically at runtime. Dynamic generation imposes some restrictions that I would like to remove - eg. it requires session affinity (requests for dynamically generated .css files must be routed back to the same origin server) and limits our ability to share .css files across applications. The above two issues/enhancements will allow these normally dynamic resources to be pregenerated and hosted along with other static resources on a static server/CDN, thus avoiding the need for session affinity and promoting cross-application resource sharing. I have a mostly complete solution ready: https://issues.apache.org/jira/secure/attachment/12517604/trinidad-skin-pregen.patch But will be doing some additional polish/clean up work on this branch: https://svn.apache.org/repos/asf/myfaces/trinidad/branches/andys-skin-pregen This does involve adding some new Trinidad APIs (mainly, a pregeneration service uri and accompanying configuration properties), so interested in feedback if you have it. Full details can be found in the issue tracker. Andy
[jira] [Created] (TRINIDAD-2234) Pregeneration of skin style sheets
Pregeneration of skin style sheets -- Key: TRINIDAD-2234 URL: https://issues.apache.org/jira/browse/TRINIDAD-2234 Project: MyFaces Trinidad Issue Type: New Feature Components: Skinning Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Trinidad skinning dynamically generates style sheets at runtime to meet context-specific (ie. platform/agent/locale/accessibility-specific) skinning requirements. While dynamic generation of style sheets is beneficial in that it allows fine tuning of which styles are delivered for particular contexts, it can complicate some use cases. One case that dynamic generation makes particularly difficult is where the application and its resources are split across separate hosts/domains. In this case, resources are typically hosted on a dedicated server that can be: a) Shared across multiple applications, thus improving the likelihood of browser cache hits. And... b) More easily fronted by a CDN (without also having to route all application traffic through a CDN ). Since a single skin definition can result in an arbitrary number of generated style sheets, it is not possible to host Trinidad skin/style sheets on a dedicated server - ie. there is currently no reliable way to pre-generate all possible variants of any given skin. This issue requests that we add a new skin pregeneration feature that would allow all style sheet variants for any skin to be generated prior to application deployment. This would facilitate the the split application/resources scenario described above. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2235) Skinning: stable names for generated style sheets
Skinning: stable names for generated style sheets - Key: TRINIDAD-2235 URL: https://issues.apache.org/jira/browse/TRINIDAD-2235 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor For this recently logged Trinidad issue: TRINIDAD-2234 Pregeneration of skin style sheets We plan to add a skin pregeneration feature in order to support cases where skin style sheets are hosted on a separate host/domain (eg. CDN use cases). One issue with this is that the names of the generated style sheet files are not produced in a stable manner. For example, a skin that contains the following locale-specific definition: @locale ja, cz, ko { ... } May share a generated .css file across Japanese, Chinese and Korean end users. The name of this generated style sheet depends on which locale is specified when the style sheet is first generated. If the style sheet is generated in response from a request for a Korean-locale user, the file name will include the ko locale token. This file will then be shared by Japanese, Chinese and Korean end users. However, if the server is subsequently bounced and the first post-bounce request is from a Japanese end user, the file will be re-generated with the ja token. As a result of this behavior, file names are not predictable across runs. This lack of predictability makes it difficult to determine which variants of style sheets should be pregenerated. In the above example, although ja/cz/ko users could/should share a single generated style sheet, we would need to pregenerate 3 style sheets just to be sure that we can handle all possible request orderings. However: a) This will result in an explosion of generated style sheets. And... b) This does not work well for range-based variants, such as agent versions. A better solution would be to enhance the way that Trinidad skinning derives names for generated style sheets. Trinidad skinning should provide a solution where style sheet names are produced in a predictable, stable, repeatable (after a server bounce) way. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2234) Pregeneration of skin style sheets
[ https://issues.apache.org/jira/browse/TRINIDAD-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13223299#comment-13223299 ] Andy Schwartz commented on TRINIDAD-2234: - Note that this issue: TRINIDAD-2235 Skinning: stable names for generated style sheets Is a pre-requisite for any skin pregeneration solution. Without stable names for generated style sheets, it won't be possible for Trinidad applications to route style sheet requests hosted/pregenerated style sheets since the file names would not necessarily align. Pregeneration of skin style sheets -- Key: TRINIDAD-2234 URL: https://issues.apache.org/jira/browse/TRINIDAD-2234 Project: MyFaces Trinidad Issue Type: New Feature Components: Skinning Affects Versions: 2.0.1-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Trinidad skinning dynamically generates style sheets at runtime to meet context-specific (ie. platform/agent/locale/accessibility-specific) skinning requirements. While dynamic generation of style sheets is beneficial in that it allows fine tuning of which styles are delivered for particular contexts, it can complicate some use cases. One case that dynamic generation makes particularly difficult is where the application and its resources are split across separate hosts/domains. In this case, resources are typically hosted on a dedicated server that can be: a) Shared across multiple applications, thus improving the likelihood of browser cache hits. And... b) More easily fronted by a CDN (without also having to route all application traffic through a CDN ). Since a single skin definition can result in an arbitrary number of generated style sheets, it is not possible to host Trinidad skin/style sheets on a dedicated server - ie. there is currently no reliable way to pre-generate all possible variants of any given skin. This issue requests that we add a new skin pregeneration feature that would allow all style sheet variants for any skin to be generated prior to application deployment. This would facilitate the the split application/resources scenario described above. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TRINIDAD-2236) Avoid warning for background-image: -webkit-gradient
Avoid warning for background-image: -webkit-gradient Key: TRINIDAD-2236 URL: https://issues.apache.org/jira/browse/TRINIDAD-2236 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Trivial For this earlier Trinidad issue: TRINIDAD-2193 Add CSS3 gradients validation support We suppressed warnings for cases where the background-image property is set to various gradient values. However, we missed one: -webkit-gradient -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2236) Avoid warning for background-image: -webkit-gradient
[ https://issues.apache.org/jira/browse/TRINIDAD-2236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2236: Status: Patch Available (was: Open) Avoid warning for background-image: -webkit-gradient Key: TRINIDAD-2236 URL: https://issues.apache.org/jira/browse/TRINIDAD-2236 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Trivial Attachments: trinidad-2236.patch For this earlier Trinidad issue: TRINIDAD-2193 Add CSS3 gradients validation support We suppressed warnings for cases where the background-image property is set to various gradient values. However, we missed one: -webkit-gradient -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2236) Avoid warning for background-image: -webkit-gradient
[ https://issues.apache.org/jira/browse/TRINIDAD-2236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz updated TRINIDAD-2236: Resolution: Fixed Status: Resolved (was: Patch Available) Avoid warning for background-image: -webkit-gradient Key: TRINIDAD-2236 URL: https://issues.apache.org/jira/browse/TRINIDAD-2236 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Trivial Attachments: trinidad-2236.patch For this earlier Trinidad issue: TRINIDAD-2193 Add CSS3 gradients validation support We suppressed warnings for cases where the background-image property is set to various gradient values. However, we missed one: -webkit-gradient -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: Build failed in Jenkins: Trinidad Core 2.0.x (sanity) #677
Any thoughts on why we are seeing this failure? The cause seems to be a missing pom: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.myfaces.trinidadbuild:maven-xrts-plugin:pom:2.0.8-SNAPSHOT Though I see the pom here: https://repository.apache.org/service/local/repositories/snapshots/content/org/apache/myfaces/trinidadbuild/maven-xrts-plugin/2.0.8-SNAPSHOT/maven-xrts-plugin-2.0.8-20120229.184311-5.pom Of course, my one line change for TRINIDAD-2236 didn't touch any pom files. Andy
Re: [VOTE] Trinidad 2.0.1 (try 2)
+1. Thanks for putting this together Scott. Andy On Feb 24, 2012, at 12:30 PM, Scott O'Bryan darkar...@gmail.com wrote: Hi Everyone, I was running the tasks needed to get the Trinidad 2.0.1 release out and now I need a vote as to whether everything looks good or not. I have committed most of the most recent submitted patches and things look to be fairly stable. There are a few patches outstanding, but I wanted to put those into trunk so that they can get some more testing. This is a very big release with many bug fixes and quite a few fixes to support the MyFaces checkstyle audits. You will notice the absence of the component showcase example module. It was decided to remove this module because it contains code brought in by Maven which is NOT under the Apache license. The component showcase *IS* available by building the source manually. The last vote was vetoed because some files were missing licenses and there were some references to external repositories. The new staging repositories contain fixes for all of these issues including an enhancement to the base POM file which will automatically run the rat verifications at build to prevent the licensing issues in the future. At this time, I would like to ask for a vote, once again, on this release. All of the following should be ready for review: * The generated repository and assembly artifacts [1] * The generated source archive [2] * The updated svn repository [3] Please review the artifacts and vote according to the following: [ ] +1 for community members who have reviewed the bits [ ] +0 [ ] -1 for fatal flaws that should cause these bits not to be released, and why.. This vote will remain open for at least 72 hours. Thanks, Scott O'Bryan [1] https://repository.apache.org/content/repositories/orgapachemyfaces-067 [2] https://repository.apache.org/content/repositories/orgapachemyfaces-067/org/apache/myfaces/trinidad/trinidad/2.0.1/trinidad-2.0.1-source-release.zip [3] https://svn.apache.org/repos/asf/myfaces/trinidad/tags/trinidad-2.0.1/
Re: [VOTE] Release of Trinidad 2.0.1
+1 Andy On Feb 22, 2012, at 12:18 AM, Scott O'Bryan darkar...@gmail.com wrote: Hi Everyone, I was running the tasks needed to get the Trinidad 2.0.1 release out and now I need a vote as to whether everything looks good or not. I have committed most of the most recent submitted patches and things look to be fairly stable. There are a few patches outstanding, but I wanted to put those into trunk so that they can get some more testing. This is a very big release with many bug fixes and quite a few fixes to support the MyFaces checkstyle audits. You will notice the absence of the component showcase example module. It was decided to remove this module because it contains code brought in by Maven which is NOT under the Apache license. The component showcase *IS* available by building the source manually. At this time, I would like to ask for a vote on this release. All of the following should be ready for review: * The generated repository and assembly artifacts [1] * The generated source archive [2] * The updated svn repository [3] Please review the artifacts and vote according to the following: [ ] +1 for community members who have reviewed the bits [ ] +0 [ ] -1 for fatal flaws that should cause these bits not to be released, and why.. This vote will remain open for at least 72 hours. Thanks, Scott O'Bryan [1] https://repository.apache.org/content/repositories/orgapachemyfaces-005/ [2] https://repository.apache.org/content/repositories/orgapachemyfaces-005/org/apache/myfaces/trinidad/trinidad/2.0.1/trinidad-2.0.1-source-release.zip [3] https://svn.apache.org/repos/asf/myfaces/trinidad/tags/trinidad-2.0.1/
[jira] [Resolved] (TRINIDAD-2215) String - Accessibility enum API
[ https://issues.apache.org/jira/browse/TRINIDAD-2215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Schwartz resolved TRINIDAD-2215. - Resolution: Fixed Fix Version/s: 2.0.2-core Added Accessibility.displayName() and Accessibility.valueOfDisplayName() APIs in r1244522. String - Accessibility enum API Key: TRINIDAD-2215 URL: https://issues.apache.org/jira/browse/TRINIDAD-2215 Project: MyFaces Trinidad Issue Type: Improvement Affects Versions: 2.0.0-core Reporter: Andy Schwartz Assignee: Andy Schwartz Priority: Minor Fix For: 2.0.2-core Attachments: trinidad-2215-take2.patch, trinidad-2215.patch The RequestContext.Accessibility enum defines aliases/pretty names for the enum constants: public enum Accessibility { /** * Output supports accessibility features */ DEFAULT(default), /** * Accessibility-specific constructs are stripped out to optimize output size */ INACCESSIBLE(inaccessible), /** * Accessibility-specific constructs are added to improve behavior under a screen reader * (but may affect other users negatively) */ SCREEN_READER(screenReader); Accessibility(String name) { _name = name; } @Override public String toString() { return _name; } private final String _name; }; I have several places in my code where I need to translate from the pretty name/alias (eg. screenReader), back to the corresponding enum constant. Enum.valueOf() is useless for this, since this only honors the canonical enum constant names (eg. SCREEN_READER). I would like an API that performs the equivalent functionality of Enum.valueOf(), but for the pretty names/aliases. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [Trinidad] RequestContext.Accessibility.valueOfAlias() API
Thanks for the comments guys. On Mon, Feb 13, 2012 at 11:51 PM, Blake Sullivan blake.sulli...@oracle.com wrote: Overloaded how? The other question is that we want to be able to go from the displayName-Enum Actually, this is the only question. :-) We've already got an accessor - the Accessibility enum overrides toString() to return the display name/pretty name/alias that gets passed in when the constant is created. What I need is a way to map back from the toString() value to the corresponding enum constant. For this, we should follow the pattern set by Enum.valueOf(). So, we'll want something like: Accessibility.valueOfTheStringThatGetsReturnedFromToStringNotTheEnumConstantName() But shorter. Maybe: - valueOfDisplayName()? Or... - valueOfAlias()? Whatever name we come up with, I will: - Update the name of the Accessibility enum constant constructor argument to match. - Add javadoc to toString() that clarifies that it returns the display name/alias/whatever we call it. Andy
Re: [Trinidad] RequestContext.Accessibility.valueOfAlias() API
On Tue, Feb 14, 2012 at 11:33 AM, Blake Sullivan blake.sulli...@oracle.com wrote: I would go with valueOfDisplayName(). I would actually add a displayName() as well, just like we have name(). Sounds good, will do. I am not a fan of assuming that toString() == displayName() Er... two options here: 1. Leave toString() documentation/contract intentionally vague. 2. Document the current behavior (toString() == displayName()) as the spec'ed/required behavior. I was leaning towards #2 since folks out there might be relying on the existing toString() behavior - ie. we could enshrine this as required behavior in our contract. Do you prefer #1? Andy
Re: [Trinidad] RequestContext.Accessibility.valueOfAlias() API
On Tue, Feb 14, 2012 at 12:57 PM, Blake Sullivan blake.sulli...@oracle.com wrote: It is actually the second of these, so everything is good. Yep. If it were the first, I wouldn't need my bonus valueOfx method. In any case, new version of the patch uploaded here: https://issues.apache.org/jira/secure/attachment/12514512/trinidad-2215-take2.patch I'll commit soon unless anyone objects. Andy
Re: [Trinidad] RequestContext.Accessibility.valueOfAlias() API
On Tue, Feb 14, 2012 at 12:51 PM, Blake Sullivan blake.sulli...@oracle.com wrote: I prefer #1. If the caller really cares about what she gets, she can call the explicit method. Sounds reasonable. Will leave toString() behavior undocumented. Andy
[jira] [Created] (TRINIDAD-2215) String - Accessibility enum API
String - Accessibility enum API Key: TRINIDAD-2215 URL: https://issues.apache.org/jira/browse/TRINIDAD-2215 Project: MyFaces Trinidad Issue Type: Improvement Affects Versions: 2.0.0-core Reporter: Andy Schwartz Priority: Minor The RequestContext.Accessibility enum defines aliases/pretty names for the enum constants: public enum Accessibility { /** * Output supports accessibility features */ DEFAULT(default), /** * Accessibility-specific constructs are stripped out to optimize output size */ INACCESSIBLE(inaccessible), /** * Accessibility-specific constructs are added to improve behavior under a screen reader * (but may affect other users negatively) */ SCREEN_READER(screenReader); Accessibility(String name) { _name = name; } @Override public String toString() { return _name; } private final String _name; }; I have several places in my code where I need to translate from the pretty name/alias (eg. screenReader), back to the corresponding enum constant. Enum.valueOf() is useless for this, since this only honors the canonical enum constant names (eg. SCREEN_READER). I would like an API that performs the equivalent functionality of Enum.valueOf(), but for the pretty names/aliases. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira