org.opencms.relations
Class CmsLinkUpdateUtil

java.lang.Object
  extended by org.opencms.relations.CmsLinkUpdateUtil

public final class CmsLinkUpdateUtil
extends java.lang.Object

An utility class for updating the link xml node.

Since:
6.0.0
Version:
$Revision: 1.6 $
Author:
Michael Moossen

Method Summary
static void updateType(org.dom4j.Element element, CmsRelationType type)
          Updates the type for a link xml element node.
static void updateXml(CmsLink link, org.dom4j.Element element, boolean updateOnly)
          Updates the link node in the underlying XML page document.
static void updateXmlForHtmlValue(CmsLink link, java.lang.String name, org.dom4j.Element element)
          Updates the given xml element with this link information.
static void updateXmlForVfsFile(CmsLink link, org.dom4j.Element element)
          Updates the given xml element with this link information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

updateType

public static void updateType(org.dom4j.Element element,
                              CmsRelationType type)
Updates the type for a link xml element node.

Parameters:
element - the link element node to update
type - the relation type to set

updateXml

public static void updateXml(CmsLink link,
                             org.dom4j.Element element,
                             boolean updateOnly)
Updates the link node in the underlying XML page document.

Parameters:
link - the link to update
element - the <link> element to update
updateOnly - if set and the element has no CmsLink.NODE_TARGET subelement, so no action if executed at all

updateXmlForHtmlValue

public static void updateXmlForHtmlValue(CmsLink link,
                                         java.lang.String name,
                                         org.dom4j.Element element)
Updates the given xml element with this link information.

Parameters:
link - the link to get the information from
name - the (optional) name of the link
element - the <link> element to update

updateXmlForVfsFile

public static void updateXmlForVfsFile(CmsLink link,
                                       org.dom4j.Element element)
Updates the given xml element with this link information.

Parameters:
link - the link to get the information from
element - the <link> element to update