Package org.opencms.ade.galleries
Class CmsAddContentRestriction
java.lang.Object
org.opencms.ade.galleries.CmsAddContentRestriction
Replacement configuration for the 'add content' dialog.
A replacement configuration contains a list of entries, one for each type, with a list of resources for each type and optionally a title string for each of the resources. The list of resources replaces the search results that would be normally shown for the type in the 'add content' dialog.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Contains the replacements (and titles of the replacements) for a single type. -
Field Summary
Modifier and TypeFieldDescriptionstatic final CmsAddContentRestriction
Empty configuration.static final String
XML node name.static final String
XML node name.static final String
XML node name.static final String
XML node name.static final String
The name of the resource type from which the configuration is read. -
Constructor Summary
ConstructorDescriptionCreates a new configuration from a list of entries. -
Method Summary
Modifier and TypeMethodDescriptionGets the replaced results for a specific resource type.getTypes()
Gets the set of names of types for which the search results are replaced.merge
(CmsAddContentRestriction child) Merges this configuration and a child configuration into a new configuration object, where an entry for a type in the child overrides an entry for the same type in the parent.static CmsAddContentRestriction
read
(CmsObject cms, I_CmsXmlContentLocation parent, String nodeName) Reads a content restriction from an XML content.readEntry
(CmsObject cms, I_CmsXmlContentValueLocation location) Reads the entry for a single type from the configuration.
-
Field Details
-
EMPTY
Empty configuration. -
N_ENTRY
XML node name.- See Also:
-
N_RESOURCE
XML node name.- See Also:
-
N_TITLE
XML node name.- See Also:
-
N_TYPE
XML node name.- See Also:
-
TYPE_NAME
The name of the resource type from which the configuration is read.- See Also:
-
-
Constructor Details
-
CmsAddContentRestriction
Creates a new configuration from a list of entries.- Parameters:
entries
- the list of configuration entries
-
-
Method Details
-
read
public static CmsAddContentRestriction read(CmsObject cms, I_CmsXmlContentLocation parent, String nodeName) Reads a content restriction from an XML content.- Parameters:
cms
- the CMS contextparent
- the parent locationnodeName
- the name of the XML elements containing the content restrictions- Returns:
- the content restriction
-
readEntry
public static CmsAddContentRestriction.TypeEntry readEntry(CmsObject cms, I_CmsXmlContentValueLocation location) Reads the entry for a single type from the configuration.- Parameters:
cms
- the CMS contextlocation
- the location from which to read the entry- Returns:
- the entry that was read
-
getResult
Gets the replaced results for a specific resource type.- Parameters:
cms
- the CMS contexttype
- the type name- Returns:
- the replacement results for the given type
-
getTypes
Gets the set of names of types for which the search results are replaced.- Returns:
- the set of types for which there are replacements configured
-
merge
Merges this configuration and a child configuration into a new configuration object, where an entry for a type in the child overrides an entry for the same type in the parent.- Parameters:
child
- the child configuration- Returns:
- the merged configuration
-