|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ItemResolver is responsible for mapping a URL in a particular content section to a content item.
As an example, here is the item resolution process for a request to http://yourserver/cms/cheese:
The item resolver would be asked to map the URL stub /cheese
in the content section mounted at /cms to a content item. To
this end, the dispatcher calls the getItem method, passing in
the ContentSection
and the URL stub for the
item within the section, /cheese in our example. As a final
argument, the dispatcher passes either ContentItem.DRAFT or
ContentItem.LIVE to the ItemResolver, depending on
whether the returned item should be the live version (for public pages)
or the draft version (for previewing).
Field Summary | |
static String |
versionId
|
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 section, url, and use context. |
CMSPage |
getMasterPage(ContentItem item,
javax.servlet.http.HttpServletRequest request)
Return a master page based on page state (and content section). |
String |
getTemplateFromURL(String inUrl)
Finds the template context from the URL and returns it, if it is there. |
String |
stripTemplateFromURL(String inUrl)
Removes the template context from the inUrl . |
Field Detail |
public static final String versionId
Method Detail |
public ContentItem getItem(ContentSection section, String url, String context)
section
- The current content sectionurl
- The section-relative URLcontext
- The use context
public String getCurrentContext(com.arsdigita.bebop.PageState state)
state
- the current page state
public String generateItemURL(com.arsdigita.bebop.PageState state, BigDecimal itemId, String name, ContentSection section, String context)
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"
getCurrentContext(com.arsdigita.bebop.PageState)
public String generateItemURL(com.arsdigita.bebop.PageState state, BigDecimal itemId, String name, ContentSection section, String context, String templateContext)
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"
getCurrentContext(com.arsdigita.bebop.PageState)
public String generateItemURL(com.arsdigita.bebop.PageState state, ContentItem item, ContentSection section, String context)
item
- The itemstate
- The page statesection
- the content section to which the item belongscontext
- the context of the URL, such as "live" or "admin"
getCurrentContext(com.arsdigita.bebop.PageState)
public String generateItemURL(com.arsdigita.bebop.PageState state, ContentItem item, ContentSection section, String context, String templateContext)
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
item
- The content itemrequest
- The HTTP request
javax.servlet.ServletException
public String getTemplateFromURL(String inUrl)
inUrl
- the URL from which to get the template context
public String stripTemplateFromURL(String inUrl)
inUrl
.
inUrl
- URL, possibly including the template context.
inUrl
with the template context removed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |