public class UpdateService
extends atg.repository.xml.ModifyService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHECKOUT_TAG
Tag supplied to the ResourcePools as an identifier for this
service.
|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
UpdateService() |
Modifier and Type | Method and Description |
---|---|
AddService |
getAddService()
If no items are selected for an update, and this component is instructed
to add the item when no items are matched, the
addItem
method will be called on this configured AddService. |
java.lang.String |
getInputString(java.io.Reader pReader) |
MutableRepositoryItem |
getSingleUpdatableItem(RepositoryItem[] pItems)
This method extracts a single MutableRepositoryItem from the
array of RepositoryItems passed to it.
|
atg.repository.xml.ModifyHandlerResourcePool |
getUpdateHandlerPool()
Maintain a pool of ContentHandlers that will be used to process
an instance document.
|
boolean |
isAddWhenNoMatchedItems()
If not items are matched for an update, then this compoent can
decide to add the items to the repository.
|
void |
setAddService(AddService addService)
Sets the addService.
|
void |
setAddWhenNoMatchedItems(boolean addWhenNoMatchedItems)
Sets the addWhenNoMatchedItems.
|
void |
setPropertiesOnContentHandler(atg.repository.xml.UpdateHandler pContentHandler,
boolean pEmptyTagIsNull,
boolean pMissingTagIsNull,
boolean pIsPersistItem,
boolean pEmptyTagIsEmptyString,
MutableRepositoryItem pItem)
This method will set properties on the contentHandler
that control how the contentHandler will process a given
instance document.
|
void |
setUpdateHandlerPool(atg.repository.xml.ModifyHandlerResourcePool pUpdateHandlerPool)
Set the UpdateHandlerPool property.
|
RepositoryItem |
updateItem(org.xml.sax.InputSource pInputSource,
boolean pIsValidate,
boolean pEmptyTagIsNull,
boolean pMissingTagIsNull,
boolean pIsPersistItem,
boolean pIsEmptyTagIsEmptyString,
MutableRepositoryItem pItem)
All method expected to be called by the user will eventually call
this method to actually perform the work of adding a repository
item to the repository.
|
RepositoryItem |
updateItem(java.io.InputStream pXMLInput,
boolean pIsValidate,
boolean pIsEmptyTagIsNull,
boolean pIsMissingTagIsNull,
boolean pIsPersistItem,
boolean pIsEmptyTagIsEmptyString,
java.lang.String[] pMatchProperties)
This method will potentially update an item in a repository.
|
RepositoryItem |
updateItem(java.io.InputStream pXMLInput,
java.util.Map pMatchValues)
This method will potentially update an item in a repository.
|
RepositoryItem |
updateItem(java.io.InputStream pXMLInput,
MutableRepositoryItem pItem)
The item specified by the
pItem parameter will be udpated
with the property values found in the pXMLInput parameter. |
RepositoryItem |
updateItem(java.io.InputStream pXMLInput,
java.lang.String[] pMatchProperties)
This method will potentially update an item in a repository.
|
RepositoryItem |
updateItem(java.io.Reader pXMLInput,
boolean pIsValidate,
boolean pIsEmptyTagIsNull,
boolean pIsMissingTagIsNull,
boolean pIsPersistItem,
boolean pIsEmptyTagIsEmptyString,
java.lang.String[] pMatchProperties)
This method will potentially update an item in a repository.
|
RepositoryItem |
updateItem(java.io.Reader pXMLInput,
java.util.Map pMatchValues)
This method will potentially update an item in a repository.
|
RepositoryItem |
updateItem(java.io.Reader pXMLInput,
MutableRepositoryItem pItem)
The item specified by the
pItem parameter will be udpated
with the property values found in the pXMLInput parameter. |
RepositoryItem |
updateItem(java.io.Reader pXMLInput,
java.lang.String[] pMatchProperties)
This method will potentially update an item in a repository.
|
RepositoryItem |
updateItem(java.lang.String pXMLInput,
boolean pIsValidate,
boolean pIsEmptyTagIsNull,
boolean pIsMissingTagIsNull,
boolean pIsPersistItem,
boolean pIsEmptyTagIsEmptyString,
java.util.Map pMatchValues)
This method is responsible for obtaining the repository item to
update and deciding if no item is selected whether the instance document
should result in a new item being added to the repository.
|
RepositoryItem |
updateItem(java.lang.String pXMLInput,
boolean pIsValidate,
boolean pIsEmptyTagIsNull,
boolean pIsMissingTagIsNull,
boolean pIsPersistItem,
boolean pIsEmptyTagIsEmptyString,
java.util.Map pMatchValues,
java.lang.String pId)
This method is responsible for obtaining the repository item to
update and deciding if no item is selected whether the instance document
should result in a new item being added to the repository.
|
RepositoryItem |
updateItem(java.lang.String pXMLInput,
boolean pIsValidate,
boolean pIsEmptyTagIsNull,
boolean pIsMissingTagIsNull,
boolean pIsPersistItem,
boolean pIsEmptyTagIsEmptyString,
java.lang.String[] pMatchProperties)
This method is responsible for obtaining the repository item to
update and deciding if no item is selected whether the instance document
should result in a new item being added to the repository.
|
RepositoryItem |
updateItem(java.lang.String pXMLInput,
boolean pIsValidate,
boolean pIsEmptyTagIsNull,
boolean pIsMissingTagIsNull,
boolean pIsPersistItem,
boolean pIsEmptyTagIsEmptyString,
java.lang.String[] pMatchProperties,
java.lang.String pId)
This method is responsible for obtaining the repository item to
update and deciding if no item is selected whether the instance document
should result in a new item being added to the repository.
|
RepositoryItem |
updateItem(java.lang.String pXMLInput,
java.util.Map pMatchValues)
This method will potentially update an item in a repository.
|
RepositoryItem |
updateItem(java.lang.String pXMLInput,
MutableRepositoryItem pItem)
The item specified by the
pItem parameter will be udpated
with the property values found in the pXMLInput parameter. |
RepositoryItem |
updateItem(java.lang.String pXMLInput,
java.lang.String[] pMatchProperties)
This method will potentially update an item in a repository.
|
clearGsaIdCache, error, fatalError, getCache, getCache, getDateFormat, getGsaIdCache, getRepositoryXMLTools, getSAXParserPool, getSchemaManager, getTransactionManager, isEmptyTagIsEmptyString, isEmptyTagIsNull, isLogWarningOnReadOnly, isMissingTagIsNull, isPersistItem, isUseGsaIdCache, isValidate, prepopulateCache, setDateFormat, setEmptyTagIsEmptyString, setEmptyTagIsNull, setFeaturesForXMLReader, setHandlersForXMLReader, setLogWarningOnReadOnly, setMissingTagIsNull, setPersistItem, setRepositoryXMLTools, setSAXParserPool, setSchemaManager, setTransactionManager, setUseGsaIdCache, setValidate, warning
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
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final java.lang.String CHECKOUT_TAG
public boolean isAddWhenNoMatchedItems()
public void setAddWhenNoMatchedItems(boolean addWhenNoMatchedItems)
addWhenNoMatchedItems
- The addWhenNoMatchedItems to setpublic AddService getAddService()
addItem
method will be called on this configured AddService.public void setAddService(AddService addService)
addService
- The addService to setpublic atg.repository.xml.ModifyHandlerResourcePool getUpdateHandlerPool()
public void setUpdateHandlerPool(atg.repository.xml.ModifyHandlerResourcePool pUpdateHandlerPool)
pUpdateHandlerPool
- public RepositoryItem updateItem(java.lang.String pXMLInput, java.lang.String[] pMatchProperties) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, String[]
method will be called.
All parameters passed to the updateItem() method will be obtained
from the values specified on this component. For example, whether to
validate the incoming instance document will be determined by the
isValidate()
property of this class.pXMLInput
- the XML instance containing the values to update.pMatchProperties
- properties to match on. Items will be selected out
of the repository whose properties (corresponding to those in the
matchProperties) have values equal to the item in the
pXMLInput
UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.lang.String pXMLInput, java.util.Map pMatchValues) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, Map
method will be called.
All parameters passed to the updateItem() method will be obtained
from the values specified on this component. For example, whether to
validate the incoming instance document will be determined by the
isValidate()
property of this class.pXMLInput
- the XML instance containing the values to update.pMatchValues
- Set of key/value pairs that we should match on.
Items will be selected out
of the repository whose properties (corresponding to the key
in the pMatchValues) have values equal to corresponding the values
in the pMatchValues.UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.io.InputStream pXMLInput, java.lang.String[] pMatchProperties) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, String[]
method will be called.
* All parameters passed to the updateItem() method will be obtained
from the values specified on this component. For example, whether to
validate the incoming instance document will be determined by the
isValidate()
property of this class.pXMLInput
- the XML instance containing the values to update.pMatchProperties
- properties to match on. Items will be selected out
of the repository whose properties (corresponding to those in the
matchProperties) have values equal to the item in the
pXMLInput
UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.io.InputStream pXMLInput, java.util.Map pMatchValues) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, String[]
method will be called.
* All parameters passed to the updateItem() method will be obtained
from the values specified on this component. For example, whether to
validate the incoming instance document will be determined by the
isValidate()
property of this class.pXMLInput
- the XML instance containing the values to update.pMatchValues
- Set of key/value pairs that we should match on.
Items will be selected out
of the repository whose properties (corresponding to the key
in the pMatchValues) have values equal to corresponding the values
in the pMatchValues.UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.io.Reader pXMLInput, java.lang.String[] pMatchProperties) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, String[]
method will be called.
* All parameters passed to the updateItem() method will be obtained
from the values specified on this component. For example, whether to
validate the incoming instance document will be determined by the
isValidate()
property of this class.pXMLInput
- the XML instance containing the values to update.pMatchProperties
- properties to match on. Items will be selected out
of the repository whose properties (corresponding to those in the
matchProperties) have values equal to the item in the
pXMLInput
UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.io.Reader pXMLInput, java.util.Map pMatchValues) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, String[]
method will be called.
* All parameters passed to the updateItem() method will be obtained
from the values specified on this component. For example, whether to
validate the incoming instance document will be determined by the
isValidate()
property of this class.pXMLInput
- the XML instance containing the values to update.pMatchValues
- Set of key/value pairs that we should match on.
Items will be selected out
of the repository whose properties (corresponding to the key
in the pMatchValues) have values equal to corresponding the values
in the pMatchValues.UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.io.InputStream pXMLInput, boolean pIsValidate, boolean pIsEmptyTagIsNull, boolean pIsMissingTagIsNull, boolean pIsPersistItem, boolean pIsEmptyTagIsEmptyString, java.lang.String[] pMatchProperties) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, String[]
method will be called.pXMLInput
- the XML instance containing the values to update.pIsValidate
- should instance documents be validated against their
corresponding Schema. The Schema is obtained by using an EntityResolver.
The EntityResolver used is the configured SchemaManager component. There
should be an entry in a given instance document for schemaLocation with
the value equal to the namespace of the document.pEmptyTagIsNull
- should empty tags be treated as null. For example,
if an element appeared in an instance document that looked like
<firstName/> this could either result in the firstName property
being set to null explicitly on the repository item, or skip setting
any value on the property. If this parameter is true, then null is set
explicitly, else no property is set.pMissingTagIsNull
- if this property is set to true, then all
tags that fail appear in a given instance document will have their
corresponding properties set to null on the repository item. For example,
if the firstName element had failed to appear in an instance document then
if this property was true null would be set for the firstName property.pIsPersistItem
- if this is true, then any item created will also
be persisted to the repository by calling the addItem() method.pIsEmptyTagIsEmptyString
- if this is true, then any empty tags
will result in setting the empty string assigned to the corresponding
propertypMatchProperties
- properties to match on. Items will be selected out
of the repository whose properties (corresponding to those in the
matchProperties) have values equal to the item in the
pXMLInput
UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.io.Reader pXMLInput, boolean pIsValidate, boolean pIsEmptyTagIsNull, boolean pIsMissingTagIsNull, boolean pIsPersistItem, boolean pIsEmptyTagIsEmptyString, java.lang.String[] pMatchProperties) throws UpdateException, MatchException, MaxNumberItemsException
#updateItem(InputSource, String, boolean, boolean, boolean, boolean, String[]
method will be called.pXMLInput
- the XML instance containing the values to update.pIsValidate
- should instance documents be validated against their
corresponding Schema. The Schema is obtained by using an EntityResolver.
The EntityResolver used is the configured SchemaManager component. There
should be an entry in a given instance document for schemaLocation with
the value equal to the namespace of the document.pEmptyTagIsNull
- should empty tags be treated as null. For example,
if an element appeared in an instance document that looked like
<firstName/> this could either result in the firstName property
being set to null explicitly on the repository item, or skip setting
any value on the property. If this parameter is true, then null is set
explicitly, else no property is set.pMissingTagIsNull
- if this property is set to true, then all
tags that fail appear in a given instance document will have their
corresponding properties set to null on the repository item. For example,
if the firstName element had failed to appear in an instance document then
if this property was true null would be set for the firstName property.pIsPersistItem
- if this is true, then any item created will also
be persisted to the repository by calling the addItem() method.pIsEmptyTagIsEmptyString
- if this is true, then any empty tags
will result in setting the empty string assigned to the corresponding
propertypMatchProperties
- properties to match on. Items will be selected out
of the repository whose properties (corresponding to those in the
matchProperties) have values equal to the item in the
pXMLInput
UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.lang.String pXMLInput, MutableRepositoryItem pItem) throws UpdateException
pItem
parameter will be udpated
with the property values found in the pXMLInput
parameter.
All values concerning whether to validate the incoming document,
to treate empty tags as null etc. will be set to the property values
on this component for their respective property.
This method is used when the item to be updated is known before
calling a method on this component.pXMLInput
- the instance document containing the values to updatepItem
- the item to be updatedUpdateException
- if an error occurspublic RepositoryItem updateItem(java.io.InputStream pXMLInput, MutableRepositoryItem pItem) throws UpdateException
pItem
parameter will be udpated
with the property values found in the pXMLInput
parameter.
All values concerning whether to validate the incoming document,
to treate empty tags as null etc. will be set to the property values
on this component for their respective property.
This method is used when the item to be updated is known before
calling a method on this component.pXMLInput
- the instance document containing the values to updatepItem
- the item to be updatedUpdateException
- if an error occurspublic RepositoryItem updateItem(java.io.Reader pXMLInput, MutableRepositoryItem pItem) throws UpdateException
pItem
parameter will be udpated
with the property values found in the pXMLInput
parameter.
All values concerning whether to validate the incoming document,
to treate empty tags as null etc. will be set to the property values
on this component for their respective property.
This method is used when the item to be updated is known before
calling a method on this component.pXMLInput
- the instance document containing the values to updatepItem
- the item to be updatedUpdateException
- if an error occurspublic RepositoryItem updateItem(java.lang.String pXMLInput, boolean pIsValidate, boolean pIsEmptyTagIsNull, boolean pIsMissingTagIsNull, boolean pIsPersistItem, boolean pIsEmptyTagIsEmptyString, java.lang.String[] pMatchProperties) throws UpdateException, MatchException, MaxNumberItemsException
getItemForUpdate()
method on this class is used to
select the repository item to be updated. If no item is found to match,
then this method will check the isAddWhenNoMatchedItems
property on this class. If its true, then the item will be added
to the repository. Else, a UpdateException will be thrown indicating
that no matching items were found.pXMLInput
- the XML instance containing the values to update.pIsValidate
- should instance documents be validated against their
corresponding Schema. The Schema is obtained by using an EntityResolver.
The EntityResolver used is the configured SchemaManager component. There
should be an entry in a given instance document for schemaLocation with
the value equal to the namespace of the document.pEmptyTagIsNull
- should empty tags be treated as null. For example,
if an element appeared in an instance document that looked like
<firstName/> this could either result in the firstName property
being set to null explicitly on the repository item, or skip setting
any value on the property. If this parameter is true, then null is set
explicitly, else no property is set.pMissingTagIsNull
- if this property is set to true, then all
tags that fail appear in a given instance document will have their
corresponding properties set to null on the repository item. For example,
if the firstName element had failed to appear in an instance document then
if this property was true null would be set for the firstName property.pIsPersistItem
- if this is true, then any item created will also
be persisted to the repository by calling the addItem() method.pIsEmptyTagIsEmptyString
- if this is true, then any empty tags
will result in setting the empty string assigned to the corresponding
propertypMatchProperties
- properties to match on. Items will be selected out
of the repository whose properties (corresponding to those in the
matchProperties) have values equal to the item in the
pXMLInput
UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.lang.String pXMLInput, boolean pIsValidate, boolean pIsEmptyTagIsNull, boolean pIsMissingTagIsNull, boolean pIsPersistItem, boolean pIsEmptyTagIsEmptyString, java.lang.String[] pMatchProperties, java.lang.String pId) throws UpdateException, MatchException, MaxNumberItemsException
getItemForUpdate()
method on this class is used to
select the repository item to be updated. If no item is found to match,
then this method will check the isAddWhenNoMatchedItems
property on this class. If its true, then the item will be added
to the repository. Else, a UpdateException will be thrown indicating
that no matching items were found.pXMLInput
- the XML instance containing the values to update.pIsValidate
- should instance documents be validated against their
corresponding Schema. The Schema is obtained by using an EntityResolver.
The EntityResolver used is the configured SchemaManager component. There
should be an entry in a given instance document for schemaLocation with
the value equal to the namespace of the document.pEmptyTagIsNull
- should empty tags be treated as null. For example,
if an element appeared in an instance document that looked like
<firstName/> this could either result in the firstName property
being set to null explicitly on the repository item, or skip setting
any value on the property. If this parameter is true, then null is set
explicitly, else no property is set.pMissingTagIsNull
- if this property is set to true, then all
tags that fail appear in a given instance document will have their
corresponding properties set to null on the repository item. For example,
if the firstName element had failed to appear in an instance document then
if this property was true null would be set for the firstName property.pIsPersistItem
- if this is true, then any item created will also
be persisted to the repository by calling the addItem() method.pIsEmptyTagIsEmptyString
- if this is true, then any empty tags
will result in setting the empty string assigned to the corresponding
propertypMatchProperties
- properties to match on. Items will be selected out
of the repository whose properties (corresponding to those in the
matchProperties) have values equal to the item in the
pXMLInput
pId
- the the string that, if not null, should be used as the id of the
"top level" repository item created if no item was found for the update and
addWhenNoMatchedItems is trueUpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.lang.String pXMLInput, boolean pIsValidate, boolean pIsEmptyTagIsNull, boolean pIsMissingTagIsNull, boolean pIsPersistItem, boolean pIsEmptyTagIsEmptyString, java.util.Map pMatchValues) throws UpdateException, MatchException, MaxNumberItemsException
getItemForUpdate()
method on this class is used to
select the repository item to be updated. If no item is found to match,
then this method will check the isAddWhenNoMatchedItems
property on this class. If its true, then the item will be added
to the repository. Else, a UpdateException will be thrown indicating
that no matching items were found.pXMLInput
- the XML instance containing the values to update.pIsValidate
- should instance documents be validated against their
corresponding Schema. The Schema is obtained by using an EntityResolver.
The EntityResolver used is the configured SchemaManager component. There
should be an entry in a given instance document for schemaLocation with
the value equal to the namespace of the document.pEmptyTagIsNull
- should empty tags be treated as null. For example,
if an element appeared in an instance document that looked like
<firstName/> this could either result in the firstName property
being set to null explicitly on the repository item, or skip setting
any value on the property. If this parameter is true, then null is set
explicitly, else no property is set.pMissingTagIsNull
- if this property is set to true, then all
tags that fail appear in a given instance document will have their
corresponding properties set to null on the repository item. For example,
if the firstName element had failed to appear in an instance document then
if this property was true null would be set for the firstName property.pIsPersistItem
- if this is true, then any item created will also
be persisted to the repository by calling the addItem() method.pIsEmptyTagIsEmptyString
- if this is true, then any empty tags
will result in setting the empty string assigned to the corresponding
propertypMatchValues
- Set of key/value pairs that we should match on.
Items will be selected out
of the repository whose properties (corresponding to the key
in the pMatchValues) have values equal to corresponding the values
in the pMatchValues.
pXMLInput
UpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(java.lang.String pXMLInput, boolean pIsValidate, boolean pIsEmptyTagIsNull, boolean pIsMissingTagIsNull, boolean pIsPersistItem, boolean pIsEmptyTagIsEmptyString, java.util.Map pMatchValues, java.lang.String pId) throws UpdateException, MatchException, MaxNumberItemsException
getItemForUpdate()
method on this class is used to
select the repository item to be updated. If no item is found to match,
then this method will check the isAddWhenNoMatchedItems
property on this class. If its true, then the item will be added
to the repository. Else, a UpdateException will be thrown indicating
that no matching items were found.pXMLInput
- the XML instance containing the values to update.pIsValidate
- should instance documents be validated against their
corresponding Schema. The Schema is obtained by using an EntityResolver.
The EntityResolver used is the configured SchemaManager component. There
should be an entry in a given instance document for schemaLocation with
the value equal to the namespace of the document.pEmptyTagIsNull
- should empty tags be treated as null. For example,
if an element appeared in an instance document that looked like
<firstName/> this could either result in the firstName property
being set to null explicitly on the repository item, or skip setting
any value on the property. If this parameter is true, then null is set
explicitly, else no property is set.pMissingTagIsNull
- if this property is set to true, then all
tags that fail appear in a given instance document will have their
corresponding properties set to null on the repository item. For example,
if the firstName element had failed to appear in an instance document then
if this property was true null would be set for the firstName property.pIsPersistItem
- if this is true, then any item created will also
be persisted to the repository by calling the addItem() method.pIsEmptyTagIsEmptyString
- if this is true, then any empty tags
will result in setting the empty string assigned to the corresponding
propertypMatchValues
- Set of key/value pairs that we should match on.
Items will be selected out
of the repository whose properties (corresponding to the key
in the pMatchValues) have values equal to corresponding the values
in the pMatchValues.
pXMLInput
pId
- the the string that, if not null, should be used as the id of the
"top level" repository item created if no item was found for the update and
addWhenNoMatchedItems is trueUpdateException
- if an error occursMatchException
- if there was a problem finding matching items
in the repositoryMaxNumberItemsException
- if more than one item was selected for
update.public RepositoryItem updateItem(org.xml.sax.InputSource pInputSource, boolean pIsValidate, boolean pEmptyTagIsNull, boolean pMissingTagIsNull, boolean pIsPersistItem, boolean pIsEmptyTagIsEmptyString, MutableRepositoryItem pItem) throws UpdateException
pInputSource
- SAX InputSource ObjectpIsValidate
- whether instance documents should be validatedpEmptyTagIsNull
- whether empty tags are considered null or
empty tags mean that no value was supplied so setting a property on
the repository item should be skipped.pMissingTagIsNull
- if a tag is missing in the instance document,
should setting a value on the repository item be skipped.UpdateException
public MutableRepositoryItem getSingleUpdatableItem(RepositoryItem[] pItems) throws UpdateException, RepositoryException, MaxNumberItemsException
pItems
- the array of items that is expected to have a single item
that is a MutableRepositoryItemUpdateException
- if an error occurred while updatingMaxNumberItemsException
- If more then one item appears in the arrayRepositoryException
- if an error occurspublic void setPropertiesOnContentHandler(atg.repository.xml.UpdateHandler pContentHandler, boolean pEmptyTagIsNull, boolean pMissingTagIsNull, boolean pIsPersistItem, boolean pEmptyTagIsEmptyString, MutableRepositoryItem pItem) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, RepositoryException
pContentHandler
parameter passed to this method.
Additionally, the AddService
property is set on the
contentHandler, which is set to this AddService object.pContentHandler
- the contentHandler that will have its properties
setpEmptyTagIsNull
- are empty tags treated as explicit nullpMissingTagIsNull
- are missing tags from the instance document
treated as explicit nullpEmptyTagIsEmptyString
- are empty tags treated as empty String
for String propertiesjava.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
RepositoryException
public java.lang.String getInputString(java.io.Reader pReader) throws UpdateException
UpdateException