|
From: dajevtic <do-...@jb...> - 2006-06-06 02:39:42
|
I have opened an issue with tomahawk myfaces team to make the MyFacesExtensionFilter work with portals, however I didn't want to wait.
Ok! here goes for the schedule :-)
First of all do a svn checkout of the newest myfaces sources and build. schedule has left the sandbox and has been moved into tomahawk!
Remove all files inside the deploy/jbossweb-tomcat55.sar/jsf-libs directory and copy the following jars into it (I'm not sure if all are needed, but that's the ones who are inside the generated war-file of myfaces):
antlr-2.7.2.jar
| commons-beanutils-1.7.0.jar
| commons-codec-1.3.jar
| commons-collections-3.1.jar
| commons-digester-1.6.jar
| commons-el-1.0.jar
| commons-fileupload-1.0.jar
| commons-lang-2.1.jar
| commons-logging-1.0.4.jar
| commons-validator-1.2.0.jar
| jstl-1.1.0.jar
| myfaces-api-1.1.4-SNAPSHOT.jar
| myfaces-impl-1.1.4-SNAPSHOT.jar
| oro-2.0.8.jar
| struts-1.2.8.jar
| tomahawk-1.1.4-SNAPSHOT.jar
| tomahawk-sandbox-1.1.4-SNAPSHOT.jar
| xalan-2.5.1.jar
| xml-apis-1.0.b2.jar
|
|
| Remove tomahawk.jar and tomahawk.tld from the portal-core.war file of the jboss portal.
|
| Change the deploy/jbossweb-tomcat55.sar/conf/web.xml inside jboss server to:
|
| <init-param>
| | <description>MyFaces tlds</description>
| | <param-name>tagLibJar0</param-name>
| | <param-value>jsf-libs/myfaces-impl-1.1.4-SNAPSHOT.jar</param-value>
| | </init-param>
| | <init-param>
| | <description>Sandbox tlds</description>
| | <param-name>tagLibJar1</param-name>
| | <param-value>jsf-libs/tomahawk-sandbox-1.1.4-SNAPSHOT.jar</param-value>
| | </init-param>
| | <init-param>
| | <description>Tomahawk tlds</description>
| | <param-name>tagLibJar2</param-name>
| | <param-value>jsf-libs/tomahawk-1.1.4-SNAPSHOT.jar</param-value>
| | </init-param>
| |
|
| As of now, jboss is running under the new myfaces version, rendering the management pages of the portal unusable.
|
| To fix this you have to:
| change the line
| org.apache.myfaces.tree2.CLIENT_SIDE_TOGGLE="#{false}" inside the index.xhtml to
| clientSideToggle="false"
|
| Then, surround any <h:commandLink> tag with a <h:form> tag where there is none (there are not too many). Now the management portlets work fine again.
|
|
| Here is a snippet of how your own web.xml file should look like (be sure to also update the web.xml inside the portal-core.war of jboss portal):
|
| <filter>
| | <filter-name>MyFacesExtensionsFilter</filter-name>
| | <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
| | <init-param>
| | <description>Set the size limit for uploaded files.
| | Format: 10 - 10 bytes
| | 10k - 10 KB
| | 10m - 10 MB
| | 1g - 1 GB</description>
| | <param-name>uploadMaxFileSize</param-name>
| | <param-value>100m</param-value>
| | </init-param>
| | <init-param>
| | <description>Set the threshold size - files
| | below this limit are stored in memory, files above
| | this limit are stored on disk.
| |
| | Format: 10 - 10 bytes
| | 10k - 10 KB
| | 10m - 10 MB
| | 1g - 1 GB</description>
| | <param-name>uploadThresholdSize</param-name>
| | <param-value>100k</param-value>
| | </init-param>
| | </filter>
| | <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
| | <filter-mapping>
| | <filter-name>MyFacesExtensionsFilter</filter-name>
| | <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
| | </filter-mapping>
| |
| | <filter-mapping>
| | <filter-name>MyFacesExtensionsFilter</filter-name>
| | <url-pattern>*.jsf</url-pattern>
| | </filter-mapping>
| | <filter-mapping>
| | <filter-name>MyFacesExtensionsFilter</filter-name>
| | <url-pattern>/faces/*</url-pattern>
| | </filter-mapping>
| |
| | <context-param>
| | <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
| | <param-value>true</param-value>
| | </context-param>
| | <context-param>
| | <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
| | <param-value>false</param-value>
| | </context-param>
| | <context-param>
| | <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
| | <param-value>true</param-value>
| | </context-param>
| | <context-param>
| | <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
| | <param-value>true</param-value>
| | </context-param>
| | <context-param>
| | <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| | <param-value>.xhtml</param-value>
| | </context-param>
| |
| | <context-param>
| | <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
| | <param-value>false</param-value>
| | </context-param>
| |
| | <!-- Must be commented out
| | <servlet>
| | <servlet-name>Faces Servlet</servlet-name>
| | <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| | <load-on-startup>1</load-on-startup>
| | </servlet>
| |
| | <servlet-mapping>
| | <servlet-name>Faces Servlet</servlet-name>
| | <url-pattern>*.jsf</url-pattern>
| | </servlet-mapping>-->
| |
| |
|
| Now for the faces-config.xml:
| <managed-bean>
| | <managed-bean-name>ScheduleBrowserBean</managed-bean-name>
| | <managed-bean-class>de.livemediagroup.ecatalog.web.ScheduleBrowserBean</managed-bean-class>
| | <managed-bean-scope>request</managed-bean-scope>
| | </managed-bean>
|
| Your portlet.jsp should look something like this. I placed the .js files as a quick hack into the portal-core folder. I usually have them in a /static folder inside my apache web server:
| <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
| | <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
| | <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
| |
| | <html>
| | <head>
| | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
| | <title>Zeitplan</title>
| | <link rel='stylesheet' type='text/css'
| | href='/portal-core/style/default/schedule.css' />
| |
| | <script type="text/javascript"
| | src="/portal-core/style/default/schedule.js"><!--
| |
| | //--></script>
| | <script type="text/javascript"
| | src="/portal-core/style/default/alphaAPI.js"><!--
| |
| | //--></script>
| | <script type="text/javascript"
| | src="/portal-core/style/default/domLib.js"><!--
| |
| | //--></script>
| | <script type="text/javascript" src="/portal-core/style/default/domTT.js"><!--
| |
| | //--></script>
| | <script type="text/javascript"
| | src="/portal-core/style/default/fadomatic.js"><!--
| |
| | //--></script>
| |
| |
| | </head>
| | <body>
| |
| | <f:view>
| |
| | <h:form>
| |
| | <t:schedule value="#{ScheduleBrowserBean.model}" id="schedule" theme="default" tooltip="true" />
| |
| | </h:form>
| | </f:view>
| | </body>
| | </html>
| |
|
|
| One last small thing. If you are using facelets:
| Add <tag>
| | <tag-name>schedule</tag-name>
| | <component>
| | <component-type>org.apache.myfaces.Schedule</component-type>
| | <renderer-type>org.apache.myfaces.Schedule</renderer-type>
| | </component>
| | </tag>
| | to the tomahawl.taglib.xml
|
| I think that's all. Please try and let me know if it worked.
| Since I am using jboss-seam I hope I haven't forgotten anything.
| If I did, sorry, I'll post the remaining things if needed.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3949070#3949070
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3949070
|