Hi, ok, now I see the problem: All classes in the package org.apache.cocoon.webapps.portal belong to the portal framework, that's why I thought you're using that version. The classes for the portal engine are in o.a.c.portal.
If you want to change the layout dynamically from flow, then you have to lookup the portal service component in flow and set the portal name on that service. You can then retrieve the current profile from the profile manager. You get the profile manager from the portal service: getComponentManager().getProfileManager(). Creating new layout objects has to be done using the LayoutFactory, new coplets are created using the CopletFactory. Both components are available from the portal service (using getComponentManager().getXXX()) as well. You can then modify the layout the way you want. HTH Carsten > -----Original Message----- > From: Andrew MacDonald [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 13, 2004 5:59 PM > To: [EMAIL PROTECTED] > Subject: RE: Changing the portal layout dynamically > > Thanks for the help Carsten, but we are using the portal > engine, not the framework. Would I use the same approach for > the engine to modify the layout dynamically? Also, I noticed > in the API that there are two classes named > PortalManagerImpl. I'm assuming I'd want to use the > org.apache.cocoon.webapps.portal.components one? > > Thanks, > Andrew > > >Ok, I think this time I know the problem :) The "portal" > context is for > >coplets that want to store/retrieve information, like user > preferences. > >So this context is only available inside a pipeline rendering the > >content for a coplet. But not outside of it. > > > >If you want to change the layout etc. dynamically, you have > to do a lot > >of things yourself I fear. You have to find the right spots in the > >PortalManagerImpl class and find out how the profile is > stored in the > >session. I fear that this is not very easy (and intuitive). > The portal > >framework has no API to change to the profile dynamically :( > > > >Usually the portal is changed by request parameters (from one of the > >html based tools where you can add new coplets etc.). So one > >possibility is to hook your code into this system and call the same > >methods that are triggered by the request parameters. > Perhaps this can > >save you a little bit of work. > > > >HTH > >Carsten > > > > __________________________________ > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard. > http://promotions.yahoo.com/new_mail > > --------------------------------------------------------------------- > 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]
