public class CmsLink
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
CmsLink(org.dom4j.Element element,
java.lang.String name,
java.lang.String type,
java.lang.String uri,
boolean internal)
Creates a new link object with a reference to the xml page link element.
|
CmsLink(org.dom4j.Element element,
java.lang.String name,
java.lang.String type,
java.lang.String target,
java.lang.String anchor,
java.lang.String query,
boolean internal)
Creates a new link object with a reference to the xml page link element.
|
CmsLink(java.lang.String name,
java.lang.String type,
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,
java.lang.String type,
java.lang.String target,
java.lang.String anchor,
java.lang.String query,
boolean internal)
Creates a new link object without a reference to the xml page link element.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAnchor()
Returns the anchor of this link.
|
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 of the target if it is internal.
|
java.lang.String |
getTarget()
Returns the target (destination) of this link.
|
java.lang.String |
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.
|
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.
|
public CmsLink(org.dom4j.Element element,
java.lang.String name,
java.lang.String type,
java.lang.String uri,
boolean internal)
element - the xml link element referencename - the internal name of this linktype - the type of this linkuri - the link uriinternal - indicates if the link is internal within OpenCmspublic CmsLink(org.dom4j.Element element,
java.lang.String name,
java.lang.String type,
java.lang.String target,
java.lang.String anchor,
java.lang.String query,
boolean internal)
element - the xml link element referencename - the internal name of this linktype - the type of this linktarget - the link target (without anchor/query)anchor - the anchor or nullquery - the query or nullinternal - indicates if the link is internal within OpenCmspublic CmsLink(java.lang.String name,
java.lang.String 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 OpenCmspublic CmsLink(java.lang.String name,
java.lang.String type,
java.lang.String target,
java.lang.String anchor,
java.lang.String query,
boolean internal)
name - the internal name of this linktype - the type of this linktarget - the link target (without anchor/query)anchor - the anchor or nullquery - the query or nullinternal - indicates if the link is internal within OpenCmspublic java.lang.String getAnchor()
public java.lang.String getName()
public java.lang.String getParameter(java.lang.String name)
name - the name of the parameternullpublic 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 parameterString[] of all parameter values or nullpublic java.lang.String getQuery()
public java.lang.String getSiteRoot()
public java.lang.String getTarget()
public java.lang.String getType()
public java.lang.String getUri()
public java.lang.String getVfsUri()
public boolean isInternal()
public java.lang.String toString()
toString in class java.lang.ObjectObject.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?querypublic 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