public final class CmsRelationType extends java.lang.Object implements java.io.Serializable
The possibles values are:
HYPERLINKEMBEDDED_IMAGEEMBEDDED_OBJECTXML_STRONGXML_WEAKJSP_STRONGJSP_WEAKOU_RESOURCECATEGORYXSDUser defined relation types are also available.
| Modifier and Type | Class and Description |
|---|---|
static class |
CmsRelationType.CopyBehavior
Enum representing how relations should be handled while copying resources.
|
| Modifier and Type | Field and Description |
|---|---|
static CmsRelationType |
CATEGORY
Constant for the category of an
OpenCmsVfsFile. |
static CmsRelationType |
DETAIL_ONLY
Constant for the type of relations between a detail content and its detail-only container pages.
|
static CmsRelationType |
EMBEDDED_IMAGE
Constant for the
<img src=''> tag in a html page/element. |
static CmsRelationType |
EMBEDDED_OBJECT
Constant for the
<embed src=''> tag in a html page/element. |
static CmsRelationType |
HYPERLINK
Constant for the
<a href=''> tag in a html page/element. |
static CmsRelationType |
JSP_STRONG
Constant for the all types of links in a jsp file using the
link.strong macro. |
static CmsRelationType |
JSP_WEAK
Constant for the all types of links in a jsp file using the
link.weak macro. |
static CmsRelationType |
LOCALE_VARIANT
Constant for the type of relations between resources which are locale variants.
|
static CmsRelationType |
OU_RESOURCE
Constant for the organizational units resource associations.
|
static CmsRelationType |
XML_STRONG
Constant for the
OpenCmsVfsFile values in xml content that were defined as 'strong' links. |
static CmsRelationType |
XML_WEAK
Constant for the
OpenCmsVfsFile values in xml content that were defined as 'weak' links. |
static CmsRelationType |
XSD
Constant for the weak links from xmlcontent to the used xsd.
|
| Constructor and Description |
|---|
CmsRelationType(int id,
java.lang.String name,
java.lang.String type)
Public constructor for user defined relation types.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static java.util.List<CmsRelationType> |
filterDefinedInContent(java.util.Collection<CmsRelationType> relationTypes)
Returns all relation types in the given list that define relations in the content.
|
static java.util.List<CmsRelationType> |
filterInternal(java.util.Collection<CmsRelationType> relationTypes)
Returns all internal defined relation types in the given list.
|
static java.util.List<CmsRelationType> |
filterNotDefinedInContent(java.util.Collection<CmsRelationType> relationTypes)
Returns all relation types in the given list that are not defined in the content.
|
static java.util.List<CmsRelationType> |
filterStrong(java.util.Collection<CmsRelationType> relationTypes)
Returns all strong relation types in the given list.
|
static java.util.List<CmsRelationType> |
filterUserDefined(java.util.Collection<CmsRelationType> relationTypes)
Returns all user defined relation types in the given list.
|
static java.util.List<CmsRelationType> |
filterWeak(java.util.Collection<CmsRelationType> relationTypes)
Returns all weak relation types in the given list.
|
static java.util.List<CmsRelationType> |
getAll()
Returns all relation types.
|
static java.util.List<CmsRelationType> |
getAllDefinedInContent()
Returns all relation types for relations defined in the content.
|
static java.util.List<CmsRelationType> |
getAllInternal()
Returns all internally defined relation types.
|
static java.util.List<CmsRelationType> |
getAllNotDefinedInContent()
Returns all relation types for relations that are not defined in the content.
|
static java.util.List<CmsRelationType> |
getAllStrong()
Returns all strong relation types.
|
static java.util.List<CmsRelationType> |
getAllUserDefined()
Returns all user defined relation types.
|
static java.util.List<CmsRelationType> |
getAllWeak()
Returns all weak relation types.
|
CmsRelationType.CopyBehavior |
getCopyBehavior()
Gets the 'copy behavior' of the relation type, which is how relations of a resource should be handled when copying that resource.
|
int |
getId()
Returns the internal representation of this type.
|
java.lang.String |
getLocalizedName(CmsMessages messages)
Returns a localized name for the given relation type.
|
java.lang.String |
getLocalizedName(java.util.Locale locale)
Returns a localized name for the given relation type.
|
java.lang.String |
getName()
Returns the type name.
|
java.lang.String |
getNameForXml()
Returns the type name for xml output.
|
java.lang.String |
getType()
Returns the string strong or weak.
|
int |
hashCode() |
boolean |
isDefinedInContent()
Checks if this relation type is defined in the content of a resource or not.
|
boolean |
isInternal()
Checks if this is an internal relation type.
|
boolean |
isStrong()
Checks if the relation type is strong or weak.
|
java.lang.String |
toString() |
static CmsRelationType |
valueOf(int id)
Parses an
int into a relation type. |
static CmsRelationType |
valueOf(java.lang.String name)
Parses an
String into a relation type. |
static CmsRelationType |
valueOfJsp(java.lang.String name)
Parses the given value into a valid enumeration element for a JSP relation type.
|
static CmsRelationType |
valueOfXml(java.lang.String name)
Parses the given value into a valid enumeration element for a XML relation type.
|
public static final CmsRelationType CATEGORY
OpenCmsVfsFile.public static final CmsRelationType EMBEDDED_IMAGE
<img src=''> tag in a html page/element.public static final CmsRelationType EMBEDDED_OBJECT
<embed src=''> tag in a html page/element.public static final CmsRelationType HYPERLINK
<a href=''> tag in a html page/element.public static final CmsRelationType JSP_STRONG
link.strong macro.public static final CmsRelationType JSP_WEAK
link.weak macro.public static final CmsRelationType OU_RESOURCE
public static final CmsRelationType XML_STRONG
OpenCmsVfsFile values in xml content that were defined as 'strong' links.public static final CmsRelationType XML_WEAK
OpenCmsVfsFile values in xml content that were defined as 'weak' links.public static final CmsRelationType LOCALE_VARIANT
public static final CmsRelationType DETAIL_ONLY
public static final CmsRelationType XSD
public CmsRelationType(int id, java.lang.String name, java.lang.String type)
id - the id of the relation typename - the name of the relationtype - the type of relation type, strong or weakpublic static java.util.List<CmsRelationType> filterDefinedInContent(java.util.Collection<CmsRelationType> relationTypes)
relationTypes - the collection of relation types to filterCmsRelationType objectspublic static java.util.List<CmsRelationType> filterInternal(java.util.Collection<CmsRelationType> relationTypes)
relationTypes - the collection of relation types to filterCmsRelationType objectspublic static java.util.List<CmsRelationType> filterNotDefinedInContent(java.util.Collection<CmsRelationType> relationTypes)
relationTypes - the collection of relation types to filterCmsRelationType objectspublic static java.util.List<CmsRelationType> filterStrong(java.util.Collection<CmsRelationType> relationTypes)
relationTypes - the collection of relation types to filterCmsRelationType objectspublic static java.util.List<CmsRelationType> filterUserDefined(java.util.Collection<CmsRelationType> relationTypes)
relationTypes - the collection of relation types to filterCmsRelationType objectspublic static java.util.List<CmsRelationType> filterWeak(java.util.Collection<CmsRelationType> relationTypes)
relationTypes - the collection of relation types to filterCmsRelationType objectspublic static java.util.List<CmsRelationType> getAll()
CmsRelationType objectspublic static java.util.List<CmsRelationType> getAllDefinedInContent()
CmsRelationType objectspublic static java.util.List<CmsRelationType> getAllInternal()
CmsRelationType objectspublic static java.util.List<CmsRelationType> getAllNotDefinedInContent()
CmsRelationType objectspublic static java.util.List<CmsRelationType> getAllStrong()
CmsRelationType objectspublic static java.util.List<CmsRelationType> getAllUserDefined()
CmsRelationType objectspublic static java.util.List<CmsRelationType> getAllWeak()
CmsRelationType objectspublic static CmsRelationType valueOf(int id) throws CmsIllegalArgumentException
int into a relation type.id - the internal representation number to parseCmsIllegalArgumentException - if the given value could not be matched against a
CmsRelationType object.public static CmsRelationType valueOf(java.lang.String name) throws CmsIllegalArgumentException
String into a relation type.name - the relation type nameCmsIllegalArgumentException - if the given value could not be matched against a
CmsRelationType objectvalueOfXml(String),
valueOfJsp(String)public static CmsRelationType valueOfJsp(java.lang.String name)
This should be used to extend Strings like "weak" or "strong" to full relation type descriptors for JSP pages like "JSP_WEAK" or "JSP_STRONG".
name - the name to get the JSP type forvalueOf(String)public static CmsRelationType valueOfXml(java.lang.String name)
This should be used to extend Strings like "weak" or "strong" to full relation type descriptors for XML documents like "XML_WEAK" or "XML_STRONG".
name - the name to get the XML type forvalueOf(String)public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public CmsRelationType.CopyBehavior getCopyBehavior()
public int getId()
public java.lang.String getLocalizedName(CmsMessages messages)
messages - the message bundle to use to resolve the namepublic java.lang.String getLocalizedName(java.util.Locale locale)
locale - the localepublic java.lang.String getName()
valueOf(String)public java.lang.String getNameForXml()
The short type name of XML or JSP types is only "WEAK" or "STRONG".
For other types the short name is equal to the name.
In case you need the full type name, use getName().
getName(),
valueOfJsp(String),
valueOfXml(String)public java.lang.String getType()
isStrong()public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean isDefinedInContent()
true if this relation type is defined in the content of a resourcepublic boolean isInternal()
true if this is an internal relation typepublic boolean isStrong()
true if the relation type is strongpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()