org.openstreetmap.josm.gui.help
Class HelpContentReader

java.lang.Object
  extended by org.openstreetmap.josm.gui.help.HelpContentReader

public class HelpContentReader
extends java.lang.Object

Reads help content from the JOSM Wiki and prepares it for rendering in the internal help browser. The help content has to be filtered because only the main content <div> of a Wiki help page is displayed in the internal help browser. It also has to be transformed because the internal help browser required slightly different HTML than what is provided by the Wiki.

See Also:
WikiReader

Field Summary
private  java.lang.String baseUrl
          the base url
 
Constructor Summary
HelpContentReader(java.lang.String baseUrl)
          constructor
 
Method Summary
 java.lang.String fetchHelpTopicContent(java.lang.String helpTopicUrl, boolean dotest)
          Fetches the content of a help topic from the JOSM wiki.
protected  java.lang.String prepareHelpContent(java.io.BufferedReader in, boolean dotest)
          Reads help content from the input stream and prepares it to be rendered later in the internal help browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseUrl

private java.lang.String baseUrl
the base url

Constructor Detail

HelpContentReader

public HelpContentReader(java.lang.String baseUrl)
constructor

Parameters:
baseUrl - the base url of the JOSM help wiki, i.e. http://josm.openstreetmap.org
Method Detail

fetchHelpTopicContent

public java.lang.String fetchHelpTopicContent(java.lang.String helpTopicUrl,
                                              boolean dotest)
                                       throws HelpContentReaderException
Fetches the content of a help topic from the JOSM wiki.

Parameters:
helpTopicUrl - the absolute help topic URL
Returns:
the content, filtered and transformed for being displayed in the internal help browser
Throws:
HelpContentReaderException - thrown if problem occurs
MissingHelpContentException - thrown if this helpTopicUrl doesn't point to an existing Wiki help page

prepareHelpContent

protected java.lang.String prepareHelpContent(java.io.BufferedReader in,
                                              boolean dotest)
                                       throws HelpContentReaderException
Reads help content from the input stream and prepares it to be rendered later in the internal help browser. Throws a MissingHelpContentException if the content read from the stream most likely represents a stub help page.

Parameters:
in - the input stream
Returns:
the content
Throws:
HelpContentReaderException - thrown if an exception occurs
MissingHelpContentException - thrown, if the content read isn't a help page


JOSM