atg.repository.xml
Class GetService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.repository.xml.GetService
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class GetService
extends GenericService

This class is used to get an XML instance document from a repository. The various flavors of getItemAsXML() can be called to obtain the instance document.


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String GET_SERVICE_OP_NAME
           
static java.util.Map sTypeToXMLIdentifierMap
          A mapping of basic Java types to XML schema type names.
static java.lang.String XML_NAMESPACE_PREFIX
           
static java.lang.String XML_SCHEMA_INSTANCE
           
static java.lang.String XSI_SCHEMA_LOCATION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
GetService()
           
 
Method Summary
 void addNamespaceDeclarations(java.lang.StringBuffer pInstanceDoc, atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void addNamespaceDeclarations(java.io.Writer pInstanceWriter, atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
          Adds the namespace declarations for all the item descriptors present in the RepositoryItem passed.
 void addSchemaLocations(java.lang.StringBuffer pInstanceDoc, atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void addSchemaLocations(java.io.Writer pInstanceWriter, atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
          Adds the schema locations for all the item-descriptors present in the RepositoryItem passed.
 void appendComplexElement(RepositoryItem pItem, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void appendComplexElement(RepositoryItem pItem, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Method called to generate the appropriate representation of a repository item for a given repository item.
protected  void appendRepositoryItem(RepositoryItem pItem, java.lang.String[] pIncludeProperties, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix, RepositoryItemDescriptor pItemDescriptor)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void appendRepositoryItem(RepositoryItem pItem, java.lang.String[] pIncludeProperties, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix, RepositoryItemDescriptor pItemDescriptor, atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
          Method called to generate the appropriate representation of a repository item for an instance document.
 java.lang.String getAdjustedValue(RepositoryPropertyDescriptor pPropertyDesc, java.lang.String pValue)
          Stub method that can be overridden to adjust a property value before writing to the XML (e.g., mask a credit card number)
 java.lang.String getItemAsXML(RepositoryItem pItem)
          Generates XML Instance Document from Repository Item.
 java.lang.String getItemAsXML(RepositoryItem pItem, java.lang.String pMappingFileName)
          Generates XML Instance Document from Repository Item
 java.lang.String getItemAsXML(RepositoryItem pItem, java.lang.String[] pIncludeProperties)
          Generates XML Instance Document from Repository Item
 java.lang.String getItemAsXML(RepositoryItem pItem, java.lang.String[] pIncludeProperties, java.lang.String pMappingFileName)
          Generates XML Instance Document from Repository Item
 void getItemAsXML(java.io.Writer pXMLOutput, RepositoryItem pItem)
          Generates XML Instance Document from Repository Item.
 void getItemAsXML(java.io.Writer pXMLOutput, RepositoryItem pItem, java.lang.String pMappingFileName)
          Generates XML Instance Document from Repository Item
 void getItemAsXML(java.io.Writer pXMLOutput, RepositoryItem pItem, java.lang.String[] pIncludeProperties)
          Generates XML Instance Document from Repository Item
 void getItemAsXML(java.io.Writer pXMLOutput, RepositoryItem pItem, java.lang.String[] pIncludeProperties, java.lang.String pMappingFileName)
          Generates XML Instance Document from Repository Item
protected  atg.repository.xml.ItemDescToNSInfo getItemDescToNSInfo(RepositoryItemDescriptor pItemDescriptor)
          Populates ItemDescToNSInfo from RepositoryItemDescriptor
protected  atg.repository.xml.ItemDescToNSInfo getItemDescToNSInfo(RepositoryItemDescriptor pItemDescriptor, java.lang.String pMappingFileName)
          Populates ItemDescToNSInfo from RepositoryItemDescriptor and mapping file name
 int getOutputBufferSize()
          Returns Size of the Buffer to use while writing the XML Instance document.
 RepositoryXMLTools getRepositoryXMLTools()
          Returns Tools class.
 java.lang.String getXMLPropertyElementName(RepositoryPropertyDescriptor pPropertyDesc, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pNSPrefix, java.lang.String pGlobalNSPrefix)
          Get the element name to be used in the xml representation of the properties.
 atg.repository.xml.XMLSchemaManager getXMLSchemaManager()
          The XMLSchemaManager is used to maintain mapping files and XML Schema files.
protected  java.lang.String getXMLTypeAttributes(RepositoryPropertyDescriptor pPropDescriptor)
          This returns XML type attributes for a given Java type.
 void handleArrayType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleArrayType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Method handleArrayType.
 void handleCollectionType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleCollectionType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Adds xml representation for collection properties.
 void handleComplexArrayType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleComplexArrayType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Handle appending the representation of an array to the instance document.
 void handleComplexCollectionType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleComplexCollectionType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Adds xml representation for items of complex type in collection properties.
 void handleComplexMapType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleComplexMapType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pNSPrefix, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Adds xml representation for items of complex type in map properties.
 void handleComplexType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleComplexType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Adds xml representation for item-descriptor property type.
 void handleMapType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleMapType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.util.Map pVisitedObjects, java.lang.String pGlobalNSPrefix)
          Adds xml representation for map properties.
 void handleSimpleArrayType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleSimpleArrayType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, java.lang.String pGlobalNSPrefix)
          Generate the XML representation of the property value represented by the pPropertyDesc on the pItem parameter.
 void handleSimpleCollectionType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleSimpleCollectionType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, java.lang.String pGlobalNSPrefix)
          Adds xml representation for items of simple type in collection properties.
 void handleSimpleMapType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, java.lang.String pGlobalNSPrefix)
          Adds xml representation for items of simple type in map properties.
protected  void handleSimpleMapType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, java.lang.String pGlobalNSPrefix)
          Adds xml representation for items of simple type in map properties.
 void handleSimpleType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.lang.StringBuffer pInstanceDoc, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pGlobalNSPrefix)
          Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.
protected  void handleSimpleType(RepositoryItem pItem, RepositoryPropertyDescriptor pPropertyDesc, java.io.Writer pInstanceWriter, java.lang.String pNSPrefix, atg.repository.databinding.ItemMappingElement pItemMappingElement, java.lang.String pGlobalNSPrefix)
          Adds simple property to the xml instance doc.
 boolean isAppendRelativeSchemaLocation()
          Should the directory name be appended to the XML Schema file name that is written out in the generated XML.
 boolean isAppendXMLTypeAttributes()
          Should ATG XML schema extension attributes appended to RepositoryItem xml tag.
protected  boolean isCircularReference(java.lang.Object pObjectId, java.util.Map pVisitedObjectMap)
          Checks whether the RepositoryItem is already parsed.
 boolean isIndentXMLOutput()
          Returns Indicates whether to indent the xml instance document or not.
protected  boolean isNullPropertyValue(RepositoryPropertyDescriptor pPropertyDesc, java.lang.Object pValue)
          Checks whether the property of RepositoryItem is null or not.
 boolean isOmitNullProperties()
          Should properties that have a null property be written out.
protected  void markObjectVisited(java.lang.Object pObjectId, java.util.Map pVisitedObjectMap)
          if a RepositoryItem is parsed for the first time, then it added to the map for future reference
protected  RepositoryItemDescriptor retrieveItemDescriptor(atg.repository.databinding.ItemMappingElement pItemMappingElement, RepositoryItem pItem)
          Retrives the correct ItemDescriptor to use.
 void setAppendRelativeSchemaLocation(boolean pAppendRelativeSchemaLocation)
          Sets the mAppendRelativeSchemaLocation.
 void setAppendXMLTypeAttributes(boolean pAppendXMLTypeAttributes)
          Sets the mAppendXMLTypeAttributes.
 void setIndentXMLOutput(boolean pIndentXMLOutput)
          Sets Indicates whether to indent the xml instance document or not.
 void setOmitNullProperties(boolean pOmitNullProperties)
          Sets the omitNullProperties.
 void setOutputBufferSize(int pOutputBufferSize)
          Sets Size of the Output Stream Buffer
 void setRepositoryXMLTools(RepositoryXMLTools pRepositoryXMLTools)
          Sets Tools class
 void setXMLSchemaManager(atg.repository.xml.XMLSchemaManager pXMLSchemaManager)
          Sets XML Schema Manager
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

GET_SERVICE_OP_NAME

public static final java.lang.String GET_SERVICE_OP_NAME
See Also:
Constant Field Values

XML_SCHEMA_INSTANCE

public static final java.lang.String XML_SCHEMA_INSTANCE
See Also:
Constant Field Values

XML_NAMESPACE_PREFIX

public static final java.lang.String XML_NAMESPACE_PREFIX
See Also:
Constant Field Values

XSI_SCHEMA_LOCATION

public static final java.lang.String XSI_SCHEMA_LOCATION
See Also:
Constant Field Values

sTypeToXMLIdentifierMap

public static final java.util.Map sTypeToXMLIdentifierMap
A mapping of basic Java types to XML schema type names.

Constructor Detail

GetService

public GetService()
Method Detail

getRepositoryXMLTools

public RepositoryXMLTools getRepositoryXMLTools()
Returns Tools class. The tools class has various utility functions that are used by this class.

Returns:
the RepositoryXMLTools

setRepositoryXMLTools

public void setRepositoryXMLTools(RepositoryXMLTools pRepositoryXMLTools)
Sets Tools class

Parameters:
RepositoryXMLTools -

isOmitNullProperties

public boolean isOmitNullProperties()
Should properties that have a null property be written out. This setting will always be observed, even if a required property is encountered. Thus, the resulting XML might not validate against a given XML Schema.

Defaults to false.

Returns:
boolean true if null properties should be omitted from being written out.

setOmitNullProperties

public void setOmitNullProperties(boolean pOmitNullProperties)
Sets the omitNullProperties.

Parameters:
omitNullProperties - The omitNullProperties to set

isAppendRelativeSchemaLocation

public boolean isAppendRelativeSchemaLocation()
Should the directory name be appended to the XML Schema file name that is written out in the generated XML.

Defaults to false.

Returns:
boolean true if directory name is added to the schema location. i.e. the complete path of the schema location is generated.

setAppendRelativeSchemaLocation

public void setAppendRelativeSchemaLocation(boolean pAppendRelativeSchemaLocation)
Sets the mAppendRelativeSchemaLocation.

Parameters:
pAppendRelativeSchemaLocation - The appendRelativeSchemaLocation to set

isAppendXMLTypeAttributes

public boolean isAppendXMLTypeAttributes()
Should ATG XML schema extension attributes appended to RepositoryItem xml tag.

Defaults to true.

Returns:
boolean true to append ATG XML schema extension attributes when transfers RepositoryItem to XML

setAppendXMLTypeAttributes

public void setAppendXMLTypeAttributes(boolean pAppendXMLTypeAttributes)
Sets the mAppendXMLTypeAttributes.

Parameters:
pAppendXMLTypeAttributes - The appendXMLTypeAttributes to set

getXMLSchemaManager

public atg.repository.xml.XMLSchemaManager getXMLSchemaManager()
The XMLSchemaManager is used to maintain mapping files and XML Schema files.

Returns:
the XMLSchemaManager

setXMLSchemaManager

public void setXMLSchemaManager(atg.repository.xml.XMLSchemaManager pXMLSchemaManager)
Sets XML Schema Manager

Parameters:
XMLSchemaManager -

isIndentXMLOutput

public boolean isIndentXMLOutput()
Returns Indicates whether to indent the xml instance document or not.

Returns:
the IndentXMLOutput

setIndentXMLOutput

public void setIndentXMLOutput(boolean pIndentXMLOutput)
Sets Indicates whether to indent the xml instance document or not.

Parameters:
IndentXMLOutput -

getOutputBufferSize

public int getOutputBufferSize()
Returns Size of the Buffer to use while writing the XML Instance document. if this is not set then we use the Default size that comes with BufferedWriter.

Returns:
the OutputBufferSize

setOutputBufferSize

public void setOutputBufferSize(int pOutputBufferSize)
Sets Size of the Output Stream Buffer

Parameters:
OutputBufferSize -

getItemAsXML

public java.lang.String getItemAsXML(RepositoryItem pItem)
                              throws GetException
Generates XML Instance Document from Repository Item.

Parameters:
pItem - the item to generate a XML instance document for.
Returns:
the generated instance document
Throws:
GetException - if an error occurs

getItemAsXML

public java.lang.String getItemAsXML(RepositoryItem pItem,
                                     java.lang.String[] pIncludeProperties)
                              throws GetException
Generates XML Instance Document from Repository Item

Parameters:
pItem - the item to generate an instance document for.
pIncludeProperties - an array list of properties that should be included in the generated instance document. All properties not appearing in this array will be excluded from the generated instance document. Using this property can be useful if the calling application knows only a subset of properties on an item changed for example. The values appearing in this array must be top-level properties on the item.
Returns:
generated instance document.
Throws:
GetException - if an error occurs

getItemAsXML

public java.lang.String getItemAsXML(RepositoryItem pItem,
                                     java.lang.String pMappingFileName)
                              throws GetException
Generates XML Instance Document from Repository Item

Parameters:
pItem - the repository item to generate an instance document for
pMappingFileName - name of a mapping file that should be used to control how the generated instance document appears. This mapping file is resolved against the configured Schema manager.
Returns:
a String value
Throws:
GetException - if an error occurs

getItemAsXML

public java.lang.String getItemAsXML(RepositoryItem pItem,
                                     java.lang.String[] pIncludeProperties,
                                     java.lang.String pMappingFileName)
                              throws GetException
Generates XML Instance Document from Repository Item

Parameters:
pItem - the item to generate an instance document for
pIncludeProperties - an array list of properties that should be included in the generated instance document. All properties not appearing in this array will be excluded from the generated instance document. Using this property can be useful if the calling application knows only a subset of properties on an item changed for example. The values appearing in this array must be top-level properties on the item.
pMappingFileName - name of a mapping file that should be used to control how the generated instance document appears. This mapping file is resolved against the configured Schema manager.
Returns:
generated instance document
Throws:
GetException - if an error occurs

getXMLTypeAttributes

protected java.lang.String getXMLTypeAttributes(RepositoryPropertyDescriptor pPropDescriptor)
This returns XML type attributes for a given Java type. This is intended for annotating the serialized repository item object; it returns some extensions to the XML schema types useful for manual decoding.


appendRepositoryItem

protected void appendRepositoryItem(RepositoryItem pItem,
                                    java.lang.String[] pIncludeProperties,
                                    atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                    java.lang.StringBuffer pInstanceDoc,
                                    java.lang.String pNSPrefix,
                                    java.util.Map pVisitedObjects,
                                    java.lang.String pGlobalNSPrefix,
                                    RepositoryItemDescriptor pItemDescriptor)
                             throws GetException,
                                    RepositoryException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Method called to generate the appropriate representation of a repository item for an instance document. This method walks the properites exposed by the pItem parameter and calls the appropriate handleXXX() methods.

Parameters:
pItem - the item to generate an instance document for
pIncludeProperties - properties to include in the generated instance document
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
pItemDescriptor - the item-descriptor backing the item represented by the pItem parameter.
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.
RepositoryException

appendComplexElement

public void appendComplexElement(RepositoryItem pItem,
                                 atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                 java.lang.StringBuffer pInstanceDoc,
                                 java.lang.String pNSPrefix,
                                 java.util.Map pVisitedObjects,
                                 java.lang.String pGlobalNSPrefix)
                          throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Method called to generate the appropriate representation of a repository item for a given repository item.

Parameters:
pItem - the item to generate an instance document for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.

handleSimpleType

public void handleSimpleType(RepositoryItem pItem,
                             RepositoryPropertyDescriptor pPropertyDesc,
                             java.lang.StringBuffer pInstanceDoc,
                             java.lang.String pNSPrefix,
                             atg.repository.databinding.ItemMappingElement pItemMappingElement,
                             java.lang.String pGlobalNSPrefix)
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds simple property to the xml instance doc.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that an XML representation will be generated for.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.

handleComplexType

public void handleComplexType(RepositoryItem pItem,
                              RepositoryPropertyDescriptor pPropertyDesc,
                              java.lang.StringBuffer pInstanceDoc,
                              java.lang.String pNSPrefix,
                              atg.repository.databinding.ItemMappingElement pItemMappingElement,
                              java.util.Map pVisitedObjects,
                              java.lang.String pGlobalNSPrefix)
                       throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds xml representation for item-descriptor property type.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that a complexType definition willbe generated for
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.
GetException - if an error occurs

handleCollectionType

public void handleCollectionType(RepositoryItem pItem,
                                 RepositoryPropertyDescriptor pPropertyDesc,
                                 java.lang.StringBuffer pInstanceDoc,
                                 java.lang.String pNSPrefix,
                                 atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                 java.util.Map pVisitedObjects,
                                 java.lang.String pGlobalNSPrefix)
                          throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds xml representation for collection properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs

handleSimpleCollectionType

public void handleSimpleCollectionType(RepositoryItem pItem,
                                       RepositoryPropertyDescriptor pPropertyDesc,
                                       java.lang.StringBuffer pInstanceDoc,
                                       java.lang.String pNSPrefix,
                                       java.lang.String pGlobalNSPrefix)
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds xml representation for items of simple type in collection properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pGlobalNSPrefix - global NS for the document

handleComplexCollectionType

public void handleComplexCollectionType(RepositoryItem pItem,
                                        RepositoryPropertyDescriptor pPropertyDesc,
                                        java.lang.StringBuffer pInstanceDoc,
                                        atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                        java.lang.String pNSPrefix,
                                        java.util.Map pVisitedObjects,
                                        java.lang.String pGlobalNSPrefix)
                                 throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds xml representation for items of complex type in collection properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used for the instance document
Throws:
GetException - if an error occurs

handleMapType

public void handleMapType(RepositoryItem pItem,
                          RepositoryPropertyDescriptor pPropertyDesc,
                          java.lang.StringBuffer pInstanceDoc,
                          java.lang.String pNSPrefix,
                          atg.repository.databinding.ItemMappingElement pItemMappingElement,
                          java.util.Map pVisitedObjects,
                          java.lang.String pGlobalNSPrefix)
                   throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds xml representation for map properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used for this document.
Throws:
GetException - if an error occurs

handleComplexMapType

public void handleComplexMapType(RepositoryItem pItem,
                                 RepositoryPropertyDescriptor pPropertyDesc,
                                 java.lang.StringBuffer pInstanceDoc,
                                 atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                 java.lang.String pNSPrefix,
                                 java.util.Map pVisitedObjects,
                                 java.lang.String pGlobalNSPrefix)
                          throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds xml representation for items of complex type in map properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used in this document.
Throws:
GetException - if an error occurs

handleSimpleMapType

public void handleSimpleMapType(RepositoryItem pItem,
                                RepositoryPropertyDescriptor pPropertyDesc,
                                java.lang.StringBuffer pInstanceDoc,
                                java.lang.String pNSPrefix,
                                java.lang.String pGlobalNSPrefix)
Adds xml representation for items of simple type in map properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used in the document.

handleArrayType

public void handleArrayType(RepositoryItem pItem,
                            RepositoryPropertyDescriptor pPropertyDesc,
                            java.lang.StringBuffer pInstanceDoc,
                            java.lang.String pNSPrefix,
                            atg.repository.databinding.ItemMappingElement pItemMappingElement,
                            java.util.Map pVisitedObjects,
                            java.lang.String pGlobalNSPrefix)
                     throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Method handleArrayType.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used through out this document
Throws:
GetException - if an error occurs

handleSimpleArrayType

public void handleSimpleArrayType(RepositoryItem pItem,
                                  RepositoryPropertyDescriptor pPropertyDesc,
                                  java.lang.StringBuffer pInstanceDoc,
                                  java.lang.String pNSPrefix,
                                  java.lang.String pGlobalNSPrefix)
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Generate the XML representation of the property value represented by the pPropertyDesc on the pItem parameter. The property type is expected to be an array that contains values that are String, int, long etc.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document Method handleSimpleArrayType.
pGlobalNSPrefix - the global namespace used in the document

handleComplexArrayType

public void handleComplexArrayType(RepositoryItem pItem,
                                   RepositoryPropertyDescriptor pPropertyDesc,
                                   java.lang.StringBuffer pInstanceDoc,
                                   atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                   java.lang.String pNSPrefix,
                                   java.util.Map pVisitedObjects,
                                   java.lang.String pGlobalNSPrefix)
                            throws GetException
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Handle appending the representation of an array to the instance document.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global namespace used through-out the document
Throws:
GetException - if an error occurs

addSchemaLocations

public void addSchemaLocations(java.lang.StringBuffer pInstanceDoc,
                               atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds the schema locations for all the item-descriptors present in the RepositoryItem passed.

Parameters:
pInstanceDoc - the instance document
pItemDescToNSInfoMap - map contain namespace information used in the generation of this instance document.

addNamespaceDeclarations

public void addNamespaceDeclarations(java.lang.StringBuffer pInstanceDoc,
                                     atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
Deprecated. We are no longer using StringBuffer to store intermediate XML Instance document, we are using Writer instead. So this method which writes into StringBuffer pInstanceDoc has been deprecated.

Adds the namespace declarations for all the item descriptors present in the RepositoryItem passed.

Parameters:
pInstanceDoc - the instance document
pItemDescToNSInfoMap - list of item-descriptor namespace information

isCircularReference

protected boolean isCircularReference(java.lang.Object pObjectId,
                                      java.util.Map pVisitedObjectMap)
Checks whether the RepositoryItem is already parsed. Checks by seeing if the pObjectID parameter appears in the pVisitedObjectMap.

Parameters:
pObjectId - ID to see if it appears in the visitedObjectMap
pVisitedObjectMap - map where keys are IDs of objects that have been seen.
Returns:
true if the ID has been seen before.

markObjectVisited

protected void markObjectVisited(java.lang.Object pObjectId,
                                 java.util.Map pVisitedObjectMap)
if a RepositoryItem is parsed for the first time, then it added to the map for future reference

Parameters:
pObjectId - the ID of the Object that should be put into the visitedObjectMap.
pVisitedObjectMap - map where the key entries represent the ID of a particular item. This is the ID that appears as the value of a ID or IDREF attribute.

isNullPropertyValue

protected boolean isNullPropertyValue(RepositoryPropertyDescriptor pPropertyDesc,
                                      java.lang.Object pValue)
Checks whether the property of RepositoryItem is null or not.

Parameters:
pPropertyDesc - property whose value is being checked.
pValue - the value that should be checked to see if its null.
Returns:
true if the property can be considered null.

getXMLPropertyElementName

public java.lang.String getXMLPropertyElementName(RepositoryPropertyDescriptor pPropertyDesc,
                                                  atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                                  java.lang.String pNSPrefix,
                                                  java.lang.String pGlobalNSPrefix)
Get the element name to be used in the xml representation of the properties.

Parameters:
pPropertyDesc - the property descriptor to get the name of
pItemMappingElement - ItemMappingElement controlloing how an item is mapped into an instance document. The property represented by the pPropertyDesc parameter could appear as a PropertyMappingElement on the ItemMappingElement
pNSPrefix - the namesapce prefix to use for this item
pGlobalNSPrefix - the global NS prefix for the document.
Returns:
the name of the property as it should be written out to an XML instance document.

getItemDescToNSInfo

protected atg.repository.xml.ItemDescToNSInfo getItemDescToNSInfo(RepositoryItemDescriptor pItemDescriptor)
Populates ItemDescToNSInfo from RepositoryItemDescriptor

Parameters:
pItemDescriptor - a RepositoryItemDescriptor value
Returns:
an ItemDescToNSInfo value

getItemDescToNSInfo

protected atg.repository.xml.ItemDescToNSInfo getItemDescToNSInfo(RepositoryItemDescriptor pItemDescriptor,
                                                                  java.lang.String pMappingFileName)
Populates ItemDescToNSInfo from RepositoryItemDescriptor and mapping file name

Parameters:
pItemDescriptor - itemDescriptor that a namespace will be generated for.
pMappingFileName - name of a mapping file to control how the item-descriptor is mapped.
Returns:
ItemDescToNSInfo mapping

retrieveItemDescriptor

protected RepositoryItemDescriptor retrieveItemDescriptor(atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                                          RepositoryItem pItem)
                                                   throws GetException,
                                                          RepositoryException
Retrives the correct ItemDescriptor to use. If ItemMappingElement represents item descriptor of super-type to the item descriptor of the repository item, then we use the super-type represented by ItemMappingElement. Otherwise we just use the item descriptor represented by the Repository item.

Parameters:
pItemMappingElement - controlling how a repository item is mapped into an instance document
pItem - the item to obtain an item-descriptor for
Returns:
a RepositoryItemDescriptor value
Throws:
GetException
RepositoryException

getItemAsXML

public void getItemAsXML(java.io.Writer pXMLOutput,
                         RepositoryItem pItem)
                  throws GetException
Generates XML Instance Document from Repository Item.

Parameters:
pItem - the item to generate a XML instance document for.
pXMLOutput - Writer instance to write XML output.
Throws:
GetException - if an error occurs

getItemAsXML

public void getItemAsXML(java.io.Writer pXMLOutput,
                         RepositoryItem pItem,
                         java.lang.String[] pIncludeProperties)
                  throws GetException
Generates XML Instance Document from Repository Item

Parameters:
pXMLOutput - Writer instance to write XML output.
pItem - the item to generate an instance document for.
pIncludeProperties - an array list of properties that should be included in the generated instance document. All properties not appearing in this array will be excluded from the generated instance document. Using this property can be useful if the calling application knows only a subset of properties on an item changed for example. The values appearing in this array must be top-level properties on the item.
Throws:
GetException - if an error occurs

getItemAsXML

public void getItemAsXML(java.io.Writer pXMLOutput,
                         RepositoryItem pItem,
                         java.lang.String pMappingFileName)
                  throws GetException
Generates XML Instance Document from Repository Item

Parameters:
pXMLOutput - Writer instance to write XML output.
pItem - the repository item to generate an instance document for
pMappingFileName - name of a mapping file that should be used to control how the generated instance document appears. This mapping file is resolved against the configured Schema manager.
Throws:
GetException - if an error occurs

getItemAsXML

public void getItemAsXML(java.io.Writer pXMLOutput,
                         RepositoryItem pItem,
                         java.lang.String[] pIncludeProperties,
                         java.lang.String pMappingFileName)
                  throws GetException
Generates XML Instance Document from Repository Item

Parameters:
pXMLOutput - Writer instance to write XML output.
pItem - the item to generate an instance document for
pIncludeProperties - an array list of properties that should be included in the generated instance document. All properties not appearing in this array will be excluded from the generated instance document. Using this property can be useful if the calling application knows only a subset of properties on an item changed for example. The values appearing in this array must be top-level properties on the item.
pMappingFileName - name of a mapping file that should be used to control how the generated instance document appears. This mapping file is resolved against the configured Schema manager.
Throws:
GetException - if an error occurs

appendRepositoryItem

protected void appendRepositoryItem(RepositoryItem pItem,
                                    java.lang.String[] pIncludeProperties,
                                    atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                    java.io.Writer pInstanceWriter,
                                    java.lang.String pNSPrefix,
                                    java.util.Map pVisitedObjects,
                                    java.lang.String pGlobalNSPrefix,
                                    RepositoryItemDescriptor pItemDescriptor,
                                    atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
                             throws GetException,
                                    java.io.IOException,
                                    RepositoryException
Method called to generate the appropriate representation of a repository item for an instance document. This method walks the properites exposed by the pItem parameter and calls the appropriate handleXXX() methods.

Parameters:
pItem - the item to generate an instance document for
pIncludeProperties - properties to include in the generated instance document
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
pItemDescriptor - the item-descriptor backing the item represented by the pItem parameter.
pItemDescToNSInfo - the class which contains the namespace info. and repository item info. of the item, pItem passed.
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.
java.io.IOException - if any error occurs while writing to pInstanceWriter
RepositoryException

appendComplexElement

protected void appendComplexElement(RepositoryItem pItem,
                                    atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                    java.io.Writer pInstanceWriter,
                                    java.lang.String pNSPrefix,
                                    java.util.Map pVisitedObjects,
                                    java.lang.String pGlobalNSPrefix)
                             throws GetException,
                                    java.io.IOException
Method called to generate the appropriate representation of a repository item for a given repository item.

Parameters:
pItem - the item to generate an instance document for
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pInstanceWriter - the Writer which contains partially generated xml instance.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleSimpleType

protected void handleSimpleType(RepositoryItem pItem,
                                RepositoryPropertyDescriptor pPropertyDesc,
                                java.io.Writer pInstanceWriter,
                                java.lang.String pNSPrefix,
                                atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                java.lang.String pGlobalNSPrefix)
                         throws java.io.IOException
Adds simple property to the xml instance doc.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that an XML representation will be generated for.
pInstanceWriter - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.
java.io.IOException - if any error occurs while writing to pInstanceWriter

getAdjustedValue

public java.lang.String getAdjustedValue(RepositoryPropertyDescriptor pPropertyDesc,
                                         java.lang.String pValue)
Stub method that can be overridden to adjust a property value before writing to the XML (e.g., mask a credit card number)

Parameters:
pPropertyDesc - The repository property descriptor
pValue - The value
Returns:
the adjusted value

handleComplexType

protected void handleComplexType(RepositoryItem pItem,
                                 RepositoryPropertyDescriptor pPropertyDesc,
                                 java.io.Writer pInstanceWriter,
                                 java.lang.String pNSPrefix,
                                 atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                 java.util.Map pVisitedObjects,
                                 java.lang.String pGlobalNSPrefix)
                          throws GetException,
                                 java.io.IOException
Adds xml representation for item-descriptor property type.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that a complexType definition willbe generated for
pInstanceWriter - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs while trying to get an xml representation for the item pItem.
GetException - if an error occurs
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleCollectionType

protected void handleCollectionType(RepositoryItem pItem,
                                    RepositoryPropertyDescriptor pPropertyDesc,
                                    java.io.Writer pInstanceWriter,
                                    java.lang.String pNSPrefix,
                                    atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                    java.util.Map pVisitedObjects,
                                    java.lang.String pGlobalNSPrefix)
                             throws GetException,
                                    java.io.IOException
Adds xml representation for collection properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pNSPrefix - NS Prefix for this instance document
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - global NS for the document
Throws:
GetException - if an error occurs
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleSimpleCollectionType

protected void handleSimpleCollectionType(RepositoryItem pItem,
                                          RepositoryPropertyDescriptor pPropertyDesc,
                                          java.io.Writer pInstanceWriter,
                                          java.lang.String pNSPrefix,
                                          java.lang.String pGlobalNSPrefix)
                                   throws java.io.IOException
Adds xml representation for items of simple type in collection properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pGlobalNSPrefix - global NS for the document
Throws:
java.io.IOException

handleComplexCollectionType

protected void handleComplexCollectionType(RepositoryItem pItem,
                                           RepositoryPropertyDescriptor pPropertyDesc,
                                           java.io.Writer pInstanceWriter,
                                           atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                           java.lang.String pNSPrefix,
                                           java.util.Map pVisitedObjects,
                                           java.lang.String pGlobalNSPrefix)
                                    throws GetException,
                                           java.io.IOException
Adds xml representation for items of complex type in collection properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used for the instance document
Throws:
GetException - if an error occurs
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleMapType

protected void handleMapType(RepositoryItem pItem,
                             RepositoryPropertyDescriptor pPropertyDesc,
                             java.io.Writer pInstanceWriter,
                             java.lang.String pNSPrefix,
                             atg.repository.databinding.ItemMappingElement pItemMappingElement,
                             java.util.Map pVisitedObjects,
                             java.lang.String pGlobalNSPrefix)
                      throws GetException,
                             java.io.IOException
Adds xml representation for map properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pNSPrefix - NS Prefix for this instance document
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used for this document.
Throws:
GetException - if an error occurs
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleComplexMapType

protected void handleComplexMapType(RepositoryItem pItem,
                                    RepositoryPropertyDescriptor pPropertyDesc,
                                    java.io.Writer pInstanceWriter,
                                    atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                    java.lang.String pNSPrefix,
                                    java.util.Map pVisitedObjects,
                                    java.lang.String pGlobalNSPrefix)
                             throws GetException,
                                    java.io.IOException
Adds xml representation for items of complex type in map properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used in this document.
Throws:
GetException - if an error occurs
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleSimpleMapType

protected void handleSimpleMapType(RepositoryItem pItem,
                                   RepositoryPropertyDescriptor pPropertyDesc,
                                   java.io.Writer pInstanceWriter,
                                   java.lang.String pNSPrefix,
                                   java.lang.String pGlobalNSPrefix)
                            throws java.io.IOException
Adds xml representation for items of simple type in map properties.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pNSPrefix - NS Prefix for this instance document
pGlobalNSPrefix - the global namespace used in the document.
Throws:
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleArrayType

protected void handleArrayType(RepositoryItem pItem,
                               RepositoryPropertyDescriptor pPropertyDesc,
                               java.io.Writer pInstanceWriter,
                               java.lang.String pNSPrefix,
                               atg.repository.databinding.ItemMappingElement pItemMappingElement,
                               java.util.Map pVisitedObjects,
                               java.lang.String pGlobalNSPrefix)
                        throws GetException,
                               java.io.IOException
Method handleArrayType.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pNSPrefix - NS Prefix for this instance document
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used through out this document
Throws:
GetException - if an error occurs
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleSimpleArrayType

protected void handleSimpleArrayType(RepositoryItem pItem,
                                     RepositoryPropertyDescriptor pPropertyDesc,
                                     java.io.Writer pInstanceWriter,
                                     java.lang.String pNSPrefix,
                                     java.lang.String pGlobalNSPrefix)
                              throws java.io.IOException
Generate the XML representation of the property value represented by the pPropertyDesc on the pItem parameter. The property type is expected to be an array that contains values that are String, int, long etc.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceDoc - StringBuffer that contains the partially generated XML Schema.
pNSPrefix - NS Prefix for this instance document
pGlobalNSPrefix - the global namespace used in the document
Throws:
java.io.IOException - if any error occurs while writing to pInstanceWriter

handleComplexArrayType

protected void handleComplexArrayType(RepositoryItem pItem,
                                      RepositoryPropertyDescriptor pPropertyDesc,
                                      java.io.Writer pInstanceWriter,
                                      atg.repository.databinding.ItemMappingElement pItemMappingElement,
                                      java.lang.String pNSPrefix,
                                      java.util.Map pVisitedObjects,
                                      java.lang.String pGlobalNSPrefix)
                               throws GetException,
                                      java.io.IOException
Handle appending the representation of an array to the instance document.

Parameters:
pItem - the item to generate an instance document for
pPropertyDesc - the property that XML is being generated for
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pItemMappingElement - ItemMappingElement that controls how an item is mapped into an instance document. This ItemMappingElement is the result of resolving a mapping file against the configured SchemaManager.
pNSPrefix - NS Prefix for this instance document
pVisitedObjects - map of visited objects in a graph to their ID. If we have already seen an object during the serialization of an object graph, the item should not be traversed a second time. Instead, the ID associated with that object used be used for the value of an IDREF attribute
pGlobalNSPrefix - the global namespace used in the document
Throws:
GetException - if an error occurs
java.io.IOException - if any error occurs while writing to pInstanceWriter

addSchemaLocations

protected void addSchemaLocations(java.io.Writer pInstanceWriter,
                                  atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
                           throws java.io.IOException
Adds the schema locations for all the item-descriptors present in the RepositoryItem passed.

Parameters:
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pItemDescToNSInfoMap - map contain namespace information used in the generation of this instance document.
Throws:
java.io.IOException - if any error occurs while writing to pInstanceWriter

addNamespaceDeclarations

protected void addNamespaceDeclarations(java.io.Writer pInstanceWriter,
                                        atg.repository.xml.ItemDescToNSInfo pItemDescToNSInfo)
                                 throws java.io.IOException
Adds the namespace declarations for all the item descriptors present in the RepositoryItem passed.

Parameters:
pInstanceWriter - the Writer which contains partially generated xml instance, and into which we write this property.
pItemDescToNSInfoMap - list of item-descriptor namespace information
Throws:
java.io.IOException - if any error occurs while writing to pInstanceWriter