Class SchemaDocumentation
Definition in the data model
The component must be declared under the element
xs:schema/xs:annotation/xs:appinfo
:
where<xs:schema ...> <xs:annotation> <xs:appinfo> <osd:documentation class="com.foo.MySchemaDocumentation"/> </xs:appinfo> </xs:annotation> ... </xs:schema ...>
com.foo.MySchemaDocumentation
is
the fully qualified name of a class extending this abstract class.
The declaration may also pass parameters, as follows:
where<osd:documentation class="com.foo.MySchemaDocumentation"> <param1>...</param1> <param2>...</param2> </osd:documentation>
param1
and param2
are JavaBean properties
of com.foo.MySchemaDocumentation
class.
For more information, see Specification of JavaBeans.
Life cycle
- When the data model is loaded:
- the specified class is instantiated through its default constructor and the setters of the JavaBean properties
are called (based on the example above,
setParam1(...)
andsetParam2(...)
); - the method
setup(SchemaDocumentationSetupContext)
is called for the new instance.
- the specified class is instantiated through its default constructor and the setters of the JavaBean properties
are called (based on the example above,
- During the operational phase: the methods
getLabel(SchemaDocumentationContext)
andgetDescription(SchemaDocumentationContext)
are called each time a node from the data model is to be displayed in the user interface.
Performance considerations
The methods getLabel(SchemaDocumentationContext)
and getDescription(SchemaDocumentationContext)
are called every time a node in the data model is displayed in
the user interface, which means the code of these methods must be optimized as much as possible to avoid impacting
performance.
For example, given a table with N nodes, these methods will be called at least
N times when accessing a table record in the user interface.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getDescription
(SchemaDocumentationContext aContext) Returns the localized description of the node in the specified context.abstract String
getLabel
(SchemaDocumentationContext aContext) Returns the localized label of the node in the specified context.abstract void
setup
(SchemaDocumentationSetupContext aContext) Checks and prepares this instance when the data model is loaded.
-
Constructor Details
-
SchemaDocumentation
public SchemaDocumentation()
-
-
Method Details
-
getLabel
Returns the localized label of the node in the specified context. This method is invoked bySchemaNode.getLabel(Session)
andSchemaNode.getLabel(java.util.Locale)
to give the ability to dynamically compute a label depending on the session or the repository.If this method returns
null
, the displayed label will usually be the label statically defined in the data model, or the node name if no static label is defined.- See Also:
-
getDescription
Returns the localized description of the node in the specified context. This method is invoked bySchemaNode.getDescription(Session)
andSchemaNode.getDescription(java.util.Locale)
to give the ability to dynamically compute a description depending on the session or the repository.If this method returns
null
the displayed description will usually be the description statically defined in the data model.- See Also:
-
setup
Checks and prepares this instance when the data model is loaded.Do note that during this step, all models may not be properly loaded. Thus, the repository should not be accessed during this step.
-