You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by MatteoBordin <ma...@somepapers.com> on 2008/03/02 16:38:22 UTC
zk on pluto portal
Hello
I am a new pluto users.
I try to insert into pluto portal a zk application.
I used for the first time the zkdemo web application.
I am not able to see the zk portlet inside the portal server.
This is my portlet.xml file:
______________
<portlet-app version="1.0"
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
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>ZK loader for ZUML pages</description>
<portlet-name>zkdemoportletA</portlet-name>
<display-name>ZK Portlet Loader</display-name>
<portlet-class>org.zkoss.zk.ui.http.DHtmlLayoutPortlet</portlet-class>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>ZK</title>
<short-title>ZK</short-title>
<keywords>ZK,ZUML</keywords>
</portlet-info>
<!-- An example to specify zk_page -->
<init-param>
<param-name>zk_page</param-name>
<param-value>index.zul</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>index.zul</param-value>
</init-param>
<init-param>
<name>config</name>
<value>/WEB-INF/testsuite-config.xml</value>
</init-param>
<portlet-preferences>
<preference>
<name>zk_page</name>
<value>index.zul</value>
</preference>
</portlet-preferences>
<security-role-ref>
<role-name>tomcat</role-name>
<role-link>tomcat</role-link>
</security-role-ref>
</portlet>
</portlet-app>
______________
This is the web.xml file
______________
<servlet-mapping>
<servlet-name>zkdemoportletA</servlet-name>
<!-- <url-pattern>/zkdemo/userguide/index.zul</url-pattern> -->
<url-pattern>/zkdemoportletA/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkdemoportletA</servlet-name>
<!-- <url-pattern>/zkdemo/userguide/index.zul</url-pattern> -->
<url-pattern>/userguide/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkdemoportletA</servlet-name>
<!-- <url-pattern>/zkdemo/userguide/index.zul</url-pattern> -->
<url-pattern>/zkdemo/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<!-- <url-pattern>/zkdemo/userguide/index.zul</url-pattern> -->
<url-pattern>/zkLoader/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<!-- <url-pattern>/zkdemo/userguide/index.zul</url-pattern> -->
<url-pattern>/userguide/*</url-pattern>
</servlet-mapping>
______________
This is the error:
The requested resource (/zkdemo/PlutoInvoker/zkdemoportletA) is not
available
Could some of you help me?
Thanks
Matteo
Re: zk on pluto portal
Posted by Benjamin Gould <be...@netsos.com>.
Matteo,
I'm not sure how ZK works or how your portlet is architected. However,
if you need to share session attributes between a portlet and a servlet
(or other portlets) in the same application, you should use
PortletRequest.getPortletSession().setAttribute(name, value,
PortletSession.APPLICATION_SCOPE). A more advanced way might be to use
javax.portlet.PortletSessionUtil if that does not work (see the Portlet
API Javadocs).
-- Ben
On Wed, 2008-03-05 at 12:00 +0100, MatteoBordin wrote:
> On 04/03/2008 1.04, ben@netsos.com wrote:
> > Matteo, this error is caused because you need to take an extra assembly step ...
> >
> > -- Ben
> Thanks Ben,
> now I am able to see my zk application into the portlet thanks for you help.
> But I have a problem when I do a remote action (I click in a button
> where I would like to interact with a server) I obtain a timeout.
> Did you know if i have set something obout the zk session?
> Do I have to sher the zk session with the portlet one? In which way?
>
> Thanks
> Matteo
>
Re: zk on pluto portal
Posted by MatteoBordin <ma...@somepapers.com>.
On 04/03/2008 1.04, ben@netsos.com wrote:
> Matteo, this error is caused because you need to take an extra assembly step ...
>
> -- Ben
Thanks Ben,
now I am able to see my zk application into the portlet thanks for you help.
But I have a problem when I do a remote action (I click in a button
where I would like to interact with a server) I obtain a timeout.
Did you know if i have set something obout the zk session?
Do I have to sher the zk session with the portlet one? In which way?
Thanks
Matteo
Re: zk on pluto portal
Posted by be...@netsos.com.
> Hello
> I am a new pluto users.
> I try to insert into pluto portal a zk application.
> I used for the first time the zkdemo web application.
> I am not able to see the zk portlet inside the portal server.
>
> This is my portlet.xml file:
> ______________
...
> ______________
>
> This is the web.xml file
> ______________
...
>
> This is the error:
> The requested resource (/zkdemo/PlutoInvoker/zkdemoportletA) is not
> available
Matteo, this error is caused because you need to take an extra assembly
step in order to add some pluto-specific entries into web.xml before
installing your web application to the server. There are plugins for Ant
and Maven 2 in order to do this. This page has some more info:
http://portals.apache.org/pluto/v11/deploying.html
If you want to do it in Ant, it goes something like this:
<taskdef name="assemble" classname="org.apache.pluto.ant.AssembleTask">
<classpath>
<path refid="pluto-ant" />
<path refid="pluto-cp" />
</classpath>
</taskdef>
<assemble
webxml="${web.dir}/WEB-INF/web.xml"
portletxml="${web.dir}/WEB-INF/portlet.xml"
destfile="${gen.dir}/pluto-web.xml" />
<war destfile="${dist.dir}/${ant.project.name}.war" basedir="${web.dir}"
webxml="${gen.dir}/WEB-INF/pluto-web.xml">
<classes dir="${classes.dir}">
<include name="**/*" />
</classes>
<lib dir="${pluto.inc}">
<include name="**/*.jar" />
</lib>
<exclude name="**/web.xml" />
</war>
Of course, modify this for your build environment as needed. Hope it
works out.
-- Ben