Class MdeNode
java.lang.Object
org.dlese.dpc.schemedit.autoform.mde.MdeNode
- Direct Known Subclasses:
MdeAttribute,MdeComplexType,MdeRepeatingNode,MdeSimpleType
Base class for rendering the document structure ("nodes") in the Metadata
Editor. Subclasses provide concrete render methods for two *modes*:
- edit_mode - in which input is accepted, and
- display_mode - in which field values are simply displayed
MdeNode instances provide access to the following classes:
- Renderers - implement the recursive process of implenting MetdataEditor Nodes, including methods to render input fields,
- RendererHelper - provides state information for the rendering process, as well as a Factory for obtaining new renderers, and
- SchemaHelper - provides utility methods for obtaining schema-based information.
- Author:
- ostwald
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.dom4j.DocumentFactoryNOT YET DOCUMENTEDprotected StringNOT YET DOCUMENTEDprotected Stringprotected StringNOT YET DOCUMENTEDprotected org.dom4j.ElementNOT YET DOCUMENTEDNOT YET DOCUMENTEDprotected RendererHelperNOT YET DOCUMENTEDprotected SchemaNodeNOT YET DOCUMENTEDprotected SchemaHelperNOT YET DOCUMENTEDprotected GlobalDefNOT YET DOCUMENTEDprotected StringNOT YET DOCUMENTED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHtmlComment(org.dom4j.Element e, String s) Adds a feature to the HtmlComment attribute of the MdeNode objectprotected voidattachElementDebugInfo(org.dom4j.Element e, String s) Attach a debugging message to this element that can be viewed in the editing form.protected voidattachElementDebugInfo(org.dom4j.Element target, String displayText, String borderColor) Attaches debugging info to a rendered element in the editor, optionally including a border to outline the element.protected voidattachElementId(org.dom4j.Element e) Add an "id" attribute to the provided element, with a value derived from this node's "xpath".protected voidattachLabelDebugInfo(Label labelObj, String s) attach debuging information to a label object that is displayed in the editorprotected voidattachLabelDebugInfo(org.dom4j.Element e, String s) Description of the Methodprotected voidattachLabelDebugInfo(org.dom4j.Element e, String s, String borderSpec) Description of the Methodprotected org.dom4j.ElementbestPracticesLink(String xpath) Return a Best Practices link represented as an Element.protected voidembedDebugInfo(org.dom4j.Element e, String s) Embed a debugging string in the provided element that can be viewed in HTML source.protected org.dom4j.ElementgetDiv()Gets the div attribute of the MdeNode objectprotected org.dom4j.ElementgetDiv(int level) Gets the div attribute of the MdeNode objectprotected org.dom4j.ElementGets a rendered inputElement for this node from the Renderer instance.protected org.dom4j.NamespaceGets the schema namespace (associated with "http://www.w3.org/2001/XMLSchema") for the root schema for the metadata framework for this Renderer.getMode()Gets the mode attribute of the MdeNode object - used for Debuggingprotected StringgetQualifiedAttributeName(String name, org.dom4j.Element element, GlobalDef typeDef) Gets the qualifiedAttributeName attribute of the Renderer object.protected StringgetQualifiedElementName(String name, GlobalDef typeDef) Gets the qualifiedName attribute of the Renderer objectprotected org.dom4j.ElementgetRenderedField(Label label, org.dom4j.Element inputField) Renders a Labelled input field (for a Simple or Built-in schema dataType.protected org.dom4j.ElementgetRenderedNoInputField(Label label) Displaying labels for elements that have no input fieldprotected org.dom4j.ElementgetRenderedNoInputField(Label label, org.dom4j.Element action) protected org.dom4j.ElementgetRenderedNoInputField(Label label, org.dom4j.Element action, org.dom4j.Element inputHelper) Creates Element for displaying labels, action controllers and collapseWidgets for elements that have no input field.protected StringAttempts to return a metadata vocab field definition for the input string assuming it is an xpath.protected voidinsertDisplaySetup(org.dom4j.Element baseDiv) Creates element representing a mousable field label that will open or close its contents.protected voidinsertHtmlComment(org.dom4j.Element e, String s) Insert an HTML comment into the html source.protected booleanGets the displayMode attribute of the MdeNode object (KEEP)protected booleanGets the editMode attribute of the MdeNode objectnewRenderer(String xpath, org.dom4j.Element parent) Gets a new renderer for the specified xpath and parent element.newRenderer(String xpath, org.dom4j.Element parent, GlobalDef typeDef) Gets a new renderer for the specified xpath and parent element and typeDef.protected voidDescription of the Methodabstract voidrender()NOT YET DOCUMENTEDstatic voidsetDebug(boolean bool) Sets the debug attribute of the MdeNode class
-
Field Details
-
sh
NOT YET DOCUMENTED -
xpath
NOT YET DOCUMENTED -
parent
protected org.dom4j.Element parentNOT YET DOCUMENTED -
schemaNode
NOT YET DOCUMENTED -
typeDef
NOT YET DOCUMENTED -
df
protected org.dom4j.DocumentFactory dfNOT YET DOCUMENTED -
rhelper
NOT YET DOCUMENTED -
formBeanName
NOT YET DOCUMENTED -
normalizedXPath
NOT YET DOCUMENTED -
renderer
NOT YET DOCUMENTED -
inputHelperFile
-
-
Constructor Details
-
MdeNode
Constructor for the MdeNode object- Parameters:
renderer- NOT YET DOCUMENTED
-
-
Method Details
-
render
public abstract void render()NOT YET DOCUMENTED -
newRenderer
Gets a new renderer for the specified xpath and parent element.- Parameters:
xpath- xpath for new rendererparent- parent element for new renderer- Returns:
- A new renderer instance.
-
newRenderer
Gets a new renderer for the specified xpath and parent element and typeDef.- Parameters:
xpath- xpath for new rendererparent- parent element for new renderertypeDef- Explicitly specified typeDef for new renderer- Returns:
- A new renderer instance.
-
getInputHelperFile
-
isEditMode
protected boolean isEditMode()Gets the editMode attribute of the MdeNode object- Returns:
- The editMode value
-
isDisplayMode
protected boolean isDisplayMode()Gets the displayMode attribute of the MdeNode object (KEEP)- Returns:
- The displayMode value
-
getMode
Gets the mode attribute of the MdeNode object - used for Debugging- Returns:
- The mode value
-
getInputElement
protected org.dom4j.Element getInputElement()Gets a rendered inputElement for this node from the Renderer instance.- Returns:
- The inputElement value
-
bestPracticesLink
Return a Best Practices link represented as an Element.NOTE: apparently css class ("action-button") must be applyed to both the link and the text within to get consistent results in both IE and FireFox ...
- Parameters:
xpath- Description of the Parameter- Returns:
- Description of the Return Value
-
getInstanceSchemaNamespace
protected org.dom4j.Namespace getInstanceSchemaNamespace()Gets the schema namespace (associated with "http://www.w3.org/2001/XMLSchema") for the root schema for the metadata framework for this Renderer. -
getQualifiedElementName
Gets the qualifiedName attribute of the Renderer object- Parameters:
name- NOT YET DOCUMENTEDtypeDef- NOT YET DOCUMENTED- Returns:
- The qualifiedName value
-
getQualifiedAttributeName
protected String getQualifiedAttributeName(String name, org.dom4j.Element element, GlobalDef typeDef) Gets the qualifiedAttributeName attribute of the Renderer object.NOTE: i don't think this method is required at all. if the instance document is constructed correctly, the attributes are already qualified as needed and there is no need to mess with it any further ..
- Parameters:
name- NOT YET DOCUMENTEDelement- NOT YET DOCUMENTEDtypeDef- NOT YET DOCUMENTED- Returns:
- The qualifiedAttributeName value
-
getRenderedField
Renders a Labelled input field (for a Simple or Built-in schema dataType.- Parameters:
label- Description of the ParameterinputField- Description of the Parameter- Returns:
- The labelFieldTable value
-
getRenderedNoInputField
Displaying labels for elements that have no input field- Parameters:
label- Description of the Parameter- Returns:
- The labelActionTable value
-
getRenderedNoInputField
-
getRenderedNoInputField
protected org.dom4j.Element getRenderedNoInputField(Label label, org.dom4j.Element action, org.dom4j.Element inputHelper) Creates Element for displaying labels, action controllers and collapseWidgets for elements that have no input field. Action controllers enable users to perform actions such as deleting a node or adding a new one.- Parameters:
label- Description of the Parameteraction- Description of the Parameter- Returns:
- The formattedLabel value
-
getDiv
protected org.dom4j.Element getDiv()Gets the div attribute of the MdeNode object- Returns:
- The div value
-
getDiv
protected org.dom4j.Element getDiv(int level) Gets the div attribute of the MdeNode object- Parameters:
level- Description of the Parameter- Returns:
- The div value
-
getToolHelp
Attempts to return a metadata vocab field definition for the input string assuming it is an xpath. The field definition is obtained from aFieldInfoReaderfor 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)..- Parameters:
s- A string that may or may not corrrespond to a field that has metadata-vocab definition information- Returns:
- A string to be used as ToolHelp which is the metadata field definition if possible.
-
embedDebugInfo
Embed a debugging string in the provided element that can be viewed in HTML source.- Parameters:
e- NOT YET DOCUMENTEDs- NOT YET DOCUMENTED
-
attachElementDebugInfo
Attach a debugging message to this element that can be viewed in the editing form.- Parameters:
e- NOT YET DOCUMENTEDs- NOT YET DOCUMENTED
-
attachElementDebugInfo
protected void attachElementDebugInfo(org.dom4j.Element target, String displayText, String borderColor) Attaches debugging info to a rendered element in the editor, optionally including a border to outline the element. The borderSpec is a string that specifies the border in css: e.g., "thin blue solid"- Parameters:
target- The Element to which the debugging element is attacheddisplayText- The debugging messageborderColor- NOT YET DOCUMENTED
-
attachLabelDebugInfo
Description of the Method- Parameters:
e- Description of the Parameters- Description of the ParameterborderSpec- NOT YET DOCUMENTED
-
attachLabelDebugInfo
Description of the Method- Parameters:
e- Description of the Parameters- Description of the Parameter
-
insertHtmlComment
Insert an HTML comment into the html source.- Parameters:
e- NOT YET DOCUMENTEDs- NOT YET DOCUMENTED
-
addHtmlComment
Adds a feature to the HtmlComment attribute of the MdeNode object- Parameters:
e- The feature to be added to the HtmlComment attributes- The feature to be added to the HtmlComment attribute
-
attachLabelDebugInfo
attach debuging information to a label object that is displayed in the editor- Parameters:
labelObj- NOT YET DOCUMENTEDs- NOT YET DOCUMENTED
-
attachElementId
protected void attachElementId(org.dom4j.Element e) Add an "id" attribute to the provided element, with a value derived from this node's "xpath".- Parameters:
e- NOT YET DOCUMENTED
-
insertDisplaySetup
protected void insertDisplaySetup(org.dom4j.Element baseDiv) Creates element representing a mousable field label that will open or close its contents. Used to expand and collapse the hierarchical strucuture of the xml document- Parameters:
baseDiv- Description of the Parameter
-
prtln
Description of the Method- Parameters:
s- Description of the Parameter
-
setDebug
public static void setDebug(boolean bool) Sets the debug attribute of the MdeNode class- Parameters:
bool- The new debug value
-