Package nl.gx.webmanager.springmvc
Class EditContextImpl
- java.lang.Object
-
- nl.gx.webmanager.springmvc.EditContextImpl
-
- All Implemented Interfaces:
EditContext
public class EditContextImpl extends Object implements EditContext
Implementation of the EditContext interface. Contains a stack of objects. Current active object in the active jsp is on top of the stack.- Author:
- arjans
-
-
Field Summary
-
Fields inherited from interface nl.gx.webmanager.springmvc.EditContext
EDIT_CONTEXT_KEY
-
-
Constructor Summary
Constructors Constructor Description EditContextImpl(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDelegatedController(Object object, DelegatedController delegatedController)
void
addExtension(Object object, ExtensionProvider extensionProvider)
void
addModelAndView(Object object, org.springframework.web.servlet.ModelAndView modelAndView)
Adds a model and view to the edit context.Object
getBaseModel()
Return model at the top of the stack.Object
getBaseObject()
Return object at the top of the stack.Collection<DelegatedController>
getDelegatedControllers(Object object)
Collection<ExtensionProvider>
getExtensions(Object object)
Object
getFirstObject()
Returns the first component in the the stack.org.springframework.web.servlet.ModelAndView
getModelAndView(Object object)
Returns the ModelAndView for the given object.Website
getWebsite()
Retrieve the website from the user sessionvoid
pop()
Pop the top object and presentation.void
popModel()
Pop the top model.void
push(Object activeObject)
Add an object and a presentation to the stack.void
pushModel(Map<String,Object> model)
Add a model and a presentation to the stack.
-
-
-
Method Detail
-
getBaseObject
public Object getBaseObject()
Description copied from interface:EditContext
Return object at the top of the stack.- Specified by:
getBaseObject
in interfaceEditContext
- Returns:
- object at the top of the stack.
-
getBaseModel
public Object getBaseModel()
Description copied from interface:EditContext
Return model at the top of the stack.- Specified by:
getBaseModel
in interfaceEditContext
- Returns:
- model at the top of the stack.
-
pop
public void pop()
Description copied from interface:EditContext
Pop the top object and presentation.- Specified by:
pop
in interfaceEditContext
-
popModel
public void popModel()
Description copied from interface:EditContext
Pop the top model.- Specified by:
popModel
in interfaceEditContext
-
push
public void push(Object activeObject)
Description copied from interface:EditContext
Add an object and a presentation to the stack.- Specified by:
push
in interfaceEditContext
-
pushModel
public void pushModel(Map<String,Object> model)
Description copied from interface:EditContext
Add a model and a presentation to the stack.- Specified by:
pushModel
in interfaceEditContext
-
getFirstObject
public Object getFirstObject()
Description copied from interface:EditContext
Returns the first component in the the stack.- Specified by:
getFirstObject
in interfaceEditContext
- Returns:
- the first component in the the stack.
-
getWebsite
public Website getWebsite()
Description copied from interface:EditContext
Retrieve the website from the user session- Specified by:
getWebsite
in interfaceEditContext
- Returns:
- The website
-
addModelAndView
public void addModelAndView(Object object, org.springframework.web.servlet.ModelAndView modelAndView)
Description copied from interface:EditContext
Adds a model and view to the edit context. The RenderTag will load the View to be rendered from the EditContext.- Specified by:
addModelAndView
in interfaceEditContext
- Parameters:
object
- Object (form backing object or business object) for which the View should be setmodelAndView
- The ModelAndView to add to the EditContext
-
getModelAndView
public org.springframework.web.servlet.ModelAndView getModelAndView(Object object)
Description copied from interface:EditContext
Returns the ModelAndView for the given object. The RenderTag will load the View to be rendered from the EditContext.- Specified by:
getModelAndView
in interfaceEditContext
- Parameters:
object
- Object (form backing object or business object) for which the View should be retrieved- Returns:
- The ModelAndView for the object
-
getExtensions
public Collection<ExtensionProvider> getExtensions(Object object)
- Specified by:
getExtensions
in interfaceEditContext
-
addExtension
public void addExtension(Object object, ExtensionProvider extensionProvider)
- Specified by:
addExtension
in interfaceEditContext
-
getDelegatedControllers
public Collection<DelegatedController> getDelegatedControllers(Object object)
- Specified by:
getDelegatedControllers
in interfaceEditContext
-
addDelegatedController
public void addDelegatedController(Object object, DelegatedController delegatedController)
- Specified by:
addDelegatedController
in interfaceEditContext
-
-