Class ToHtml
- All Implemented Interfaces:
PCDataVisitor
The text structure of lablog is imported from d2d_gp.basic.
One central issue is the difference in content models for the xhtml
containers
Element_p, Element_li, Element_td, etc., and the
compositional modifiers Element_em, Element_span, etc.
E.g. a visited PCData on the input side will be translated into very
different of these target contexts, and thus wrapped into different
TypedContent classes.
For this the ToHtml.DeliveryContext is introduced.
A special problem is the "hierarchy rotation" between "p" on one side and "list" and "table" on the other. In d2d_gp.basic the "p" element is the central means for organizing text (e.g. the attributes "language", "style", "accessRights"), and all other elements containing text (even images) are subordinated. In xhtml its different and not so consistent:
d2d_gp.basic: xhtml:
| |---------+--------+
p p list p
|--------+-----+ | |
PCData list PCData PCData PCData
The xhtml Tdom defines some abstract classes which make this sorting easier:
Element_body Element_p Element_li E_span Element_div
Element_td E_em etc. _inline
contains..
E_block_content E_p.Content E_li.Content E_span.Content
wraps..
E_misc_inline E_block_content E_misc_inline
| E_inline | E_inline | E_inline
which are..
|_a|_phrase |_fonstyle
|_em|_kbd |_b|_big|_i|_tt
which are..
E_form | E_form_content
E_block | E_misc
| E_misc_inline|_noscript
| _del|_ins|_script
E_div|_p|E_table
E_heading|E_blocktext
_h1|_h2..|hr pre address
Element_misc_inline (del, ins, script, noscript) is not in a full
compositional way.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classAuxiliary co-tuple class for putting Element_inline and pcdata into one list.protected classThis variant accepts only block content and stores it as such.protected classThis variant accepts only block content and stores it as content of Element_div.protected classThis variant wraps every accepted input into a "pre" content element.protected classThis variant wraps every accepted input into a "list item content" element.protected classThis variant wraps every accepted input into a "pre" content element.protected classThis variant wraps every accepted input into a table data "td" content element.protected classA delivery context maintains a list into which the generated html elements can be stored. -
Field Summary
FieldsModifier and TypeFieldDescriptionControl for duplicate entries.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final StringClass name for the css style definitions.static final Element_brstatic final Element_spanstatic final Element_hrInput parameter, passed in from the file visitor inMain, which collected the lablog tdom elements.static final StringPut into the footer.static final StringSeparator between the names of package and issue.static final StringStub of the name of the anchor where the docmat region of a package begins.protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> static final StringValue which will be encoded in the generated html to address the stylesheet.static final StringValue which will be encoded in the generated html to address the stylesheet.Fields inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
validating -
Method Summary
Modifier and TypeMethodDescriptionprotected StringVisit an subtree of the d2d input and extract a list of author names.makeHtml(SortedMap<String, List<Element_issue>> issuesByPackage, SortedMap<String, List<Element_docmat>> docmatsByPackage, Map<Element, File> elements2file, Map<File, @Opt MessageStore<SimpleMessage<XMLDocumentIdentifier>>> files2error) Make the complete html rendering.protected voidrenderDocmat(String packageName, String issueName, Element_docmat data) Make the xhtml rendering of a d2d "docMat" element, which appears independent from an issue.protected voidrenderIssue(String packageName, String issueName, Element_issue data) Make the xhtml rendering of a d2d "issue" element.protected voidrenderPackage(String packagename, @Opt List<Element_issue> issues, @Opt List<Element_docmat> docmats) Make the xhtml rendering of a package header, i.e.voidvisit(Element_a_emph el) Construct an xhtml em from a d2d emph.voidvisit(Element_a_hh el) Insert character data hashmark.voidvisit(Element_a_link el) Construct an xhtml link from a d2d link.voidvisit(Element_a_list el) Construct an xhtml list from a d2d list.voidCan be overridden by the user to define particular semantic operations.voidvisit(Element_a_nl el) Construct an xhtml br from a d2d nl.voidvisit(Element_a_p el) Construct an xhtml p from a d2d p.voidvisit(Element_a_src el) Construct an xhtml tt from a d2d src.voidvisit(Element_a_SRC el) Construct an xhtml PRE from a d2d SRC.voidvisit(Element_a_table el) Construct an xhtml table from a d2d table.voidvisit(Element_a_td el) Construct an xhtml td from a d2d td.voidvisit(Element_a_tr el) Construct an xhtml tr from a d2d tr.voidvisit(Element_a_xemph el) Construct an xhtml b from a d2d xemph.voidvisit(Element_desc el) Make the xhtml rendering of a d2d "desc" element, which occurs is the main sub-element of an issue.voidvisit(Element_note el) Make the xhtml rendering of a note = a text aappended to an Issue.voidvisit(TypedPCData data) To be overridden.Methods inherited from class eu.bandm.tools.lablog.xml.Visitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitMethods inherited from class eu.bandm.tools.tdom.runtime.BaseVisitor
visit
-
Field Details
-
path_to_stylesheet
Value which will be encoded in the generated html to address the stylesheet.- See Also:
-
path_to_javascript
Value which will be encoded in the generated html to address the stylesheet.- See Also:
-
ISSUE_SEPARATOR
Separator between the names of package and issue. This must be a valid XML NMTOKEN character but NOT part of a java package name- See Also:
-
href_bandm_online_docu
Put into the footer.- See Also:
-
LINK_DOCMAT
Stub of the name of the anchor where the docmat region of a package begins.- See Also:
-
CL_topHeadline
Class name for the css style definitions.- See Also:
-
CL_survey_tab
Class name for the css style definitions.- See Also:
-
CL_survey_tab_ACTIVE
Class name for the css style definitions.- See Also:
-
CL_package_header
Class name for the css style definitions.- See Also:
-
CL_issue_header
Class name for the css style definitions.- See Also:
-
CL_issue_prefix
Class name for the css style definitions.- See Also:
-
CL_td_nodecor
Class name for the css style definitions.- See Also:
-
CL_prior_N
Class name for the css style definitions.- See Also:
-
CL_costs_N
Class name for the css style definitions.- See Also:
-
CL_issueDate
Class name for the css style definitions.- See Also:
-
CL_status_N
Class name for the css style definitions.- See Also:
-
CL_authors
Class name for the css style definitions.- See Also:
-
CL_noteHeader
Class name for the css style definitions.- See Also:
-
CL_docmatHeader
Class name for the css style definitions.- See Also:
-
EL_BR
-
EL_HH
-
EL_HR
-
msg
-
elements2file
Input parameter, passed in from the file visitor inMain, which collected the lablog tdom elements. -
allNames
Control for duplicate entries.
-
-
Method Details
-
visit
Description copied from class:BaseVisitorTo be overridden. This default implementation does nothing.- Specified by:
visitin interfacePCDataVisitor- Overrides:
visitin classVisitor
-
visit
Construct an xhtml list from a d2d list. For this, a currently growing xhtml paragraph must be closed and re-opened afterwards. ATTENTION: corresponding to d2d_gp toXhtml, a list without "symbol" entry is rendered by arabic numbers. -
visit
Description copied from class:VisitorCan be overridden by the user to define particular semantic operations. Will be called whenever the default model instance traversal (as implemented by the methods in this class) reaches such an element.
This default implementation descends into the element by callingvisit(..)in turn for all PCData and all Elements in its contents. -
visit
Construct an xhtml table from a d2d table. For this, a currently growing xhtml paragraph must be closed and re-opened afterwards. -
visit
Construct an xhtml tr from a d2d tr. -
visit
Construct an xhtml td from a d2d td. -
visit
Construct an xhtml p from a d2d p. -
visit
Construct an xhtml PRE from a d2d SRC. Flush an open p iff we are the first in a "desc" -
visit
Construct an xhtml br from a d2d nl. -
visit
Insert character data hashmark. -
visit
Construct an xhtml tt from a d2d src. Can only contain "#hh". -
visit
Construct an xhtml link from a d2d link.
ATTENTION renders from the "text" input only un-decorated text. Starting "0" is replaced by "http:/" and "1" by "https:/", for ease of writing. -
visit
Construct an xhtml em from a d2d emph. FIXME CHECK d2d emph NUR CHARACTER DATA wird genommen ?!?! -
visit
Construct an xhtml b from a d2d xemph. FIXME CHECK d2d emph NUR CHARACTER DATA wird genommen ?!?! -
extractAuthors
Visit an subtree of the d2d input and extract a list of author names. -
visit
Make the xhtml rendering of a note = a text aappended to an Issue. -
visit
Make the xhtml rendering of a d2d "desc" element, which occurs is the main sub-element of an issue. Open a paragraph context in case that the "@p" alternative of its content model is chosen, andflushP()it on return, if necessary. If the "p*" alternative is chosen, this first (empty) paragraph will be flushed and the explicit/contained paragraph will also be flushed by its visitor code (thusinP==false). -
renderDocmat
Make the xhtml rendering of a d2d "docMat" element, which appears independent from an issue. -
renderIssue
Make the xhtml rendering of a d2d "issue" element.- Parameters:
packageName- "noPackage" is encoded as ""
-
renderPackage
protected void renderPackage(String packagename, @Opt @Opt List<Element_issue> issues, @Opt @Opt List<Element_docmat> docmats) Make the xhtml rendering of a package header, i.e. a package name for which issues or docmats or both have been collected. -
makeHtml
public Element_html makeHtml(SortedMap<String, List<Element_issue>> issuesByPackage, SortedMap<String, List<Element_docmat>> docmatsByPackage, Map<Element, File> elements2file, Map<File, @Opt MessageStore<SimpleMessage<XMLDocumentIdentifier>>> files2error) Make the complete html rendering.
-