org.opencms.xml.containerpage
Interface I_CmsADEConfiguration


public interface I_CmsADEConfiguration

Configurable & expandable configuration.

Since:
7.6

Method Summary
 CmsResource createNewElement(CmsObject cms, java.lang.String cntPageUri, javax.servlet.ServletRequest request, java.lang.String type, java.util.Locale locale)
          Creates a new element of a given type at the configured location.
 java.util.Collection<CmsResource> getCreatableElements(CmsObject cms, java.lang.String cntPageUri, javax.servlet.ServletRequest request)
          Returns the list of creatable elements.
 int getFavoriteListMaxSize(CmsObject cms)
          Returns the maximal size of the favorite list.
 CmsFormatterConfiguration getFormattersForResource(CmsObject cms, java.lang.String containerPageRootPath, CmsResource res)
          Returns the formatter configuration for a given resource.
 java.lang.String getNextNewFileName(CmsObject cms, java.lang.String cntPageUri, javax.servlet.ServletRequest request, java.lang.String type)
          Returns the name of the next new file of the given type to be created.
 int getRecentListMaxSize(CmsObject cms)
          Returns the maximal size of the recent list.
 java.util.Collection<CmsResource> getSearchableResourceTypes(CmsObject cms, java.lang.String cntPageUri, javax.servlet.ServletRequest request)
          Returns the list of searchable resource types.
 void init(CmsObject cms)
          Initializes the configuration.
 boolean isCreatableType(CmsObject cms, java.lang.String currentUri, java.lang.String typeName)
          Returns if the given type has a valid configuration to be created.
 

Method Detail

createNewElement

CmsResource createNewElement(CmsObject cms,
                             java.lang.String cntPageUri,
                             javax.servlet.ServletRequest request,
                             java.lang.String type,
                             java.util.Locale locale)
                             throws CmsException
Creates a new element of a given type at the configured location.

Parameters:
cms - the current opencms context
cntPageUri - the container page uri
request - the current request
type - the type of the element to be created
locale - the content locale
Returns:
the CmsResource representing the newly created element
Throws:
CmsException - if something goes wrong

getCreatableElements

java.util.Collection<CmsResource> getCreatableElements(CmsObject cms,
                                                       java.lang.String cntPageUri,
                                                       javax.servlet.ServletRequest request)
                                                       throws CmsException
Returns the list of creatable elements.

Parameters:
cms - the current opencms context
cntPageUri - the container page uri
request - the current request
Returns:
the list of creatable elements
Throws:
CmsException - if something goes wrong

getFavoriteListMaxSize

int getFavoriteListMaxSize(CmsObject cms)
                           throws CmsException
Returns the maximal size of the favorite list.

Parameters:
cms - the current opencms context
Returns:
the maximal size of the favorite list
Throws:
CmsException - if something goes wrong

getFormattersForResource

CmsFormatterConfiguration getFormattersForResource(CmsObject cms,
                                                   java.lang.String containerPageRootPath,
                                                   CmsResource res)
                                                   throws CmsException
Returns the formatter configuration for a given resource.

Parameters:
cms - the OpenCms user context
containerPageRootPath - the root path to the container page that includes the element resource
res - the container page element resource
Returns:
the formatter configuration for a given resource
Throws:
CmsException - if something goes wrong

getNextNewFileName

java.lang.String getNextNewFileName(CmsObject cms,
                                    java.lang.String cntPageUri,
                                    javax.servlet.ServletRequest request,
                                    java.lang.String type)
                                    throws CmsException
Returns the name of the next new file of the given type to be created.

Parameters:
cms - the current opencms context
cntPageUri - the container page uri
request - the current request
type - the resource type name
Returns:
the name of the next new file of the given type to be created
Throws:
CmsException - if something goes wrong

getRecentListMaxSize

int getRecentListMaxSize(CmsObject cms)
                         throws CmsException
Returns the maximal size of the recent list.

Parameters:
cms - the current opencms context
Returns:
the maximal size of the recent list
Throws:
CmsException - if something goes wrong

getSearchableResourceTypes

java.util.Collection<CmsResource> getSearchableResourceTypes(CmsObject cms,
                                                             java.lang.String cntPageUri,
                                                             javax.servlet.ServletRequest request)
                                                             throws CmsException
Returns the list of searchable resource types.

Parameters:
cms - the current opencms context
cntPageUri - the container page uri
request - the current request
Returns:
the list of searchable resource types, identified by a sample resource
Throws:
CmsException - if something goes wrong

init

void init(CmsObject cms)
Initializes the configuration.

Parameters:
cms - the CMS object

isCreatableType

boolean isCreatableType(CmsObject cms,
                        java.lang.String currentUri,
                        java.lang.String typeName)
                        throws CmsException
Returns if the given type has a valid configuration to be created.

Parameters:
cms - the CMS context
currentUri - the current URI
typeName - the resource type name
Returns:
true if the type can be created as new
Throws:
CmsException - if something goes wrong