Class HtmlDomDocNewsletter
java.lang.Object
fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter
This classes provides implementation to retrieve urls from specified tags on an HTML page.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrlTo 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.ElementUrlTo 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.ElementUrlTo 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.ElementUrlTo 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.ElementUrlTo 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
ConstructorsConstructorDescriptionHtmlDomDocNewsletter(String strHtml, String strBaseUrl) Instantiates an HtmlDocument after having built the DOM tree. -
Method Summary
Modifier and TypeMethodDescriptionvoidconvertAllRelativesUrls(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 urlsGet the document content
-
Field Details
-
CONSTANT_STATIC_URL
- See Also:
-
CONSTANT_PROTOCOL_DELIMITER
- See Also:
-
ELEMENT_CSS
public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_CSSTo define a CSS, html element must have:- "link" tag name
- "rel" attribute equal to "stylesheet"
-
ELEMENT_JAVASCRIPT
public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_JAVASCRIPTTo define a javascript, html element must have:- "script" tag name
- "type" attribute equal to "text/javascript"
-
ELEMENT_IMG
public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_IMGTo define an image, html element must have:- "img" tag name
-
ELEMENT_A
public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_ATo define a anchor, a element must have:- "a" tag name
-
ELEMENT_FORM
public static final fr.paris.lutece.plugins.newsletter.util.HtmlDomDocNewsletter.ElementUrl ELEMENT_FORMTo define a form, form element must have:- "form" tag name
-
-
Constructor Details
-
HtmlDomDocNewsletter
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
Get the document content- Returns:
- The String content
-