com.arsdigita.cms.dispatcher
Class Utilities

java.lang.Object
  extended bycom.arsdigita.cms.dispatcher.Utilities

public class Utilities
extends Object

This class provides many utility functions for the Content Management System.

Version:
$Revision: #16 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Michael Pih (pihman@arsdigita.com)

Field Summary
static String CMS_SERVICE
           
static String CMS_WORKSPACE
           
static org.apache.log4j.Logger LOG
           
static String versionId
           
 
Constructor Summary
Utilities()
           
 
Method Summary
static void disableBrowserCache(javax.servlet.http.HttpServletResponse response)
          Deprecated. use com.arsdigita.dispatcher.DispatcherHelper.cacheDisable(HttpServletResponse)
static String getAssetURL(BigDecimal assetId)
          Constuct a URL which serves a binary asset.
static String getAssetURL(BinaryAsset asset)
          Constuct a URL which serves a binary asset.
static com.arsdigita.kernel.User getCurrentUser(javax.servlet.http.HttpServletRequest request)
          Deprecated. use KernelContext.getParty()
static String getGlobalAssetsURL()
           
static String getImageOID(ImageAsset asset)
          Constuct an oid for the image.
static String getImageURL(ImageAsset asset)
          Constuct a URL which serves an image.
static Date getLastSectionRefresh()
          Check for the last refresh on authoring kits or content types in any section.
static Date getLastSectionRefresh(ContentSection section)
          Check for the last refresh on authoring kits or content types in a section.
static String getLogoutURL()
          The URL to log out.
static SecurityManager getSecurityManager(com.arsdigita.bebop.PageState state)
          Fetch the security manager.
static String getServiceURL()
          Fetch the location of the CMS Services package.
static String getWebappContext()
          Fetch the context path of the request.
static String getWorkspaceURL()
          Fetch the location of the CMS Workspace package.
static void refreshAdminUI(com.arsdigita.bebop.PageState state)
          Force the authoring UI to reload.
static void refreshItemUI(com.arsdigita.bebop.PageState state)
          Force the authoring UI to reload.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

CMS_WORKSPACE

public static final String CMS_WORKSPACE
See Also:
Constant Field Values

CMS_SERVICE

public static final String CMS_SERVICE
See Also:
Constant Field Values

LOG

public static final org.apache.log4j.Logger LOG
Constructor Detail

Utilities

public Utilities()
Method Detail

getWorkspaceURL

public static String getWorkspaceURL()
Fetch the location of the CMS Workspace package. Caches the result.

Returns:
The URL of the CMS Workspace package

getServiceURL

public static String getServiceURL()
Fetch the location of the CMS Services package. Caches the result.

Returns:
The URL of the CMS Services package

getLogoutURL

public static String getLogoutURL()
The URL to log out.

Returns:
The logout URL

getAssetURL

public static String getAssetURL(BinaryAsset asset)
Constuct a URL which serves a binary asset.

Parameters:
asset - The binary asset
Returns:
the URL which will serve the specified binary asset

getAssetURL

public static String getAssetURL(BigDecimal assetId)
Constuct a URL which serves a binary asset.

Parameters:
assetId - The asset ID
Returns:
the URL which will serve the specified binary asset

getImageURL

public static String getImageURL(ImageAsset asset)
Constuct a URL which serves an image.

Parameters:
asset - The image asset whose image is to be served
Returns:
the URL which will serve the specified image asset

getImageOID

public static String getImageOID(ImageAsset asset)
Constuct an oid for the image. This is used when publishing to the file system.

Parameters:
asset - The image asset whose image is to be served
Returns:
the oid for the specified image asset

getGlobalAssetsURL

public static String getGlobalAssetsURL()

getWebappContext

public static String getWebappContext()
Fetch the context path of the request. This is typically "/".

Returns:
The webapp context path

getLastSectionRefresh

public static Date getLastSectionRefresh(ContentSection section)
Check for the last refresh on authoring kits or content types in a section.


getLastSectionRefresh

public static Date getLastSectionRefresh()
Check for the last refresh on authoring kits or content types in any section.


refreshItemUI

public static void refreshItemUI(com.arsdigita.bebop.PageState state)
Force the authoring UI to reload. This should be done every time an authoring kit or a content type are updated.


refreshAdminUI

public static void refreshAdminUI(com.arsdigita.bebop.PageState state)
Force the authoring UI to reload. This should be done every time an authoring kit or a content type are updated.


disableBrowserCache

public static void disableBrowserCache(javax.servlet.http.HttpServletResponse response)
Deprecated. use com.arsdigita.dispatcher.DispatcherHelper.cacheDisable(HttpServletResponse)

Add the "pragma: no-cache" header to the HTTP response to make sure the browser does not cache tha page

Parameters:
response - The HTTP response

getCurrentUser

public static com.arsdigita.kernel.User getCurrentUser(javax.servlet.http.HttpServletRequest request)
Deprecated. use KernelContext.getParty()

Fetches the currently logged in user.

Parameters:
request - The HTTP request
Returns:
The currently logged-in user, or null if there is none

getSecurityManager

public static SecurityManager getSecurityManager(com.arsdigita.bebop.PageState state)
Fetch the security manager.

Parameters:
state - The page state
Returns:
The SecurityManager for the content section


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