|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.cms.dispatcher.AbstractItemResolver
com.arsdigita.cms.dispatcher.SimpleItemResolver
This is the default implementation of
ItemResolver
.
The getItem method of the default implementation of
ItemResolver,
SimpleItemResolver
runs a simple query using the passed in information to retrieve the
content item with a name that matches the URL stub, in our example
it looks for a content item with name cheese. If no such item
exists, or if there is such an item, but without a live version, even
though one has been requested, getItem returns null.
After the CMS Dispatcher received the content item from the
ItemResolver, it also asks it for the
MasterPage
for that item in the
current request. With the content item and the master page in hand,
the dispatcher calls service on the page.
Field Summary | |
static String |
versionId
|
Fields inherited from class com.arsdigita.cms.dispatcher.AbstractItemResolver |
TEMPLATE_CONTEXT_PREFIX |
Constructor Summary | |
SimpleItemResolver()
|
Method Summary | |
String |
generateItemURL(com.arsdigita.bebop.PageState state,
BigDecimal itemId,
String name,
ContentSection section,
String context)
Generates a URL for a content item. |
String |
generateItemURL(com.arsdigita.bebop.PageState state,
BigDecimal itemId,
String name,
ContentSection section,
String context,
String templateContext)
Generates a URL for a content item. |
String |
generateItemURL(com.arsdigita.bebop.PageState state,
ContentItem item,
ContentSection section,
String context)
Generates a URL for a content item. |
String |
generateItemURL(com.arsdigita.bebop.PageState state,
ContentItem item,
ContentSection section,
String context,
String templateContext)
Generates a URL for a content item. |
String |
getCurrentContext(com.arsdigita.bebop.PageState state)
Fetches the current context based on the page state. |
ContentItem |
getItem(ContentSection section,
String url,
String context)
Return a content item based on page state (and content section). |
ContentItem |
getItem(String url,
Folder rootFolder)
Return the content item at the specified path, or null if no such item exists. |
CMSPage |
getMasterPage(ContentItem item,
javax.servlet.http.HttpServletRequest request)
Return a master page based on page state (and content section). |
Methods inherited from class com.arsdigita.cms.dispatcher.AbstractItemResolver |
getTemplateFromURL, stripTemplateFromURL |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.arsdigita.cms.dispatcher.ItemResolver |
getTemplateFromURL, stripTemplateFromURL |
Field Detail |
public static final String versionId
Constructor Detail |
public SimpleItemResolver()
Method Detail |
public ContentItem getItem(ContentSection section, String url, String context)
getItem
in interface ItemResolver
getItem
in class AbstractItemResolver
section
- The current content sectionurl
- The section-relative URLcontext
- The LIVE/DRAFT context (*not* the template use context)
public String getCurrentContext(com.arsdigita.bebop.PageState state)
ItemResolver
getCurrentContext
in interface ItemResolver
getCurrentContext
in class AbstractItemResolver
state
- the current page state
public ContentItem getItem(String url, Folder rootFolder)
url
- the URL to the itemrootFolder
- The root folder where the item search will start
public String generateItemURL(com.arsdigita.bebop.PageState state, BigDecimal itemId, String name, ContentSection section, String context)
generateItemURL
in interface ItemResolver
generateItemURL
in class AbstractItemResolver
itemId
- The item IDname
- The name of the content pagestate
- The page statesection
- the content section to which the item belongscontext
- the context of the URL, such as "LIVE" or "DRAFT"
public String generateItemURL(com.arsdigita.bebop.PageState state, BigDecimal itemId, String name, ContentSection section, String context, String templateContext)
generateItemURL
in interface ItemResolver
generateItemURL
in class AbstractItemResolver
itemId
- The item IDname
- The name of the content pagestate
- The page statesection
- the content section to which the item belongscontext
- the context of the URL, such as "live" or "admin"templateContext
- the context for the URL, such as "public"
public String generateItemURL(com.arsdigita.bebop.PageState state, ContentItem item, ContentSection section, String context)
generateItemURL
in interface ItemResolver
generateItemURL
in class AbstractItemResolver
item
- The itemstate
- The page statesection
- the content section to which the item belongscontext
- the context of the URL, such as "LIVE" or "DRAFT"
getCurrentContext(com.arsdigita.bebop.PageState)
public String generateItemURL(com.arsdigita.bebop.PageState state, ContentItem item, ContentSection section, String context, String templateContext)
generateItemURL
in interface ItemResolver
generateItemURL
in class AbstractItemResolver
item
- The itemstate
- The page statesection
- the content section to which the item belongscontext
- the context of the URL, such as "live" or "admin"templateContext
- the context for the URL, such as "public"
getCurrentContext(com.arsdigita.bebop.PageState)
public CMSPage getMasterPage(ContentItem item, javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
getMasterPage
in interface ItemResolver
getMasterPage
in class AbstractItemResolver
item
- The content itemrequest
- The HTTP request
javax.servlet.ServletException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |