com.ibm.commerce.attachment.commands

Class AttachmentRelationBaseDeleteCmdImpl

  • All Implemented Interfaces:
    AttachmentRelationBaseDeleteCmd, 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
    Direct Known Subclasses:
    CatalogAttachmentDeleteCmdImpl, CatalogEntryAttachmentDeleteCmdImpl, CatalogGroupAttachmentDeleteCmdImpl


    public abstract class AttachmentRelationBaseDeleteCmdImpl
    extends ControllerCommandImpl
    implements AttachmentRelationBaseDeleteCmd
    An abstract implementation for the controller command to delete an Attachment Relation for a given business object. At a minimum, a command writer has to implement its own performExecute method and set up the proper response data. The proper attachment object type ID and the attachment object ID must also be set. This command will delete an attachment relation with the specified parameters.
    Parameters:
    • atchrelId
    • atchobjtypId, objectId
    • atchobjtypId, objectId, atchrlusId, atchtgtId
    Behavior:
    • Delete by the attachment relation.
      • The delete by business object option is set to False
      • If the attachment relation ID is not specified, then a few IDs must be presented to resolve it. This IDs include the attachment object type ID, object ID, attachment target ID, and the attachment relation usage ID. An exception will be thrown if the attachment relation ID is not found or not resolved.
      • Delete the corresponding attachment relation.
      • Delete the corresponding attachment relation descriptions.
    • Delete all the attachment relations in a business object.
      • The delete by business object option is set to True or the following parameters are set to null:
        • atchrelId (the attachment relation id)
        • atchrlusId (the attachment relation usage id)
        • atchtgtId (the attachment target id)
      • The attachment object type ID and the object ID must be specified, an exception will be thrown if any one of these parameters are missing.
      • Find all the attachment relation belongs to that business object, and delete all the attachment relations found.
      • For all the attachment relations deleted, delete the corresponding attachment relation descriptions.
    • By default, the delete by business object is set to False so it will delete only the specified attachment relation and relation descriptions.
    Access Bean:
    • AttachmentRelationAccessBean
    • AttachmentRelationDescriptionAccessBean
    Task Commands:
    • DeleteAttachmentRelationCmd
    Helper:
    • AttachmentRelationHelper
    See Also:
    Serialized Form
    • 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
    • Constructor Detail

      • AttachmentRelationBaseDeleteCmdImpl

        public AttachmentRelationBaseDeleteCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        If the attachment relation ID is not given, calls addAttachmentRelation to create the attachment relation. Calls addAttachmentRelationDescriptions to create the attachment relation descriptions.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • getDeleteByBusinessObject

        public java.lang.Boolean getDeleteByBusinessObject()
        Gets the option to delete all the attachment relations by business object.
        • True = delete all the attachment relations by the business object specified in the parameter
        • False = delete by attachment relation ID or the unique index of the attachment relation
        By default, this option is set to False.
        Specified by:
        getDeleteByBusinessObject in interface AttachmentRelationBaseDeleteCmd
        Returns:
        The primary key of the business object
      • setAttachmentRelationId

        public void setAttachmentRelationId(java.lang.Long anAttachmentRelationId)
        Sets the attachment relation ID.
        Specified by:
        setAttachmentRelationId in interface AttachmentRelationBaseDeleteCmd
        Parameters:
        anAttachmentRelationId - The attachment relation ID
      • setAttachmentRelationUsageId

        public void setAttachmentRelationUsageId(java.lang.Integer anAttachmentRelationUsageId)
        Sets the attachment relation usage ID used in this attachment relation.
        Specified by:
        setAttachmentRelationUsageId in interface AttachmentRelationBaseDeleteCmd
        Parameters:
        anAttachmentRelationUsageId - The attachment relation usage
      • setAttachmentTargetId

        public void setAttachmentTargetId(java.lang.Long anAttachmentTargetId)
        Sets the attachment target ID used in the attachment relation.
        Specified by:
        setAttachmentTargetId in interface AttachmentRelationBaseDeleteCmd
        Parameters:
        anAttachmentTargetId - The attachment target ID
      • setDeleteByBusinessObject

        public void setDeleteByBusinessObject(java.lang.Boolean aboolDeleteByBusinessObject)
        Sets the option to delete all the attachment relations by business object.
        • True = delete all the attachment relations by the business object specified in the parameter
        • False = delete by attachment relation ID or the unique index of the attachment relation
        By default, this option is set to False.
        Specified by:
        setDeleteByBusinessObject in interface AttachmentRelationBaseDeleteCmd
        Parameters:
        aboolDeleteByBusinessObject - option to delete attachment relation by business object
      • setURL

        public void setURL(java.lang.String astrURL)
        Sets the redirect URL.
        Specified by:
        setURL in interface AttachmentRelationBaseDeleteCmd
        Parameters:
        astrURL - The redirect URL
      • reset

        public void reset()
        Resets the variables used.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand