Package org.dlese.dpc.schemedit.autoform
Class RendererHelper
java.lang.Object
org.dlese.dpc.schemedit.autoform.RendererHelper
Manages global rhelper information for a Renderer Instance as well as
providing a renderer factory for instantiating new renderer objects.
See Renderer and it's concrete
subclasses.
- Author:
- ostwald
-
Field Summary
FieldsModifier and TypeFieldDescriptionintKeeps track of number of Renderer instantiations to guard against infinite loopsstatic final intbooleanCauses debugging information about each element to be shown in editorbooleanCauses debugging information about the element labels to be shown in editor -
Constructor Summary
ConstructorsConstructorDescriptionRendererHelper(org.dom4j.Element root, MetaDataFramework framework, String formBeanName) Constructor for the RendererHelper objectRendererHelper(org.dom4j.Element root, MetaDataFramework framework, String formBeanName, String renderer) Constructor for the RendererHelper object with renderer class name explicitly specified. -
Method Summary
Modifier and TypeMethodDescriptionorg.dom4j.ElementacceptsNewChioceTest(String path) NOT YET DOCUMENTEDorg.dom4j.ElementacceptsNewSiblingTest(String path) NOT YET DOCUMENTEDvoidattachElementDebugInfo(org.dom4j.Element target, String displayText, String borderColor) NOT YET DOCUMENTEDvoidattachMessages(org.dom4j.Element container, String xpath) Description of the MethodvoidattachToolHelp(org.dom4j.Element e, String helpMsg) Attach a pop-up tool help message to an elementvoiddestroy()NOT YET DOCUMENTEDvoidembedDebugInfo(org.dom4j.Element e, String s) NOT YET DOCUMENTEDstatic final StringencodeIndexId(String xpath) Given a "siblingPath" (xpath with no indexing on leaf node), create a javascript variable to use for indexed elements.intGets the baseLevel attribute of the RendererHelper object.getFieldInfo(String xpath) returns the FieldInfoReader for the given xpath, or null if one does not existGets the formBeanName attribute of the RendererHelper objectGets the framework attribute of the RendererHelper objectgetInputHelperFile(String xpath) Returns the configured inputHelper value for the provided xpath (inputHelper value is relative to the /editor/input_helper directory in the deployed appintGets the maxLen attribute of the RendererHelper objectfinal RendererImplgetRenderer(String xpath, org.dom4j.Element parent) Renderer factory returns a Renderer instance for the schemaNode at xpath.final RendererImplgetRenderer(String xpath, org.dom4j.Element parent, GlobalDef typeDef) Renderer factory returns a Renderer instance for the schemaNode at xpath, possibly with a "proxy dataType" (if provided) that will override the dataType associated with the schemaNode.Gets the rendererClassName attribute of the RendererHelper objectorg.dom4j.ElementgetRoot()Gets the root attribute of the RendererHelper objectGets the schemaHelper attribute of the RendererHelper objectAttempts to return a metadata vocab field definition for the input string assuming it is an xpath.booleanhasFieldInfo(String xpath) Description of the MethodbooleanhasInputHelper(String xpath) Returns true if the provided path is configured with an inputHelperbooleanhasMuiGroupInfo(String xpath) Return if there is Mui Grouping Information available for this field.booleanhasVocabLayout(String xpath) NOT YET DOCUMENTEDstatic org.dom4j.ElementjspInclude(String page) NOT YET DOCUMENTEDstatic final Stringreturns the input string surrounded by a string that is replaced with a quotation mark when the rendered Element is writen to disk.org.dom4j.ElementnodeExistsTest(String path) Creates a test for the existence of a node in the instance document at the given pathorg.dom4j.ElementnodeHasChildrenTest(String path) NOT YET DOCUMENTEDorg.dom4j.ElementnodeHasMembersTest(String path) NOT YET DOCUMENTEDorg.dom4j.ElementnodeHasNoMembersTest(String path) NOT YET DOCUMENTEDorg.dom4j.ElementnodeNotExistsTest(String path) Creates an element that tests for the NON-existence of an instance document node at the given pathstatic StringnormalizeXPath(String encodedXPpath) Removes any and all indexing information from an XPath.org.dom4j.ElementparentNodeExistsTest(String xpath) Creates a test for the existance of the parentNode of the node being renderedorg.dom4j.ElementparentNodeNotExistsTest(String xpath) NOT YET DOCUMENTEDstatic voidsetDebug(boolean bool) Sets the debug attribute of the RendererHelper classvoidsetFormBeanName(String beanName) Sets the formBeanName attribute of the RendererHelper objectstatic voidsetLogging(boolean verbose) Sets the logging attribute of the RendererHelper classorg.dom4j.ElementviewNodeTest(String xpath) Used by the viewing classes (not the editing classes) to test that a node exists and has content.
-
Field Details
-
DEFAULT_TEXT_INPUT_SIZE
public static final int DEFAULT_TEXT_INPUT_SIZE- See Also:
-
showElementDebugInfo
public boolean showElementDebugInfoCauses debugging information about each element to be shown in editor -
showLabelDebugInfo
public boolean showLabelDebugInfoCauses debugging information about the element labels to be shown in editor -
counter
public int counterKeeps track of number of Renderer instantiations to guard against infinite loops
-
-
Constructor Details
-
RendererHelper
public RendererHelper(org.dom4j.Element root, MetaDataFramework framework, String formBeanName, String renderer) Constructor for the RendererHelper object with renderer class name explicitly specified. Used by View Renders, such asEditorViewerRenderer, for which the renderer cannot be obtained from the MetaDataFramework.- Parameters:
root- Description of the Parameterframework- Description of the ParameterformBeanName- Description of the Parameterrenderer- Description of the Parameter
-
RendererHelper
Constructor for the RendererHelper object- Parameters:
root- rootElementto be renderedframework- MetaDataFramework representing the XML Schema to be usedformBeanName- Description of the Parameter
-
-
Method Details
-
attachElementDebugInfo
public void attachElementDebugInfo(org.dom4j.Element target, String displayText, String borderColor) NOT YET DOCUMENTED- Parameters:
target- NOT YET DOCUMENTEDdisplayText- NOT YET DOCUMENTEDborderColor- NOT YET DOCUMENTED
-
embedDebugInfo
NOT YET DOCUMENTED- Parameters:
e- NOT YET DOCUMENTEDs- NOT YET DOCUMENTED
-
getRenderer
Renderer factory returns a Renderer instance for the schemaNode at xpath.- Parameters:
xpath- xpath for node to be renderedparent- parent element to which to attach rendered node- Returns:
- The renderer value
-
getRenderer
Renderer factory returns a Renderer instance for the schemaNode at xpath, possibly with a "proxy dataType" (if provided) that will override the dataType associated with the schemaNode.- Parameters:
xpath- xpath for node to be renderedparent- parent element to which to attach rendered nodetypeDef- NOT YET DOCUMENTED- Returns:
- The renderer value
-
normalizeXPath
Removes any and all indexing information from an XPath. In particular, cleans up any JSP-encoding, including curly bracketed indexing (e.g., ${indexId+1}). This form of XPath is necessary for accessing schemaNodes, which contain no indexing.- Parameters:
encodedXPpath- Description of the Parameter- Returns:
- Xpath duitable for finding a SchemaNode
-
getRendererClassName
Gets the rendererClassName attribute of the RendererHelper object- Returns:
- The rendererClassName value
-
getMaxLen
Gets the maxLen attribute of the RendererHelper object- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- The maxLen value
-
getFormBeanName
Gets the formBeanName attribute of the RendererHelper object- Returns:
- The formBeanName value
-
setFormBeanName
Sets the formBeanName attribute of the RendererHelper object- Parameters:
beanName- The new formBeanName value
-
getSchemaHelper
Gets the schemaHelper attribute of the RendererHelper object- Returns:
- The schemaHelper value
-
getFramework
Gets the framework attribute of the RendererHelper object- Returns:
- The framework value
-
getRoot
public org.dom4j.Element getRoot()Gets the root attribute of the RendererHelper object- Returns:
- The root value
-
hasMuiGroupInfo
Return if there is Mui Grouping Information available for this field. Mui Group Information is specified in the groups files of the MetadataVocab object, and stored in the MetaDataFramework object.- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
hasVocabLayout
NOT YET DOCUMENTED- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
hasFieldInfo
Description of the Method- Parameters:
xpath- Description of the Parameter- Returns:
- Description of the Return Value
-
getFieldInfo
returns the FieldInfoReader for the given xpath, or null if one does not exist- Parameters:
xpath- Description of the Parameter- Returns:
- The fieldInfo value
-
hasInputHelper
Returns true if the provided path is configured with an inputHelper- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
getInputHelperFile
Returns the configured inputHelper value for the provided xpath (inputHelper value is relative to the /editor/input_helper directory in the deployed app- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- The inputHelperFile value
-
getBaseLevel
public int getBaseLevel()Gets the baseLevel attribute of the RendererHelper object. The baseLevel determines at which level in the schema we are rendering for the individual pages.- Returns:
- The baseLevel value
-
encodeIndexId
Given a "siblingPath" (xpath with no indexing on leaf node), create a javascript variable to use for indexed elements. Replace colons in index id with underscore to avoid javascript problems with qualified names. Then add a string ("Index") and indexId index, if required, to avoid name collisions.- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
jspQuotedString
returns the input string surrounded by a string that is replaced with a quotation mark when the rendered Element is writen to disk. This is necessary because dom4J turns quotation marks and appostrophies into entities, which then cause the JSP processer to barf when the jsp page is rendered- Parameters:
s- Description of the Parameter- Returns:
- Description of the Return Value
-
jspInclude
NOT YET DOCUMENTED- Parameters:
page- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
parentNodeExistsTest
Creates a test for the existance of the parentNode of the node being rendered- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- An Element representing the test for the existance of a parent node
-
parentNodeNotExistsTest
NOT YET DOCUMENTED- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
nodeExistsTest
Creates a test for the existence of a node in the instance document at the given path- Parameters:
path- Description of the Parameter- Returns:
- Element that performs test when embedded in JSP
-
nodeHasChildrenTest
NOT YET DOCUMENTED- Parameters:
path- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
nodeHasMembersTest
NOT YET DOCUMENTED- Parameters:
path- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
nodeHasNoMembersTest
NOT YET DOCUMENTED- Parameters:
path- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
acceptsNewSiblingTest
NOT YET DOCUMENTED- Parameters:
path- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
acceptsNewChioceTest
NOT YET DOCUMENTED- Parameters:
path- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
nodeNotExistsTest
Creates an element that tests for the NON-existence of an instance document node at the given path- Parameters:
path- Description of the Parameter- Returns:
- Element that performs test when embedded in JSP
-
viewNodeTest
Used by the viewing classes (not the editing classes) to test that a node exists and has content.NOTE: should this method be ABSTRACT here, and only instantiated in DcsView utils?? (it must be at least declared here, since it is referenced from the renderer, which has obtained utils as RenderUtils.
- Parameters:
xpath- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
-
attachMessages
Description of the Method- Parameters:
container- Description of the Parameterxpath- NOT YET DOCUMENTED
-
attachToolHelp
Attach a pop-up tool help message to an element- Parameters:
e- The element to recieve the tool helphelpMsg- Description of the Parameter
-
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.
-
setLogging
public static void setLogging(boolean verbose) Sets the logging attribute of the RendererHelper class- Parameters:
verbose- The new logging value
-
destroy
public void destroy()NOT YET DOCUMENTED -
setDebug
public static void setDebug(boolean bool) Sets the debug attribute of the RendererHelper class- Parameters:
bool- The new debug value
-