Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

TagName resolution

TagName resolution should only be a matter in xml context. IE, we can fully use the modello-plugin-xml attributes and mecanisms, because we should be in xml context (parser, documentation, schema or anything else).

Where is it done?

It should be done in a Utility class, provided by the modello-plugin-xml. As of now, it's done separatly by each plugin, which could lead to very inconsistent behaviour!
For example:

How is it done?

The more complete algorithm, for tagName resolution is, according to me:

  1. if xml.tagName is set, this is our tagName, no question there.
  2. else
    1. if the we are not in an association : tagName is the name of the class/field (starting with lower case)
    2. if we are in an association :
      1. if xml.associationTagName is set, this is our tagName
      2. else tagName is the name of the association in singular if xml.listStyle is set to WRAPPED, as given is xml.listStyle is set to FLAT.

Other candidate helper methods

Following helper methods should be included in utility pack somewhere:

  • isInnerAssociation( Model objectModel, ModelField field )
  • isManyAssociation( Model objectModel, ModelField field )
  • isWrappedAssociation( Model objectModel, ModelField field )
  • isFlatAssociation( Model objectModel, ModelField field )
  • isNonRecursiveAssociation( Model objectModel, ModelClass modelClass, ModelAssociation association )

All of these methods are provided in path (initially for use in Xdoc Plugin)