KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlet > exomvc > Page


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portlet.exomvc;
6
7 import javax.portlet.ActionRequest;
8 import javax.portlet.ActionResponse;
9 import javax.portlet.RenderRequest;
10 import javax.portlet.RenderResponse;
11 import org.exoplatform.portlet.exomvc.config.Configuration;
12
13 /**
14  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
15  * @since Nov 7, 2004
16  * @version $Id$
17  */

18 public class Page {
19   final static public String JavaDoc VELOCITY_CONTEXT = "mvc.velocity.context" ;
20   
21   final static public String JavaDoc PAGE_URL = "mvc.page.url" ;
22   final static public String JavaDoc PAGE_NAME = "mvc.page.name" ;
23   final static public String JavaDoc FORWARD_PAGE = "mvc.page.forward" ;
24   
25   private Configuration configuration_ ;
26   private String JavaDoc pageName_ ;
27   
28   public String JavaDoc getPageName() { return pageName_ ; }
29   public void setPageName(String JavaDoc s) { pageName_ = s ; }
30   
31   public void render(RenderRequest req, RenderResponse res) throws Exception JavaDoc {
32     
33   }
34   
35   public void processAction(ActionRequest req, ActionResponse res) throws Exception JavaDoc {
36     
37   }
38   
39   public Configuration getConfiguration() { return configuration_ ; }
40   public void setConfiguration(Configuration c) { configuration_ = c ;}
41   
42   public String JavaDoc getPageURL(RenderResponse res) {
43     return res.createActionURL().toString() + "&" + PAGE_NAME + "=" + pageName_;
44   }
45   
46   public void setForwardPage(ActionResponse res, String JavaDoc pageName) {
47     res.setRenderParameter(FORWARD_PAGE, pageName) ;
48   }
49 }
Popular Tags