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 Mike Davis <th...@yahoo.com> on 2003/01/15 05:00:00 UTC

How to refer to another JSP (from a JSP portlet) staying within "portlet context"

Hi Folks,

                Here is the situation (#4 is my main concern) . 

1) I am using JSP portlets since I am not familiar with Velocity and I do NOT wish to use a DatabaseBrowser portlet

2) I have a task that makes sense to show a series of JSP's (within the same portlet "space" if possible) to accomplish.  Thus there is a screen flow that I want to setup.

3) For example, 

- The first JSP (portlet) (JSP #1) shows a list of names of toys.  The toy name is actually a hyperlink to the details on that specific toy.  

- If the user clicks on that hyperlink (toy name), a new screen (JSP #2) is shown (in that same portlet "space") which shows the details of that toy.  The new screen has two buttons, one that says "update" and the other says "return".  

- If the user clicks the update button, the user is displayed a screen (JSP #3) that contains the toy details to be editted and a submit button.

- And so on, you get the idea.  Extremely common functionality...

4) I have played with the jetspeed:portletlink tag, but it's doesn't seem to work.  I added this to a JSP portlet and when I click it, the page does seem to repaint, but no HelloJSP is shown:

<a href="<jetspeed:portletlink name="HelloJSP" />"><jetspeed:portletlink name="HelloJSP" /></A>

This is that the link looks like in the page (Note that I do NOT have an action specified above.  I guess that Maximize is the default):

http://localhost:8080/portal/user/m/page/default.psml/media-type/html?action=controls.Maximize 


5) I have read the tutorial and I must admit that I do not find it very clear on how to accomplish this type of functionality.  I read about the "action" and the "template" which seems to work great if you are showing a single screen full of data...

6) It would simply be a case of passing the toy name (see example above) as a parameter to JSP #2 from JSP #1 as part of the link.  Something like:

----- snipet from JSP #1 -----

<a href="JSP#2.jsp?toyname=legos">Legos</a>

7) Any larger examples of how to do this would be greatly appreciated

Thanks very much in advance,

Mike

 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

RE: How to refer to another JSP (from a JSP portlet) staying within "portlet context"

Posted by Mike Davis <th...@yahoo.com>.
Hi Mark,
     To be clear, what I am trying to do is (within a JSP Portlet) present a hyperlink (with some attached request parameters) that refers to itself within the normal context.   Is there some other link type (tag) I can use to do this (link? navigation?) ?   
This would look like in a "regular" JSP something like:
myJSP.jsp---------
// lots of stuff here
<a href="myJSP.jsp?myparm=somevalue">click here</a>
// more stuff
------ end myJSP.jsp -----
The portletlink tag does what I want other than rendering in the Maximized view as described previously...
Thanks again,
                     Mike
 
 
 Mark Orciuch <ma...@ngsltd.com> wrote:>
> Hi Mark,
> Thanks for the reply. Based on your advice, I got
> quite a bit farther. I have figured out much of how to use the
> action and the template. However, I have one more question
> regarding the portletlink tag.
> This piece of code within the JSP template:
> "/>&mylink=tom">HERE
>
> Results in the following HTML:
> > href="HEREhttp://localhost:8080/portal/user/m/page/default.psml/js
> _peid/P-f2c39a9b06-10001/media-type/html?action=controls.Maximize&
> mylink=tom">HERE
>
> I don't want the "action=controls.Maximize", I simply want the
> "normal" (non-Maximized) view. What do I need to change? Is
> there a configuration settting to control this behavior?
>

I'm not sure where portletlink fits into your wizard portlet. "Normal" view
would be showing the portlet within page along with other portlets defined
on that page so I don't know why you want to use portletlink (unless the
portlet is in different pane or something).

> On a side note, I looked at "JSP1_1andJetspeedTagLib" and there
> was nothing that I saw that showed me an example of the jspeid
> attribute. I figured that out by your hint and looking at the
> taglib directly. Is there a more complete example for the
> portletlink tag somewhere?
>

No, there isn't. Using js_peid directly is not the best approach since
js_peid can change.


Best regards,

Mark Orciuch - morciuch@apache.org
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

RE: How to refer to another JSP (from a JSP portlet) staying within "portlet context"

Posted by Mark Orciuch <ma...@ngsltd.com>.
>
> Hi Mark,
>              Thanks for the reply.    Based on your advice, I got
> quite a bit farther.  I have figured out much of how to use the
> action and the template.  However, I have one more question
> regarding the portletlink tag.
> This piece of code within the JSP template:
> <a href="<jetspeed:portletlink jspeid="<%=jspeid%>"/>&mylink=tom">HERE</a>
>
> Results in the following HTML:
> <a
> href="HEREhttp://localhost:8080/portal/user/m/page/default.psml/js
> _peid/P-f2c39a9b06-10001/media-type/html?action=controls.Maximize&
> mylink=tom">HERE</a>
>
> I don't want the "action=controls.Maximize", I simply want the
> "normal" (non-Maximized) view.  What do I need to change?  Is
> there a configuration settting to control this behavior?
>

I'm not sure where portletlink fits into your wizard portlet. "Normal" view
would be showing the portlet within page along with other portlets defined
on that page so I don't know why you want to use portletlink (unless the
portlet is in different pane or something).

> On a side note, I looked at "JSP1_1andJetspeedTagLib" and there
> was nothing that I saw that showed me an example of the jspeid
> attribute.  I figured that out by your hint and looking at the
> taglib directly.  Is there a more complete example for the
> portletlink tag somewhere?
>

No, there isn't. Using js_peid directly is not the best approach since
js_peid can change.


Best regards,

Mark Orciuch - morciuch@apache.org
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to refer to another JSP (from a JSP portlet) staying within "portlet context"

Posted by Mike Davis <th...@yahoo.com>.
Hi Mark, 
             Thanks for the reply.    Based on your advice, I got quite a bit farther.  I have figured out much of how to use the action and the template.  However, I have one more question regarding the portletlink tag.
This piece of code within the JSP template:
<a href="<jetspeed:portletlink jspeid="<%=jspeid%>"/>&mylink=tom">HERE</a>
 
Results in the following HTML:
<a href="HEREhttp://localhost:8080/portal/user/m/page/default.psml/js_peid/P-f2c39a9b06-10001/media-type/html?action=controls.Maximize&mylink=tom">HERE</a>
 
I don't want the "action=controls.Maximize", I simply want the "normal" (non-Maximized) view.  What do I need to change?  Is there a configuration settting to control this behavior?  

On a side note, I looked at "JSP1_1andJetspeedTagLib" and there was nothing that I saw that showed me an example of the jspeid attribute.  I figured that out by your hint and looking at the taglib directly.  Is there a more complete example for the portletlink tag somewhere? 


Thanks,
            Mark
 
 
 
 Mark Orciuch <mo...@apache.org> wrote: Mike,

My comments in-line:

>
> Here is the situation (#4 is my main concern) .
>
> 1) I am using JSP portlets since I am not familiar with Velocity
> and I do NOT wish to use a DatabaseBrowser portlet
>
> 2) I have a task that makes sense to show a series of JSP's
> (within the same portlet "space" if possible) to accomplish.
> Thus there is a screen flow that I want to setup.
>
> 3) For example,
>
> - The first JSP (portlet) (JSP #1) shows a list of names of toys.
> The toy name is actually a hyperlink to the details on that
> specific toy.
>
> - If the user clicks on that hyperlink (toy name), a new screen
> (JSP #2) is shown (in that same portlet "space") which shows the
> details of that toy. The new screen has two buttons, one that
> says "update" and the other says "return".
>
> - If the user clicks the update button, the user is displayed a
> screen (JSP #3) that contains the toy details to be editted and a
> submit button.
>
> - And so on, you get the idea. Extremely common functionality...
>

Sounds like a wizard portlet. I don't know of any examples of how to write
it but a generic wizard portlet would be a nice addition to Jetspeed. My
recommendation would be to use a driver JSP template which would include
different JSP templates depending on the step #, such as file="page-x.jsp" %>. You would write JSPPortletAction to control the screen
flow.

> 4) I have played with the jetspeed:portletlink tag, but it's
> doesn't seem to work. I added this to a JSP portlet and when I
> click it, the page does seem to repaint, but no HelloJSP is shown:
>
> > />">
>
> This is that the link looks like in the page (Note that I do NOT
> have an action specified above. I guess that Maximize is the default):
>
>
http://localhost:8080/portal/user/m/page/default.psml/media-type/html?action
=controls.Maximize

The tag will need either "js_peid" (if portlet is in
the current psml) or "psml" and "portletname" (if portlet is in another
psml) to correctly generate the link. Just look at "JSP1_1andJetspeedTagLib"
portlet for an example.

Best regards,

Mark Orciuch - morciuch@apache.org
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

RE: How to refer to another JSP (from a JSP portlet) staying within "portlet context"

Posted by Mark Orciuch <mo...@apache.org>.
Mike,

My comments in-line:

>
>                 Here is the situation (#4 is my main concern) .
>
> 1) I am using JSP portlets since I am not familiar with Velocity
> and I do NOT wish to use a DatabaseBrowser portlet
>
> 2) I have a task that makes sense to show a series of JSP's
> (within the same portlet "space" if possible) to accomplish.
> Thus there is a screen flow that I want to setup.
>
> 3) For example,
>
> - The first JSP (portlet) (JSP #1) shows a list of names of toys.
>  The toy name is actually a hyperlink to the details on that
> specific toy.
>
> - If the user clicks on that hyperlink (toy name), a new screen
> (JSP #2) is shown (in that same portlet "space") which shows the
> details of that toy.  The new screen has two buttons, one that
> says "update" and the other says "return".
>
> - If the user clicks the update button, the user is displayed a
> screen (JSP #3) that contains the toy details to be editted and a
> submit button.
>
> - And so on, you get the idea.  Extremely common functionality...
>

Sounds like a wizard portlet. I don't know of any examples of how to write
it but a generic wizard portlet would be a nice addition to Jetspeed. My
recommendation would be to use a driver JSP template which would include
different JSP templates depending on the step #, such as <%@ include
file="page-x.jsp" %>. You would write JSPPortletAction to control the screen
flow.

> 4) I have played with the jetspeed:portletlink tag, but it's
> doesn't seem to work.  I added this to a JSP portlet and when I
> click it, the page does seem to repaint, but no HelloJSP is shown:
>
> <a href="<jetspeed:portletlink name="HelloJSP"
> />"><jetspeed:portletlink name="HelloJSP" /></A>
>
> This is that the link looks like in the page (Note that I do NOT
> have an action specified above.  I guess that Maximize is the default):
>
>
http://localhost:8080/portal/user/m/page/default.psml/media-type/html?action
=controls.Maximize

The <jetspeed:portletlink> tag will need either "js_peid" (if portlet is in
the current psml) or "psml" and "portletname" (if portlet is in another
psml) to correctly generate the link. Just look at "JSP1_1andJetspeedTagLib"
portlet for an example.

Best regards,

Mark Orciuch - morciuch@apache.org
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>