You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew MacDonald <an...@yahoo.com> on 2004/10/04 20:35:32 UTC

Changing the portal layout dynamically

Hello,
I am trying to change the portal layout dynamically
but am having problems doing so.  One of the
approaches I've tried is to access (and possibly
change) the portal context.  I've tried accessing it
from flow and from an XML page using the session
transformer.  The following is the code I've tried and
the errors I get...
>From flow:

var portalManager =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.portal.components.PortalManager.ROLE);
var portalContext = portalManager.getContext(true);
var xml = portalContext.getXML("/*");

That code produces the error:
"portal: portal-uri required for application 'portal'"

I've also tried from flow:

var contextMan =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);

var portalContext = contextMan.getContext("portal");
var xml = portalContext.getXML("/*");

That code produces the error:
"Portal context not available outside a coplet."

I also get that same error when I try to access the
portal context from XML.  For example:
<session:getxml context="portal" path="/*"/>

I'm almost certain I'm inside a coplet when using this
code so I don't understand the meaning of this error.

Any help towards solving these problems would be much
appreciated.  I've looked and haven't been able to
find any info on accessing the portal context.

Thanks,
Andrew MacDonald


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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


RE: Changing the portal layout dynamically

Posted by Carsten Ziegeler <cz...@apache.org>.
I think that you have to "initialize" the context on each request
before you can use it.
Usually you can do this by calling the "auth-protect" action in
the sitemap with the handler and the application parameter
before you call your flow.

HTH
Carsten 

> -----Original Message-----
> From: Andrew MacDonald [mailto:andrew_james_macdonald@yahoo.com] 
> Sent: Monday, October 04, 2004 8:36 PM
> To: users@cocoon.apache.org
> Subject: Changing the portal layout dynamically
> 
> Hello,
> I am trying to change the portal layout dynamically but am 
> having problems doing so.  One of the approaches I've tried 
> is to access (and possibly
> change) the portal context.  I've tried accessing it from 
> flow and from an XML page using the session transformer.  The 
> following is the code I've tried and the errors I get...
> >From flow:
> 
> var portalManager =
> cocoon.getComponent(Packages.org.apache.cocoon.webapps.portal.
> components.PortalManager.ROLE);
> var portalContext = portalManager.getContext(true); var xml = 
> portalContext.getXML("/*");
> 
> That code produces the error:
> "portal: portal-uri required for application 'portal'"
> 
> I've also tried from flow:
> 
> var contextMan =
> cocoon.getComponent(Packages.org.apache.cocoon.webapps.session
> .ContextManager.ROLE);
> 
> var portalContext = contextMan.getContext("portal"); var xml 
> = portalContext.getXML("/*");
> 
> That code produces the error:
> "Portal context not available outside a coplet."
> 
> I also get that same error when I try to access the portal 
> context from XML.  For example:
> <session:getxml context="portal" path="/*"/>
> 
> I'm almost certain I'm inside a coplet when using this code 
> so I don't understand the meaning of this error.
> 
> Any help towards solving these problems would be much 
> appreciated.  I've looked and haven't been able to find any 
> info on accessing the portal context.
> 
> Thanks,
> Andrew MacDonald
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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