Class Userdoc

java.lang.Object
eu.bandm.tools.d2d2.base.Userdoc
Direct Known Subclasses:
UserdocInstantiated, UserdocUninstantiated

public abstract class Userdoc extends Object
Common superclass for user documentation, instantiated or uninstantiated.
  • Field Details

    • local_copy_js

      public static final String local_copy_js
      Name of the local file into which the default java script resource will be copied into the generated directory. Exactly this file name is included by the generated "usage survey" SVG file directly.
      See Also:
    • resource_position_ddfdoc_js

      protected String resource_position_ddfdoc_js
      Position of the resource (relative to class DocTypes) which will be copied into the generated directory. @see #local_copy_js Can be overwritten by subclasses.
    • local_copy_css

      public static final String local_copy_css
      Name of the local file into which the default css resource will be copied into the generated directory. If the user stylesheet parameters are empty at the position Constants.stylesheet_param_cssUrls, then this file name is used as a default for inclusion. (Implemented in "Tasks"!) Otherwise it must appear explicitly in the user's stylesheet parameters.
      See Also:
    • resource_position_ddfdoc_css

      public static final String resource_position_ddfdoc_css
      Position of the resource (relative to class DocTypes) which will be copied into the generated directory. @see #local_copy_css
      See Also:
    • item_in_line_separator

      public static final String item_in_line_separator
      Text separator to encode the two anchorpoint which are connected by a line in the "uses" SVG graphics. Attention, this value must be in in sync with ddfDoc.js
      See Also:
    • target_module_name

      static final String target_module_name
      For d2d/xslt conversion of the documentation text fragments.
      See Also:
    • target_top_tag

      static final String target_top_tag
      For d2d/xslt conversion of the documentation text fragments.
      See Also:
    • filename_htmldoc

      static final String filename_htmldoc
      Generated file structure.
      See Also:
    • filename_contentGraph

      static final String filename_contentGraph
      Generated file structure.
      See Also:
    • mapname_contentGraph

      static final String mapname_contentGraph
      Generated file structure.
      See Also:
    • classname_alert

      public static final String classname_alert
      See Also:
    • classname_defcategory_in_header

      public static final String classname_defcategory_in_header
      How to render the type ("chars" "tags", etc) in a header line
      See Also:
    • classname_defname_in_header

      public static final String classname_defname_in_header
      See Also:
    • classname_modulename_in_header

      public static final String classname_modulename_in_header
      See Also:
    • classname_modulename_as_header_in_list

      public static final String classname_modulename_as_header_in_list
      See Also:
    • classname_contextpath_in_header

      public static final String classname_contextpath_in_header
      See Also:
    • classname_text_generic

      public static final String classname_text_generic
      See Also:
    • classname_syntaxgraph_image

      public static final String classname_syntaxgraph_image
      See Also:
    • classname_enum_intconst

      public static final String classname_enum_intconst
      See Also:
    • classname_enumtable

      public static final String classname_enumtable
      See Also:
    • classname_nestedModuleTable

      public static final String classname_nestedModuleTable
      See Also:
    • classname_docuSurveyTable

      public static final String classname_docuSurveyTable
      See Also:
    • classname_import_relevant

      public static final String classname_import_relevant
      See Also:
    • classname_import_repeat

      public static final String classname_import_repeat
      See Also:
    • classname_import_recursive

      public static final String classname_import_recursive
      See Also:
    • classname_footertext

      public static final String classname_footertext
      See Also:
    • classname_creationcommand

      public static final String classname_creationcommand
      See Also:
    • imageFormat

      public static final String imageFormat
      See Also:
    • image_file_suffix

      public static final String image_file_suffix
      See Also:
    • map_prefix

      public static final String map_prefix
      See Also:
    • anchorname_toc

      public static final String anchorname_toc
      See Also:
    • anchorname_listOfHomonyms

      public static final String anchorname_listOfHomonyms
      See Also:
    • prefix_anchor_module

      public static final String prefix_anchor_module
      See Also:
    • prefix_anchor_definition

      public static final String prefix_anchor_definition
      See Also:
    • prefix_anchor_importitem

      public static final String prefix_anchor_importitem
      See Also:
    • color_syntaxGraph_background_dynamic

      static final Color color_syntaxGraph_background_dynamic
    • color_syntaxGraph_background_static

      static final Color color_syntaxGraph_background_static
    • docu_prefix

      protected static final String docu_prefix
      Prefix to each documentation text fragment, to get it parsed and rendered.
      See Also:
    • docu_errorstrategy

      protected static final Text2Udom.ErrorStrategy docu_errorstrategy
      For parsing the docu_prefix text fragments.
    • docTexts

      protected DocTexts docTexts
      Translations of standard text components.
    • msg

      Evident
    • msgMEMSTRING

      protected MessageReceiver<SimpleMessage<String>> msgMEMSTRING
      With location<String>, for MemString addressing.
    • generatedDir

      protected final File generatedDir
    • lineWidth

      protected final int lineWidth
    • moduleRegistry

      protected final ModuleRegistry moduleRegistry
    • languagecode

      protected final String languagecode
    • targetcode

      protected final String targetcode
    • generationString

      protected final String generationString
    • stylesheetParams

      protected final NamespaceName2String stylesheetParams
    • xml_lineWidth

      public static final int xml_lineWidth
      See Also:
    • bodysubs

      protected final List<Element_block_content> bodysubs
    • toctoclist

      protected final List<Element_li> toctoclist
    • el_img_pcdata

      protected Element_img el_img_pcdata
      cache for the re-usable graphic represenation of an un-mixed pcdata-only contents definition.
    • indicateGENERIC

      protected final Element_pre indicateGENERIC
    • warnGeneric

      protected Lazy<Element_p> warnGeneric
    • docTextXsltTransformation

      @Opt @Opt Transformation docTextXsltTransformation
      Is != null after succesful loading.
    • docTextXsltTransformationLoaded

      boolean docTextXsltTransformationLoaded
      Indicates whether loading of docTextXsltTransformation has been tried.
    • functionLibrary

      FunctionLibrary<Node> functionLibrary
      Needed for Transfomation (once) and Application (multiple times).
    • hrefTooltipAlt

      protected String[] hrefTooltipAlt
    • html_repr_empty

      final Lazy<Element_p> html_repr_empty
      The html text for an element to be defined with empty content.
    • jumpToToc

      final Lazy<Element_p> jumpToToc
  • Constructor Details

  • Method Details

    • makeHtmlDoc

      protected abstract void makeHtmlDoc()
      Service Access Point callable by client.
    • error

      protected void error(String s, Object... args)
      Evident
    • warning

      protected void warning(String s, Object... args)
      Evident
    • error

      protected void error(Location<XMLDocumentIdentifier> loc, String s, Object... args)
      Evident
    • error

      protected void error(Exception ex, String s, Object... args)
      Evident
    • failure

      protected void failure(String s, Object... args)
      Evident
    • copyResource

      protected void copyResource(String resourceFileName, String localFileName)
    • anchor

      Element_a anchor(String id)
      Generate an anchor without any visible content and with the given id.
    • anchor

      Element_a anchor(Definition def)
    • anchor

      Element_a anchor(Module mod)
    • anchor

      Element_a anchor(ImportItem x)
    • jump

      Element_a jump(Definition def, Element_a.Content... contents)
    • jumpName

      Element_a jumpName(Definition def)
    • jump

      Element_a jump(Module mod, Element_a.Content... contents)
    • jump

      Element_a jump(Module mod, String cls, String txt)
    • jump

      Element_a jump(ImportItem x, Element_a.Content... contents)
    • packTd

      protected Element_tr.Choice_1_Alt_2 packTd(String s)
    • packTd

      protected Element_tr.Choice_1_Alt_2 packTd(String s, String cls)
    • mtext

      String mtext(String m)
      Translate a text fragment of pre-defined infrastructure text.
    • mtext

      String mtext(String m, Object... args)
      Translate and format a text fragment of pre-defined infrastructure text.
    • joinAllDocStrings

      public static String joinAllDocStrings(CheckedList<LocString> list)
    • splitWithAlerts

      List<Element_p.Content> splitWithAlerts(String text)
      Render into paragraph contents, printing marked segments in warning color.
    • loadDocTextXsltTransformation

      protected void loadDocTextXsltTransformation()
      Prepare the txsl Application. Load the xslt code for ddf:meta_model to targget=xhtml_1_0, using the default built-in function library.
    • renderDocu

      protected void renderDocu(SourceItem item)
      Convert the docu text for the given item, selected by the value of targetcode from d2d source into xhtml. Append the latter to the growing list bodysubs.
    • getRenderedDocu

      protected Element_block_content @Opt [] getRenderedDocu(SourceItem item)
    • f_renderDocu

      protected Element_block_content @Opt [] f_renderDocu(@Opt @Opt CheckedList<LocString> in, String docu_ident)
      Translate the d2d-encoded documentation text collected for one element to udom and then by standard xslt rules to xhtml.
    • do_renderDocu

      @Opt protected @Opt Element_block_content[] do_renderDocu(String docu_text, String docu_ident)
      Translate the d2d-encoded documentation text collected for one element to udom and then by standard xslt rules to xhtml.
    • getHrefTooltipAlt

      protected abstract void getHrefTooltipAlt(Reference ref, String[] out)
      Callback method to deliver these three values for the graphic rendering of the given reference.
    • makePngAndMap

      public void makePngAndMap(XRegExp def0, String modname, Color backgroundColor)
      Call the syntax graph creation with standard parameters. Uses the default constructor of SyntaxGraph.LayoutParameters
    • makePngAndMap

      public void makePngAndMap(XRegExp def0, String modName, Color backgroundColor, SyntaxGraph.LayoutParameters layoutParams)
      Create one single graphic file containing the graphic representation of the syntax of one single definition.
      Calls layouter and painter, and let the latter paint to a buffered image and writes this into a PNG file the name of which is generated from the path of the definition.
      Add corresponding html:img and html:map Elements to the global register bodysubs. The map makes mouse clicks to the references jump to the corresponding definitions.
      Parameters:
      modName - used to generated file names. Attention: iff def0 is rewritten, then its "fullpath()" is not usable as an XML-ident due to "$"
    • showCategory_short

      protected static String showCategory_short(Definition def)
      Short text = the keyword in the d2d definition format, which gives the kind of a definition.
    • showCategory_long

      protected String showCategory_long(Definition def)
    • makeEnumTable

      protected void makeEnumTable(Enumeration def)
      Generates a tabular visualisation of an enum, following the numerical values. (This because doc texts are stored with the numeric value.) Representation can be "asis", "numeric", or "first name".
    • makeDocuTable

      @Opt protected @Opt Element_table makeDocuTable(Set<Module> modules, Predicate<Definition> filter)
      Show for which raw definitions which documentation and transformation entries exist. (This table is not clickable, because there is not alwayas a one-to-one relations between source text and instantiations.)
    • addJumpToToc

      protected void addJumpToToc()
      Insert a jump back to the table of contents into the growing html body.
    • make_li_text_localhref

      void make_li_text_localhref(List<Element_li> v, String t, String href)
    • make_h2_with_aname

      Element_h2 make_h2_with_aname(String t, String Xname)