You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Francisco Diaz Trepat - gmail <fr...@gmail.com> on 2009/03/03 16:43:59 UTC

Please Please Portlet

Hi all, I decided to ask for help, since last night I had nightmares of xml
files extrangulating me.
I read the portlet how-to in the wiki, probably misread it. I have an
application that has no portlet usage (as in no blabla extends blaportlet),
but I was told that all the application could be seen from inside a portle,
simply by configure xmls:

web.xml
portlet.xml
sun-web.xml

(using Netbeans, wicket 1.4rc2, glassfish v3, portlet-container from
open-portal project)


I have this on the web.xml:

   <filter>
      <filter-name>WicketFilter</filter-name>

 <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>

      <!-- portlet support -->
      <init-param>
         <param-name>portletOnlyFilter</param-name>
         <param-value>true</param-value>
      </init-param>

      <init-param>
         <param-name>detectPortletContext</param-name>
         <param-value>true</param-value>
      </init-param>


      <init-param>
         <param-name>configuration</param-name>
         <param-value>development</param-value>
      </init-param>

     <init-param>
         <param-name>filterMappingUrlPattern</param-name>

<param-value>/MyApplicationThatDoesNotWorkWithPortlet/*</param-value>
      </init-param>

I have this on the portlet.xml:

<portlet-app id="MyApplicationThatDoesNotWorkWithPortlet">
   <portlet>
      <description> MyApplicationThatDoesNotWorkWithPortlet
portlet version</description>
      <portlet-name> MyApplicationThatDoesNotWorkWithPortlet </portlet-name>
      <display-name> MyApplicationThatDoesNotWorkWithPortlet -
Portlet</display-name>

 <portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>

      <init-param>
        <name>wicketFilterPath</name>
        <value>/MyApplicationThatDoesNotWorkWithPortlet</value>
      </init-param>

      <expiration-cache>-1</expiration-cache>
      <supports>
         <mime-type>*/*</mime-type>
         <portlet-mode>VIEW</portlet-mode>
      </supports>
      <portlet-info>
         <title>MyApplicationThatDoesNotWorkWithPortlet</title>

<keywords>Portlet MyApplicationThatDoesNotWorkWithPortlet</keywords>
      </portlet-info>
   </portlet>
</portlet-app>

finally I have this on the sun-web.xml:

<sun-web-app error-url="">
  <context-root>/MyApplicationThatDoesNotWorkWithPortlet</context-root>
  <class-loader delegate="true"/>
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java
code.</description>
    </property>
  </jsp-config>
</sun-web-app>

Please, could someone help me out. I couldn't find a comprehensive guide to
these 3 xml file and I am sure that I am missing something.

f(t)

Re: Please Please Portlet

Posted by Francisco Diaz Trepat - gmail <fr...@gmail.com>.
Thanks for the tip. I will look it up.
I didn't include all the parameter but applicationClassName is there.

Thanks again,
f(t)

On Tue, Mar 3, 2009 at 7:36 PM, Niels van Kampenhout <
n.vankampenhout@onehippo.com> wrote:

> On Tue, Mar 3, 2009 at 7:43 AM, Francisco Diaz Trepat - gmail
> <fr...@gmail.com> wrote:
> > Hi all, I decided to ask for help, since last night I had nightmares of
> xml
> > files extrangulating me.
> > I read the portlet how-to in the wiki, probably misread it. I have an
> > application that has no portlet usage (as in no blabla extends
> blaportlet),
> > but I was told that all the application could be seen from inside a
> portle,
> > simply by configure xmls:
> >
> > web.xml
> > portlet.xml
> > sun-web.xml
> >
> > (using Netbeans, wicket 1.4rc2, glassfish v3, portlet-container from
> > open-portal project)
> >
> >
> > I have this on the web.xml:
> >
> >   <filter>
> >      <filter-name>WicketFilter</filter-name>
> >
> >
>  <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
> >
> >      <!-- portlet support -->
> >      <init-param>
> >         <param-name>portletOnlyFilter</param-name>
> >         <param-value>true</param-value>
> >      </init-param>
> >
> >      <init-param>
> >         <param-name>detectPortletContext</param-name>
> >         <param-value>true</param-value>
> >      </init-param>
> >
> >
> >      <init-param>
> >         <param-name>configuration</param-name>
> >         <param-value>development</param-value>
> >      </init-param>
> >
> >     <init-param>
> >         <param-name>filterMappingUrlPattern</param-name>
> >
> > <param-value>/MyApplicationThatDoesNotWorkWithPortlet/*</param-value>
> >      </init-param>
> >
> > I have this on the portlet.xml:
> >
> > <portlet-app id="MyApplicationThatDoesNotWorkWithPortlet">
> >   <portlet>
> >      <description> MyApplicationThatDoesNotWorkWithPortlet
> > portlet version</description>
> >      <portlet-name> MyApplicationThatDoesNotWorkWithPortlet
> </portlet-name>
> >      <display-name> MyApplicationThatDoesNotWorkWithPortlet -
> > Portlet</display-name>
> >
> >
>  <portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>
> >
> >      <init-param>
> >        <name>wicketFilterPath</name>
> >        <value>/MyApplicationThatDoesNotWorkWithPortlet</value>
> >      </init-param>
> >
> >      <expiration-cache>-1</expiration-cache>
> >      <supports>
> >         <mime-type>*/*</mime-type>
> >         <portlet-mode>VIEW</portlet-mode>
> >      </supports>
> >      <portlet-info>
> >         <title>MyApplicationThatDoesNotWorkWithPortlet</title>
> >
> > <keywords>Portlet MyApplicationThatDoesNotWorkWithPortlet</keywords>
> >      </portlet-info>
> >   </portlet>
> > </portlet-app>
> >
> > finally I have this on the sun-web.xml:
> >
> > <sun-web-app error-url="">
> >  <context-root>/MyApplicationThatDoesNotWorkWithPortlet</context-root>
> >  <class-loader delegate="true"/>
> >  <jsp-config>
> >    <property name="keepgenerated" value="true">
> >      <description>Keep a copy of the generated servlet class' java
> > code.</description>
> >    </property>
> >  </jsp-config>
> > </sun-web-app>
> >
> > Please, could someone help me out. I couldn't find a comprehensive guide
> to
> > these 3 xml file and I am sure that I am missing something.
>
> I suggest looking at the web.xml and portlet.xml in wicket-examples
> [1]. That's what I did and I had my Wicket app running as a portlet in
> no time.
>
> One thing I miss in your filter configuration is the init-param
> 'applicationClassName' which should have your Wicket application class
> as value.
>
> HTH,
>
> Niels
>
> [1]
> http://svn.apache.org/repos/asf/wicket/releases/wicket-1.4-rc2/wicket-examples/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Please Please Portlet

Posted by Niels van Kampenhout <n....@onehippo.com>.
On Tue, Mar 3, 2009 at 7:43 AM, Francisco Diaz Trepat - gmail
<fr...@gmail.com> wrote:
> Hi all, I decided to ask for help, since last night I had nightmares of xml
> files extrangulating me.
> I read the portlet how-to in the wiki, probably misread it. I have an
> application that has no portlet usage (as in no blabla extends blaportlet),
> but I was told that all the application could be seen from inside a portle,
> simply by configure xmls:
>
> web.xml
> portlet.xml
> sun-web.xml
>
> (using Netbeans, wicket 1.4rc2, glassfish v3, portlet-container from
> open-portal project)
>
>
> I have this on the web.xml:
>
>   <filter>
>      <filter-name>WicketFilter</filter-name>
>
>  <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
>
>      <!-- portlet support -->
>      <init-param>
>         <param-name>portletOnlyFilter</param-name>
>         <param-value>true</param-value>
>      </init-param>
>
>      <init-param>
>         <param-name>detectPortletContext</param-name>
>         <param-value>true</param-value>
>      </init-param>
>
>
>      <init-param>
>         <param-name>configuration</param-name>
>         <param-value>development</param-value>
>      </init-param>
>
>     <init-param>
>         <param-name>filterMappingUrlPattern</param-name>
>
> <param-value>/MyApplicationThatDoesNotWorkWithPortlet/*</param-value>
>      </init-param>
>
> I have this on the portlet.xml:
>
> <portlet-app id="MyApplicationThatDoesNotWorkWithPortlet">
>   <portlet>
>      <description> MyApplicationThatDoesNotWorkWithPortlet
> portlet version</description>
>      <portlet-name> MyApplicationThatDoesNotWorkWithPortlet </portlet-name>
>      <display-name> MyApplicationThatDoesNotWorkWithPortlet -
> Portlet</display-name>
>
>  <portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>
>
>      <init-param>
>        <name>wicketFilterPath</name>
>        <value>/MyApplicationThatDoesNotWorkWithPortlet</value>
>      </init-param>
>
>      <expiration-cache>-1</expiration-cache>
>      <supports>
>         <mime-type>*/*</mime-type>
>         <portlet-mode>VIEW</portlet-mode>
>      </supports>
>      <portlet-info>
>         <title>MyApplicationThatDoesNotWorkWithPortlet</title>
>
> <keywords>Portlet MyApplicationThatDoesNotWorkWithPortlet</keywords>
>      </portlet-info>
>   </portlet>
> </portlet-app>
>
> finally I have this on the sun-web.xml:
>
> <sun-web-app error-url="">
>  <context-root>/MyApplicationThatDoesNotWorkWithPortlet</context-root>
>  <class-loader delegate="true"/>
>  <jsp-config>
>    <property name="keepgenerated" value="true">
>      <description>Keep a copy of the generated servlet class' java
> code.</description>
>    </property>
>  </jsp-config>
> </sun-web-app>
>
> Please, could someone help me out. I couldn't find a comprehensive guide to
> these 3 xml file and I am sure that I am missing something.

I suggest looking at the web.xml and portlet.xml in wicket-examples
[1]. That's what I did and I had my Wicket app running as a portlet in
no time.

One thing I miss in your filter configuration is the init-param
'applicationClassName' which should have your Wicket application class
as value.

HTH,

Niels

[1] http://svn.apache.org/repos/asf/wicket/releases/wicket-1.4-rc2/wicket-examples/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Please Please Portlet

Posted by Igor Vaynberg <ig...@gmail.com>.
afaik 1.4 snapshots should have native portlet 2.0 support.

-igor

On Wed, Mar 4, 2009 at 6:58 AM, Wilhelmsen Tor Iver <To...@arrive.no> wrote:
>> (using Netbeans, wicket 1.4rc2, glassfish v3,
>> portlet-container from open-portal project)
>
> I thought the portlet-container in effect was dead since the Sun Portal
> is dead? They have ditched that in favor of a solution based on Liferay
> 5.2 called Web Space (codename WebSynergy during development):
> https://webspace.dev.java.net/download.html - note that it uses
> Glassfish v2.1 in case you require features from v3.
>
> Around here we use a patched snapshot of 1.4 (using an adapted version
> of the older portlet 2.0 patch) for Wicket portlets. (Or have I been
> sleeping and we get "real" Portlet 2.0 "out of the box" in 1.4 now?)
>
> I noticed some differences between what we do (which works :) ) and what
> you posted:
>
> 1) In web.xml we have a filter mapping for each portlet:
>
>        <filter-mapping>
>                <filter-name>bookmark</filter-name>
>                <url-pattern>/basic/*</url-pattern>
>                <dispatcher>REQUEST</dispatcher>
>                <dispatcher>INCLUDE</dispatcher>
>                <dispatcher>FORWARD</dispatcher>
>                <dispatcher>ERROR</dispatcher>
>        </filter-mapping>
>
> 2) We also declare the application in the filter element:
>
>                <init-param>
>                        <param-name>applicationClassName</param-name>
>
> <param-value>no.nsb.intranet.bookmark.wicket.BookmarkApplication
>                        </param-value>
>                </init-param>
>
> 3) You also seem to be missing an init-parameter for viewPage, in our
> case e.g.
>
>                <init-param>
>                        <name>wicketFilterPath</name>
>                        <value>/basic</value>
>                </init-param>
>                <init-param>
>                        <name>viewPage</name>
>                        <value>/basic/list</value>
>                </init-param>
>
>   though in theory it should use the application's getHomePage(), I
> guess...
>
> 4) We do not have anything in sun-web.xml, though I guess we would
> benefit from a shared classloader with Web Space.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Please Please Portlet

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> (using Netbeans, wicket 1.4rc2, glassfish v3, 
> portlet-container from open-portal project)

I thought the portlet-container in effect was dead since the Sun Portal
is dead? They have ditched that in favor of a solution based on Liferay
5.2 called Web Space (codename WebSynergy during development):
https://webspace.dev.java.net/download.html - note that it uses
Glassfish v2.1 in case you require features from v3.

Around here we use a patched snapshot of 1.4 (using an adapted version
of the older portlet 2.0 patch) for Wicket portlets. (Or have I been
sleeping and we get "real" Portlet 2.0 "out of the box" in 1.4 now?)

I noticed some differences between what we do (which works :) ) and what
you posted:

1) In web.xml we have a filter mapping for each portlet:

	<filter-mapping>
		<filter-name>bookmark</filter-name>
		<url-pattern>/basic/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>

2) We also declare the application in the filter element:

		<init-param>
			<param-name>applicationClassName</param-name>
	
<param-value>no.nsb.intranet.bookmark.wicket.BookmarkApplication
			</param-value>
		</init-param>

3) You also seem to be missing an init-parameter for viewPage, in our
case e.g.

		<init-param>
			<name>wicketFilterPath</name>
			<value>/basic</value>
		</init-param>
		<init-param>
			<name>viewPage</name>
			<value>/basic/list</value>
		</init-param>

   though in theory it should use the application's getHomePage(), I
guess...

4) We do not have anything in sun-web.xml, though I guess we would
benefit from a shared classloader with Web Space.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org