cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guido Casper <gcas...@s-und-n.de>
Subject Re: Portal: ApplicationCopletAdapter and persistent links
Date Tue, 22 Jan 2008 07:48:41 GMT
Yes, page labels work fine. I use page labels as they already identify 
the portal state through urls and I only have to "attach" the 
CopletLinkEvent when persisting links/urls - so I thought.

Thanks
Guido

Ralph Goers schrieb:
> Have you configured your application to actually use page labels? By 
> default they are disabled.
> 
> Guido Casper wrote:
>> Hi all,
>>
>> I am trying to implement persistent links within an application coplet 
>> of the portal. By default the internal links of external applications 
>> are dynamically converted to "?cocoon-portal-event=xx" parameters at 
>> runtime. So a particular page of an external application is not easily 
>> bookmarkable or to be incorporated in search results, etc. So to have 
>> a search crawler be able to index these pages, these links have to be 
>> globally valid, identifyable and have to survive Tomcat restarts. In 
>> short, they have to be persistent.
>>
>> I found it would be easiest to base the implementation on the 
>> PageLabelEventConverter.
>>
>> As a test I tried to manually create a CopletLinkEvent within the 
>> start Method (initialize() wouldn't work because this code accesses 
>> the ProfileManager) to simulate recreating these Links from a 
>> persistent store:
>>
>> public void start() {
>>     String label = this.labelManager.setCurrentLabel();
>>     try {
>>         PortalService portalService = 
>> (PortalService)this.manager.lookup(PortalService.ROLE);
>>         PortalComponentManager componentManager = 
>> portalService.getComponentManager();
>>         ProfileManager profileManager = 
>> componentManager.getProfileManager();
>>         if (this.eventList.size() == 0) {
>>             CopletInstanceData cid = 
>> profileManager.getCopletInstanceData( "Google-1" );
>>             if (cid != null) {
>>                 cid.setAttribute("cookie", null);
>>                 cid.setAttribute("documentbase", 
>> "http://www.google.de/");
>>                 Event persistentEevent = new CopletLinkEvent(cid, 
>> "/intl/de/about.html");
>>                 this.eventList.add(persistentEevent);
>>             }
>>         }
>>     } catch (ServiceException se) {
>>         this.getLogger().error("Error getting " + PortalService.ROLE + 
>> ": ", se);
>>     }
>> }
>>
>> The event gets correctly endoded into the pages. Even decoding seems 
>> to work correctly, however clicking this link simply reloads the 
>> current page.
>>
>> Any idea what might go wrong is much appreciated. The complete Code of 
>> PageLabelPersistentEventConverter is below.
>>
>> Thanks
>> Guido
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

-- 
Freundliche Grüße / With kind regards
Guido Casper

S&N AG
Klingenderstr. 5
D 33100 Paderborn

voice  +49 5251/1581-87
fax    +49 5251/1581-71
eMail  gcasper@s-und-n.de
Web    http://www.s-und-n.de

Vorstand
Klaus Beverungen
Josef Tillmann

Vorsitzender des Aufsichtsrates
Heinz-Dieter Wendorff

Handelsregister
Amtsgericht Paderborn HRB 3270

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message