|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.ade.configuration.CmsADEManager
public class CmsADEManager
This is the main class used to access the ADE configuration and also accomplish some other related tasks like loading/saving favorite and recent lists.
Nested Class Summary | |
---|---|
protected static class |
CmsADEManager.FavListProp
JSON property name constant. |
protected static class |
CmsADEManager.Status
A status enum for the initialization status. |
Field Summary | |
---|---|
protected static String |
ADDINFO_ADE_FAVORITE_LIST
User additional info key constant. |
static String |
ADDINFO_ADE_FAVORITE_LIST_SIZE
User additional info key constant. |
protected static String |
ADDINFO_ADE_RECENT_LIST
User additional info key constant. |
static String |
ADDINFO_ADE_RECENT_LIST_SIZE
User additional info key constant. |
static String |
ADDINFO_ADE_SEARCH_PAGE_SIZE
User additional info key constant. |
static String |
CLIENT_ID_SEPERATOR
The client id separator. |
static String |
CONFIG_FILE_NAME
The configuration file name. |
static String |
CONFIG_FOLDER_NAME
The content folder name. |
static String |
CONFIG_FOLDER_TYPE
The name of the sitemap configuration file type. |
static String |
CONFIG_SUFFIX
The path for sitemap configuration files relative from the base path. |
static String |
CONFIG_TYPE
The name of the sitemap configuration file type. |
static int |
DEFAULT_FAVORITE_LIST_SIZE
Default favorite list size constant. |
static int |
DEFAULT_RECENT_LIST_SIZE
Default recent list size constant. |
static String |
MODULE_CONFIG_TYPE
The name of the module configuration file type. |
static String |
PATH_SITEMAP_EDITOR_JSP
The path to the sitemap editor JSP. |
Constructor Summary | |
---|---|
CmsADEManager(CmsObject adminCms,
CmsMemoryMonitor memoryMonitor,
CmsSystemConfiguration systemConfiguration)
Creates a new ADE manager. |
Method Summary | |
---|---|
void |
cmsEvent(CmsEvent event)
Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class. |
protected CmsContainerElementBean |
elementFromJson(JSONObject data)
Creates an element from its serialized data. |
protected JSONObject |
elementToJson(CmsContainerElementBean element)
Converts the given element to JSON. |
String |
findEntryPoint(CmsObject cms,
String openPath)
Finds the entry point to a sitemap. |
CmsADECache |
getCache()
Gets the containerpage cache instance. |
I_CmsResourceType |
getConfigurationType()
Gets the configuration file type. |
CmsContainerElementBean |
getCurrentElement(javax.servlet.ServletRequest req)
Reads the current element bean from the request. |
String |
getDetailPage(CmsObject cms,
String pageRootPath,
String originPath)
Gets the detail page for a content element. |
I_CmsDetailPageFinder |
getDetailPageFinder()
Gets the detail page finder. |
List<String> |
getDetailPages(CmsObject cms,
String type)
Returns the main detail pages for a type in all of the VFS tree. |
Map<String,CmsXmlContentProperty> |
getElementSettings(CmsObject cms,
CmsResource resource)
Returns the element settings for a given resource. |
List<CmsContainerElementBean> |
getFavoriteList(CmsObject cms)
Returns the favorite list, or creates it if not available. |
int |
getMaxSitemapDepth()
Gets the maximum sitemap depth. |
I_CmsResourceType |
getModuleConfigurationType()
Gets the module configuration resource type. |
List<CmsContainerElementBean> |
getRecentList(CmsObject cms)
Returns the favorite list, or creates it if not available. |
int |
getRecentListMaxSize(CmsUser user)
Gets the maximum length of the recent list. |
protected String |
getRootPath(CmsUUID structureId,
boolean online)
Gets the root path for a given resource structure id. |
String |
getSubSiteRoot(CmsObject cms,
String rootPath)
Tries to get the subsite root for a given resource root path. |
protected CmsProject |
getTempfileProject(CmsObject cms)
Gets a tempfile project, creating one if it doesn't exist already. |
void |
initialize()
Initializes the configuration by reading all configuration files and caching their data. |
protected CmsADEConfigData |
internalLookupConfiguration(CmsObject cms,
String rootPath)
Internal configuration lookup method. |
boolean |
isInitialized()
Checks whether the ADE manager is initialized (this should usually be the case except during the setup). |
CmsADEConfigData |
lookupConfiguration(CmsObject cms,
String rootPath)
Looks up the configuration data for a given sitemap path. |
void |
refresh()
Reloads the configuration. |
boolean |
saveDetailPages(CmsObject cms,
String rootPath,
List<CmsDetailPageInfo> detailPages,
CmsUUID newId)
Saves a list of detail pages. |
void |
saveFavoriteList(CmsObject cms,
List<CmsContainerElementBean> favoriteList)
Saves the favorite list, user based. |
void |
saveRecentList(CmsObject cms,
List<CmsContainerElementBean> recentList)
Saves the favorite list, user based. |
void |
shutdown()
The method which is called when the OpenCms instance is shut down. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ADDINFO_ADE_FAVORITE_LIST_SIZE
public static final String ADDINFO_ADE_RECENT_LIST_SIZE
public static final String ADDINFO_ADE_SEARCH_PAGE_SIZE
public static final String CLIENT_ID_SEPERATOR
public static final String CONFIG_FILE_NAME
public static final String CONFIG_FOLDER_NAME
public static final String CONFIG_FOLDER_TYPE
public static final String CONFIG_SUFFIX
public static final String CONFIG_TYPE
public static final int DEFAULT_FAVORITE_LIST_SIZE
public static final int DEFAULT_RECENT_LIST_SIZE
public static final String MODULE_CONFIG_TYPE
public static final String PATH_SITEMAP_EDITOR_JSP
protected static final String ADDINFO_ADE_FAVORITE_LIST
protected static final String ADDINFO_ADE_RECENT_LIST
Constructor Detail |
---|
public CmsADEManager(CmsObject adminCms, CmsMemoryMonitor memoryMonitor, CmsSystemConfiguration systemConfiguration)
adminCms
- a CMS context with admin privilegesmemoryMonitor
- the memory monitor instancesystemConfiguration
- the system configurationMethod Detail |
---|
public void cmsEvent(CmsEvent event)
I_CmsEventListener
cmsEvent
in interface I_CmsEventListener
event
- CmsEvent that has occurredI_CmsEventListener.cmsEvent(org.opencms.main.CmsEvent)
public String findEntryPoint(CmsObject cms, String openPath)
cms
- the CMS contextopenPath
- the resource path to find the sitemap to
public CmsADECache getCache()
public I_CmsResourceType getConfigurationType()
public CmsContainerElementBean getCurrentElement(javax.servlet.ServletRequest req) throws CmsException
req
- the servlet request
CmsException
- if no current element is setpublic String getDetailPage(CmsObject cms, String pageRootPath, String originPath)
cms
- the CMS contextpageRootPath
- the element's root pathoriginPath
- the path in which the the detail page is being requested
public I_CmsDetailPageFinder getDetailPageFinder()
public List<String> getDetailPages(CmsObject cms, String type)
cms
- the current CMS contexttype
- the resource type name
public Map<String,CmsXmlContentProperty> getElementSettings(CmsObject cms, CmsResource resource) throws CmsException
cms
- the current cms contextresource
- the resource
CmsException
- if something goes wrongpublic List<CmsContainerElementBean> getFavoriteList(CmsObject cms) throws CmsException
cms
- the cms context
CmsException
- if something goes wrongpublic int getMaxSitemapDepth()
public I_CmsResourceType getModuleConfigurationType()
public List<CmsContainerElementBean> getRecentList(CmsObject cms) throws CmsException
cms
- the cms context
CmsException
- if something goes wrongpublic int getRecentListMaxSize(CmsUser user)
user
- the user for which to get the maximum length
public String getSubSiteRoot(CmsObject cms, String rootPath)
cms
- the current CMS contextrootPath
- the root path for which the subsite root should be found
public void initialize()
public boolean isInitialized()
public CmsADEConfigData lookupConfiguration(CmsObject cms, String rootPath)
cms
- the current CMS contextrootPath
- the root path for which the configuration data should be looked up
public void refresh()
Normally you shouldn't call this directly since the event handlers take care of updating the configuration.
public boolean saveDetailPages(CmsObject cms, String rootPath, List<CmsDetailPageInfo> detailPages, CmsUUID newId) throws CmsException
cms
- the cms contextrootPath
- the root pathdetailPages
- the detail pagesnewId
- the id to use for new detail pages without an id
CmsException
- if something goes wrongpublic void saveFavoriteList(CmsObject cms, List<CmsContainerElementBean> favoriteList) throws CmsException
cms
- the cms contextfavoriteList
- the element list
CmsException
- if something goes wrongpublic void saveRecentList(CmsObject cms, List<CmsContainerElementBean> recentList) throws CmsException
cms
- the cms contextrecentList
- the element list
CmsException
- if something goes wrongpublic void shutdown()
protected CmsContainerElementBean elementFromJson(JSONObject data) throws JSONException
data
- the serialized data
JSONException
- if the serialized data got corruptedprotected JSONObject elementToJson(CmsContainerElementBean element)
element
- the element to convert
protected String getRootPath(CmsUUID structureId, boolean online) throws CmsException
structureId
- the structure idonline
- if true, the resource will be looked up in the online project ,else in the offline project
CmsException
- if something goes wrongprotected CmsProject getTempfileProject(CmsObject cms) throws CmsException
cms
- the CMS context to use
CmsException
- if something goes wrongprotected CmsADEConfigData internalLookupConfiguration(CmsObject cms, String rootPath)
cms
- the cms contextrootPath
- the root path for which to look up the configuration
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |