Class WfXMLWebLink

java.lang.Object
com.groiss.wfxml.WfXMLObject
com.groiss.wfxml.WfXMLWebLink
All Implemented Interfaces:
Cloneable

public class WfXMLWebLink extends WfXMLObject implements Cloneable
Instances of this class represent web links. You can use it to create new web links, create web links out of JDOM elements, and create a web link out of an existing DMSWebLink object.
See the super class WfXMLObject for details and examples.
  • Constructor Details

    • WfXMLWebLink

      public WfXMLWebLink(String name, String url, String description, String userId)
      Creates a web link with all possible fields.
      Parameters:
      name - A subject for the note.
      url - The content of the note.
      description - A description text for the web link. A description is not obligatory, so you can provide null if you don't want to set something special.
      userId - Id of the user who will be (or is) the creator of the note. You can use null here, if you don't want to use a special user. In that case the note will be created by another user (if possible), or an error will occur.
    • WfXMLWebLink

      public WfXMLWebLink(org.apache.xmlbeans.XmlObject obj)
    • WfXMLWebLink

      public WfXMLWebLink(DMSWebLink dmsWebLink) throws Exception
      Use this constructor to build a WfXMLWebLink out of a DMSWebLink. The WfXMLWebLink will be filled with the values of the DMSWebLink.
      Parameters:
      dmsWebLink - A DMSWebLink object.
      Throws:
      Exception - if there occur problems reading data from the DMSWebLink object.
  • Method Details

    • getName

      public String getName()
      Returns the name string of this web link.
      Specified by:
      getName in class WfXMLObject
      Returns:
      A String containing the name of this web link or null if no name has been defined.
    • getURL

      public String getURL()
      Returns the URL (as String) of this web link.
      Returns:
      A String with the URL of this web link or null if no URL has been set.
    • getDescription

      public String getDescription()
      Returns the description of this web link.
      Returns:
      A String holding the description of this web link or null if no description has been defined.
    • setName

      public void setName(String name)
      Set the name of this web link.
      Parameters:
      name - A String containing a new name for this web link.
    • setURL

      public void setURL(String url)
      Set the URL for this web link. You should provide a complete URL here (like "http://www...") so that the link will work properly in @enterprise.
      Parameters:
      url - A String with the new URL for the web link
    • setDescription

      public void setDescription(String description)
      Set a new description for this web link.
      Parameters:
      description - A String holding the new description.
    • fill

      public void fill(DMSObject existingWebLink, User defaultCreator) throws Exception
      This method fills an existing DMSWebLink with the data of this WfXMLWebLink and updates it to the database.
      Specified by:
      fill in class WfXMLObject
      Parameters:
      existingWebLink - The existing DMSWebLink. If you pass an object that is no DMSWebLink, this method will simply do nothing.
      defaultCreator - A creator for objects that must be created. As this method updates a web link, the user will not be used, because it will not be necessary to create anything here. You can simply pass in null.
      Throws:
      Exception - If updating the DMSWebLink with the data fails.
    • createDMSObject

      public DMSObject createDMSObject(User defaultCreator)
      Creates a DMSWebLink object out of this WfXMLWebLink.
      Specified by:
      createDMSObject in class WfXMLObject
      Parameters:
      defaultCreator - You can specify a default creator with this parameter. If there is no user defined in this WfXMLWebLink object, or if the defined user cannot be found, the defaultCreator will be used. If this user also does not exist, an ApplicationException will be thrown.
      Returns:
      The new DMSWebLink object, or null if creating the web link didn't work.
    • clone

      public Object clone()
      Creates a deep copy of this web link. The returned object can be casted to WfXMLWebLink.
      Overrides:
      clone in class Object
    • getXMLObject

      public org.apache.xmlbeans.XmlObject getXMLObject()
      Specified by:
      getXMLObject in class WfXMLObject