com.ideo.sweetdevria.page
Class Page

java.lang.Object
  extended by com.ideo.sweetdevria.page.Page
All Implemented Interfaces:
java.io.Serializable

public class Page
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static java.lang.String REQ_PAGE_ID
           
static java.lang.String SESS_PAGE_ID
           
 
Constructor Summary
Page(java.lang.String _id, javax.servlet.http.HttpSession _session)
           
 
Method Summary
 void addModel(IModel model)
          Add a model as a part of this page+session
 java.lang.String getId()
           
 IModel getModel(java.lang.String id)
          Return the Model corresponding to this id
 ModelRegistry getModelRegistry()
          Return the model registry for this page, with some APIs describing the state of the models
static java.lang.String getPageId(javax.servlet.http.HttpSession _sess)
           
static java.lang.String getPageId(javax.servlet.ServletRequest _req)
           
 javax.servlet.http.HttpSession getSession()
           
static java.lang.String initPageId(javax.servlet.http.HttpServletRequest request, java.lang.String pageName)
          Init a page id for the current http request First look up if one exists is the request, then if one is specified in the page, then if the session one should be propagated, and finally generate one if all the previous check fail
static java.lang.String initPageId(javax.servlet.jsp.PageContext pageContext, java.lang.String pageName)
          Init a page id for the current page context First look up if one exists is the request, then if one is specified in the page, then if the session one should be propagated, and finally generate one if all the previous check fail
static java.lang.String initPageId(javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session, java.lang.String pageName)
          Init a page id for this couple request/session First look up if one exists is the request, then if one is specified in the page, then if the session one should be propagated, and finally generate one if all the previous check fail
 void setId(java.lang.String _id)
           
static void setPageId(javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session, java.lang.String _idPage)
          Set a page id for the corresponding request and session
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REQ_PAGE_ID

public static final java.lang.String REQ_PAGE_ID
See Also:
Constant Field Values

SESS_PAGE_ID

public static final java.lang.String SESS_PAGE_ID
See Also:
Constant Field Values
Constructor Detail

Page

public Page(java.lang.String _id,
            javax.servlet.http.HttpSession _session)
Method Detail

getId

public java.lang.String getId()

setId

public void setId(java.lang.String _id)

getSession

public javax.servlet.http.HttpSession getSession()

getPageId

public static java.lang.String getPageId(javax.servlet.ServletRequest _req)
Parameters:
_req - the request to look up the page id
Returns:
The page id corresponding to this request, or null if none has been found

getPageId

public static java.lang.String getPageId(javax.servlet.http.HttpSession _sess)
Parameters:
_sess - the session to look up the page id
Returns:
The page id corresponding to this request, or null if none has been found

setPageId

public static void setPageId(javax.servlet.ServletRequest request,
                             javax.servlet.http.HttpSession session,
                             java.lang.String _idPage)
Set a page id for the corresponding request and session

Parameters:
request - the request related to the page id
session - the session of the user
_idPage - the page id

initPageId

public static java.lang.String initPageId(javax.servlet.jsp.PageContext pageContext,
                                          java.lang.String pageName)
Init a page id for the current page context First look up if one exists is the request, then if one is specified in the page, then if the session one should be propagated, and finally generate one if all the previous check fail

Parameters:
pageContext - the page context of the page
pageName - the name specified in the page in resourcesImport (null if none)
Returns:
a pageId for this page context

initPageId

public static java.lang.String initPageId(javax.servlet.http.HttpServletRequest request,
                                          java.lang.String pageName)
Init a page id for the current http request First look up if one exists is the request, then if one is specified in the page, then if the session one should be propagated, and finally generate one if all the previous check fail

Parameters:
request - the http request which contains the request data
pageName - the name specified in the page in resourcesImport (null if none)
Returns:
a pageId for this http request

initPageId

public static java.lang.String initPageId(javax.servlet.ServletRequest request,
                                          javax.servlet.http.HttpSession session,
                                          java.lang.String pageName)
Init a page id for this couple request/session First look up if one exists is the request, then if one is specified in the page, then if the session one should be propagated, and finally generate one if all the previous check fail

Parameters:
request - the servlet request
session - the session to init for
pageName - the name specified in the page in resourcesImport (null if none)
Returns:
a pageId for this couple request/session

getModelRegistry

public ModelRegistry getModelRegistry()
Return the model registry for this page, with some APIs describing the state of the models

Returns:
the model registry for this page

getModel

public IModel getModel(java.lang.String id)
Return the Model corresponding to this id

Parameters:
id - the id of the model to get for this page
Returns:
the model corresponding to this page and this id
Throws:
java.lang.IllegalArgumentException - if no model exist with this id
See Also:
for more APIs on this page's models

addModel

public void addModel(IModel model)
Add a model as a part of this page+session

Parameters:
model - the model to add to the registry of this page

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Ideo Technologies. All Rights Reserved.