We've found that the best way to handle this is to submit to an action
class, per the Turbine framework for handling actions
(http://jakarta.apache.org/turbine/turbine-2/howto/action-event-howto.html).
It's relatively easy to control the displayed portlet template using
Velocity templates and a back-end action class. It's a little more
challenging to do the same with jsp. We managed it with a variation on the
JSPPortlet class (I don't have a specific suggestion for handling this in
WebPagePortlet, but it could follow a similar path):

*******************************
    public ConcreteElement getContent( RunData rundata )
    {

        EcsServletElement element ;
        String template = "";

        try {

            HttpSession session = rundata.getSession();
                /* Here we look for a session attribute that matches a
parameter we've set for
                 * this portlet in the portlets.xreg. This allows us to pass
a different jsp to 
                 * ECS than the one defined in portlets.xreg. Setting the
appropriate template
                 * happens in an action class. To revert to the default
template, we just remove
                 * the session attribute. 
                 */
 
if(session.getAttribute(getPortletConfig().getInitParameter("templateNav"))
!= null)
            
            {
            template =
(String)session.getAttribute(getPortletConfig().getInitParameter("templateNa
v"));
            }
            else
            {   
            template = getPortletConfig().getInitParameter("template");
                }
            element = new EcsServletElement(rundata, template);
            
        } catch (Exception e) {
            String message = "JspPortletNav: Could not include the following
JSP Page:  " + template + " : " + e.getMessage();
            Log.error( message, e );
            return new StringElement( message );
        }
        
        System.out.println("Param from JspNav templateNav = " +
getPortletConfig().getInitParameter("templateNav"));
        return element;
    }
***********************************

-----Original Message-----
From: ZHU Jia [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 08, 2001 7:42 AM
To: [EMAIL PROTECTED]
Subject: Re: FW: WebPagePortlet - Content in the Portlet area


Now the explanation gets a bit complicated, I think the easiest way is
to quote my other mail:

<quote>
I'm new to Jetspeed and have some very basic questions:
We have an XML based web information delivery framework, now we support
HTML, SMS, Mail and WAP. My job is now to look into the possiblity of
making it portal-ready. I don't think there's any problem to convert the
output to be displayed in Jetspeed, but we also want to make the simple
configuration available using a portal interface. It's quite simple, but
does involve several steps (screens) of interaction, my question is that
is this possible/feasible with Jetspeed?
I couldn't find much documentation concerning this, so maybe someone
from the list can shed some light?
Any hints and tips would be highly appreciated, and many thanks in
advance!
</quote>

So, with multi-screen I mean multiple steps of interaction, like
configuration dialogues. My problem is that I don't really know how a
portlet works, let's say if I click a submit button in a portlet, the
next screen should be fetched, but where is it displayed? I don't want
the output to occupy the whole window, only the portlet area, the rest
of the page should remain unchanged, only my portlet area now contains
the next step of configuration or something.
I'm not sure I quite understand what you meant, would you care to
explain some more?

Many thanks!

regards
ZHU Jia

Ming Fai schrieb:
> 
> Actually, i can't get your exact meaning. A screen is an unique page in
> Turbine, (certainly, it is possible to have different screen showing the
> same content if all of them load the same Jetspeed psml) so, multi-screen
> means multi-page! Pls refer to the Turbine doc.
> 
> I think what you really mean is, there are more than one portlets in a
> single page (screen), right? In this case, it may not be a good idea to
make
> them into different frames. You may take my 2nd method: you write your own
> portlet class, which extends WebPagePortlet, your class loads url from an
> url parameter by any means. There are some different ways to implement,
the
> best one is to make it as an action, but I'm lazy to explore that area and
I
> make my portlet to read parameter from rundata
> [rundata.getParameters().getString(url)]. In your case, for example, your
> portlet read two parameters, the portlet id and url, if the portlet id
> matches itself, then it displays the url from parameter, otherwise, it
> displays the old url. The link looks like:
> /jetspeed/portal?url=www.sun.com&amps;portletid=1
> certain, you may design your application in other ways with similar
concept.
> 
> Regards,
> mingfai
> 
> -----Original Message-----
> From: ZHU Jia [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 08, 2001 6:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: FW: WebPagePortlet - Content in the Portlet area
> 
> Thanks for the answer! But here comes the next question-
> what about multi-screen application? do i have to use another frame or
> window or is there any way to simply get all the output from a portlet
> confined in the portlet area?
> Many thanks in advance!
> 
> ZHU Jia
> 
> Ming Fai schrieb:
> >
> > last time, I've replied it only to the dev list but not the user list.
:-P
> > (well, btw, pls don't cross post unless it is really necessary)
> >
> > Regards,
> > mingfai
> >
> > -----Original Message-----
> > From: Ming Fai [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, October 05, 2001 4:07 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: WebPagePortlet - Content in the Portlet area
> >
> > unofficial answer:
> > coz the link in java.sun.com is a normal link, so, it targets at the
> browser
> > window, as same as any other links on the page.
> >
> > So, my solution:
> > 1. Set the base target
> > make ur site with frame and set the base target to a specific frame. not
a
> > perfect solution but better than none.
> >
> > 2. modify the link when loading the WebPagePortlet
> > The only perfect solution is to change the link in the portlet when it
> > loads. So, write an portlet class to extend WebPagePortlet, after loaded
> the
> > http stream, do a process to replace all href attribute i.e. <a
> href="url">
> > to target to ur screen. So, when a user click on a link, he is linked to
> > your page with the original url as a parameter, then let the portlet
read
> > the url parameter to show the target page.
> >
> > the world is never perfect, if the link is in javascript, then you mean
> need
> > a more complex process to modify the href attribute.
> >
> > regards,
> > mingfai
> >
> > -----Original Message-----
> > From: Peter Rajesh [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, October 05, 2001 3:56 PM
> > To: jetspeed; jet-dev
> > Subject: WebPagePortlet - Content in the Portlet area
> >
> > HI,
> >
> > I have a WebPagePortlet in Jetspeed, which displays the content of
> > http://java.sun.com . When i click some thing, for ex., if i do a search
> > in that site, the Jetspeed page is gone and the search result is
> > displayed in the same browser, i.e, the entire javasoft site if
> > displayed. Is it possible to display the search content in the Portlet
> > area itself? I need to click the Back button to get the original
> > Jetspeed page. Please let me know if you have any idea to achieve this.
> >
> > Thanks,
> >
> > Regards
> >
> > Peter Rajesh
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to