Class HtmlDomDocNewsletter

java.lang.Object
fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter

public class HtmlDomDocNewsletter extends Object
This classes provides implementation to retrieve urls from specified tags on an HTML page.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl
    To define a anchor, a element must have: "a" tag name The url is contained in the attributed named "href"
    static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl
    To define a CSS, html element must have: "link" tag name "rel" attribute equal to "stylesheet" The url is contained in the attributed named "href"
    static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl
    To define a form, form element must have: "form" tag name The url is contained in the attributed named "action"
    static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl
    To define an image, html element must have: "img" tag name The url is contained in the attributed named "src"
    static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl
    To define a javascript, html element must have: "script" tag name "type" attribute equal to "text/javascript" The url is contained in the attributed named "src"
  • Constructor Summary

    Constructors
    Constructor
    Description
    HtmlDomDocNewsletter(String strHtml, String strBaseUrl)
    Instantiates an HtmlDocument after having built the DOM tree.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    convertAllRelativesUrls(fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl elementType)
    Get the relatives urls of all html elements specified by elementType and convert its to absolutes urls
    Get the document content

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CONSTANT_STATIC_URL

      public static final String CONSTANT_STATIC_URL
      See Also:
    • CONSTANT_PROTOCOL_DELIMITER

      public static final String CONSTANT_PROTOCOL_DELIMITER
      See Also:
    • ELEMENT_CSS

      public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_CSS
      To define a CSS, html element must have:
      • "link" tag name
      • "rel" attribute equal to "stylesheet"
      The url is contained in the attributed named "href"
    • ELEMENT_JAVASCRIPT

      public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_JAVASCRIPT
      To define a javascript, html element must have:
      • "script" tag name
      • "type" attribute equal to "text/javascript"
      The url is contained in the attributed named "src"
    • ELEMENT_IMG

      public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_IMG
      To define an image, html element must have:
      • "img" tag name
      The url is contained in the attributed named "src"
    • ELEMENT_A

      public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_A
      To define a anchor, a element must have:
      • "a" tag name
      The url is contained in the attributed named "href"
    • ELEMENT_FORM

      public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_FORM
      To define a form, form element must have:
      • "form" tag name
      The url is contained in the attributed named "action"
  • Constructor Details

    • HtmlDomDocNewsletter

      public HtmlDomDocNewsletter(String strHtml, String strBaseUrl)
      Instantiates an HtmlDocument after having built the DOM tree.
      Parameters:
      strHtml - The Html code to be parsed.
      strBaseUrl - The Base url used to retrieve urls.
  • Method Details

    • convertAllRelativesUrls

      public void convertAllRelativesUrls(fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl elementType)
      Get the relatives urls of all html elements specified by elementType and convert its to absolutes urls
      Parameters:
      elementType - the type of element to get
    • getContent

      public String getContent()
      Get the document content
      Returns:
      The String content