com.raritantechnologies.searchApp.component
Class ComponentTemplate

java.lang.Object
  extended bycom.raritantechnologies.searchApp.component.ComponentTemplate
All Implemented Interfaces:
IConfigurable, IConfigurableFactory

public class ComponentTemplate
extends java.lang.Object
implements IConfigurableFactory

Provides a configurable Component Template that can be used by the MasterTemplateEditor.

XML Configuration Template:
  <ComponentConfig name="[ name of component ]"
                      type="[ interface type of component ]"
                      interfaceClass="[ interface class of component ]" >

    <!-- Simple attribute=value parameters that are inserted into the Configuration Template using {[configKey]} patterns. -->
    <Attributes>
      <!-- one or more Attribute elements: -->
      <Attribute name="[ parameter name ]"
                    displayName="[ display name on configuration UI ]"
                    configKey="[ name in {key} pattern in Configuration template ]"
                    description="[ description of the Attribute ]"
                    required="[ true|false ]"
                    choices="[ pipe (|) delimited list of valid choices for values ]"
                    pattern="[ string pattern for final version (used for optional attributes) ]" />
    </Attributes>

    <!-- Complex sections may use a configuration tag. -->
    <Tags>
      <!-- one or more Tag elements: -->
      <Tag name="[ display name in configuration UI ]"
              configKey="[ name in {key} pattern in main Configuration Template ]"
              multiple="[ true|false( default ) - if true, can have more than one tag output ]" />

        <!-- one or more Attribute elements: -->
        <Attribute name="[ display name in configuration UI ]"
                      configKey="[ name in {key} pattern in local Tag Template ]" />
        <!-- . . . -->

        <TagTemplate>
          <![CDATA[
             tag template XML goes here with {key} placeholders for attributes ...
          ]]>
        </TagTemplate>

      </Tag>
    </Tags>

    <NestedComponents>
       <!-- pointers to other component template files ... -->
       <Component name="[ display name of the Element ]"
                     interfaceClass="[ fully qualified IConfigurable Interface class name ]"
                     required="[ true|false ]"
                     multiple="[ true|false ]"
                     configKey="[ name that matches {key} section in the master template ]"
                     templateFile="[ name of component template file (if no choice available) ]" >

          <!-- IXMLDataSource that contains a set of ComponentTemplate(s) that could be    -->
          <!-- used for this Component. (Not required if 'templateFile' attribute is set). -->
          <TemplateSource class="[ class of IXMLDataSource ]" >

          </TemplateSource>

       </Component>
    </NestedComponents>

    <ComponentTemplate>
      <![CDATA[
        Component XML configuration Template with {key} placeholders for attributes and tag elements...
      ]]>
    </ComponentTemplate>

  </ComponentConfig>
 


Constructor Summary
ComponentTemplate()
           
 
Method Summary
 void addTag(java.lang.String tagName)
           
 boolean canAdd(java.lang.String tagName)
           
 OrderedMap getAttributes()
           
 java.lang.String getConfigurationXML()
           
 IConfigurable getConfiguredObject()
           
 IConfigurable getConfiguredObject(java.lang.String objectName)
          Returns a configured object given an object name.
 java.util.Iterator getConfiguredObjectNames()
          Returns a list of the configured objects that are available.
 org.w3c.dom.Element getInitializer()
           
 org.w3c.dom.Element getInitializer(java.lang.String objectName)
          Used by Configurable objects that need to have their own constructor.
 java.lang.String getInterfaceClass()
           
 java.lang.String getName()
           
 com.raritantechnologies.searchApp.component.FrameworkComponent getNestedComponent(java.lang.String componentName)
           
 java.util.Iterator getNestedComponentNames()
           
 java.util.Iterator getTagNames()
           
 java.util.Iterator getTags(java.lang.String tagName)
           
 java.lang.String getType()
           
 boolean hasConfiguredObject(java.lang.String objectName)
          Does this ConfigurableFactory support multiple Configurable Objects?
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 boolean isInitialized()
           
 boolean isMultiple(java.lang.String componentName)
           
 boolean isRequired(java.lang.String componentName)
           
 void removeTag(java.lang.String tagName, int index)
           
 void setConfigElement(org.w3c.dom.Element elem)
           
 void setMasterTemplateEditor(MasterTemplateEditor masterEditor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentTemplate

public ComponentTemplate()
Method Detail

getName

public java.lang.String getName()

getType

public java.lang.String getType()

getInterfaceClass

public java.lang.String getInterfaceClass()

getConfiguredObject

public IConfigurable getConfiguredObject()
Specified by:
getConfiguredObject in interface IConfigurableFactory

hasConfiguredObject

public boolean hasConfiguredObject(java.lang.String objectName)
Description copied from interface: IConfigurableFactory
Does this ConfigurableFactory support multiple Configurable Objects?

Specified by:
hasConfiguredObject in interface IConfigurableFactory

getConfiguredObjectNames

public java.util.Iterator getConfiguredObjectNames()
Returns a list of the configured objects that are available.

Specified by:
getConfiguredObjectNames in interface IConfigurableFactory

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface IConfigurableFactory

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurableFactory

setMasterTemplateEditor

public void setMasterTemplateEditor(MasterTemplateEditor masterEditor)

getConfiguredObject

public IConfigurable getConfiguredObject(java.lang.String objectName)
Returns a configured object given an object name.

Specified by:
getConfiguredObject in interface IConfigurableFactory

setConfigElement

public void setConfigElement(org.w3c.dom.Element elem)
Specified by:
setConfigElement in interface IConfigurableFactory

getInitializer

public org.w3c.dom.Element getInitializer()
Specified by:
getInitializer in interface IConfigurableFactory

getConfigurationXML

public java.lang.String getConfigurationXML()

getInitializer

public org.w3c.dom.Element getInitializer(java.lang.String objectName)
Description copied from interface: IConfigurableFactory
Used by Configurable objects that need to have their own constructor.

Specified by:
getInitializer in interface IConfigurableFactory

getAttributes

public OrderedMap getAttributes()

getTagNames

public java.util.Iterator getTagNames()

getTags

public java.util.Iterator getTags(java.lang.String tagName)

canAdd

public boolean canAdd(java.lang.String tagName)

addTag

public void addTag(java.lang.String tagName)

removeTag

public void removeTag(java.lang.String tagName,
                      int index)

getNestedComponentNames

public java.util.Iterator getNestedComponentNames()

getNestedComponent

public com.raritantechnologies.searchApp.component.FrameworkComponent getNestedComponent(java.lang.String componentName)

isRequired

public boolean isRequired(java.lang.String componentName)

isMultiple

public boolean isMultiple(java.lang.String componentName)