public class RendererImpl extends Renderer
The Renderer is initialized with information from the schema definition for the particular schemaNode (attribute or element) to be rendered, along with access to a RenderHelper, which provides utility functions. Rendered nodes are attached to the parent element (and thus to the Render-tree).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISPLAY_MODE
NOT YET DOCUMENTED
|
static java.lang.String |
EDIT_MODE |
df, formBeanName, normalizedXPath, parent, repeatingComplexSingletonChildPath, rhelper, root, schemaNode, sh, typeDef, typeName, xpath
Constructor and Description |
---|
RendererImpl()
Constructor for the Renderer object
|
Modifier and Type | Method and Description |
---|---|
org.dom4j.Element |
bestPracticesLink(java.lang.String xpath)
Render a Best Practices link for the specified xpath
|
protected void |
doInit(java.lang.String xpath,
org.dom4j.Element parent,
GlobalDef typeDef,
RendererHelper rhelper)
NOT YET DOCUMENTED
|
protected org.dom4j.Element |
getBooleanInput(java.lang.String xpath)
Boolean input elements are rendered with a tag that implements an select
input with options for true and false.
|
protected org.dom4j.Element |
getComboUnionInput(java.lang.String xpath)
comboUnionInput allows user to select from enumerated list (supplied by
schema) or enter in an arbitray value if desired.
|
ComplexTypeLabel |
getComplexTypeLabel(java.lang.String xpath)
Gets the complexTypeLabel attribute of the RendererImpl object
|
ComplexTypeLabel |
getComplexTypeLabel(java.lang.String xpath,
java.lang.String siblingPath,
java.lang.String indexId)
Gets the complexTypeLabel attribute of the RendererImpl object
|
org.dom4j.Element |
getDeleteController(java.lang.String itemPath,
java.lang.String elementName)
Gets the deleteController attribute of the RendererImpl object
|
org.dom4j.Element |
getInputElement(java.lang.String xpath,
SchemaNode schemaNode,
GlobalDef typeDef)
Gets the inputElement attribute of the RendererImpl object
|
org.dom4j.Element |
getInputHelperElement(java.lang.String xpath)
Creates the JSP element to render an input helper for the specified path
|
java.lang.String |
getLabelText(java.lang.String xpath,
java.lang.String siblingPath,
java.lang.String indexId)
Label text is indexed if siblingPath and indexId provided, otherwise based
on xpath
|
org.dom4j.Element |
getLanguageInput(java.lang.String xpath)
Gets the languageSelectInput attribute of the RendererImpl object
|
protected org.dom4j.Element |
getMultiBoxInput(java.lang.String xpath)
Renders a MultiBoxInput (a set of checkboxes) for the current element.
|
Label |
getMultiBoxLabel(java.lang.String xpath)
Gets the multiBoxLabel attribute of the RendererImpl object
|
org.dom4j.Element |
getMultiSelectInput(java.lang.String xpath)
Renders a multiSelect input (a set of of checkboxes) as an Element.
|
org.dom4j.Element |
getOptionalItemControl(java.lang.String xpath)
Creates an optionalItemControl Element that allows user to add or delete an
optional Element to/from the instance document
|
protected org.dom4j.Element |
getReadOnlyElement(java.lang.String xpath)
Gets the readOnlyElement attribute of the RendererImpl object
|
org.dom4j.Element |
getRenderedField(java.lang.String xpath,
org.dom4j.Element label,
org.dom4j.Element input)
Renders a Labelled input field (for a Simple or Built-in schema dataType.
|
org.dom4j.Element |
getRenderedField(java.lang.String xpath,
Label label,
org.dom4j.Element input)
Gets the renderedField attribute of the RendererImpl object
|
java.lang.String |
getRenderMode() |
org.dom4j.Element |
getSelectInput(java.lang.String xpath)
Gets the selectInput attribute of the RendererImpl object
|
static boolean |
getShowNSPrefixInLabels()
Gets the showNSPrefixInLabels attribute of the RendererImpl class
|
SimpleTypeLabel |
getSimpleTypeLabel(java.lang.String xpath)
Gets the simpleTypeLabel attribute of the RendererImpl object
|
SimpleTypeLabel |
getSimpleTypeLabel(java.lang.String xpath,
java.lang.String siblingPath,
java.lang.String indexId)
Gets the simpleTypeLabel attribute of the RendererImpl object
|
org.dom4j.Element |
getTextAreaInput(java.lang.String xpath)
Gets the textAreaInput attribute of the RendererImpl object
|
org.dom4j.Element |
getTextAreaInput(java.lang.String xpath,
int rows)
Gets the textAreaInput attribute of the RendererImpl object
|
protected org.dom4j.Element |
getTextInput(java.lang.String xpath,
SchemaNode schemaNode,
GlobalDef typeDef)
Gets the textInput attribute of the RendererImpl object
|
java.lang.String |
getToolHelp(java.lang.String s)
Attempts to return a metadata vocab field definition for the input string
assuming it is an xpath.
|
java.lang.String |
getXpath()
Gets the xpath of the Node to be rendered.
|
boolean |
isDisplayMode()
Returns true if we are in display mode (not editing)
|
boolean |
isEditMode()
Returns true if we are editing field contents (as opposed to simply viewing them).
|
void |
renderAttribute()
Render an Attribute schemaNode
|
void |
renderChoice(org.dom4j.Element choiceElement)
Render a choice compository via either MdeChoice, for simple choices, or
MdeMultiChoice for choice compositors that have more than one occurance
|
void |
renderComplexTypeConcrete()
Renders a complexType element by creating an containerBox and then
populating it with a formattedLabel and the complexType element contents
(via renderSubElements).
|
void |
renderDerivedContentModel()
Render a derived content model (complexType).
|
void |
renderDerivedTextOnlyModel()
Render a Text-only content model, which is a complexType that uses a
simpleContent element.
|
protected org.dom4j.Element |
renderInputElement(java.lang.String xpath,
SchemaNode schemaNode,
GlobalDef typeDef)
Gets the inputElement attribute of the EditorRenderer object
|
void |
renderModelGroup(org.dom4j.Element group)
called with group element, e.g., <xs:group ref="nameGroup"/>
|
void |
renderRepeatingElement()
NOT YET DOCUMENTED
|
void |
renderRepeatingSubstitutionGroup()
NOT YET DOCUMENTED
|
void |
renderSequence(org.dom4j.Element sequence)
NOT YET DOCUMENTED
|
void |
renderSimpleTypeConcrete()
NOT YET DOCUMENTED
|
void |
renderSubElements()
NOT YET DOCUMENTED
|
void |
renderSubElements(GlobalDef proxyTypeDef)
NOT YET DOCUMENTED
|
void |
renderSubElements(java.util.List subElements)
Render the given subElements (or those of the current ComplexType if no
subElements are provided).
|
java.lang.String |
report()
Description of the Method
|
static void |
setDebug(boolean bool)
Sets the debug attribute of the RendererImpl class
|
void |
setRenderMode(java.lang.String mode)
RenderMode determines whether we are editing a record, or simply viewing its contents.
|
static void |
setShowNSPrefixInLabels(boolean b)
Sets the showNSPrefixInLabels attribute of the RendererImpl class
|
boolean |
showXsdStringElement(java.lang.String xpath)
Hook to allow specialized renderers (in particular DleseEditorRenderer) to
suppress display of xsd:string elements in certain circumstances by
overriding this method.
|
doInit, getDiv, getDiv, getLevel, getSchemaNamespace, getSchemaNSPrefix, getXmlFormat, init, jspQuotedString, renderComplexType, renderNode, renderSimpleType
public static final java.lang.String EDIT_MODE
public static final java.lang.String DISPLAY_MODE
public void setRenderMode(java.lang.String mode)
setRenderMode
in class Renderer
public java.lang.String getRenderMode()
getRenderMode
in class Renderer
public boolean isDisplayMode()
isDisplayMode
in class Renderer
public boolean isEditMode()
isEditMode
in class Renderer
public static void setShowNSPrefixInLabels(boolean b)
b
- The new showNSPrefixInLabels valuepublic static boolean getShowNSPrefixInLabels()
protected void doInit(java.lang.String xpath, org.dom4j.Element parent, GlobalDef typeDef, RendererHelper rhelper) throws java.lang.Exception
doInit
in class Renderer
xpath
- path to the node to be renderedparent
- element to which the rendered node will be attachedtypeDef
- schema-defined type definition for the node to be
renderedrhelper
- Helper class provided utility functions to aid
renderingjava.lang.Exception
- NOT YET DOCUMENTEDpublic java.lang.String getXpath()
public void renderSimpleTypeConcrete()
renderSimpleTypeConcrete
in class Renderer
public void renderComplexTypeConcrete()
renderComplexTypeConcrete
in class Renderer
public void renderDerivedTextOnlyModel()
renderDerivedTextOnlyModel
in class Renderer
public void renderDerivedContentModel()
renderDerivedContentModel
in class Renderer
public void renderModelGroup(org.dom4j.Element group)
renderModelGroup
in class Renderer
group
- NOT YET DOCUMENTEDpublic void renderAttribute()
renderAttribute
in class Renderer
public void renderChoice(org.dom4j.Element choiceElement)
renderChoice
in class Renderer
choiceElement
- choice compositor element from the parent node's
typeDefinition.public void renderSequence(org.dom4j.Element sequence)
renderSequence
in class Renderer
sequence
- NOT YET DOCUMENTEDpublic void renderRepeatingSubstitutionGroup()
renderRepeatingSubstitutionGroup
in class Renderer
public void renderRepeatingElement()
renderRepeatingElement
in class Renderer
public void renderSubElements(GlobalDef proxyTypeDef)
renderSubElements
in class Renderer
proxyTypeDef
- NOT YET DOCUMENTEDpublic void renderSubElements(java.util.List subElements)
renderSubElements
in class Renderer
subElements
- A list of elements to be rendered.public void renderSubElements()
renderSubElements
in class Renderer
public org.dom4j.Element bestPracticesLink(java.lang.String xpath)
bestPracticesLink
in class Renderer
xpath
- NOT YET DOCUMENTEDpublic java.lang.String getToolHelp(java.lang.String s)
FieldInfoReader
for the xpath. If a FieldInfoReader cannot be found,
return the input string (encoded so whether an xpath or a regular string,
there won't be a javascript error)..s
- A string that may or may not corrrespond to a field that has
metadata-vocab definition informationpublic org.dom4j.Element getInputHelperElement(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDprotected org.dom4j.Element renderInputElement(java.lang.String xpath, SchemaNode schemaNode, GlobalDef typeDef)
xpath
- NOT YET DOCUMENTEDschemaNode
- NOT YET DOCUMENTEDtypeDef
- NOT YET DOCUMENTEDpublic org.dom4j.Element getInputElement(java.lang.String xpath, SchemaNode schemaNode, GlobalDef typeDef)
getInputElement
in class Renderer
xpath
- NOT YET DOCUMENTEDschemaNode
- NOT YET DOCUMENTEDtypeDef
- NOT YET DOCUMENTEDprotected org.dom4j.Element getReadOnlyElement(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDprotected org.dom4j.Element getTextInput(java.lang.String xpath, SchemaNode schemaNode, GlobalDef typeDef)
xpath
- NOT YET DOCUMENTEDschemaNode
- NOT YET DOCUMENTEDtypeDef
- NOT YET DOCUMENTEDprotected org.dom4j.Element getBooleanInput(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDpublic org.dom4j.Element getTextAreaInput(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDpublic org.dom4j.Element getTextAreaInput(java.lang.String xpath, int rows)
xpath
- NOT YET DOCUMENTEDrows
- NOT YET DOCUMENTEDpublic org.dom4j.Element getSelectInput(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDpublic org.dom4j.Element getLanguageInput(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDpublic org.dom4j.Element getMultiSelectInput(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDprotected org.dom4j.Element getMultiBoxInput(java.lang.String xpath)
getMultiBoxInput
in class Renderer
xpath
- NOT YET DOCUMENTEDprotected org.dom4j.Element getComboUnionInput(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDpublic SimpleTypeLabel getSimpleTypeLabel(java.lang.String xpath)
getSimpleTypeLabel
in class Renderer
xpath
- NOT YET DOCUMENTEDpublic SimpleTypeLabel getSimpleTypeLabel(java.lang.String xpath, java.lang.String siblingPath, java.lang.String indexId)
getSimpleTypeLabel
in class Renderer
xpath
- NOT YET DOCUMENTEDsiblingPath
- NOT YET DOCUMENTEDindexId
- NOT YET DOCUMENTEDpublic java.lang.String getLabelText(java.lang.String xpath, java.lang.String siblingPath, java.lang.String indexId)
xpath
- NOT YET DOCUMENTEDsiblingPath
- NOT YET DOCUMENTEDindexId
- NOT YET DOCUMENTEDpublic Label getMultiBoxLabel(java.lang.String xpath)
xpath
- NOT YET DOCUMENTEDpublic org.dom4j.Element getDeleteController(java.lang.String itemPath, java.lang.String elementName)
getDeleteController
in class Renderer
itemPath
- NOT YET DOCUMENTEDelementName
- NOT YET DOCUMENTEDpublic org.dom4j.Element getOptionalItemControl(java.lang.String xpath)
getOptionalItemControl
in class Renderer
xpath
- NOT YET DOCUMENTEDpublic ComplexTypeLabel getComplexTypeLabel(java.lang.String xpath)
getComplexTypeLabel
in class Renderer
xpath
- NOT YET DOCUMENTEDpublic ComplexTypeLabel getComplexTypeLabel(java.lang.String xpath, java.lang.String siblingPath, java.lang.String indexId)
getComplexTypeLabel
in class Renderer
xpath
- NOT YET DOCUMENTEDsiblingPath
- NOT YET DOCUMENTEDindexId
- NOT YET DOCUMENTEDpublic boolean showXsdStringElement(java.lang.String xpath)
showXsdStringElement
in class Renderer
xpath
- The xpath to showpublic org.dom4j.Element getRenderedField(java.lang.String xpath, Label label, org.dom4j.Element input)
xpath
- NOT YET DOCUMENTEDlabel
- NOT YET DOCUMENTEDinput
- NOT YET DOCUMENTEDpublic org.dom4j.Element getRenderedField(java.lang.String xpath, org.dom4j.Element label, org.dom4j.Element input)
getRenderedField
in class Renderer
label
- Description of the Parameterinput
- Description of the Parameterxpath
- NOT YET DOCUMENTEDpublic java.lang.String report()
public static void setDebug(boolean bool)
bool
- The new debug value