public abstract class A_CmsResourceCollector extends java.lang.Object implements I_CmsResourceCollector
| Modifier and Type | Field and Description |
|---|---|
protected int |
m_order
The collector order of this collector.
|
static java.lang.String |
SEPARATOR_TEMPLATEFILE
The template file separator string for creating a new resource in direct edit mode,
can be used to append an explicit template file name in
I_CmsResourceCollector.getCreateParam(CmsObject, String, String). |
DEFAULT_LIMIT| Constructor and Description |
|---|
A_CmsResourceCollector()
Constructor to initialize some default values.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkParams()
Checks if the required parameters have been set.
|
int |
compareTo(I_CmsResourceCollector obj) |
static java.lang.String |
createResourceForCollector(CmsObject cms,
java.lang.String newLink,
java.util.Locale locale,
java.lang.String referenceResource,
java.lang.String modelFile,
java.lang.String mode,
java.lang.String postCreateHandler)
Creates a new content collector resource.
|
boolean |
equals(java.lang.Object obj)
Two collectors are considered to be equal if they are sharing the same
implementation class.
|
protected java.lang.String |
getCreateInFolder(CmsObject cms,
CmsCollectorData data)
Returns the link to create a new XML content item in the folder pointed to by the parameter.
|
protected java.lang.String |
getCreateInFolder(CmsObject cms,
java.lang.String param)
Returns the link to create a new XML content item in the folder pointed to by the parameter.
|
java.lang.String |
getCreateLink(CmsObject cms)
Returns the link that must be executed when a user clicks on the direct edit
"new" button on a list created by the default collector.
|
java.lang.String |
getCreateParam(CmsObject cms)
Returns the default parameter that must be passed to the
I_CmsResourceCollector.getCreateLink(CmsObject, String, String) method. |
int |
getCreateTypeId(CmsObject cms,
java.lang.String collectorName,
java.lang.String param)
Returns the id of the resource type for new collector items.
|
java.lang.String |
getDefaultCollectorName()
Returns the default collector name to use for collecting resources.
|
java.lang.String |
getDefaultCollectorParam()
Returns the default collector parameter to use for collecting resources.
|
int |
getOrder()
Returns the "order weight" of this collector.
|
static I_CmsCollectorPostCreateHandler |
getPostCreateHandler(java.lang.String className)
Instantiates a post-create handler given a class name (which may actually be null).
|
java.util.Set<CmsResource> |
getPublishResources(CmsObject cms,
I_CmsContentLoadCollectorInfo info)
Gets the publish list for the collector.
|
java.util.List<CmsResource> |
getResults(CmsObject cms)
Returns a list of
CmsResource Objects that are
gathered in the VFS using the default collector name and parameter. |
int |
hashCode() |
void |
setDefaultCollectorName(java.lang.String collectorName)
Sets the default collector name to use for collecting resources.
|
void |
setDefaultCollectorParam(java.lang.String param)
Sets the default collector parameter to use for collecting resources.
|
void |
setOrder(int order)
Sets the "order weight" of this collector.
|
protected java.util.List<CmsResource> |
shrinkToFit(java.util.List<CmsResource> result,
int maxSize)
Shrinks a List to fit a maximum size.
|
protected java.util.List<CmsResource> |
shrinkToFit(java.util.List<CmsResource> result,
int maxSize,
int explicitNumResults)
Shrinks a List to fit a maximum size.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetCollectorNames, getCreateLink, getCreateParam, getResults, getResultspublic static final java.lang.String SEPARATOR_TEMPLATEFILE
I_CmsResourceCollector.getCreateParam(CmsObject, String, String).protected int m_order
public A_CmsResourceCollector()
public static java.lang.String createResourceForCollector(CmsObject cms, java.lang.String newLink, java.util.Locale locale, java.lang.String referenceResource, java.lang.String modelFile, java.lang.String mode, java.lang.String postCreateHandler) throws CmsException
cms - the cms contextnewLink - the new resource linklocale - the content localereferenceResource - the reference resourcemodelFile - the model filemode - the optional creation mode (can be null)postCreateHandler - optional class name of an I_CmsCollectorPostCreateHandler which is invoked after the content has been created.
The fully qualified class name can be followed by a "|" symbol and a handler specific configuration string.CmsException - if something goes wrongpublic static I_CmsCollectorPostCreateHandler getPostCreateHandler(java.lang.String className)
If the given name is null or does not refer to a valid post-create handler class, a default implementation will be returned.
className - the class name of the post-create handler classpublic int compareTo(I_CmsResourceCollector obj)
compareTo in interface java.lang.Comparable<I_CmsResourceCollector>Comparable.compareTo(java.lang.Object)public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public java.lang.String getCreateLink(CmsObject cms) throws CmsException, CmsDataAccessException
I_CmsResourceCollector
If this method returns null,
it indicated that the selected collector implementation does not support a "create link",
and so no "new" button will should shown on lists generated with this collector.
getCreateLink in interface I_CmsResourceCollectorcms - the current CmsObjectCmsException - if something goes wrongCmsDataAccessException - if the parameter attribute of the corresponding collector tag is invalidI_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject)public java.lang.String getCreateParam(CmsObject cms) throws CmsDataAccessException
I_CmsResourceCollectorI_CmsResourceCollector.getCreateLink(CmsObject, String, String) method.
If this method returns null,
it indicates that the selected collector implementation does not support a "create link",
and so no "new" button will should shown on lists generated with this collector.
getCreateParam in interface I_CmsResourceCollectorcms - the current CmsObjectI_CmsResourceCollector.getCreateLink(CmsObject, String, String) method, or nullCmsDataAccessException - if the param attrib of the corresponding collector tag is invalidI_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject)public int getCreateTypeId(CmsObject cms, java.lang.String collectorName, java.lang.String param) throws CmsException
I_CmsResourceCollectorReturns -1 if creation of new items is not supported.
getCreateTypeId in interface I_CmsResourceCollectorcms - the current CmsObjectcollectorName - the name of the collector to useparam - an optional collector parameterCmsException - if something goes wrongI_CmsResourceCollector.getCreateTypeId(org.opencms.file.CmsObject, java.lang.String, java.lang.String)public java.lang.String getDefaultCollectorName()
I_CmsResourceCollectorgetDefaultCollectorName in interface I_CmsResourceCollectorI_CmsResourceCollector.getDefaultCollectorName()public java.lang.String getDefaultCollectorParam()
I_CmsResourceCollectorgetDefaultCollectorParam in interface I_CmsResourceCollectorI_CmsResourceCollector.getDefaultCollectorParam()public int getOrder()
I_CmsResourceCollectorThe "order weight" is important because two collector classes may provide a collector with the same name. If this is the case, the collector implementation with the higher order number "overrules" the lower order number class.
getOrder in interface I_CmsResourceCollectorI_CmsResourceCollector.getOrder()public java.util.Set<CmsResource> getPublishResources(CmsObject cms, I_CmsContentLoadCollectorInfo info) throws CmsException
I_CmsCollectorPublishListProvidergetPublishResources in interface I_CmsCollectorPublishListProvidercms - the CMS context to useinfo - the collector informationCmsException - if soemthing goes wrongI_CmsCollectorPublishListProvider.getPublishResources(org.opencms.file.CmsObject, org.opencms.gwt.shared.I_CmsContentLoadCollectorInfo)public java.util.List<CmsResource> getResults(CmsObject cms) throws CmsDataAccessException, CmsException
I_CmsResourceCollectorCmsResource Objects that are
gathered in the VFS using the default collector name and parameter.getResults in interface I_CmsResourceCollectorcms - the current CmsObjectCmsDataAccessException - if the parameter attribute of the corresponding collector tag is invalidCmsException - if something goes wrongI_CmsResourceCollector.getResults(org.opencms.file.CmsObject)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public void setDefaultCollectorName(java.lang.String collectorName)
I_CmsResourceCollectorsetDefaultCollectorName in interface I_CmsResourceCollectorcollectorName - the default collector nameI_CmsResourceCollector.setDefaultCollectorName(java.lang.String)public void setDefaultCollectorParam(java.lang.String param)
I_CmsResourceCollectorsetDefaultCollectorParam in interface I_CmsResourceCollectorparam - the default collector parameterI_CmsResourceCollector.setDefaultCollectorParam(java.lang.String)public void setOrder(int order)
I_CmsResourceCollectorsetOrder in interface I_CmsResourceCollectororder - the order weight to setI_CmsResourceCollector.setOrder(int)protected void checkParams()
protected java.lang.String getCreateInFolder(CmsObject cms, CmsCollectorData data) throws CmsException
cms - the current CmsObjectdata - the collector data to useCmsException - if something goes wrongprotected java.lang.String getCreateInFolder(CmsObject cms, java.lang.String param) throws CmsException
cms - the current CmsObjectparam - the folder name to useCmsException - if something goes wrongprotected java.util.List<CmsResource> shrinkToFit(java.util.List<CmsResource> result, int maxSize)
result - a ListmaxSize - the maximum size of the Listprotected java.util.List<CmsResource> shrinkToFit(java.util.List<CmsResource> result, int maxSize, int explicitNumResults)
result - a ListmaxSize - the maximum size of the ListexplicitNumResults - the value of the numResults parameter given to the getResults method (this overrides maxSize if it is positive)