[Logo] Infoglue - Official Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Different behaviour in working, live, etc.  XML
Forum Index » Component Development
Author Message
baek

User

Joined: 17/11/2009 12:53:49
Messages: 12
Location: Aalborg University, Denmark
Offline

We are interested in having different behaviour of components in infoglueDevlierWorking, infoglueDeliverLive, etc.

E.g. we have a "redirect" component, which redirects to another sitenode or external site. But when we have specified where the redirect should go to, the sitenode will actually do the redirection, and we don't have the possibility to change the redirect URL.

In infoglueDeliverWorking we want to have a page explaining where the redirect is going to, whereas infoglueDeliverLive of cause should do the actual redirect. In that way it should be possible to change the redirect URL.

Is there a way in jsp to check which context, we are in?

Lasse Bæk
AAU Portal Team
Aalborg University
David

User

Joined: 10/11/2009 17:51:18
Messages: 25
Location: Université Lille 1, France
Offline

That should do the trick :

Context Path: <%=request.getContextPath()%>
baek

User

Joined: 17/11/2009 12:53:49
Messages: 12
Location: Aalborg University, Denmark
Offline

Thanks, David!

Yep - that's an acceptable solution. I was thinking it could maybe be found through the page:pageContext/deliveryContext tags - maybe it would be a useful feature to add here...?

Lasse Bæk
AAU Portal Team
Aalborg University
jaric

Admin
[Avatar]

Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline

I'm not sure if this is what you asked for, but I got his from Bogeblad once, when asking a similar question (my translation from Swedish):

pc.isInPageComponentMode tells you if you're in page building mode or not
pc.isDecorated tells you if EditOnSight is enabled
pc.operatingMode gives the deliver mode: 0 = working, 2=preview, 3=live

Where pc is declared with <page:pageContext id="pc"/>


Peter Jaric
Division for IT and Procurement
Uppsala University
[WWW]
baek

User

Joined: 17/11/2009 12:53:49
Messages: 12
Location: Aalborg University, Denmark
Offline

Beautiful - that was exactly what I thought of!

Lasse Bæk
AAU Portal Team
Aalborg University
jaric

Admin
[Avatar]

Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline

baek wrote:Beautiful - that was exactly what I thought of!

Good!

Since the pc variable here is an instance of the interface TemplateController (and in reality of the class BasicTemplateController) all public getters from that interface are available for use in components, so there may be more interesting stuff there to look for.

Peter Jaric
Division for IT and Procurement
Uppsala University
[WWW]
 
Forum Index » Component Development
Go to:   
Powered by JForum 2.1.8 © JForum Team