portals-jetspeed-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b.v.we...@valbosoft.com
Subject Re: Retrieving a portlet's unique instance ID..
Date Mon, 23 Jan 2006 21:58:01 GMT




Hello,

we've developed some content management modules, which basically add a
parameter to the portlet's definition called "channel" at creation time (so
no further customization is required). At the same time we create that
channel in the database. In this way, you can have a unique reference for
the portlet without using the portlet ID.
I think that what you're saying is that you use the same portlet for every
content, while I'd create a new portlet for every appearance, so you can
control every aspect at forehand.

Regards,

Bo van Weert
tel. 902 014 180
(00 34) 96 393 19 77
fax. 96 360 69 13
http://www.valbosoft.com: Jetspeed development




                                                                           
             jetspeed@theunder                                             
             ground.net                                                    
                                                                        To 
             23/01/2006 22:02          "Jetspeed Users List"               
                                       <jetspeed-user@portals.apache.org>  
                                                                        cc 
             Please respond to                                             
              "Jetspeed Users                                      Subject 
                   List"               Re: Retrieving a portlet's unique   
             <jetspeed-user@po         instance ID..                       
             rtals.apache.org>                                             
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Thanks for the reply.  But I had a question about one of your points..

> A portlet isn't really supposed to know about its 'unique id' as that is
> an implementation detail of the portal.

Perhaps the reason I encountered this problem is because I'm not thinking
about the design in the correct way.  What are thoughts on the following
situation:

A generic Content Display Portlet (CDP) is to be created.  The requirement
are that, whenever the CDP is added to a page, it will automatically
create a new 'block' of content in the content management system that's
associated to this individual CDP.

The only way I can think of tackling that requirement would be for the
portlet to be aware of some unique ID.  Then, in the render method (the
first method to be executed), the portlet tries accessing the content
repository with it's unique ID.  If the request fails, the portlet knows
to create a new content object.  If the request succeeds, the portlet
knows to display the content.  This 'unique key' could be done via portlet
preferences, but then there would be an extra customizing step that would
need to be performed after the portlet was added to a page (by the user
clicking the Edit mode and then manually typing a unique string).

Anyone out there have thoughts on this?  Am I thinking about this
incorrectly, or is this a time when a portlet has a legitimate reason for
fetching a unique identifier?

-Ben


>> Wiadomosc od jetspeed@theunderground.net z 2006-01-22 05:19 brzmiala:
>>
>>> Is there a way to get a portlet instance's unique ID without using the
>>> request object (namely, from the portlet init() method)?
>>
>> As far as I know, init() is common for the whole portlet lifecycle (all
>> instances) and is called at the webapp initialization (once for a
>> restart/deployment), while the unique fragmend ID appears at each
>> rendering the portlet (and it it constant as long as it is not changed
>> in PSML).
>>
>> In order to get access to all fragments use ContentPage and
>> ContentFragment implementations (getType() method to identify portlets)
>> and recurse through your portal structure parsing each .psml file.
>>
> A portlet isn't really supposed to know about its 'unique id' as that is
> an implementation detail of the portal.
>
> If you want to write portlets specific to Jetspeed-2, have a look at the
> j2-admin app which accesses portal services in the jetspeed-portlet.xml
>
> <js:services>
>          <js:service name='PageManager'/>
>          <js:service name='PermissionManager'/>
>          <js:service name='PortalAdministration'/>
> ...
> </js:services>
>
> ---------------------------------------------------------------------
> 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




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


Mime
View raw message