"marec" wrote : Is there a way how can I instantiate portlets from another portal?
I'd really like to hear a clear answer to this question, as well. The broader question, which has also been asked but also not been clearly answered as far as I can tell, is what is the procedure to create a custom portal (as opposed to editing the default portal that is shipped in portal-core.war) that consumes any combination of custom and JBoss-provided portlets (e.g., ContentPortlet)? Maybe a concrete test case would help the discussion... For example, I can't find any documentation or forum posts that indicates that it shouldn't be possible to create a custom portal (on JBoss Portal 2.0) composed of: a) the "2ColumnLayout", provided as myLayout.war on the JBoss Portal wiki b) the HelloWorld portlet, provided as helloworld.war on the JBoss Portal wiki c) the Content portlet, provided in portal-core.war within the JBoss Portal SAR Assuming JBoss Portal is installed as described in the User Guide, I would have thought the steps would be the following (I've included JBoss server console output for each step): 1) deploy helloworld.war by copying to $JBOSS_HOME/server/default/deploy | 13:52:21,890 INFO [TomcatDeployer] deploy, ctxPath=/helloworld, warUrl=file:/opt/jboss-4.0.2/server/default/deploy/helloworld.war/ | 13:52:22,270 INFO [PortalServer] Added application /helloworld | 2) deploy myLayout.war by copying to $JBOSS_HOME/server/default/deploy | 13:53:08,469 INFO [TomcatDeployer] deploy, ctxPath=/myLayout, warUrl=file:/opt/jboss-4.0.2/server/default/deploy/myLayout.war/ | 13:53:08,683 INFO [ContextConfig] Missing application web.xml, using defaults only StandardEngine[jboss.web].StandardHost[localhost].StandardContext[/myLayout] | 13:53:08,849 INFO [LayoutDeployment] new layout deployer for : /myLayout | 13:53:08,850 INFO [ThemeDeployment] new theme deployer for : /myLayout | 13:53:08,860 INFO [LayoutDeployment] create new layout(s), found in : /myLayout | 13:53:08,878 INFO [LayoutDeployment] done creating new layout(s), found in : /myLayout | 13:53:08,880 INFO [ThemeDeployment] create new theme(s), found in : /myLayout | 13:53:08,890 INFO [ThemeDeployment] done creating new theme(s), found in : /myLayout | 3) deploy custom.war (containing the files shown below) by copying to $JBOSS_HOME/server/default/deploy | 13:53:39,142 INFO [TomcatDeployer] deploy, ctxPath=/custom, warUrl=file:/opt/jboss-4.0.2/server/default/tmp/deploy/tmp7971custom.war/ | 13:53:39,456 INFO [PortalServer] Added portal custom | 13:54:04,121 WARN [TagLibCache] Internal Error: File /WEB-INF/web.xml not found | The contents of custom.war: | custom.war/WEB-INF/portlet-instances.xml: | | <?xml version="1.0" standalone="yes"?> | <instances> | <instance> | <instance-name>CustomHelloWorldPortletInstance</instance-name> | <component-ref>HelloWorldPortlet</component-ref> | </instance> | <instance> | <instance-name>CustomContentPortletInstance</instance-name> | <component-ref>ContentPortlet</component-ref> | </instance> | </instances> | | custom.war/WEB-INF/custom-portal.xml: | | <?xml version="1.0" encoding="UTF-8"?> | <portal> | <portal-name>custom</portal-name> | <properties> | <property> | <name>org.jboss.portal.property.layout</name> | <value>2ColumnLayout</value> | </property> | </properties> | <!-- ...etc... --> | <pages> | <default-page>home</default-page> | <page> | <page-name>home</page-name> | <window> | <window-name>CustomHelloWorldPortletWindow</window-name> | <instance-ref>custom.HelloWorldPortlet.CustomHelloWorldPortletInstance</instance-ref> | <region>left</region> | <height>0</height> | </window> | <window> | <window-name>CustomContentPortletWindow</window-name> | <instance-ref>custom.ContentPortlet.CustomContentPortletInstance</instance-ref> | <region>center</region> | <height>0</height> | </window> | </page> | </pages> | </portal> | | custom.war/WEB-INF/jboss-app.xml: | | <jboss-app> | <app-name>custom</app-name> | </jboss-app> | | custom.war/WEB-INF/jboss-web.xml: | | <?xml version="1.0"?> | <jboss-web> | <context-root>/custom</context-root> | </jboss-web> | | custom.war/WEB-INF/web.xml: | | <?xml version="1.0"?> | <!DOCTYPE web-app PUBLIC | "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | "http://java.sun.com/dtd/web-app_2_3.dtd"> | <web-app> | </web-app> | When I pointed my browser at http://localhost:8080/portal/custom/, I see a JBoss Portal using the MyLayout (as expected) but with no portlets (not as expected). The server console outputs: | 13:54:04,905 WARN [RegionTagHandler] requested page has no region [left] | 13:54:04,905 WARN [RegionTagHandler] requested page has no region [center] | Obviously something is not right. I suppose marec's note about the portlet not being STARTED state might explain this, but noone from JBoss ever commented on that so who knows. I thought maybe I should include a portlet.xml that (re-)defines the HelloWorld and ContentPortlet portlets (and I made the corresponding changes to the component-ref elements of the porlet-instances.xml file): | custom.war/WEB-INF/portlet.xml: | | <?xml version="1.0" encoding="UTF-8"?> | <portlet-app | xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd" version="1.0"> | <portlet> | <portlet-name>CustomHelloWorldPortlet</portlet-name> | <portlet-class>org.jboss.portlet.helloworld.HelloWorld</portlet-class> | <supported-locale>en</supported-locale> | <supports> | <mime-type>text/html</mime-type> | <portlet-mode>VIEW</portlet-mode> | </supports> | <portlet-info> | <title>Custom HelloWorld Portlet</title> | </portlet-info> | </portlet> | <portlet> | <portlet-name>CustomContentPortlet</portlet-name> | <portlet-class>org.jboss.portal.core.portlet.cms.ContentPortlet</portlet-class> | <supported-locale>en</supported-locale> | <supports> | <mime-type>text/html</mime-type> | <portlet-mode>VIEW</portlet-mode> | </supports> | <portlet-info> | <title>Content</title> | </portlet-info> | <portlet-preferences> | <preference> | <name>uri</name> | <value>/default/index.html</value> | </preference> | </portlet-preferences> | </portlet> | </portlet-app> | but then I get the following when I try to deploy custom.war: | 15:39:19,754 INFO [TomcatDeployer] deploy, ctxPath=/custom, warUrl=file:/opt/jboss-4.0.2/server/default/tmp/deploy/tmp7973custom.war/ | 15:39:19,999 INFO [PortalServer] Added portal custom | 15:39:20,079 INFO [PortalServer] Added application /custom | 15:39:20,087 ERROR [PortletAppDeployment] The portlet cannot be started due to an error that occcured during init | org.jboss.portal.portlet.PortletInitializationException: Portlet class not found org.jboss.portlet.helloworld.HelloWorld | at org.jboss.portal.portlet.PortletContainer.start(PortletContainer.java:147) | at org.jboss.portal.server.kernel.StartMethod.invokeMethod(StartMethod.java:37) | ...etc... | Caused by: java.lang.ClassNotFoundException: org.jboss.portlet.helloworld.HelloWorld | at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332) | at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181) | at org.jboss.portal.portlet.PortletContainer.start(PortletContainer.java:125) | ... 82 more | If someone can help me figure this out, I'd be happy to contribute an example custom portal war with some doc about how to build and deploy it. Thanks in advance. -Dave View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3891151#3891151 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3891151 ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
