b-gyula / liquibase-doc

Source code for the liquibase.org website
0 stars 1 forks source link

Create a modified version of the doc generator that uses freemarker template #3

Open b-gyula opened 1 month ago

b-gyula commented 1 month ago

Overview

Modify the doc generator to expect a FreeMarker template as default parameter.

Instead of creating multiple md files the template should be populated with the metadata collected from the liquibase jar.

  1. Relevant information required for each change:
    • name
    • properties
    • if can it contain plain text
    • possible nested tag(s)
    • description

Information required for each property:

Details (expected as implementation plan)

  1. As one can see, at the 1st line of ChangeDocGenerator all the defined changes can be retrieved by calling ChangeFactory.getInstance().getRegistry();

  2. For each Change the required meta information can be retrieved with a call of

    ChangeMetaData meta = ChangeFactory.getInstance().getChangeMetaData(changeName); // changeName = change.getSerializedObjectName()
  3. liquibase.change.ChangeMetaData contains the {name} (== change.getSerializedObjectName()) and {description} required for the <complexType ...> tag

  4. For each <attribute ...> the meta.parameters property can be used that contains all the change parameters in liquibase.change.ChangeParameterMetaData objects: parameterName, description, dataType

  5. To get the {children} nested element list a wrapper class like ChangeDocGenerator.ChangeParamMetaData could be used. returns inisContainer` if a parameter is a nested element.

b-gyula commented 2 weeks ago

Type mapping:

String : xsd:string Boolean : booleanExp BigInteger|Integer : integerExp Long : xsd:long

(containedType.getSimpleName) "ColumnConfig" : column "LoadDataColumnConfig : loadDataColumn :