public final class CmsRelationType
extends java.lang.Object
implements java.io.Serializable
The possibles values are:
HYPERLINK
EMBEDDED_IMAGE
EMBEDDED_OBJECT
XML_STRONG
XML_WEAK
JSP_STRONG
JSP_WEAK
OU_RESOURCE
CATEGORY
XSD
User defined relation types are also available.
限定符和类型 | 字段和说明 |
---|---|
static CmsRelationType |
CATEGORY
Constant for the category of an
OpenCmsVfsFile . |
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 |
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.
|
构造器和说明 |
---|
CmsRelationType(int id,
java.lang.String name,
java.lang.String type)
Public constructor for user defined relation types.
|
限定符和类型 | 方法和说明 |
---|---|
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.
|
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 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
在类中 java.lang.Object
Object.equals(java.lang.Object)
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
在类中 java.lang.Object
Object.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
在类中 java.lang.Object
Object.toString()