|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.relations.CmsLink
public class CmsLink
A single link entry in the link table.
Field Summary | |
---|---|
static java.lang.String |
ATTRIBUTE_INTERNAL
Name of the internal attribute of the link node. |
static java.lang.String |
ATTRIBUTE_NAME
Name of the name attribute of the elements node. |
static java.lang.String |
ATTRIBUTE_TYPE
Name of the type attribute of the elements node. |
static java.lang.String |
DEFAULT_NAME
Default link name. |
static CmsRelationType |
DEFAULT_TYPE
Default link type. |
static java.lang.String |
NODE_ANCHOR
Name of the anchor node. |
static java.lang.String |
NODE_QUERY
Name of the query node. |
static java.lang.String |
NODE_TARGET
Name of the target node. |
static java.lang.String |
NODE_UUID
Name of the UUID node. |
static CmsLink |
NULL_LINK
Constant for the NULL link. |
Constructor Summary | |
---|---|
CmsLink(org.dom4j.Element element)
Reconstructs a link object from the given XML node. |
|
CmsLink(java.lang.String name,
CmsRelationType type,
CmsUUID structureId,
java.lang.String uri,
boolean internal)
Creates a new link object without a reference to the xml page link element. |
|
CmsLink(java.lang.String name,
CmsRelationType type,
java.lang.String uri,
boolean internal)
Creates a new link object without a reference to the xml page link element. |
Method Summary | |
---|---|
void |
checkConsistency(CmsObject cms)
Checks and updates the structure id or the path of the target. |
boolean |
equals(java.lang.Object obj)
A link is considered equal if the link target and the link type is equal. |
java.lang.String |
getAnchor()
Returns the anchor of this link. |
org.dom4j.Element |
getElement()
Returns the xml node element representing this link object. |
java.lang.String |
getLink(CmsObject cms)
Returns the processed link. |
java.lang.String |
getLink(CmsObject cms,
boolean processEditorLinks)
Deprecated. use getLink(CmsObject) instead,
the process editor option is set using the OpenCms request context attributes |
java.lang.String |
getName()
Returns the macro name of this link. |
java.lang.String |
getParameter(java.lang.String name)
Returns the first parameter value for the given parameter name. |
java.util.Map |
getParameterMap()
Returns the map of parameters of this link. |
java.util.Set |
getParameterNames()
Returns the set of available parameter names for this link. |
java.lang.String[] |
getParameterValues(java.lang.String name)
Returns all parameter values for the given name. |
java.lang.String |
getQuery()
Returns the query of this link. |
java.lang.String |
getSiteRoot()
Return the site root if the target of this link is internal, or null otherwise. |
CmsUUID |
getStructureId()
The structure id of the linked resource. |
java.lang.String |
getTarget()
Returns the target (destination) of this link. |
CmsRelationType |
getType()
Returns the type of this link. |
java.lang.String |
getUri()
Returns the raw uri of this link. |
java.lang.String |
getVfsUri()
Returns the vfs link of the target if it is internal. |
int |
hashCode()
|
boolean |
isInternal()
Returns if the link is internal. |
java.lang.String |
toString()
|
void |
updateLink(java.lang.String uri)
Updates the uri of this link with a new value. |
void |
updateLink(java.lang.String target,
java.lang.String anchor,
java.lang.String query)
Updates the uri of this link with a new target, anchor and query. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTRIBUTE_INTERNAL
public static final java.lang.String ATTRIBUTE_NAME
public static final java.lang.String ATTRIBUTE_TYPE
public static final java.lang.String DEFAULT_NAME
public static final CmsRelationType DEFAULT_TYPE
public static final java.lang.String NODE_ANCHOR
public static final java.lang.String NODE_QUERY
public static final java.lang.String NODE_TARGET
public static final java.lang.String NODE_UUID
public static final CmsLink NULL_LINK
Constructor Detail |
---|
public CmsLink(org.dom4j.Element element)
element
- the XML node containing the link informationpublic CmsLink(java.lang.String name, CmsRelationType type, CmsUUID structureId, java.lang.String uri, boolean internal)
name
- the internal name of this linktype
- the type of this linkstructureId
- the structure id of the linkuri
- the link uriinternal
- indicates if the link is internal within OpenCmspublic CmsLink(java.lang.String name, CmsRelationType type, java.lang.String uri, boolean internal)
name
- the internal name of this linktype
- the type of this linkuri
- the link uriinternal
- indicates if the link is internal within OpenCmsMethod Detail |
---|
public void checkConsistency(CmsObject cms)
cms
- the cms contextpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.lang.String getAnchor()
public org.dom4j.Element getElement()
public java.lang.String getLink(CmsObject cms)
cms
- the current OpenCms user context, can be null
public java.lang.String getLink(CmsObject cms, boolean processEditorLinks)
getLink(CmsObject)
instead,
the process editor option is set using the OpenCms request context attributes
cms
- the current OpenCms user context, can be null
processEditorLinks
- this parameter is not longer used
public java.lang.String getName()
public java.lang.String getParameter(java.lang.String name)
name
- the name of the parameter
null
public java.util.Map getParameterMap()
Map(String[])
)public java.util.Set getParameterNames()
Set
of parameter namespublic java.lang.String[] getParameterValues(java.lang.String name)
name
- the name of the parameter
String[]
of all parameter values or null
public java.lang.String getQuery()
public java.lang.String getSiteRoot()
null
otherwise.
null
otherwisepublic CmsUUID getStructureId()
public java.lang.String getTarget()
public CmsRelationType getType()
public java.lang.String getUri()
public java.lang.String getVfsUri()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isInternal()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void updateLink(java.lang.String uri)
Also updates the structure of the underlying XML page document this link belongs to.
Note that you can not update the "internal" or "type" values of the link, so the new link must be of same type (A, IMG) and also remain either an internal or external link.
uri
- the uri to update this link with scheme://authority/path#anchor?query
public void updateLink(java.lang.String target, java.lang.String anchor, java.lang.String query)
If anchor and/or query are null
, this features are not used.
Note that you can not update the "internal" or "type" values of the link, so the new link must be of same type (A, IMG) and also remain either an internal or external link.
Also updates the structure of the underlying XML page document this link belongs to.
target
- the target (destination) of this linkanchor
- the anchor or null if undefinedquery
- the query or null if undefined
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |