|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.file.collectors.A_CmsResourceCollector
public abstract class A_CmsResourceCollector
Provides some helpful base implementations for resource collector classes.
| Field Summary | |
|---|---|
protected int |
m_order
The collector order of this collector. |
| Constructor Summary | |
|---|---|
A_CmsResourceCollector()
Constructor to initialize some default values. |
|
| Method Summary | |
|---|---|
protected void |
checkParams()
Checks if the required parameters have been set. |
int |
compareTo(Object obj)
|
boolean |
equals(Object obj)
Two collectors are considered to be equal if they are sharing the same implementation class. |
protected String |
getCreateInFolder(CmsObject cms,
String param)
Returns the link to create a new XML content item in the folder pointed to by the parameter. |
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. |
String |
getCreateParam(CmsObject cms)
Returns the default parameter that must be passed to the I_CmsResourceCollector.getCreateLink(CmsObject, String, String) method. |
String |
getDefaultCollectorName()
Returns the default collector name to use for collecting resources. |
String |
getDefaultCollectorParam()
Returns the default collector parameter to use for collecting resources. |
int |
getOrder()
Returns the "order weight" of this collector. |
List |
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(String collectorName)
Sets the default collector name to use for collecting resources. |
void |
setDefaultCollectorParam(String param)
Sets the default collector parameter to use for collecting resources. |
void |
setOrder(int order)
Sets the "order weight" of this collector. |
protected List |
shrinkToFit(List result,
int maxSize)
Shrinks a List to fit a maximum size. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opencms.file.collectors.I_CmsResourceCollector |
|---|
getCollectorNames, getCreateLink, getCreateParam, getResults |
| Field Detail |
|---|
protected int m_order
| Constructor Detail |
|---|
public A_CmsResourceCollector()
| Method Detail |
|---|
public int compareTo(Object obj)
compareTo in interface ComparableComparable.compareTo(java.lang.Object)public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)
public 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 CmsObject
CmsException - if something goes wrong
CmsDataAccessException - if the param attrib of the corresponding collector tag is invalidI_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject)
public 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 CmsObject
I_CmsResourceCollector.getCreateLink(CmsObject, String, String) method, or null
CmsDataAccessException - if the param attrib of the corresponding collector tag is invalidI_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject)public String getDefaultCollectorName()
I_CmsResourceCollector
getDefaultCollectorName in interface I_CmsResourceCollectorI_CmsResourceCollector.getDefaultCollectorName()public String getDefaultCollectorParam()
I_CmsResourceCollector
getDefaultCollectorParam 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 classs.
getOrder in interface I_CmsResourceCollectorI_CmsResourceCollector.getOrder()
public List 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 CmsObject
CmsDataAccessException - if the param attrib of the corresponding collector tag is invalid
CmsException - if something goes wrongI_CmsResourceCollector.getResults(org.opencms.file.CmsObject)public int hashCode()
hashCode in class ObjectObject.hashCode()public void setDefaultCollectorName(String collectorName)
I_CmsResourceCollector
setDefaultCollectorName in interface I_CmsResourceCollectorcollectorName - the default collector nameI_CmsResourceCollector.setDefaultCollectorName(java.lang.String)public void setDefaultCollectorParam(String param)
I_CmsResourceCollector
setDefaultCollectorParam in interface I_CmsResourceCollectorparam - the default collector parameterI_CmsResourceCollector.setDefaultCollectorParam(java.lang.String)public void setOrder(int order)
I_CmsResourceCollector
setOrder in interface I_CmsResourceCollectororder - the order weight to setI_CmsResourceCollector.setOrder(int)protected void checkParams()
setDefaultCollectorName(String),
setDefaultCollectorParam(String)
protected String getCreateInFolder(CmsObject cms,
String param)
throws CmsException
cms - the current CmsObjectparam - the folder name to use
CmsException - if something goes wrong
protected List shrinkToFit(List result,
int maxSize)
result - a ListmaxSize - the maximum size of the List
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||