Class CmsLinkUpdateUtil


  • public final class CmsLinkUpdateUtil
    extends java.lang.Object
    An utility class for updating the link xml node.

    Since:
    6.0.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.lang.String decodeEntities​(java.lang.String value)
      Decodes entities in a string if it isn't null.
      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
      • decodeEntities

        protected static java.lang.String decodeEntities​(java.lang.String value)
        Decodes entities in a string if it isn't null.

        Parameters:
        value - the string for which to decode entities
        Returns:
        the string with the decoded entities