You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by z w <wz...@hotmail.com> on 2008/08/21 15:48:23 UTC
Change portal page from within portlet ?
Hi,
In a portal, we must integrate an application doing a search then showing a result page.
This application should be implemented as a portlet.
Assuming we have 3 pages in the portlet:
Page 1: Simple search: a form with a single text field, whose action is launching a search, this page contains also a link to Page 2 who corresponds to Advanced search.
Page 2: Advanced search: a form with multiple fields, whose action is also launching a search.
Page 3: list of results, who is used for displaying results of Page 1 and Page 2.
On the portal's permanent menu, a small region shows always the Page 1 (Simple search).
The central zone of the portal initially shows information from other portlets.
When one click on the link of the Page 1, the central zone of the portal must display the Page 2 (Advanced search).
When one type a name and submit the form of the Page 1 (Simple Search), the central zone of the portal displays the Page 3 (List of results).
When one type in information and submit the form of the Page 2 (Advanced search), the central zone displays the Page 3 (List of results).
Beeing new to portlet, I've quite a few questions:
1) should Page 1 be defined as a portlet and the central zone as another portlet ?
2) if so, both portlets can be the same war ?
3) how can I show the portal page containg Page 2 (Advanced Search) when I click on the link inside Page 1 (how to specify the good URL inside my JSP) ?
4) is similar to 3), how can I trigger processAction() of my portlet when submit the form from Page 1 (Simple Search) and at the same time instruct the portal to switch to the page containing the Page 3 (List of results) ?
Thanks in advance,
wzx
_________________________________________________________________
Sur Windows Live Ideas, découvrez en exclusivité de nouveaux services en ligne... si nouveaux qu'ils ne sont pas encore sortis officiellement sur le marché !
http://ideas.live.com
Re: Change portal page from within portlet ?
Posted by David Sean Taylor <da...@bluesunrise.com>.
On Aug 21, 2008, at 6:48 AM, z w wrote:
>
> Hi,
>
> In a portal, we must integrate an application doing a search then
> showing a result page.
> This application should be implemented as a portlet.
>
> Assuming we have 3 pages in the portlet:
> Page 1: Simple search: a form with a single text field, whose action
> is launching a search, this page contains also a link to Page 2 who
> corresponds to Advanced search.
> Page 2: Advanced search: a form with multiple fields, whose action
> is also launching a search.
> Page 3: list of results, who is used for displaying results of Page
> 1 and Page 2.
>
> On the portal's permanent menu, a small region shows always the Page
> 1 (Simple search).
> The central zone of the portal initially shows information from
> other portlets.
> When one click on the link of the Page 1, the central zone of the
> portal must display the Page 2 (Advanced search).
> When one type a name and submit the form of the Page 1 (Simple
> Search), the central zone of the portal displays the Page 3 (List of
> results).
> When one type in information and submit the form of the Page 2
> (Advanced search), the central zone displays the Page 3 (List of
> results).
>
> Beeing new to portlet, I've quite a few questions:
> 1) should Page 1 be defined as a portlet and the central zone as
> another portlet ?
This is a hard one to answer, as it depends on your user requirements
etc. I have implemented a search form for a medical database search
application. In that case, I think I made the advanced search expand
out in a hidden div.
Its really up to you
>
> 2) if so, both portlets can be the same war ?
yes, of course
>
> 3) how can I show the portal page containg Page 2 (Advanced Search)
> when I click on the link inside Page 1 (how to specify the good URL
> inside my JSP) ?
you can make a link to a page by hardcoding it "/jetspeed/portal/
advancedSearch.psml"
>
> 4) is similar to 3), how can I trigger processAction() of my portlet
> when submit the form from Page 1 (Simple Search) and at the same
> time instruct the portal to switch to the page containing the Page 3
> (List of results) ?
>
You have to send back to your own portlet for the processAction(), and
then redirect to Page 2 using the portlet api in your processAction.
The portlet api disallows calling the process action of another
portlet from your portlet (on the current or any page)
I usually do this with a redirect in the action such as
response.sendRedirect("/jetspeed/portal/search.psml");
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: Change portal page from within portlet ?
Posted by David Sean Taylor <da...@bluesunrise.com>.
I can't read this!
On Aug 25, 2008, at 7:26 PM, z w wrote:
>
> Thanks a lot. I'll try it.> Date: Mon, 25 Aug 2008 14:18:30 +0200>
> From: d.dam@onehippo.com> To: jetspeed-user@portals.apache.org>
> Subject: Re: Change portal page from within portlet ?> > Hi,> > see
> my comments below.> > z w wrote:> > Hi,> > > > In a portal, we must
> integrate an application doing a search then showing a result page.>
> > This application should be implemented as a portlet.> > > >
> Assuming we have 3 pages in the portlet:> > Page 1: Simple search: a
> form with a single text field, whose action is launching a search,
> this page contains also a link to Page 2 who corresponds to Advanced
> search.> > Page 2: Advanced search: a form with multiple fields,
> whose action is also launching a search.> > Page 3: list of results,
> who is used for displaying results of Page 1 and Page 2.> > > > On
> the portal's permanent menu, a small region shows always the Page 1
> (Simple search).> > The central zone of the portal initially shows
> information from other portlets.> > When one click on the link of
> the Page 1, the central zone of the portal must display the Page 2
> (Advanced search).> > When one type a name and submit the form of
> the Page 1 (Simple Search), the central zone of the portal displays
> the Page 3 (List of results).> > When one type in information and
> submit the form of the Page 2 (Advanced search), the central zone
> displays the Page 3 (List of results).> > > > Beeing new to portlet,
> I've quite a few questions:> > 1) should Page 1 be defined as a
> portlet and the central zone as another portlet ?> > > to make your
> portlet application more modular, I would implement the > three
> portlets as separate portlets.> > > 2) if so, both portlets can be
> the same war ?> > > > Yes, it makes sense to put all these portlets
> in the same war, since > they are strongly related.> > > 3) how can
> I show the portal page containg Page 2 (Advanced Search) when I
> click on the link inside Page 1 (how to specify the good URL inside
> my JSP) ?> > > > since you use three separate portlets on different
> pages, you will have > to use three separate PSMLs for this, each
> containing a different > portlet setup. Just use the relative (!)
> url to the PSML to navigate > between pages, e.g. "page1.psml",
> "page2.psml".> > > 4) is similar to 3), how can I trigger
> processAction() of my portlet when submit the form from Page 1
> (Simple Search) and at the same time instruct the portal to switch
> to the page containing the Page 3 (List of results) ?> > > > > your
> question is not entirely clear .. do you want to trigger >
> processAction of the portlet belonging to the page 1 or for page 3?
> You > cannot call a processAction of a different portlet, only to
> the portlet > which is creating the action url. Why do you need a
> processAction, for > validation of the search query ? If that's the
> case, you can call the > processAction of portlet 1, and
> conditionally redirect to portlet 3 (or > back to the page
> containing portlet 1, if validation failed). You can > pass on the
> query parameters to portlet 3 as request parameters (since > you
> cannot set render parameters of another portlet). By default, >
> request parameters are not passed through to portlets, but you can >
> enable this by setting two properties in override.properties (or >
> jetspeed.properties) :> >
> #---------------------------------------------------------------------------------- >
> > # Until version 2.1, Jetspeed merged portal request parameters
> with > portlet specific> # parameters, effectively allowing "shared"
> parameters.> # This is not compliant with the JSR-168 PLT.11, so by
> default this is > now disabled.> #> # By setting
> merge.portal.parameters.with.portlet.parameters=true this > feature
> can> # be "restored".> # In the situation of portal and portlet
> parameters with the same name, > by default> # the portlet
> parameters will be provided first in the values array, but > this
> too> # can be overridden by setting >
> merge.portal.parameters.before.portlet.parameters=true> #> # Setting
> both these properties to true will deliver the "old" pre-2.1 >
> behavior.> # Note: for individual portlets, these global settings
> can be overridden > by setting> # these properties as metadata in
> jetspeed-portlet.xml>
> #---------------------------------------------------------------------------------- >
> > merge.portal.parameters.with.portlet.parameters=false>
> merge.portal.parameters.before.portlet.parameters=false> > > HTH,>
> Dennis> > Thanks in advance,> > > > wzx> >
> _________________________________________________________________> >
> Sur Windows Live Ideas, découvrez en exclusivité de nouveaux
> services en ligne... si nouveaux qu'ils ne sont pas encore sortis
> officiellement sur le marché !> > http://ideas.live.com> > > > >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-
> unsubscribe@portals.apache.org> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> _________________________________________________________________
> Découvrez Windows Live Spaces et créez votre site Web perso en
> quelques clics !
> http://spaces.live.com/signup.aspx
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
RE: Change portal page from within portlet ?
Posted by z w <wz...@hotmail.com>.
Thanks a lot. I'll try it.> Date: Mon, 25 Aug 2008 14:18:30 +0200> From: d.dam@onehippo.com> To: jetspeed-user@portals.apache.org> Subject: Re: Change portal page from within portlet ?> > Hi,> > see my comments below.> > z w wrote:> > Hi,> > > > In a portal, we must integrate an application doing a search then showing a result page.> > This application should be implemented as a portlet.> > > > Assuming we have 3 pages in the portlet:> > Page 1: Simple search: a form with a single text field, whose action is launching a search, this page contains also a link to Page 2 who corresponds to Advanced search.> > Page 2: Advanced search: a form with multiple fields, whose action is also launching a search.> > Page 3: list of results, who is used for displaying results of Page 1 and Page 2.> > > > On the portal's permanent menu, a small region shows always the Page 1 (Simple search).> > The central zone of the portal initially shows information from other portlets.> > When one click on the link of the Page 1, the central zone of the portal must display the Page 2 (Advanced search).> > When one type a name and submit the form of the Page 1 (Simple Search), the central zone of the portal displays the Page 3 (List of results).> > When one type in information and submit the form of the Page 2 (Advanced search), the central zone displays the Page 3 (List of results).> > > > Beeing new to portlet, I've quite a few questions:> > 1) should Page 1 be defined as a portlet and the central zone as another portlet ?> > > to make your portlet application more modular, I would implement the > three portlets as separate portlets.> > > 2) if so, both portlets can be the same war ?> > > > Yes, it makes sense to put all these portlets in the same war, since > they are strongly related.> > > 3) how can I show the portal page containg Page 2 (Advanced Search) when I click on the link inside Page 1 (how to specify the good URL inside my JSP) ?> > > > since you use three separate portlets on different pages, you will have > to use three separate PSMLs for this, each containing a different > portlet setup. Just use the relative (!) url to the PSML to navigate > between pages, e.g. "page1.psml", "page2.psml".> > > 4) is similar to 3), how can I trigger processAction() of my portlet when submit the form from Page 1 (Simple Search) and at the same time instruct the portal to switch to the page containing the Page 3 (List of results) ?> > > > > your question is not entirely clear .. do you want to trigger > processAction of the portlet belonging to the page 1 or for page 3? You > cannot call a processAction of a different portlet, only to the portlet > which is creating the action url. Why do you need a processAction, for > validation of the search query ? If that's the case, you can call the > processAction of portlet 1, and conditionally redirect to portlet 3 (or > back to the page containing portlet 1, if validation failed). You can > pass on the query parameters to portlet 3 as request parameters (since > you cannot set render parameters of another portlet). By default, > request parameters are not passed through to portlets, but you can > enable this by setting two properties in override.properties (or > jetspeed.properties) :> > #---------------------------------------------------------------------------------- > > # Until version 2.1, Jetspeed merged portal request parameters with > portlet specific> # parameters, effectively allowing "shared" parameters.> # This is not compliant with the JSR-168 PLT.11, so by default this is > now disabled.> #> # By setting merge.portal.parameters.with.portlet.parameters=true this > feature can> # be "restored".> # In the situation of portal and portlet parameters with the same name, > by default> # the portlet parameters will be provided first in the values array, but > this too> # can be overridden by setting > merge.portal.parameters.before.portlet.parameters=true> #> # Setting both these properties to true will deliver the "old" pre-2.1 > behavior.> # Note: for individual portlets, these global settings can be overridden > by setting> # these properties as metadata in jetspeed-portlet.xml> #---------------------------------------------------------------------------------- > > merge.portal.parameters.with.portlet.parameters=false> merge.portal.parameters.before.portlet.parameters=false> > > HTH,> Dennis> > Thanks in advance,> > > > wzx> > _________________________________________________________________> > Sur Windows Live Ideas, découvrez en exclusivité de nouveaux services en ligne... si nouveaux qu'ils ne sont pas encore sortis officiellement sur le marché !> > http://ideas.live.com> > > > > ---------------------------------------------------------------------> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org> For additional commands, e-mail: jetspeed-user-help@portals.apache.org>
_________________________________________________________________
Découvrez Windows Live Spaces et créez votre site Web perso en quelques clics !
http://spaces.live.com/signup.aspx
Re: Change portal page from within portlet ?
Posted by Dennis Dam <d....@onehippo.com>.
Hi,
see my comments below.
z w wrote:
> Hi,
>
> In a portal, we must integrate an application doing a search then showing a result page.
> This application should be implemented as a portlet.
>
> Assuming we have 3 pages in the portlet:
> Page 1: Simple search: a form with a single text field, whose action is launching a search, this page contains also a link to Page 2 who corresponds to Advanced search.
> Page 2: Advanced search: a form with multiple fields, whose action is also launching a search.
> Page 3: list of results, who is used for displaying results of Page 1 and Page 2.
>
> On the portal's permanent menu, a small region shows always the Page 1 (Simple search).
> The central zone of the portal initially shows information from other portlets.
> When one click on the link of the Page 1, the central zone of the portal must display the Page 2 (Advanced search).
> When one type a name and submit the form of the Page 1 (Simple Search), the central zone of the portal displays the Page 3 (List of results).
> When one type in information and submit the form of the Page 2 (Advanced search), the central zone displays the Page 3 (List of results).
>
> Beeing new to portlet, I've quite a few questions:
> 1) should Page 1 be defined as a portlet and the central zone as another portlet ?
>
to make your portlet application more modular, I would implement the
three portlets as separate portlets.
> 2) if so, both portlets can be the same war ?
>
Yes, it makes sense to put all these portlets in the same war, since
they are strongly related.
> 3) how can I show the portal page containg Page 2 (Advanced Search) when I click on the link inside Page 1 (how to specify the good URL inside my JSP) ?
>
since you use three separate portlets on different pages, you will have
to use three separate PSMLs for this, each containing a different
portlet setup. Just use the relative (!) url to the PSML to navigate
between pages, e.g. "page1.psml", "page2.psml".
> 4) is similar to 3), how can I trigger processAction() of my portlet when submit the form from Page 1 (Simple Search) and at the same time instruct the portal to switch to the page containing the Page 3 (List of results) ?
>
>
your question is not entirely clear .. do you want to trigger
processAction of the portlet belonging to the page 1 or for page 3? You
cannot call a processAction of a different portlet, only to the portlet
which is creating the action url. Why do you need a processAction, for
validation of the search query ? If that's the case, you can call the
processAction of portlet 1, and conditionally redirect to portlet 3 (or
back to the page containing portlet 1, if validation failed). You can
pass on the query parameters to portlet 3 as request parameters (since
you cannot set render parameters of another portlet). By default,
request parameters are not passed through to portlets, but you can
enable this by setting two properties in override.properties (or
jetspeed.properties) :
#----------------------------------------------------------------------------------
# Until version 2.1, Jetspeed merged portal request parameters with
portlet specific
# parameters, effectively allowing "shared" parameters.
# This is not compliant with the JSR-168 PLT.11, so by default this is
now disabled.
#
# By setting merge.portal.parameters.with.portlet.parameters=true this
feature can
# be "restored".
# In the situation of portal and portlet parameters with the same name,
by default
# the portlet parameters will be provided first in the values array, but
this too
# can be overridden by setting
merge.portal.parameters.before.portlet.parameters=true
#
# Setting both these properties to true will deliver the "old" pre-2.1
behavior.
# Note: for individual portlets, these global settings can be overridden
by setting
# these properties as metadata in jetspeed-portlet.xml
#----------------------------------------------------------------------------------
merge.portal.parameters.with.portlet.parameters=false
merge.portal.parameters.before.portlet.parameters=false
HTH,
Dennis
> Thanks in advance,
>
> wzx
> _________________________________________________________________
> Sur Windows Live Ideas, découvrez en exclusivité de nouveaux services en ligne... si nouveaux qu'ils ne sont pas encore sortis officiellement sur le marché !
> http://ideas.live.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org