com.ibm.commerce.filepublish.util

Class ContentManagedFileHandlerImpl

  • java.lang.Object
    • com.ibm.commerce.filepublish.util.ContentManagedFileHandlerImpl
  • All Implemented Interfaces:
    ContentManagedFileHandler


    public class ContentManagedFileHandlerImpl
    extends java.lang.Object
    implements ContentManagedFileHandler
    Implementation for ContentManagedFileHandler.
    Behavior:
    Retrieve the list of content managed files from the databases. The list of content managed files contains 2 sets:
    • content managed files that need to be committed to the Commerce EAR;
    • content managed files that are marked for delete.
    When the files have been committed, it will update them in the database to indicate that these files have been committed to the file system. When the files have been removed from the Commerce EAR, it will permanently delete them in the database. Files that have been removed from the Commerce EAR are marked as ready for deletion.
    The procedure to do these is to first call and initialize this class. And then call the prepareContentManagedFiles() to prepare and retrieve the list of content managed files ready for Commerce EAR update.
    The getContentManagedFile(int) can be used to get the individual content managed file in the list.
    promoteContentManagedFiles() will go through each content managed file in the list. It will update the committed files in the database and permanently delete the unwanted files.

    AccessBean:
    • ManagedFileAccessBean
    Utility:
    • ContentManagedFile
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM internal copyright field.
        See Also:
        Constant Field Values
      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The CLASSNAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • ContentManagedFileHandlerImpl

        public ContentManagedFileHandlerImpl()
                                      throws ECException
        Default constructor for ContentManagedFileHandlerImpl
        Throws:
        ECException - Any exception captured
    • Method Detail

      • getNumOfFiles

        public int getNumOfFiles()
        Returns the total number of content managed files.
        Specified by:
        getNumOfFiles in interface ContentManagedFileHandler
        Returns:
        The total number of managed files.
      • getNumOfFilesForCommit

        public int getNumOfFilesForCommit()
        Returns the total number of content managed files ready for commit.
        Specified by:
        getNumOfFilesForCommit in interface ContentManagedFileHandler
        Returns:
        The total number of managed files ready for commit.
      • getNumOfFilesForDelete

        public int getNumOfFilesForDelete()
        Returns the total number of marked for delete content managed files.
        Specified by:
        getNumOfFilesForDelete in interface ContentManagedFileHandler
        Returns:
        The total number of marked for delete content managed files.
      • getContentManagedFile

        public ContentManagedFile getContentManagedFile(int aIndex)
                                                 throws ECException
        Prepares and gets the content managed file in the specified index If the index is out of range, then a null will be returned.
        Specified by:
        getContentManagedFile in interface ContentManagedFileHandler
        Parameters:
        aIndex - The index for the list of content managed files.
        Returns:
        The content managed file.
        Throws:
        ECException - Any exception captured when retrieving the content managed file. A possible error maybe when the file content is not found.
      • promoteContentManagedFiles

        public void promoteContentManagedFiles(java.lang.Short anPublished)
                                        throws ECException
        Update the list of content managed files in the database. For files that are committed to the file system, it will set the promote to file system flag for the files. For files that are marked for deleted, published, and removed from the file system, it will permanently delete these files. The content managed files to be committed are those with the file promotion flag set to true in the ContentManagedFile. The content managed files for delete are those with their mark for delete flag set to ready for delete in the ContentManagedFile. set the published parameter to 1 if the files are also published.
        Specified by:
        promoteContentManagedFiles in interface ContentManagedFileHandler
        Parameters:
        anPublished - set to 1 if the files are also published. If null then it will not update the published flag.
        Throws:
        ECException - Any exception captured. Possible error may includes problems in retrieving the access bean for the managed file or updating it.
      • cleanUpMarkForDeleteContentManagedFiles

        public void cleanUpMarkForDeleteContentManagedFiles(java.lang.Short anPublished)
                                                     throws ECException
        Clean up the list of mark for delete content managed file. A mark for delete, published, and null content managed file will be deleted from the database.
        Specified by:
        cleanUpMarkForDeleteContentManagedFiles in interface ContentManagedFileHandler
        Parameters:
        anPublished - The published flag set by user
        Throws:
        ECException - Exception
      • prepareContentManagedFiles

        public void prepareContentManagedFiles(java.sql.Timestamp atmLastUploadTimestamp)
                                        throws ECException
        Prepare and retrieve the list of content managed files.
        Specified by:
        prepareContentManagedFiles in interface ContentManagedFileHandler
        Parameters:
        atmLastUploadTimestamp - The last upload timestamp
        Throws:
        ECException - Any exception captured.