com.ibm.commerce.attachment.commands
Class AttachmentUpdateCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.ControllerCommandImpl
-
- com.ibm.commerce.attachment.commands.AttachmentUpdateCmdImpl
-
- All Implemented Interfaces:
- AttachmentUpdateCmd, AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
public class AttachmentUpdateCmdImpl extends ControllerCommandImpl implements AttachmentUpdateCmd
TheAttachmentUpdateCmd
is a URL and controller command that:- Updates an Attachment Target.
- Updates Attachment Target Descriptions.
- Delete the lists of unwanted attachment assets.
- Updates Attachment Assets for the Attachment Target.
- Updates Attachment Asset Languages for each Attachment Asset in the Attachment Target.
- Updates the content of the managed file that the attachment asset is pointed to by the attachment asset path.
- Create Missing option is set to true by default and cannot be changed when the command is called through URL.
- Only one attachment target description can be update, with one attachment asset and one language for the attachment asset.
- Attachment asset cannot be deleted from attachment target.
- Only 1 attachment asset can be updated.
- 1 asset language can be added to the attachment asset.
- 1 asset language can be removed from the attachment asset.
- Only data provided by the caller will be updated. If the attachment target name is not specified in the URL, it will not be changed.
- The content of the managed file that the attachment asset is pointed to by the attachment asset path will not be updated.
- If the store entity ID of the attachment target is changed, the store entity ID of all its the attachment assets will be updated.
- the vector of
AttachmentTargetDescriptionDataBean
will be used to update multiple attachment target descriptions. - the vector of
AttachmentAssetDataBean
for delete will be used to delete the list of attachment assets from the attachment target. - the vector of
AttachmentAssetDataBean
will be used to update multiple assets and all the asset languages. - If the list of language IDs in the
AttachmentAssetDataBean
is not null, then - All the attachment asset languages will be deleted from the attachment asset that is being updated.
- The list of language IDs in the
AttachmentAssetDataBean
will be used to recreate the attachment asset languages. This means that the list must contain ALL the languages supported by the attachment asset. - If the content of the attachment asset in the
AttachmentAssetDataBean
is set, then it will be written to the Managed File. - when updating using databeans, if any of the parameters are not specified, they will be set to null. Caller must specify all the parameters even when these parameters are not being changed.
- By default, the option to create missing attachment target description, asset, and asset language is set to true.
- When updating the attachment target description, the attachment target ID will be obtained from the parameter, not from the databean.
- When updating the attachment assets, the attachment target ID will be obtained from the parameter, not from the databean.
- Only the records that need to be updated or created will be accessed by this command.
- Attachment Target ID
- Store Entity ID
- Attachment Target Identifier
- Attachment Target Field 1
- Attachment Target Field 2
- Attachment Target Field 3
- Attachment Target Field 4
- Attachment Usage ID used for the Attachment Target
- Target Name
- Target Description Language ID
- Target Short Description
- Target Long Description
- Attachment Asset Path
- Attachment Asset MIME Types
- Attachment Asset MIME Types Encoding
- Attachment Asset Image 1
- Attachment Asset Image 2
- Language ID supported by the Attachment Asset
- Language ID to be removed from the Attachment Asset.
- Vector of
AttachmentTargetDescriptionDataBean
- Vector of
AttachmentAssetDataBean
- Vector of
AttachmentAssetDataBean
for delete
AttachmentTargetAccessBean
AttachmentTargetDescriptionAccessBean
AttachmentAssetAccessBean
AttachmentAssetLanguageAccessBean
AttachmentTargetDescriptionDataBean
AttachmentAssetDataBean
UpdateAttachmentTarget
,
UpdateAttachmentAsset
,
DeleteAttachmentAsset
,
AttachmentHelper
AttachmentAssetHelper
AttachmentTargetHelper
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
CLASSNAME
Define the CLASSNAME.static java.lang.String
COPYRIGHT
The internal copyright field.-
Fields inherited from interface com.ibm.commerce.command.ECCommand
defaultCommandClassName
-
-
Constructor Summary
Constructors Constructor and Description AttachmentUpdateCmdImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.Vector
getAttachmentAssets()
Gets the vector ofAttachmentAssetDataBean
for update.java.util.Vector
getAttachmentTargetDescriptions()
Gets the vector ofAttachmentTargetDescriptionDataBean
for update.java.lang.Long
getAttachmentTargetId()
Gets the attachment target ID.java.lang.String
getAttachmentUsageId()
Gets the attachment usage ID of the attachment target.java.lang.String[]
getCatalogIdsForCacheInvalidations()
Gets the list of catalog IDs for cache invalidations.java.lang.String[]
getCatentryIdsForCacheInvalidations()
Gets the list of catalog entry IDs for cache invalidations.java.lang.String[]
getCatgroupIdsForCacheInvalidations()
Gets the list of catalog group IDs for cache invalidations.java.lang.String[]
getCollateralIdsForCacheInvalidations()
Gets the list of collateral IDs for cache invalidations.java.util.Collection
getEMarketingSpotNamesForCacheInvalidations()
Gets the list of e-Marketing Spot names for cache invalidations.java.lang.Long
getField1()
Gets the customizable field 1 in the attachment target.java.lang.Double
getField2()
Gets the customizable field 2 in the attachment target.java.lang.String
getField3()
Gets the customizable field 3 in the attachment target.java.lang.String
getField4()
Gets the customizable field 4 in the attachment target.java.lang.String
getIdentifier()
Gets the identifier of the attachment target.java.lang.Long
getMemberId()
Gets the owner of the attachment target.java.lang.Integer
getStoreentId()
Gets the store entity ID that owns the attachment target.void
performExecute()
Updates the attachment target. Updates the attachment target descriptions. Delete the set of unwanted attachment assets. Updates all the attachment asset of the attachment target if the store entity ID is changed. Updates the attachment assets and languages.void
reset()
Resets the variables used.void
setAttachmentAssets(java.util.Vector avAttachmentAssetDataBeans)
Sets the vector ofAttachmentAssetDataBean
as the attachment assets to be updated for the attachment target.void
setAttachmentAssetsForDelete(java.util.Vector avAttachmentAssetDataBeansForDelete)
Sets the vector ofAttachmentAssetDataBean
as the attachment assets to be deleted from the attachment target.void
setAttachmentTargetDescriptions(java.util.Vector avAttachmentTargetDescriptionDataBeans)
Sets the vector ofAttachmentTargetDescriptionDataBean
as the description to be updated for the attachment target.void
setAttachmentTargetId(java.lang.Long anAttachmentTargetId)
Sets the attachment target ID.void
setAttachmentUsageId(java.lang.String astrAttachmentUsageId)
Sets the attachment usage ID used in the attachment target.void
setCreateMissing(java.lang.Boolean aboolCreateMissing)
Sets the option to the create missing attachment target, target descriptions, and assets.void
setField1(java.lang.Long anField1)
Sets the customizable field 1 of the attachment target.void
setField2(java.lang.Double adField2)
Sets the customizable field 2 of the attachment target.void
setField3(java.lang.String astrField3)
Sets the customizable field 3 of the attachment target.void
setField4(java.lang.String astrField4)
Sets the customizable field 4 of the attachment target.void
setIdentifier(java.lang.String astrIdentifier)
Sets the identifier of the attachment target.void
setMemberId(java.lang.Long anMemberId)
Sets the owner ID of the attachment target to retrieve an existing attachment.void
setRequestProperties(TypedProperty reqParms)
Sets the request properties.void
setStoreentId(java.lang.Integer anStoreentId)
Sets the store entity ID.void
setURL(java.lang.String astrURL)
Sets the redirect URL.void
validateParameters()
Validate the parameters.-
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
The internal copyright field.- See Also:
- Constant Field Values
-
CLASSNAME
public static final java.lang.String CLASSNAME
Define the CLASSNAME.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAttachmentTargetId
public java.lang.Long getAttachmentTargetId()
Gets the attachment target ID.- Specified by:
getAttachmentTargetId
in interfaceAttachmentUpdateCmd
- Returns:
- The attachment target ID
-
getStoreentId
public java.lang.Integer getStoreentId()
Gets the store entity ID that owns the attachment target.- Specified by:
getStoreentId
in interfaceAttachmentUpdateCmd
- Returns:
- The store entity ID
-
getMemberId
public java.lang.Long getMemberId()
Gets the owner of the attachment target.- Specified by:
getMemberId
in interfaceAttachmentUpdateCmd
- Returns:
- The owner ID of the attachment target
-
getIdentifier
public java.lang.String getIdentifier()
Gets the identifier of the attachment target.- Specified by:
getIdentifier
in interfaceAttachmentUpdateCmd
- Returns:
- The identifier of the attachment target
-
getAttachmentUsageId
public java.lang.String getAttachmentUsageId()
Gets the attachment usage ID of the attachment target.- Specified by:
getAttachmentUsageId
in interfaceAttachmentUpdateCmd
- Returns:
- The attachment usage ID
-
getField1
public java.lang.Long getField1()
Gets the customizable field 1 in the attachment target.- Specified by:
getField1
in interfaceAttachmentUpdateCmd
- Returns:
- The customizable field 1
-
getField2
public java.lang.Double getField2()
Gets the customizable field 2 in the attachment target.- Specified by:
getField2
in interfaceAttachmentUpdateCmd
- Returns:
- The customizable field 2
-
getField3
public java.lang.String getField3()
Gets the customizable field 3 in the attachment target.- Specified by:
getField3
in interfaceAttachmentUpdateCmd
- Returns:
- The customizable field 3
-
getField4
public java.lang.String getField4()
Gets the customizable field 4 in the attachment target.- Specified by:
getField4
in interfaceAttachmentUpdateCmd
- Returns:
- The customizable field 4
-
getAttachmentTargetDescriptions
public java.util.Vector getAttachmentTargetDescriptions()
Gets the vector ofAttachmentTargetDescriptionDataBean
for update.- Specified by:
getAttachmentTargetDescriptions
in interfaceAttachmentUpdateCmd
- Returns:
- The vector of
AttachmentTargetDescriptionDataBean
-
getAttachmentAssets
public java.util.Vector getAttachmentAssets()
Gets the vector ofAttachmentAssetDataBean
for update.- Specified by:
getAttachmentAssets
in interfaceAttachmentUpdateCmd
- Returns:
- The vector of
AttachmentAssetDataBean
-
performExecute
public void performExecute() throws ECException
- Updates the attachment target.
- Updates the attachment target descriptions.
- Delete the set of unwanted attachment assets.
- Updates all the attachment asset of the attachment target if the store entity ID is changed.
- Updates the attachment assets and languages.
- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
-
reset
public void reset()
Resets the variables used.- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
setAttachmentTargetId
public void setAttachmentTargetId(java.lang.Long anAttachmentTargetId)
Sets the attachment target ID.- Specified by:
setAttachmentTargetId
in interfaceAttachmentUpdateCmd
- Parameters:
anAttachmentTargetId
- The attachment target ID
-
setStoreentId
public void setStoreentId(java.lang.Integer anStoreentId)
Sets the store entity ID.- Specified by:
setStoreentId
in interfaceAttachmentUpdateCmd
- Parameters:
anStoreentId
- The store entity ID
-
setMemberId
public void setMemberId(java.lang.Long anMemberId)
Sets the owner ID of the attachment target to retrieve an existing attachment. If a new attachment target is being created, the member ID set here will be ignored. To override the default owner of a new attachment target, please useAttachmentAdd
.- Specified by:
setMemberId
in interfaceAttachmentUpdateCmd
- Parameters:
anMemberId
- The owner of the attachment target
-
setIdentifier
public void setIdentifier(java.lang.String astrIdentifier)
Sets the identifier of the attachment target.- Specified by:
setIdentifier
in interfaceAttachmentUpdateCmd
- Parameters:
astrIdentifier
- The identifier of the attachment target
-
setAttachmentUsageId
public void setAttachmentUsageId(java.lang.String astrAttachmentUsageId)
Sets the attachment usage ID used in the attachment target.- Specified by:
setAttachmentUsageId
in interfaceAttachmentUpdateCmd
- Parameters:
astrAttachmentUsageId
- The attachment usage ID
-
setField1
public void setField1(java.lang.Long anField1)
Sets the customizable field 1 of the attachment target.- Specified by:
setField1
in interfaceAttachmentUpdateCmd
- Parameters:
anField1
- The customizable field 1
-
setField2
public void setField2(java.lang.Double adField2)
Sets the customizable field 2 of the attachment target.- Specified by:
setField2
in interfaceAttachmentUpdateCmd
- Parameters:
adField2
- The customizable field 2
-
setField3
public void setField3(java.lang.String astrField3)
Sets the customizable field 3 of the attachment target.- Specified by:
setField3
in interfaceAttachmentUpdateCmd
- Parameters:
astrField3
- The customizable field 3
-
setField4
public void setField4(java.lang.String astrField4)
Sets the customizable field 4 of the attachment target.- Specified by:
setField4
in interfaceAttachmentUpdateCmd
- Parameters:
astrField4
- The customizable field 4
-
setAttachmentAssets
public void setAttachmentAssets(java.util.Vector avAttachmentAssetDataBeans)
Sets the vector ofAttachmentAssetDataBean
as the attachment assets to be updated for the attachment target.- Specified by:
setAttachmentAssets
in interfaceAttachmentUpdateCmd
- Parameters:
avAttachmentAssetDataBeans
- The list ofAttachmentAssetDataBean
-
setAttachmentAssetsForDelete
public void setAttachmentAssetsForDelete(java.util.Vector avAttachmentAssetDataBeansForDelete)
Sets the vector ofAttachmentAssetDataBean
as the attachment assets to be deleted from the attachment target.- Specified by:
setAttachmentAssetsForDelete
in interfaceAttachmentUpdateCmd
- Parameters:
avAttachmentAssetDataBeansForDelete
- The list ofAttachmentAssetDataBean
as the attachment assets for delete.
-
setAttachmentTargetDescriptions
public void setAttachmentTargetDescriptions(java.util.Vector avAttachmentTargetDescriptionDataBeans)
Sets the vector ofAttachmentTargetDescriptionDataBean
as the description to be updated for the attachment target.- Specified by:
setAttachmentTargetDescriptions
in interfaceAttachmentUpdateCmd
- Parameters:
avAttachmentTargetDescriptionDataBeans
- The list ofAttachmentTargetDescriptionDataBean
-
setURL
public void setURL(java.lang.String astrURL)
Sets the redirect URL.- Specified by:
setURL
in interfaceAttachmentUpdateCmd
- Parameters:
astrURL
- The redirect URL
-
setCreateMissing
public void setCreateMissing(java.lang.Boolean aboolCreateMissing)
Sets the option to the create missing attachment target, target descriptions, and assets.- True - create the missing attachment target, target descriptions, assets, and asset languages.
- False - throw exception if the attachment target, target descriptions, or assets do not exists
- Specified by:
setCreateMissing
in interfaceAttachmentUpdateCmd
- Parameters:
aboolCreateMissing
- The create missing flag
-
setRequestProperties
public void setRequestProperties(TypedProperty reqParms) throws ECApplicationException
Sets the request properties.- Specified by:
setRequestProperties
in interfaceControllerCommand
- Overrides:
setRequestProperties
in classControllerCommandImpl
- Parameters:
reqParms
- The request properties- Throws:
ECApplicationException
-
validateParameters
public void validateParameters() throws ECException
Validate the parameters.- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECException
-
getCatalogIdsForCacheInvalidations
public java.lang.String[] getCatalogIdsForCacheInvalidations() throws ECException
Gets the list of catalog IDs for cache invalidations.- Returns:
- The string array of catalog IDs
- Throws:
ECException
-
getCatentryIdsForCacheInvalidations
public java.lang.String[] getCatentryIdsForCacheInvalidations() throws ECException
Gets the list of catalog entry IDs for cache invalidations.- Returns:
- The string array of catalog entry IDs
- Throws:
ECException
-
getCatgroupIdsForCacheInvalidations
public java.lang.String[] getCatgroupIdsForCacheInvalidations() throws ECException
Gets the list of catalog group IDs for cache invalidations.- Returns:
- The string array of catalog group IDs
- Throws:
ECException
-
getCollateralIdsForCacheInvalidations
public java.lang.String[] getCollateralIdsForCacheInvalidations() throws ECException
Gets the list of collateral IDs for cache invalidations.- Returns:
- The string array of collateral IDs
- Throws:
ECException
-
getEMarketingSpotNamesForCacheInvalidations
public java.util.Collection getEMarketingSpotNamesForCacheInvalidations() throws ECException
Gets the list of e-Marketing Spot names for cache invalidations.- Returns:
- The string array of e-Marketing Spot names
- Throws:
ECException
-
-