|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.cms.CMSExcursion
A CMS excursion is a way of making your code execute under an alternative environment (context). Override the excurse method to create a CMSExcursion. For example:
CMSExcursion excursion = new CMSExcursion() { public void excurse() { // Set up specific context variables. setContentItem(ItemDispatcher.getContentItem()); // Execute code in new context. }}; excursion.run();
CMS
,
KernelExcursion
Field Summary | |
static String |
versionId
|
Constructor Summary | |
CMSExcursion()
|
Method Summary | |
protected abstract void |
excurse()
When this method is called the current CMSContext is copied and the code inside the excurse() method is given the opportunity to modify the new context. |
void |
run()
Begins execution of the excursion. |
protected void |
setContentItem(ContentItem item)
Sets the current content item. |
protected void |
setContentSection(ContentSection section)
Sets the current content section. |
protected void |
setSecurityManager(SecurityManager security)
Sets the current security manager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public CMSExcursion()
Method Detail |
public final void run() throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
IOException
protected abstract void excurse() throws javax.servlet.ServletException, IOException
When this method is called the current CMSContext is copied and the code inside the excurse() method is given the opportunity to modify the new context. Any code then called from within the excurse() method is executed in this new context. After the excurse() method completes the old context is restored exactly as it was before. This makes it unnecessary to write error prone code like this:
ContentItem oldItem = context.getContentItem(); context.setContentItem(newItem); ... // do something ... context.setCOntentItem(oldItem); // If this is forgotten, bad // things can happen.
javax.servlet.ServletException
IOException
protected final void setContentSection(ContentSection section)
section
- the new content sectionprotected final void setContentItem(ContentItem item)
item
- the new content itemprotected final void setSecurityManager(SecurityManager security)
security
- the new SecurityManager
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |