Class CatalogTools


  • public class CatalogTools
    extends java.lang.Object
    This is tools class of the Catalog extension. It mainly provides methods to copy the items of the Catalog extension from one catalogvserion to a another.
    • Constructor Detail

      • CatalogTools

        public CatalogTools()
    • Method Detail

      • copyProduct

        public static Product copyProduct​(Product oldProd,
                                          CatalogVersion newCV)
        Copies a product and assigning it to the given catalog version
        Parameters:
        oldProd - old product
        newCV - new catalog version
        Returns:
        copied Product
      • copyKeyword

        public static Keyword copyKeyword​(Keyword oldKeywrd,
                                          CatalogVersion newCV)
        Copies a keyword
        Parameters:
        oldKeywrd - old keyword
        newCV - new catalog version
        Returns:
        copied keyword
      • copyMedia

        public static Media copyMedia​(Media oldMedia,
                                      CatalogVersion newCV)
        Copies a media
        Parameters:
        oldMedia - old media
        newCV - new catalog version
        Returns:
        copied media
      • copyCategory

        public static Category copyCategory​(Category oldCat,
                                            CatalogVersion newCV)
        Copies a Catgeory
        Parameters:
        oldCat - old category version
        newCV - new catalog version
        Returns:
        copied category
      • copyAllProducts

        public static java.util.Collection copyAllProducts​(CatalogVersion oldCV,
                                                           CatalogVersion newCV)
        Copies products
        Parameters:
        oldCV - old catalog version
        newCV - new catalog version
        Returns:
        a collection of copied products
      • copyAllCategories

        public static java.util.Collection copyAllCategories​(CatalogVersion oldCV,
                                                             CatalogVersion newCV)
        Copies categories
        Parameters:
        oldCV - old catalog version
        newCV - new catalog version
        Returns:
        a collection of copied categories
      • copyAllKeywords

        public static java.util.Collection copyAllKeywords​(CatalogVersion oldCV,
                                                           CatalogVersion newCV)
        Copies keywords
        Parameters:
        oldCV - old catalog version
        newCV - new catalog version
        Returns:
        collection of copied keywords
      • copyAllMedias

        public static java.util.Collection copyAllMedias​(CatalogVersion oldCV,
                                                         CatalogVersion newCV)
        Copies media
        Parameters:
        oldCV - old catalog version
        newCV - new catalog version
        Returns:
        collection of copied media
      • getCatalogVersionItems

        public static SearchResult getCatalogVersionItems​(java.lang.Class itemclass,
                                                          CatalogVersion catalogVersion,
                                                          int start,
                                                          int count)
        Returns items of specified type which belong to a given catalog version
        Parameters:
        itemclass - the item class
        catalogVersion - catalog version
        start - the range start
        count - the range count
        Returns:
        searchresult which contains a collection of items of the specified itemclass
      • copyItems

        public static java.util.Collection copyItems​(java.util.Collection items,
                                                     CatalogVersion newCV)
        Parameters:
        items - collection with items
        newCV - new catalog version
        Returns:
        collection of copied items