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 Hans Brattberg <ha...@crisp.se> on 2006/07/12 14:01:55 UTC

Tree in a portlet

Hi!
I'm struggeling trying to have a dynamic tree structure in a portlet.
And I am realy not sure if I'm walking the rigth path.

Is there anyone out there that has succeded in putting a tree structure 
in a portlet?
What techs did u use?

/Hans

-- 
Hans Brattberg
hans.brattberg@crisp.se
070-575 31 32
www.crisp.se


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by Stefano Bianchi <st...@softeco.it>.
Well, I think a jsp or a velocity portlet can work.
There are a lot of Java tree API available, and putting data into session 
should be quite straightforward.
A jsp submitting a form to itself when clicking on an item could put the 
item in the session, couldn't it?

----- Original Message ----- 
From: "Hans Brattberg" <ha...@crisp.se>
To: "Jetspeed Users List" <je...@portals.apache.org>
Sent: Wednesday, July 12, 2006 2:13 PM
Subject: Re: Tree in a portlet


> What I have is a tree structure of "products", a dynamic structure.
> I want to show this structure for the user, and when the user selects one 
> I want to put that product in the session for other portlets to use.
> /Hans
>
> Stefano Bianchi wrote:
>> A tree of what?
>> Maybe you can use a jsp portlet...
>> If you need an example, www.euroworksafe.org, click on Free Tour, then 
>> OntoSafeBrowser.
>> It is a JSP/Servlet application shown through a IFramePortlet.
>> Cheers,
>> Stefano
>>
>> ----- Original Message ----- From: "Hans Brattberg" 
>> <ha...@crisp.se>
>> To: <je...@portals.apache.org>
>> Sent: Wednesday, July 12, 2006 2:01 PM
>> Subject: Tree in a portlet
>>
>>
>>> Hi!
>>> I'm struggeling trying to have a dynamic tree structure in a portlet.
>>> And I am realy not sure if I'm walking the rigth path.
>>>
>>> Is there anyone out there that has succeded in putting a tree structure 
>>> in a portlet?
>>> What techs did u use?
>>>
>>> /Hans
>>>
>>> -- 
>>> Hans Brattberg
>>> hans.brattberg@crisp.se
>>> 070-575 31 32
>>> www.crisp.se
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>>
>>>
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>
>
> -- 
> Hans Brattberg
> hans.brattberg@crisp.se
> 070-575 31 32
> www.crisp.se
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


RE: Tree in a portlet

Posted by Ruben Fragoso <ru...@tap.pt>.
See the example of the Portal Site manager, it works with a Tree :)

-----Original Message-----
From: Hans Brattberg [mailto:hans.brattberg@crisp.se] 
Sent: quarta-feira, 12 de Julho de 2006 13:13
To: Jetspeed Users List
Subject: Re: Tree in a portlet


What I have is a tree structure of "products", a dynamic structure. I want
to show this structure for the user, and when the user selects 
one I want to put that product in the session for other portlets to use.
/Hans

Stefano Bianchi wrote:
> A tree of what?
> Maybe you can use a jsp portlet...
> If you need an example, www.euroworksafe.org, click on Free Tour, then
> OntoSafeBrowser.
> It is a JSP/Servlet application shown through a IFramePortlet.
> Cheers,
> Stefano
>
> ----- Original Message ----- From: "Hans Brattberg"
> <ha...@crisp.se>
> To: <je...@portals.apache.org>
> Sent: Wednesday, July 12, 2006 2:01 PM
> Subject: Tree in a portlet
>
>
>> Hi!
>> I'm struggeling trying to have a dynamic tree structure in a portlet. 
>> And I am realy not sure if I'm walking the rigth path.
>>
>> Is there anyone out there that has succeded in putting a tree
>> structure in a portlet?
>> What techs did u use?
>>
>> /Hans
>>
>> --
>> Hans Brattberg
>> hans.brattberg@crisp.se
>> 070-575 31 32
>> www.crisp.se
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: 
>> jetspeed-user-help@portals.apache.org
>>
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>


-- 
Hans Brattberg
hans.brattberg@crisp.se
070-575 31 32
www.crisp.se


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by Hans Brattberg <ha...@crisp.se>.
What I have is a tree structure of "products", a dynamic structure.
I want to show this structure for the user, and when the user selects 
one I want to put that product in the session for other portlets to use.
/Hans

Stefano Bianchi wrote:
> A tree of what?
> Maybe you can use a jsp portlet...
> If you need an example, www.euroworksafe.org, click on Free Tour, then 
> OntoSafeBrowser.
> It is a JSP/Servlet application shown through a IFramePortlet.
> Cheers,
> Stefano
>
> ----- Original Message ----- From: "Hans Brattberg" 
> <ha...@crisp.se>
> To: <je...@portals.apache.org>
> Sent: Wednesday, July 12, 2006 2:01 PM
> Subject: Tree in a portlet
>
>
>> Hi!
>> I'm struggeling trying to have a dynamic tree structure in a portlet.
>> And I am realy not sure if I'm walking the rigth path.
>>
>> Is there anyone out there that has succeded in putting a tree 
>> structure in a portlet?
>> What techs did u use?
>>
>> /Hans
>>
>> -- 
>> Hans Brattberg
>> hans.brattberg@crisp.se
>> 070-575 31 32
>> www.crisp.se
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>


-- 
Hans Brattberg
hans.brattberg@crisp.se
070-575 31 32
www.crisp.se


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by Stefano Bianchi <st...@softeco.it>.
A tree of what?
Maybe you can use a jsp portlet...
If you need an example, www.euroworksafe.org, click on Free Tour, then 
OntoSafeBrowser.
It is a JSP/Servlet application shown through a IFramePortlet.
Cheers,
Stefano

----- Original Message ----- 
From: "Hans Brattberg" <ha...@crisp.se>
To: <je...@portals.apache.org>
Sent: Wednesday, July 12, 2006 2:01 PM
Subject: Tree in a portlet


> Hi!
> I'm struggeling trying to have a dynamic tree structure in a portlet.
> And I am realy not sure if I'm walking the rigth path.
>
> Is there anyone out there that has succeded in putting a tree structure in 
> a portlet?
> What techs did u use?
>
> /Hans
>
> -- 
> Hans Brattberg
> hans.brattberg@crisp.se
> 070-575 31 32
> www.crisp.se
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by David Sean Taylor <da...@bluesunrise.com>.
Aaron Evans wrote:
> Oh, one more thing:
> 
> Is it easy to change the location of dojo.js? Hopefully it is a
> configuration somewhere that only needs to be changed in the one spot?
> 
Configure the dojo location in your desktop-theme:

djConfig.baseScriptUri = 
de_jsessionid_url('$jetspeedDesktop.getPortalResourceUrl("/javascript/dojo/")' 
);

djConfig.desktopThemeRootUrl = 
de_jsessionid_url("$jetspeedDesktop.getDesktopThemeRootUrl()" );

<script type="text/javascript" 
src='$jetspeedDesktop.getPortalResourceUrl("/javascript/dojo/dojo.js")'></script>


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by Aaron Evans <aa...@gmail.com>.
Oh, one more thing:

Is it easy to change the location of dojo.js? Hopefully it is a
configuration somewhere that only needs to be changed in the one spot?

The reason I ask is that I would prefer to host it on the web server
rather than the app server for performance reasons...

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by Aaron Evans <aa...@gmail.com>.
On 7/18/06, David Sean Taylor <da...@bluesunrise.com> wrote:
> >
> > One question I have though is how we prevent multiple portlets from
> > including the same resources multiple times?  (Eg. if 5 portlets in
> > the page all need dojo.js, then how do we prevent it from being
> > needlessly included 5 times).
>
> The AbstractDojoVelocityPortlet uses the HeaderResource component to
> ensure that any header resources added via addHeaderInfo or
> addJavaScript or addStyleSheet are unique.
>
>

Ah, sweet.  I'll look at what's done in AbstractDojoVelocityPortlet
and I'm sure I can figure out something for my specific case in the
mean time...

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by David Sean Taylor <da...@bluesunrise.com>.
Aaron Evans wrote:
> David,
> I will take a look at that example for sure, however, I don't use
> velocity in my portlets, so I'll have to figure out exactly what needs
> doing for a portlet in general in order to join in the "doHeader"
> phase.

This solution could be better designed to work with JSP or any other 
dispatched template. In fact, I think it should be refactored and more 
formalized to a complete doHeader phase in the portal itself.
I look at this as a prototype we came up with for a need. Now we need to 
refine the solution and align it with  the upcoming standard.

> 
> One question I have though is how we prevent multiple portlets from
> including the same resources multiple times?  (Eg. if 5 portlets in
> the page all need dojo.js, then how do we prevent it from being
> needlessly included 5 times).

The AbstractDojoVelocityPortlet uses the HeaderResource component to 
ensure that any header resources added via addHeaderInfo or 
addJavaScript or addStyleSheet are unique.


> 
> Perhaps this will become obvious when I look at the example, in which
> case, disregard the question.
> 
> I use dojo heavily though, so I'm sure when I upgrade to 2.1, I'll
> have a few things to figure out...
> 
> On 7/17/06, David Sean Taylor <da...@bluesunrise.com> wrote:
> 
>> Hans Brattberg wrote:
>> > Hi!
>> > I'm struggeling trying to have a dynamic tree structure in a portlet.
>> > And I am realy not sure if I'm walking the rigth path.
>> >
>> > Is there anyone out there that has succeded in putting a tree structure
>> > in a portlet?
>> > What techs did u use?
>> >
>> > /Hans
>> >
>> Dojo also has a tree widget
>>
>> You can use Dojo in any portlet running in Jetspeed, either in /desktop
>> or /portlet. Take a look at the SecurityPermissionsPortlet.java for an
>> example of how to do this (and its vm, view.vm)
>>
>> Important:
>> SecurityPermissionsPortlet extends AbstractDojoVelocityPortlet
>> You will need to extend AbstractDojoVelocityPortlet (just add a dep to
>> the jetspeed-gems jar)
>> This is necessary to join in the "doHeader" phase of the portlet request
>> cycle. Currently there are two cycles for a portlet request:
>> 1. action
>> 2. render
>> With JSR-286, there will be 3 phases:
>> 1. header
>> 2. action
>> 3. render
>> The AbstractDojoVelocityPortlet handles the header phase
>> There are two methods to override for your dojo imports:
>>    1. includeDojoRequires
>>    2. includeDojoWidgetRequires
>> See the SecurityPermissionPortlet for examples of including in dojo
>> imports into the <head> area
>>
>> All of this will get sorted out with the new spec
>> I really don't like that we have to include dojo imports via java
>> It would be much better via a vm or jsp file
>> But, this is where its at right now...
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 
> 


-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by Aaron Evans <aa...@gmail.com>.
David,
I will take a look at that example for sure, however, I don't use
velocity in my portlets, so I'll have to figure out exactly what needs
doing for a portlet in general in order to join in the "doHeader"
phase.

One question I have though is how we prevent multiple portlets from
including the same resources multiple times?  (Eg. if 5 portlets in
the page all need dojo.js, then how do we prevent it from being
needlessly included 5 times).

Perhaps this will become obvious when I look at the example, in which
case, disregard the question.

I use dojo heavily though, so I'm sure when I upgrade to 2.1, I'll
have a few things to figure out...

On 7/17/06, David Sean Taylor <da...@bluesunrise.com> wrote:
> Hans Brattberg wrote:
> > Hi!
> > I'm struggeling trying to have a dynamic tree structure in a portlet.
> > And I am realy not sure if I'm walking the rigth path.
> >
> > Is there anyone out there that has succeded in putting a tree structure
> > in a portlet?
> > What techs did u use?
> >
> > /Hans
> >
> Dojo also has a tree widget
>
> You can use Dojo in any portlet running in Jetspeed, either in /desktop
> or /portlet. Take a look at the SecurityPermissionsPortlet.java for an
> example of how to do this (and its vm, view.vm)
>
> Important:
> SecurityPermissionsPortlet extends AbstractDojoVelocityPortlet
> You will need to extend AbstractDojoVelocityPortlet (just add a dep to
> the jetspeed-gems jar)
> This is necessary to join in the "doHeader" phase of the portlet request
> cycle. Currently there are two cycles for a portlet request:
> 1. action
> 2. render
> With JSR-286, there will be 3 phases:
> 1. header
> 2. action
> 3. render
> The AbstractDojoVelocityPortlet handles the header phase
> There are two methods to override for your dojo imports:
>    1. includeDojoRequires
>    2. includeDojoWidgetRequires
> See the SecurityPermissionPortlet for examples of including in dojo
> imports into the <head> area
>
> All of this will get sorted out with the new spec
> I really don't like that we have to include dojo imports via java
> It would be much better via a vm or jsp file
> But, this is where its at right now...
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Tree in a portlet

Posted by David Sean Taylor <da...@bluesunrise.com>.
Hans Brattberg wrote:
> Hi!
> I'm struggeling trying to have a dynamic tree structure in a portlet.
> And I am realy not sure if I'm walking the rigth path.
> 
> Is there anyone out there that has succeded in putting a tree structure 
> in a portlet?
> What techs did u use?
> 
> /Hans
> 
Dojo also has a tree widget

You can use Dojo in any portlet running in Jetspeed, either in /desktop 
or /portlet. Take a look at the SecurityPermissionsPortlet.java for an 
example of how to do this (and its vm, view.vm)

Important:
SecurityPermissionsPortlet extends AbstractDojoVelocityPortlet
You will need to extend AbstractDojoVelocityPortlet (just add a dep to 
the jetspeed-gems jar)
This is necessary to join in the "doHeader" phase of the portlet request 
cycle. Currently there are two cycles for a portlet request:
1. action
2. render
With JSR-286, there will be 3 phases:
1. header
2. action
3. render
The AbstractDojoVelocityPortlet handles the header phase
There are two methods to override for your dojo imports:
   1. includeDojoRequires
   2. includeDojoWidgetRequires
See the SecurityPermissionPortlet for examples of including in dojo 
imports into the <head> area

All of this will get sorted out with the new spec
I really don't like that we have to include dojo imports via java
It would be much better via a vm or jsp file
But, this is where its at right now...



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org