|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.velocity.JetspeedPowerToolImpl
public class JetspeedPowerToolImpl
JetspeedPowerTool
The JetspeedPowerTool is meant to be used by template designers to build templates for internal Jetspeed portlet applications. It hides the implementation details of the more common template actions so that future changes to said implementation have minimal effect on template.
Where applicable, methods have been marked with a BEST PRATICES meaning that this method should be used instead the synonymous code listed within the method docuementation.
Field Summary | |
---|---|
private static String |
ACTION_IMAGE_EXTENSION_ATTR
|
private org.apache.jetspeed.container.url.BasePortalURL |
baseUrlAccess
|
protected org.apache.jetspeed.capabilities.CapabilityMap |
capabilityMap
|
protected static String |
COLUMN_SIZES
|
protected static String |
COLUMNS_ATTR
|
protected org.apache.jetspeed.locator.TemplateLocator |
decorationLocator
|
protected org.apache.jetspeed.locator.LocatorDescriptor |
decorationLocatorDescriptor
|
private static String |
DECORATOR_ID_ATTR
|
protected org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent |
entityAccess
|
protected Locale |
locale
|
protected static org.apache.commons.logging.Log |
log
|
protected static String |
PORTLET_CONFIG_ATTR
|
protected javax.portlet.PortletConfig |
portletConfig
|
protected static String |
RENDER_REQUEST_ATTR
|
protected static String |
RENDER_RESPONSE_ATTR
|
private org.apache.jetspeed.aggregator.PortletRenderer |
renderer
|
protected javax.portlet.RenderRequest |
renderRequest
|
protected javax.portlet.RenderResponse |
renderResponse
|
protected org.apache.jetspeed.request.RequestContext |
requestContext
|
protected org.apache.jetspeed.locator.TemplateLocator |
templateLocator
|
protected org.apache.jetspeed.locator.LocatorDescriptor |
templateLocatorDescriptor
|
protected Writer |
templateWriter
|
private DynamicTitleService |
titleService
|
protected org.apache.velocity.context.Context |
velocityContext
|
protected org.apache.jetspeed.container.window.PortletWindowAccessor |
windowAccess
|
Fields inherited from interface org.apache.jetspeed.layout.JetspeedPowerTool |
---|
DECORATOR_TYPE, FRAGMENT_ATTR, FRAGMENT_PROCESSING_ERROR_PREFIX, GENERIC_TEMPLATE_TYPE, HIDDEN, LAYOUT_ATTR, LAYOUT_TEMPLATE_TYPE |
Constructor Summary | |
---|---|
JetspeedPowerToolImpl(org.apache.jetspeed.request.RequestContext requestContext,
DynamicTitleService titleService,
org.apache.jetspeed.aggregator.PortletRenderer renderer)
|
Method Summary | |
---|---|
protected void |
checkState()
|
String |
decorateAndInclude(org.apache.jetspeed.om.page.ContentFragment f)
Decorate and include fragment content. |
protected String |
decorateAndIncludePortlet(org.apache.jetspeed.om.page.ContentFragment f)
The decorator template itself is responsible for including the content of the target Fragment which is easily acheived like so: in Velocity: |
String |
getAbsoluteUrl(String relativePath)
|
String |
getBasePath()
|
List[] |
getColumns()
|
List |
getColumnSizes()
|
Object |
getComponent(String name)
|
org.apache.jetspeed.om.page.ContentFragment |
getCurrentFragment()
|
org.apache.jetspeed.om.page.ContentFragment |
getCurrentLayout()
|
org.apache.pluto.om.entity.PortletEntity |
getCurrentPortletEntity()
|
org.apache.jetspeed.locator.TemplateDescriptor |
getDecoration(String path,
String templateType)
|
List |
getDecoratorActions()
Deprecated. |
boolean |
getLoggedOn()
|
javax.portlet.PortletMode |
getMappedPortletMode()
Gets the internal (portal) portlet mode for a current portlet window (fragment) |
javax.portlet.WindowState |
getMappedWindowState()
Gets the internal (portal) window state for the current portlet window (fragment) |
org.apache.jetspeed.om.page.Page |
getPage()
|
String |
getPageBasePath()
|
List |
getPageDecoratorActions()
Deprecated. |
org.apache.pluto.om.entity.PortletEntity |
getPortletEntity(org.apache.jetspeed.om.page.ContentFragment f)
|
javax.portlet.PortletMode |
getPortletMode()
Gets the portlet mode for a current portlet window (fragment) |
protected org.apache.jetspeed.request.RequestContext |
getRequestContext()
getRequestContext |
Subject |
getSubject()
|
org.apache.jetspeed.locator.TemplateDescriptor |
getTemplate(String path,
String templateType)
Retreives a template using Jetspeed's |
protected org.apache.jetspeed.locator.TemplateDescriptor |
getTemplate(String path,
String templateType,
org.apache.jetspeed.locator.TemplateLocator locator,
org.apache.jetspeed.locator.LocatorDescriptor descriptor)
|
String |
getTitle(org.apache.pluto.om.entity.PortletEntity entity)
getTitle |
String |
getTitle(org.apache.pluto.om.entity.PortletEntity entity,
org.apache.jetspeed.om.page.ContentFragment f)
getTitle |
org.apache.commons.configuration.Configuration |
getTypeConfiguration(String type,
String name,
String location)
|
javax.portlet.WindowState |
getWindowState()
Gets the window state for the current portlet window (fragment) |
protected void |
handleError(Exception e,
String msg,
org.apache.jetspeed.om.page.ContentFragment fragment)
handleError |
String |
includeDecoration(String template,
String templateType)
|
String |
includeTemplate(String template,
String templateType)
|
boolean |
isHidden(org.apache.jetspeed.om.page.ContentFragment f)
Checks the the visibilty of this fragment with respect to the current RenderReqeust. |
String |
renderPortletEntity(String entityId,
String portletId)
|
protected void |
setAttribute(String name,
Object object)
Sets an attribute for use within your layout and decoration templates. |
void |
setCurrentFragment(org.apache.jetspeed.om.page.ContentFragment f)
|
void |
setCurrentLayout()
|
void |
setVelocityContext(org.apache.velocity.context.Context velocityContext)
Sets the Velocity Context object for this powertool instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String DECORATOR_ID_ATTR
private static final String ACTION_IMAGE_EXTENSION_ATTR
protected static final String PORTLET_CONFIG_ATTR
protected static final String RENDER_RESPONSE_ATTR
protected static final String RENDER_REQUEST_ATTR
protected static final String COLUMNS_ATTR
protected static final String COLUMN_SIZES
protected javax.portlet.RenderRequest renderRequest
protected javax.portlet.RenderResponse renderResponse
protected javax.portlet.PortletConfig portletConfig
protected Writer templateWriter
protected static final org.apache.commons.logging.Log log
protected org.apache.jetspeed.capabilities.CapabilityMap capabilityMap
protected Locale locale
protected org.apache.jetspeed.locator.LocatorDescriptor templateLocatorDescriptor
protected org.apache.jetspeed.locator.TemplateLocator templateLocator
protected org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent entityAccess
protected org.apache.jetspeed.locator.TemplateLocator decorationLocator
protected org.apache.jetspeed.locator.LocatorDescriptor decorationLocatorDescriptor
protected org.apache.jetspeed.container.window.PortletWindowAccessor windowAccess
protected org.apache.jetspeed.request.RequestContext requestContext
protected org.apache.velocity.context.Context velocityContext
private DynamicTitleService titleService
private org.apache.jetspeed.container.url.BasePortalURL baseUrlAccess
private org.apache.jetspeed.aggregator.PortletRenderer renderer
Constructor Detail |
---|
public JetspeedPowerToolImpl(org.apache.jetspeed.request.RequestContext requestContext, DynamicTitleService titleService, org.apache.jetspeed.aggregator.PortletRenderer renderer) throws Exception
Exception
Method Detail |
---|
protected final org.apache.jetspeed.request.RequestContext getRequestContext()
getRequestContext
public javax.portlet.WindowState getWindowState() throws Exception
getWindowState
in interface org.apache.jetspeed.layout.JetspeedPowerTool
Exception
public javax.portlet.WindowState getMappedWindowState() throws Exception
getMappedWindowState
in interface org.apache.jetspeed.layout.JetspeedPowerTool
Exception
public javax.portlet.PortletMode getPortletMode() throws Exception
getPortletMode
in interface org.apache.jetspeed.layout.JetspeedPowerTool
Exception
public javax.portlet.PortletMode getMappedPortletMode() throws Exception
getMappedPortletMode
in interface org.apache.jetspeed.layout.JetspeedPowerTool
Exception
public org.apache.jetspeed.om.page.ContentFragment getCurrentFragment()
getCurrentFragment
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public void setCurrentFragment(org.apache.jetspeed.om.page.ContentFragment f)
setCurrentFragment
in interface org.apache.jetspeed.layout.JetspeedPowerTool
f
- public void setCurrentLayout()
setCurrentLayout
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public org.apache.jetspeed.om.page.ContentFragment getCurrentLayout()
getCurrentLayout
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public org.apache.jetspeed.om.page.Page getPage()
getPage
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public List[] getColumns()
getColumns
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public List getColumnSizes()
getColumnSizes
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public org.apache.pluto.om.entity.PortletEntity getCurrentPortletEntity() throws Exception
getCurrentPortletEntity
in interface org.apache.jetspeed.layout.JetspeedPowerTool
Exception
public org.apache.pluto.om.entity.PortletEntity getPortletEntity(org.apache.jetspeed.om.page.ContentFragment f) throws Exception
getPortletEntity
in interface org.apache.jetspeed.layout.JetspeedPowerTool
f
- Fragment whose PortletEntity
we want to
retreive.
Exception
public boolean isHidden(org.apache.jetspeed.om.page.ContentFragment f)
isHidden
in interface org.apache.jetspeed.layout.JetspeedPowerTool
f
- Fragment
public org.apache.jetspeed.locator.TemplateDescriptor getTemplate(String path, String templateType) throws org.apache.jetspeed.locator.TemplateLocatorException
getTemplate
in interface org.apache.jetspeed.layout.JetspeedPowerTool
path
- Expected to the template. This may actually be changed by the
TL service based the capability and localization information
provided by the client.templateType
- Type off template we are interested in.
org.apache.jetspeed.locator.TemplateLocatorException
- if the path
does not exist.TemplateLocator
public org.apache.commons.configuration.Configuration getTypeConfiguration(String type, String name, String location) throws Exception
Exception
public org.apache.jetspeed.locator.TemplateDescriptor getDecoration(String path, String templateType) throws org.apache.jetspeed.locator.TemplateLocatorException
getDecoration
in interface org.apache.jetspeed.layout.JetspeedPowerTool
org.apache.jetspeed.locator.TemplateLocatorException
public String includeTemplate(String template, String templateType) throws IOException
includeTemplate
in interface org.apache.jetspeed.layout.JetspeedPowerTool
IOException
public String includeDecoration(String template, String templateType) throws IOException
includeDecoration
in interface org.apache.jetspeed.layout.JetspeedPowerTool
IOException
public String decorateAndInclude(org.apache.jetspeed.om.page.ContentFragment f) throws Exception
Decorate and include fragment content.
decorateAndInclude
in interface org.apache.jetspeed.layout.JetspeedPowerTool
f
- Fragment to include and decorate
Exception
protected String decorateAndIncludePortlet(org.apache.jetspeed.om.page.ContentFragment f) throws Exception
The decorator template itself is responsible for including the content of
the target Fragment which is easily acheived like so:
in Velocity:
$jetspeed.include($jetspeed.currentFragment)
In JSP:
<%
JetspeedPowerTool jetspeed = new JetspeedPowerTool(renderRequest, renderResponse, portletConfig);
jetspeed.include(jetspeed.getCurrentFragment());
%>
f
- Portlet fragment to "decorate"
Exception
protected void checkState()
IllegalStateException
- if the PortletConfig
,
RenderRequest
or RenderReponse
is null.protected org.apache.jetspeed.locator.TemplateDescriptor getTemplate(String path, String templateType, org.apache.jetspeed.locator.TemplateLocator locator, org.apache.jetspeed.locator.LocatorDescriptor descriptor) throws org.apache.jetspeed.locator.TemplateLocatorException
org.apache.jetspeed.locator.TemplateLocatorException
protected void handleError(Exception e, String msg, org.apache.jetspeed.om.page.ContentFragment fragment)
handleError
e
- msg
- public List getDecoratorActions()
getDecoratorActions
in interface org.apache.jetspeed.layout.JetspeedPowerTool
Exception
public List getPageDecoratorActions() throws Exception
getPageDecoratorActions
in interface org.apache.jetspeed.layout.JetspeedPowerTool
Exception
public String getTitle(org.apache.pluto.om.entity.PortletEntity entity, org.apache.jetspeed.om.page.ContentFragment f)
getTitle
Returns the appropriate for the title based on locale prferences
getTitle
in interface org.apache.jetspeed.layout.JetspeedPowerTool
entity
-
public String getTitle(org.apache.pluto.om.entity.PortletEntity entity)
getTitle
Returns the appropriate for the title based on locale prferences
getTitle
in interface org.apache.jetspeed.layout.JetspeedPowerTool
entity
-
public Object getComponent(String name)
getComponent
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public String getAbsoluteUrl(String relativePath)
getAbsoluteUrl
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public Subject getSubject()
getSubject
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public boolean getLoggedOn()
getLoggedOn
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public String getBasePath()
getBasePath
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public String getPageBasePath()
getPageBasePath
in interface org.apache.jetspeed.layout.JetspeedPowerTool
public void setVelocityContext(org.apache.velocity.context.Context velocityContext)
JetspeedVelocityPowerTool
setVelocityContext
in interface JetspeedVelocityPowerTool
protected void setAttribute(String name, Object object)
javax.portlet.Renderrequest
and is also stored within the
current org.apache.velocity.Context
if it is available.
name
- to store the attribute under.obj
- object to set.public String renderPortletEntity(String entityId, String portletId)
renderPortletEntity
in interface org.apache.jetspeed.layout.JetspeedPowerTool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |