13 Replies Latest reply on May 30, 2007 8:32 PM by Grant

    error changing theme when logged in as admin in 2.6cr2

    Grant Newbie

      The following error displays in the log when trying to change the theme in the admin module for the default portal. A javascript error also gets thrown. you can change from renaissence to maple in the combo box but it comes back renaissence.
      Windows XP
      MS SQL 2000
      base portal no changes.

      14:07:29,307 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jstl-fn.ta
      glib.xml
      14:07:29,338 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jsf-html.t
      aglib.xml
      14:07:29,354 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28823portal-faces-lib.jar!/META-INF/portal.taglib.xml
      14:07:29,401 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jsf-ui.tag
      lib.xml
      14:07:29,416 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28821jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
      14:07:29,416 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28821jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
      14:07:29,479 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jstl-core.
      taglib.xml
      14:07:29,557 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28821jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
      14:07:29,557 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28821jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
      14:07:29,573 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28821jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
      14:07:29,573 ERROR [STDERR] May 8, 2007 2:07:29 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-portal-2.6-CR2/server/default/tmp/d
      eploy/tmp28843portal-wsrp.jse-contents/lib/jsf-facelets.jar!/META-INF/jsf-core.t
      aglib.xml
      14:07:30,354 INFO [MyfacesConfig] Tomahawk jar not available. Autoscrolling, De
      tectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.

        • 1. Re: error changing theme when logged in as admin in 2.6cr2
          Thomas Heute Master

          The errors are safe to ignore, Facelets is a bit noisy on the standard error output...

          But hte behavior you mention is not normal, i will test again.

          • 2. Re: error changing theme when logged in as admin in 2.6cr2
            Thomas Heute Master

            I cannot reproduce it with the latest from trunk

            • 3. Re: error changing theme when logged in as admin in 2.6cr2
              Andreas Wiesauer Newbie

              The same error happens to me. I'm using the latest trunk, AS 4.0.5 and MySQL as database.

              • 4. Re: error changing theme when logged in as admin in 2.6cr2
                Thomas Heute Master

                Could you please detail, what problem you are facing, and how i can reproduce it ?

                Thanks

                • 5. Re: error changing theme when logged in as admin in 2.6cr2
                  Andreas Wiesauer Newbie

                  Hello,

                  I did nothing special. As I said, I installed JBoss Portal from SVN (trunk) and I use a MYSQL database as datasource. I deployed with "build deploy" and after that I installed add-on (samples, admin, management portlets).

                  If I log in as admin and try to change the theme of the default portal, the drop-down list switches back to default theme and the theme is not changed (but there is no error message, the theme simply does not change). The same thing happens if I create a new user with admin role. The only theme I can change is the theme of my dashboard.

                  Thank you for your help!

                  Best regards,
                  Andy

                  • 6. Re: error changing theme when logged in as admin in 2.6cr2
                    Ricardo Harari Newbie

                    The same error happens to me.
                    It´s missing the fieldset tag in this file: /portal-admin.sar/portal-admin.war/WEB-INF/jsf/common/editTheme.xhtml

                     <h:form id="themeform">
                     <fieldset style="border: 1px solid;">
                     <legend>Theme properties</legend>
                    
                     <table>
                     .....
                     </table>
                    
                     </fieldset>
                    
                     <br />
                     <ui:insert name="form_submit"/>
                    </pre>
                    


                    • 7. Re: error changing theme when logged in as admin in 2.6cr2
                      Ricardo Harari Newbie

                      Sorry,

                      The fieldset will not fix the problem but if you move the commandbuttons from editPortalTheme.xhtml to this page (common/editTheme.xhtml) it will works with IE 6 and Firefox 1.5. This this page is used when you customize the theme of a Portal or Page. There is another one (editWindowTheme.xhtml) that is used when you customize the window theme.

                      Follows the complete source (worked for me) of editTheme.xhtml:

                      <div
                       xmlns="http://www.w3.org/1999/xhtml"
                       xmlns:ui="http://java.sun.com/jsf/facelets"
                       xmlns:h="http://java.sun.com/jsf/html"
                       xmlns:f="http://java.sun.com/jsf/core">
                      
                       <h:panelGroup styleClass="portlet-section-body" id="themepg">
                       <h:form id="themeform">
                       <table>
                       <tbody>
                       <tr>
                       <td class="portlet-form-field-label">
                       <h:outputLabel for="layout">Layout:</h:outputLabel>
                       </td>
                       <td>
                       <h:selectOneMenu id="layout" styleClass="portlet-form-field" value="#{themePropertyAction.layoutName}">
                       <f:selectItems value="#{applicationScope.LayoutService.layoutItems}"/>
                       </h:selectOneMenu>
                       </td>
                       </tr>
                       <tr>
                       <td class="portlet-form-field-label">
                       <h:outputLabel for="theme">Theme:</h:outputLabel>
                       </td>
                       <td>
                       <h:selectOneMenu id="theme" styleClass="portlet-form-field" value="#{themePropertyAction.themeName}">
                       <f:selectItems value="#{applicationScope.ThemeService.themeItems}"/>
                       </h:selectOneMenu>
                       </td>
                       </tr>
                       <tr>
                       <td class="portlet-form-field-label">
                       <h:outputLabel for="renderSet">RenderSet:</h:outputLabel>
                       </td>
                       <td>
                       <h:selectOneMenu id="renderSet" styleClass="portlet-form-field" value="#{themePropertyAction.renderSetName}">
                       <f:selectItems value="#{applicationScope.LayoutService.renderSetItems}"/>
                       </h:selectOneMenu>
                       </td>
                       </tr>
                      
                       <tr><td colspan="2">
                       <h:commandButton value="Update" action="#{themePropertyAction.execute}" styleClass="portlet-form-button"/>
                       <h:commandButton value="Cancel" action="#{portalobjectmgr.selectObject}" styleClass="portlet-form-button">
                       <f:param name="id" value="#{node.id}"/>
                       </h:commandButton>
                       </td></tr>
                      
                       </tbody>
                       </table>
                       <br />
                      
                       <!-- ui:insert name="form_submit"/ -->
                      
                       </h:form>
                      </h:panelGroup>
                      </div>
                      
                      


                      Do the same approach with editWindowTheme.xhtml.
                      The editWindowTheme.xhtml is working fine whith Firefox but not with IE. The main difference between them is the DIV just before ui:insert

                      Hope this help.


                      regards,

                      r.harari



                      • 8. Re: error changing theme when logged in as admin in 2.6cr2
                        Thomas Heute Master

                        Could you try on the SVN trunk ? This page has changed already

                        • 9. Re: error changing theme when logged in as admin in 2.6cr2
                          Andreas Wiesauer Newbie

                          I tried what rharari suggested on the latest trunk but that does not fix the error either (I tried with both Firefox 1.5 and Internet Explorer).

                          • 10. Re: error changing theme when logged in as admin in 2.6cr2
                            Ricardo Harari Newbie

                            Hi Andreas,

                            I´ve tried the last trunk and is still not working.
                            My environment:
                            - java version "1.6.0_01"
                            Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
                            Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
                            - JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)

                            Below is the HTML (trying to change portal theme):


                             ....
                             <!-- Content -->
                             <h3>Portal theme properties:</h3>
                             <p>The settings defined here will be applied to the whole portal including all the pages
                             and windows unless they have been assigned with different settings</p>
                             <br><div xmlns="http://www.w3.org/1999/xhtml">
                             <span id="themepg" class="portlet-section-body">
                            
                             <form id="themeform" name="themeform" method="post"
                             action="/portal/auth/portal/admin/default/AdminPortletWindow?org.apache.myfaces.portlet.MyFacesGenericPortlet.VIEW_ID=%2FWEB-INF%2Fjsf%2FeditPortalTheme.xhtml&action=1"
                             enctype="application/x-www-form-urlencoded">
                            
                             <table>
                             <tbody>
                             <tr>
                             <td class="portlet-form-field-label"><label for="themeform:layout">Layout:</label>
                             </td>
                             <td><select id="themeform:layout" name="themeform:layout" size="1" class="portlet-form-field">
                             <option value="1column">1column</option>
                             <option value="3columns">3columns</option>
                             <option value="generic" selected="selected">generic</option>
                             <option value="phalanx">phalanx</option>
                             <option value="nodesk">nodesk</option>
                             <option value="">default</option></select>
                             </td>
                             </tr>
                             <tr>
                             <td class="portlet-form-field-label"><label for="themeform:theme">Theme:</label>
                             </td>
                             <td><select id="themeform:theme" name="themeform:theme" size="1" class="portlet-form-field">
                             <option value="maple">maple</option>
                             <option value="renaissance" selected="selected">renaissance</option>
                             <option value="industrial">industrial</option>
                             <option value="mission-critical">mission-critical</option>
                             <option value="nphalanx">nphalanx</option>
                             <option value="">default</option></select>
                             </td>
                             </tr>
                             <tr>
                             <td class="portlet-form-field-label"><label for="themeform:renderSet">RenderSet:</label>
                             </td>
                             <td>
                             <select id="themeform:renderSet" name="themeform:renderSet" size="1" class="portlet-form-field">
                             <option value="emptyRenderer">emptyRenderer</option>
                             <option value="emptyRendererNoAjax">emptyRendererNoAjax</option>
                             <option value="divRenderer" selected="selected">divRenderer</option>
                             <option value="divRendererNoAjax">divRendererNoAjax</option>
                             <option value="">default</option></select>
                             </td>
                             </tr>
                             </tbody>
                             </table>
                            
                             <br>
                            
                             <input id="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             value="Update" onclick="clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj();"
                             class="portlet-form-button" type="submit">
                            
                             <input id="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id43jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id43jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             value="Cancel" onclick="clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj();"
                             class="portlet-form-button" type="submit">
                            
                             <input name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj_SUBMIT" value="1" type="hidden">
                             <input name="jsf_sequence" value="1" type="hidden">
                             <input name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_link_hidden_" type="hidden">
                             <script type="text/javascript"><!--
                             function clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj() {
                             var f = document.forms['themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj'];
                             f.elements['themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_link_hidden_'].value='';
                             f.target='';
                             }
                             clear_themeform_3A_5Fid41jbpns_5F2fadmin_5F2fdefault_5F2fAdminPortletWindowsnpbj();
                             //--></script>
                             </form>
                             <input name="themeform_SUBMIT" value="1" type="hidden">
                             <input name="jsf_sequence" value="1" type="hidden">
                             </span>
                             .....
                            


                            I think that should be another FORM tag but it does not appear!?
                            Maybe there is a bug in ui:define with a decorate template? :(

                            Another suggestion to fix this is changing the 3 xhtml at portal-admin.sar\portal-admin.war\WEB-INF\jsf:

                            - editPortalTheme.xhtml, editPageTheme.xhtml and editWindowTheme.xhtml

                            in all of them remove or comment these 2 lines (in bold):

                             <h:form>
                             <h:commandButton value="Update" action="#{themePropertyAction.execute}" styleClass="portlet-form-button"/>
                             <h:commandButton value="Cancel" action="#{portalobjectmgr.selectObject}" styleClass="portlet-form-button">
                             <f:param name="id" value="#{node.id}"/>
                             </h:commandButton>
                             </h:form>
                            




                            After doing this the generated HTML will be:


                             ....
                             <br>
                            
                             <input id="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             name="themeform:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             value="Update" onclick="clear_themeform();"
                             class="portlet-form-button" type="submit">
                            
                             <input id="themeform:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             name="themeform:_id42jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj"
                             value="Cancel" onclick="clear_themeform();" class="portlet-form-button" type="submit">
                             <input name="themeform_SUBMIT" value="1" type="hidden">
                             <input name="jsf_sequence" value="1" type="hidden">
                             <input value="" name="themeform:_link_hidden_" type="hidden">
                             <script type="text/javascript"><!--
                             function clear_themeform() {
                             var f = document.forms['themeform'];
                             f.elements['themeform:_link_hidden_'].value='';
                             f.target='';
                             }
                             clear_themeform();
                             //--></script>
                             </form>
                             </span>
                            


                            Now it seems to be Ok and after clicking in the update button you should see the message:

                            Theme has been correctly updated on the portal named: default

                            regards.

                            R.Harari

                            • 11. Re: error changing theme when logged in as admin in 2.6cr2
                              Andreas Wiesauer Newbie

                              You are right, your fix works.

                              • 12. Re: error changing theme when logged in as admin in 2.6cr2
                                Thomas Heute Master

                                Indeed ;) I saw the problem and commited the fix in SVN, thank you Ricardo !

                                • 13. Re: error changing theme when logged in as admin in 2.6cr2
                                  Grant Newbie

                                  I have done some other testing and have found I do not get this error with firefox but i do with IE7