com.arsdigita.cms.dispatcher
Class AbstractItemResolver

java.lang.Object
  extended bycom.arsdigita.cms.dispatcher.AbstractItemResolver
All Implemented Interfaces:
ItemResolver
Direct Known Subclasses:
MultilingualItemResolver, SimpleItemResolver

public abstract class AbstractItemResolver
extends Object
implements ItemResolver

Author:
bche

Field Summary
protected static String TEMPLATE_CONTEXT_PREFIX
           
 
Fields inherited from interface com.arsdigita.cms.dispatcher.ItemResolver
versionId
 
Constructor Summary
AbstractItemResolver()
           
 
Method Summary
abstract  String generateItemURL(com.arsdigita.bebop.PageState state, BigDecimal itemId, String name, ContentSection section, String context)
          Generates a URL for a content item.
abstract  String generateItemURL(com.arsdigita.bebop.PageState state, BigDecimal itemId, String name, ContentSection section, String context, String templateContext)
          Generates a URL for a content item.
abstract  String generateItemURL(com.arsdigita.bebop.PageState state, ContentItem item, ContentSection section, String context)
          Generates a URL for a content item.
abstract  String generateItemURL(com.arsdigita.bebop.PageState state, ContentItem item, ContentSection section, String context, String templateContext)
          Generates a URL for a content item.
abstract  String getCurrentContext(com.arsdigita.bebop.PageState state)
          Fetches the current context based on the page state.
abstract  ContentItem getItem(ContentSection section, String url, String context)
          Return a content item based on section, url, and use context.
abstract  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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_CONTEXT_PREFIX

protected static final String TEMPLATE_CONTEXT_PREFIX
See Also:
Constant Field Values
Constructor Detail

AbstractItemResolver

public AbstractItemResolver()
Method Detail

getItem

public abstract ContentItem getItem(ContentSection section,
                                    String url,
                                    String context)
Description copied from interface: ItemResolver
Return a content item based on section, url, and use context.

Specified by:
getItem in interface ItemResolver
Parameters:
section - The current content section
url - The section-relative URL
context - The use context
Returns:
The content item, or null if no such item exists

getCurrentContext

public abstract String getCurrentContext(com.arsdigita.bebop.PageState state)
Description copied from interface: ItemResolver
Fetches the current context based on the page state.

Specified by:
getCurrentContext in interface ItemResolver
Parameters:
state - the current page state
Returns:
the context of the current URL, such as "live" or "admin"

generateItemURL

public abstract String generateItemURL(com.arsdigita.bebop.PageState state,
                                       BigDecimal itemId,
                                       String name,
                                       ContentSection section,
                                       String context)
Description copied from interface: ItemResolver
Generates a URL for a content item.

Specified by:
generateItemURL in interface ItemResolver
Parameters:
itemId - The item ID
name - The name of the content page
state - The page state
section - the content section to which the item belongs
context - the context of the URL, such as "live" or "admin"
Returns:
The URL of the item
See Also:
ItemResolver.getCurrentContext(com.arsdigita.bebop.PageState)

generateItemURL

public abstract String generateItemURL(com.arsdigita.bebop.PageState state,
                                       BigDecimal itemId,
                                       String name,
                                       ContentSection section,
                                       String context,
                                       String templateContext)
Description copied from interface: ItemResolver
Generates a URL for a content item.

Specified by:
generateItemURL in interface ItemResolver
Parameters:
itemId - The item ID
name - The name of the content page
state - The page state
section - the content section to which the item belongs
context - the context of the URL, such as "live" or "admin"
templateContext - the context for the URL, such as "public"
Returns:
The URL of the item
See Also:
ItemResolver.getCurrentContext(com.arsdigita.bebop.PageState)

generateItemURL

public abstract String generateItemURL(com.arsdigita.bebop.PageState state,
                                       ContentItem item,
                                       ContentSection section,
                                       String context)
Description copied from interface: ItemResolver
Generates a URL for a content item.

Specified by:
generateItemURL in interface ItemResolver
Parameters:
item - The item
state - The page state
section - the content section to which the item belongs
context - the context of the URL, such as "live" or "admin"
Returns:
The URL of the item
See Also:
ItemResolver.getCurrentContext(com.arsdigita.bebop.PageState)

generateItemURL

public abstract String generateItemURL(com.arsdigita.bebop.PageState state,
                                       ContentItem item,
                                       ContentSection section,
                                       String context,
                                       String templateContext)
Description copied from interface: ItemResolver
Generates a URL for a content item.

Specified by:
generateItemURL in interface ItemResolver
Parameters:
item - The item
state - The page state
section - the content section to which the item belongs
context - the context of the URL, such as "live" or "admin"
templateContext - the context for the URL, such as "public"
Returns:
The URL of the item
See Also:
ItemResolver.getCurrentContext(com.arsdigita.bebop.PageState)

getMasterPage

public abstract CMSPage getMasterPage(ContentItem item,
                                      javax.servlet.http.HttpServletRequest request)
                               throws javax.servlet.ServletException
Description copied from interface: ItemResolver
Return a master page based on page state (and content section).

Specified by:
getMasterPage in interface ItemResolver
Parameters:
item - The content item
request - The HTTP request
Returns:
The master page
Throws:
javax.servlet.ServletException

getTemplateFromURL

public String getTemplateFromURL(String inUrl)
Finds the template context from the URL and returns it, if it is there. Otherwise, returns null.

Specified by:
getTemplateFromURL in interface ItemResolver
Parameters:
inUrl - the URL from which to get the template context
Returns:
the template context, or null if there is no template context

stripTemplateFromURL

public String stripTemplateFromURL(String inUrl)
Removes the template context from the inUrl.

Specified by:
stripTemplateFromURL in interface ItemResolver
Parameters:
inUrl - URL, possibly including the template context.
Returns:
inUrl with the template context removed


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2352 UTC