Class CatalogManager

    • Constructor Detail

      • CatalogManager

        public CatalogManager()
    • Method Detail

      • notifyItemRemoval

        protected void notifyItemRemoval​(SessionContext ctx,
                                         Item item)
        Superclass method overridden to avoid calls to ejb layer except for Product and ProductFeature instances.
        Overrides:
        notifyItemRemoval in class Extension
        Parameters:
        ctx - the currency session context
        item - the item which is going to be removed
      • getInstance

        public static CatalogManager getInstance()
        Returns:
        instance of this manager
      • getMediaCode

        public java.lang.String getMediaCode​(java.lang.String catalogID,
                                             java.lang.String catalogVersion,
                                             java.lang.String mediaCode)
      • createKeyword

        public Keyword createKeyword​(CatalogVersion catalogVersion,
                                     java.lang.String keyword,
                                     Language lang)
        Creates an new Keyword for the given CatalogVersion and keyword value.
        Parameters:
        catalogVersion - The CatalogVersion, the keyword will belong to.
        keyword - The keyword value.
        Returns:
        The new Keyword for the given CatalogVersion and keyword value.
      • getDefaultCatalog

        @Deprecated
        public Catalog getDefaultCatalog()
        Deprecated.
        since ages - Use CatalogService.getDefaultCatalog() instead.
      • getKeyword

        public Keyword getKeyword​(CatalogVersion catalogVersion,
                                  java.lang.String keywordValue)
        Returns the Keyword for the specified keyword value and CatalogVersion.
        Parameters:
        catalogVersion - The CatalogVersion the Keyword belongs to.
        keywordValue - The value of the searched Keyword.
        Returns:
        The matching Keyword or null if there is no matching Keyword.
      • getKeyword

        public Keyword getKeyword​(java.lang.String typeCode,
                                  CatalogVersion catalogVersion,
                                  java.lang.String keywordValue)
        Returns the Keyword for the specified keyword value and CatalogVersion.
        Parameters:
        typeCode - of keyword to allow to search for subclasses
        catalogVersion - The CatalogVersion the Keyword belongs to.
        keywordValue - The value of the searched Keyword.
        Returns:
        The matching Keyword or null if there is no matching Keyword.
      • createCatalog

        @Deprecated
        public Catalog createCatalog​(java.lang.String id)
        Deprecated.
        since ages - Use modelService to create new catalog. Use CatalogModel setters to provide attributes values.
        Creates a new Catalog with the given id.
        Parameters:
        id - The id of the new Catalog.
        Returns:
        The new Catalog.
      • createCatalog

        @Deprecated
        public Catalog createCatalog​(java.lang.String id,
                                     java.lang.String name,
                                     Company supplier)
        Deprecated.
        since ages - Use modelService to create new catalog. Use CatalogModel setters to provide attributes values.
        Creates a new Catalog with the given id, name and supplier.
        Parameters:
        id - The id of the new Catalog. The combination of supplier and id must be unique.
        name - The localized name of the Catalog. The current session language is used to set this localized value.
        supplier - The supplier of this Catalog.
        Returns:
        The new Catalog.
      • createCatalogVersion

        @Deprecated
        public CatalogVersion createCatalogVersion​(Catalog catalog,
                                                   java.lang.String version,
                                                   Language importLanguage)
        Deprecated.
        since ages - Use modelService to create new catalogVersion. Use CatalogVersionModel setters to provide attributes values.
        Creates a new CatalogVersion with the given version string and import language for the specified Catalog.
        Parameters:
        catalog - The Catalog for which the new version is created. This value must not be null.
        version - The version string. This value can not be null.
        importLanguage - The inital Language of this catalog version. This value must not be null.
        Returns:
        The new CatalogVersion.
      • createAgreement

        @Deprecated
        public Agreement createAgreement​(java.lang.String id,
                                         java.util.Date startDate,
                                         java.util.Date endDate)
        Deprecated.
        since ages - Use ModelService to create new AgreementModels. Use AgreementModel's setters to provide attribute values.
        Creates a new Agreement with the given id, start- and enddate.
        Parameters:
        id - The id of this Agreement. This value must not be null.
        startDate - The start date of this Agreement.
        endDate - The end date of this Agreement. This value must not be null.
        Returns:
        The new Agreement for the specified parameter values.
      • createAgreement

        @Deprecated
        public Agreement createAgreement​(CatalogVersion catalogVersion,
                                         java.lang.String id,
                                         java.util.Date startDate,
                                         java.util.Date endDate)
        Deprecated.
        since ages - Use ModelService to create new AgreementModels. Use AgreementModel's setters to provide attribute values.
        Creates a new Agreement for the specified CatalogVersion with the given id, start- and enddate.
        Parameters:
        catalogVersion - The CatalogVersion this Agreement belongs to. This value must not be null.
        id - The id of this Agreement. This value must not be null.
        startDate - The start date of this Agreement.
        endDate - The end date of this Agreement. This value must not be null.
        Returns:
        The new Agreement for the specified parameter values.
      • createProductReference

        @Deprecated
        public ProductReference createProductReference​(java.lang.String qualifier,
                                                       Product source,
                                                       Product target,
                                                       java.lang.Integer quantity)
        Deprecated.
        since ages - Use ModelService to create new ProductReferences. Use ProductReferncveModel setters to set attribute values.
        Creates a new ProductReference for the specified parameter values.
        Parameters:
        qualifier - the reference qualifier. This value must not be null.
        source - the source product
        target - the target product
        quantity -
        Returns:
        The new ProductReference for the specified parameter values.
      • getProductReferences

        @Deprecated
        public java.util.Collection<ProductReference> getProductReferences​(java.lang.String qualifier,
                                                                           Product source,
                                                                           Product target,
                                                                           java.lang.Integer quantity,
                                                                           boolean forceQuantitySearch)
        Deprecated.
        since ages - Use one of the ProductReferenceService methods to fetch product references
        Parameters:
        qualifier -
        source -
        target -
        quantity -
        forceQuantitySearch - specifies search behavior for the case that quantity is null. If false it means that all items with any quantity will be returned - if true only items with quantity == null will be returned
        Returns:
        Collection of product references
      • getProductReferences

        @Deprecated
        public java.util.Collection<ProductReference> getProductReferences​(java.lang.String qualifier,
                                                                           Product source,
                                                                           Product target)
        Deprecated.
        since ages - Use one of the ProductReferenceService methods to fetch product references
      • getCatalog

        @Deprecated
        public Catalog getCatalog​(java.lang.String catalogID)
        Deprecated.
        since ages - Use CatalogService.getCatalogForId(String) instead.
        Returns the matching Catalog for the specified supplier and ID.
        Parameters:
        catalogID - The id of the searched Catalog.
        Returns:
        The matching Catalog or null if there is no matching Catalog.
      • getClassificationSystem

        public ClassificationSystem getClassificationSystem​(java.lang.String classificationSystemId)
        Returns the matching ClassificationSystem for the specified id.
        Parameters:
        classificationSystemId - The id of the searched ClassificationSystem.
        Returns:
        The matching ClassificationSystem or null if there is no matching ClassificationSystem.
      • getClassificationClass

        public ClassificationClass getClassificationClass​(java.lang.String systemName,
                                                          java.lang.String versionName,
                                                          java.lang.String classID)
        Finds a classification class directly by specifying its classificaiton system name, system version and class code.
        Parameters:
        systemName -
        versionName -
        classID -
      • getCatalog

        @Deprecated
        public Catalog getCatalog​(java.lang.String supplierUID,
                                  java.lang.String catalogID)
        Deprecated.
        since ages - catalogId is unique, so it is sufficient to search over catalogId only. Use CatalogService.getCatalogForId(String) instead.
        Returns the Catalog with the provided id of Supplier specified by his UID. If either the is no Company with the provided UID or no Catalog for the combination of catalog id and supplier null is returned.
        Parameters:
        supplierUID - The UID of the supplier.
        catalogID - The ID of the searched Catalog.
        Returns:
        The found Catalog or null if no Catalog matches the provided supplier and catalog id.
      • getCatalog

        @Deprecated
        public Catalog getCatalog​(Company supplier,
                                  java.lang.String catalogID)
        Deprecated.
        since ages - catalogId is unique, so it is sufficient to search over catalogId only. Use CatalogService.getCatalogForId(String) instead.
        Returns the matching Catalog for the specified supplier and catalogID.
        Parameters:
        supplier - The supplier of the searched catalog.
        catalogID - The id of the searched Catalog.
        Returns:
        The matching Catalog or null if there is no matching Catalog.
      • getAllCatalogCategories

        @Deprecated
        public java.util.Collection<Category> getAllCatalogCategories​(CatalogVersion catalogVersion)
        Deprecated.
        since ages - useCategoryService instead.
        Returns a collection of all CatalogCategories for the specified CatalogVersion
        Parameters:
        catalogVersion - The CatalogVersion the CatalogCategory should belong to.
        Returns:
        The Collection of matching CatalogCategories.
      • getCompanyByUID

        @Deprecated
        public Company getCompanyByUID​(java.lang.String uid)
        Deprecated.
        since ages - Use UserService.getUserGroupForUID(uid, CompanyModel.class) instead.
        Returns the Company with the specified UID. If no Company can be found with the specified UID, null is returned.
        Parameters:
        uid - The UID of the searched Company.
        Returns:
        The Company with the specified UID or null if there exists no Company with the specified UID.
      • createCompany

        @Deprecated
        public Company createCompany​(java.lang.String uid)
        Deprecated.
        since ages - Use ModelService to create new CompanyModel. Use CompanyModel setters to provide attributes values.
        Creates a new Company with the given uid. By default the value of uid is also used as the name of the Company.
        Parameters:
        uid - The uid of the Company. The uid must be unique within all companies.
        Returns:
        The new Company.
      • createCatalogCategory

        @Deprecated
        public Category createCatalogCategory​(CatalogVersion catalogVersion,
                                              java.lang.String code,
                                              java.lang.String name,
                                              java.lang.String description,
                                              java.lang.Integer order,
                                              java.util.Collection keywords,
                                              Category parent)
        Deprecated.
        since ages - Use ModelService to create new CategoryModel. Use CategoryModel setters to provide attributes values.
        Creates a new CatalogCategory instance for the given CatalogVersion.
        Parameters:
        catalogVersion - The CatalogVersion, this category belongs to. null is not a valid value.
        code - The unique code of this category. (Unique within this CatalogVersion).null is not a valid value.
        name - The localized name of this category. The Language of the current session is used to set this localized value.
        description - The localized description of this category. The Language of the current session is used to set this localized value.
        order - This order can be used to define an order of the subcategories of an CatalogCategory.
        keywords - Collection containing all Keyword s which are associated with the CatalogCategory.
        parent - The parent CatalogCategory instance of this new CatalogCategory.
        Returns:
        The new CatalogCategory instance for the given values.
      • setCatalogVersion

        @Deprecated
        public void setCatalogVersion​(SessionContext ctx,
                                      Product product,
                                      CatalogVersion version)
        Deprecated.
        since ages - Use ProductModel.setCatalogVersion(de.hybris.platform.catalog.model.CatalogVersionModel) instead. Use ModelService to persist model changes.
        Superclass method overridden to change the catalog as well.
        Overrides:
        setCatalogVersion in class GeneratedCatalogManager
        version - the catalogVersion
      • setCatalogVersion

        @Deprecated
        public void setCatalogVersion​(SessionContext ctx,
                                      Category cat,
                                      CatalogVersion catver)
        Deprecated.
        since ages - Use CategoryModel.setCatalogVersion(de.hybris.platform.catalog.model.CatalogVersionModel) instead. Use ModelService to persist model changes.
        Superclass method overridden to change the catalog as well.
      • setCatalogVersion

        @Deprecated
        public void setCatalogVersion​(SessionContext ctx,
                                      Media media,
                                      CatalogVersion version)
        Deprecated.
        since ages - Use MediaModel.setCatalogVersion(de.hybris.platform.catalog.model.CatalogVersionModel) instead. Use ModelService to persist model changes.
        Superclass method overridden to set catalog as well.
        Overrides:
        setCatalogVersion in class GeneratedCatalogManager
        version - the catalogVersion
      • setSessionCatalogVersions

        @Deprecated
        public void setSessionCatalogVersions​(java.util.Collection<CatalogVersion> versions)
        Deprecated.
        since ages - Use CatalogVersionService.setSessionCatalogVersions(Set) instead.
        Changes the catalog versions which are associated to the given session.

        These versions are evaluated by the catalog search restrictions. Those restrictions will take effect only if they apply to the session user!

        Parameters:
        versions - the versions collection
      • setSessionCatalogVersions

        @Deprecated
        public void setSessionCatalogVersions​(SessionContext ctx,
                                              java.util.Collection<CatalogVersion> versions)
        Deprecated.
        since ages - Use CatalogVersionService.setSessionCatalogVersions(Set) instead.
        Changes the catalog versions which are associated to the given session context.

        These versions are evaluated by the catalog search restrictions. Those restrictions will take effect only if they apply to the session user!

        Parameters:
        ctx - the jalo session context to change catalog versions for
        versions - the versions collection
      • isActivatingPreviewMode

        @Deprecated
        public boolean isActivatingPreviewMode​(JaloSession jalosession)
        Deprecated.
        since ages - Use SessionService.getAttribute(CatalogConstants.PREVIEW_MODE_ACTIVATION) in order to read the 'preview mode' flag value.
      • isActivatingPreviewMode

        @Deprecated
        public boolean isActivatingPreviewMode​(SessionContext ctx)
        Deprecated.
        since ages - Use SessionService.getAttribute(CatalogConstants.PREVIEW_MODE_ACTIVATION) in order to read the 'preview mode' flag value.
      • getSessionCatalogVersions

        @Deprecated
        public java.util.Collection<CatalogVersion> getSessionCatalogVersions​(JaloSession jalosession)
        Deprecated.
        since ages - Use CatalogVersionService.getSessionCatalogVersions() instead.
        Tells which catalog versions are currently associated with the given jalo session.

        These versions are evaluated by the catalog search restrictions. Those restrictions will take effect only if they apply to the session user!

        Parameters:
        jalosession - the jalo session to get the catalog versions from
      • getSessionCatalogVersions

        @Deprecated
        public java.util.Collection<CatalogVersion> getSessionCatalogVersions​(SessionContext ctx)
        Deprecated.
        since ages - Use CatalogVersionService.getSessionCatalogVersions() instead.
        Tells which catalog versions are currently associated with the given jalo session context.

        These versions are evaluated by the catalog search restrictions. Those restrictions will take effect only if they apply to the session user!

        Parameters:
        ctx - the session contex to evaluate
      • getAvailableCatalogVersions

        @Deprecated
        public java.util.Collection<CatalogVersion> getAvailableCatalogVersions​(JaloSession jalosession)
        Deprecated.
        since ages - Use CatalogVersionService.getAllReadableCatalogVersions(PrincipalModel currentUser) instead. UserService allows to fetch current user: UserService.getCurrentUser().
        Returns all catalog versions available to this jalo session. Right now this will return all catalog versions in the system. In future there may be different versions available per user.
        Parameters:
        jalosession - the jalo session to get all available versions for
      • createCatalogSyncMediaFolder

        public void createCatalogSyncMediaFolder()
      • getCatalogSyncMediaFolder

        public MediaFolder getCatalogSyncMediaFolder()
      • notifyInitializationEnd

        public void notifyInitializationEnd​(java.util.Map<java.lang.String,​java.lang.String> params,
                                            JspContext ctx)
                                     throws java.lang.Exception
        Overrides:
        notifyInitializationEnd in class Extension
        Throws:
        java.lang.Exception
      • createSavedQueries

        public void createSavedQueries​(JspContext jspc)
      • getZipEntryInputStream

        protected java.io.InputStream getZipEntryInputStream​(java.util.zip.ZipFile zipfile,
                                                             java.lang.String entryName)
                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • createBatchMedia

        protected ImpExMedia createBatchMedia​(java.lang.String fileName,
                                              java.lang.String mime,
                                              java.io.InputStream istr)
      • getCategoryProductLinks

        @Deprecated
        public java.util.Collection<Link> getCategoryProductLinks​(CatalogVersion catalogVersion,
                                                                  Category category,
                                                                  Product product)
        Deprecated.
        since ages
      • getProductByCatalogVersion

        public Product getProductByCatalogVersion​(CatalogVersion catalogVersion,
                                                  java.lang.String productCode)
      • getAllCatalogs

        @Deprecated
        public java.util.Set<Catalog> getAllCatalogs()
        Deprecated.
        since ages - Use CatalogService.getAllCatalogs() instead.
        Returns all catalogs within the system.
      • getAllCatalogVersions

        @Deprecated
        public java.util.Set<CatalogVersion> getAllCatalogVersions()
        Deprecated.
        since ages - Use CatalogVersionService.getAllCatalogVersions() instead.
        Returns all catalog versions within the system.
        Returns:
        all catalog versions
      • getAllClassificationSystems

        public java.util.Set<ClassificationSystem> getAllClassificationSystems()
        Returns all classification systems within the system.
      • getAllClassificationSystemVersions

        @Deprecated
        public java.util.Set<ClassificationSystemVersion> getAllClassificationSystemVersions()
        Deprecated.
        since ages - Use ClassificationSystemVersionDao.findAllClassificationSystemVersions() instead.
        Returns all classification system versions within the system.
        Returns:
        all classification system versions within the system.
      • getLanguageIfExists

        @Deprecated
        public Language getLanguageIfExists​(java.lang.String isoCode)
        Deprecated.
        since ages - Use CommonI18NService.getLanguage(String) instead.
      • createUsersAndGroupsAndRights

        public void createUsersAndGroupsAndRights()
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createDefaultCatalog

        public boolean createDefaultCatalog​(JspContext jspc)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • configureDefaultSynchronization

        public void configureDefaultSynchronization​(JspContext jspc)
      • configureSynchronizationJob

        public SyncItemJob configureSynchronizationJob​(java.lang.String code,
                                                       Catalog catalog,
                                                       java.lang.String sourceVersion,
                                                       java.lang.String targetVersion,
                                                       boolean createNewItems,
                                                       boolean removeMissingItems)
        Configures a publication rule (as SyncItemJob item) between a specified source catalog version and target catalog version with a given catalog.

        If no such item exists a new one is being created.

        Parameters:
        code - the code of the publication rule
        catalog - the catalog to search source and target version within
        sourceVersion - the source version qualifier
        targetVersion - the target version qualifier
        createNewItems - whether or not the publication should create items which are missing in target version
        removeMissingItems - whether or not the publication should remove items which exist in target version only
        Returns:
        the publication rule item
      • newDefaultSyncJobInstance

        protected SyncItemJob newDefaultSyncJobInstance​(java.util.Map attributes)
      • getCreatorParameterDefault

        public java.lang.String getCreatorParameterDefault​(java.lang.String param)
        Description copied from class: Extension
        Override this method to provide default value for the given creator parameter.
        Overrides:
        getCreatorParameterDefault in class Extension
        Parameters:
        param - the name of the parameter
        Returns:
        default value for the given creator parameter; use null when the parameter should have no default value
      • getCreatorParameterPossibleValues

        public java.util.List<java.lang.String> getCreatorParameterPossibleValues​(java.lang.String param)
        Description copied from class: Extension
        Override this method to provide a list of all possible values for the given creator parameter. If not null the list of these values will be shown to the user of system creator and no other values will be possible to set.
        Overrides:
        getCreatorParameterPossibleValues in class Extension
        Parameters:
        param - the name of the parameter
        Returns:
        list of all possible values for the given creator parameter; use null when this parameter should have no restriction of possible values
      • getTypeQualifier

        public java.lang.String getTypeQualifier​(Address address)
      • setApprovalStatus

        @Deprecated
        public void setApprovalStatus​(Category cat,
                                      EnumerationValue status,
                                      boolean recursively,
                                      boolean asTransaction)
        Deprecated.
        since ages
        Changes the approval status of all products within a given category.
        Parameters:
        cat - the category which products are changed
        status - the new approval status
        recursively - if true products of all subcategories are changed too
        asTransaction - if true the whole operation is wrapped inside a transaction - for large category structures this may exceed the transaction timeout and should be disabled in that case
        Since:
        1.31
      • getLastSyncModifiedTime

        public java.util.Date getLastSyncModifiedTime​(SyncItemJob job,
                                                      Item src,
                                                      Item copy)
      • removeProductReferencesFor

        protected void removeProductReferencesFor​(SessionContext ctx,
                                                  Product prod)
      • removeSyncTimestampsFor

        protected void removeSyncTimestampsFor​(SessionContext ctx,
                                               Item forItem)
      • createDefaultCompareCatalogVersionCronJob

        public CompareCatalogVersionsCronJob createDefaultCompareCatalogVersionCronJob​(CatalogVersion source,
                                                                                       CatalogVersion target,
                                                                                       Customer priceCompareCustomer,
                                                                                       java.lang.Double tolerance,
                                                                                       java.lang.Boolean searchMissingProducts,
                                                                                       java.lang.Boolean searchMissingCategories,
                                                                                       java.lang.Boolean searchNewProducts,
                                                                                       java.lang.Boolean searchNewCategories,
                                                                                       java.lang.Boolean searchPriceDiffs,
                                                                                       java.lang.Boolean overwriteStatus)
      • getOrCreateDefaultRemoveCatalogVersionJob

        public RemoveCatalogVersionJob getOrCreateDefaultRemoveCatalogVersionJob()
      • getAllCatalogItemRootTypes

        @Deprecated
        public java.util.Set<ComposedType> getAllCatalogItemRootTypes()
        Deprecated.
        since ages - Use CatalogVersionService.getAllCatalogVersionAwareTypes(true) instead.
        Returns all composed types which are marked as holding catalog capable items. If the super-type of a composed type is allready marked as holding catalog capable items then this subtype is not included in the set.
        Returns:
        a Set with (Super)ComposedType which are marked as holding catalog capable items
      • getAllCatalogItemTypes

        @Deprecated
        public java.util.Set<ComposedType> getAllCatalogItemTypes()
        Deprecated.
        since ages - Use CatalogTypeService.getAllCatalogVersionAwareTypes(false) instead.
        Returns all composed types (also the subtypes) which are marked as holding catalog capable items.
      • isCatalogItem

        @Deprecated
        public boolean isCatalogItem​(Item item)
        Deprecated.
        since ages - Use CatalogTypeService.isCatalogVersionAwareModel(de.hybris.platform.core.model.ItemModel) instead.
        Tells whether or not a item is a catalog contained item. This is always true for items of type Product, Categoryand Media. Optionally any item which jalo class implements CatalogItemis considered as catalog item.
      • isCatalogItem

        @Deprecated
        public boolean isCatalogItem​(ComposedType comptyp)
        Deprecated.
        since ages - Use CatalogTypeService.isCatalogVersionAwareModel(de.hybris.platform.core.model.ItemModel) instead.
        Tells whether or not a item is a catalog contained item. This is always true for items of type Product, Categoryand Media. Optionally any item which jalo class implements CatalogItemis considered as catalog item.
      • isCatalogItem

        @Deprecated
        public boolean isCatalogItem​(java.lang.Class itemclass)
        Deprecated.
        since ages - please useisCatalogItem(ComposedType) instead
        Tells whether or not a item class belongs to a catalog contained item. This is always true for classes of type Product,Categoryand Media. Optionally any class which implements CatalogItemis considered as catalog item.
      • getCatalogVersion

        @Deprecated
        public CatalogVersion getCatalogVersion​(Item item)
        Deprecated.
        since ages - Use CatalogTypeService.getCatalogVersion(de.hybris.platform.core.model.ItemModel) instead.
        Retrieves the owning catalog version for a catalog item. The default SessionContext us used.
        Throws:
        JaloInvalidParameterException - if the item is no catalog item or its type does not provide a catalog version attribute
        See Also:
        isCatalogItem(Item)
      • getCounterpartItem

        @Deprecated
        public Item getCounterpartItem​(Item sourceItem,
                                       CatalogVersion targetVersion)
                                throws JaloInvalidParameterException
        Deprecated.
        since ages - Use CatalogTypeService.getCatalogVersionAwareModel(CatalogVersionModel, String, Map) instead.
        Locates the counterpart item of a given catalog item with a target catalog version. Here the unique key attribute is required to find this item.

        Please note that this method does not check if the source item has been synchronized and a ItemSyncTimestamp exists. Use getSynchronizedCopy(Item, SyncItemJob) to locate a existing synchronized item.

        Parameters:
        sourceItem - the source item to locate the counterpart
        targetVersion - the target version to search within
        Returns:
        the counterpart item from the target version or null if no such item exist
        Throws:
        JaloInvalidParameterException - if either no unique key attribute is available, the attribute is not searchable or the source item is no instance of this type
      • getCounterpartItem

        @Deprecated
        public Item getCounterpartItem​(SessionContext ctx,
                                       Item sourceItem,
                                       CatalogVersion targetVersion)
                                throws JaloInvalidParameterException
        Deprecated.
        since ages - Use CatalogTypeService.getCatalogVersionAwareModel(CatalogVersionModel, String, Map) instead.
        Locates the counterpart item of a given catalog item with a target catalog version. Here the unique key attribute is required to find this item.

        Please note that this method does not check if the source item has been synchronized and a ItemSyncTimestamp exists. Use getSynchronizedCopy(Item, SyncItemJob) to locate a existing synchronized item.

        Parameters:
        ctx - the session context
        sourceItem - the source item to locate the counterpart
        targetVersion - the target version to search within
        Returns:
        the counterpart item from the target version or null if no such item exist
        Throws:
        JaloInvalidParameterException - if either no unique key attribute is available, the attribute is not searchable or the source item is no instance of this type
      • getCatalogItemID

        public java.lang.String getCatalogItemID​(Item catalogItem)
                                          throws JaloInvalidParameterException
        Returns the ID of a catalog item. Currently this method recognizes products, categories, medias, keywords and items implementing CatalogItem.
        Parameters:
        catalogItem -
        Throws:
        JaloInvalidParameterException - in case the item is no supported catalog item
      • hasUniqueKeyAttributes

        @Deprecated
        public boolean hasUniqueKeyAttributes​(ComposedType comptyp)
        Deprecated.
        since ages - Check ComposedTypeModel.getUniqueKeyAttributes() instead.
      • getUniqueKeyAttributeQualifiers

        @Deprecated
        public java.util.Set<java.lang.String> getUniqueKeyAttributeQualifiers​(ComposedType comptyp)
        Deprecated.
        since ages - Use CatalogTypeService.getCatalogVersionUniqueKeyAttribute(String typeCode) instead;
        Returns all configured unique key attribute qualifiers for a given composed type. Please note that this method will noch check if the qualifiers really match existing attribute descriptors!
        Parameters:
        comptyp -
      • getOldest

        public static Item getOldest​(java.util.Collection items)
      • getFirstOne

        public static final java.lang.Object getFirstOne​(java.util.Collection coll)
        Tool method which returns just the first element of a collection.
        Parameters:
        coll - the collection to get the first element from
        Returns:
        the first element of the collection or null if the collection is empty or null
      • mustSetCatalogVersions

        public static boolean mustSetCatalogVersions​(JaloSession jaloSession,
                                                     javax.servlet.http.HttpServletRequest req)
      • filterByURL

        protected java.util.Collection filterByURL​(javax.servlet.http.HttpServletRequest request,
                                                   java.util.Collection allActiveVersions)
      • collectPreviewTicketVersions

        protected java.util.Collection<PreviewTicket> collectPreviewTicketVersions​(javax.servlet.http.HttpServletRequest request,
                                                                                   JaloSession jaloSession)
      • assignCatalogVersions

        protected void assignCatalogVersions​(javax.servlet.http.HttpServletRequest request,
                                             JaloSession jaloSession,
                                             java.util.Collection<CatalogVersion> versions,
                                             boolean previewMode)
      • doPreRequest

        public void doPreRequest​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
        Specified by:
        doPreRequest in interface WebRequestInterceptor
      • doPostRequest

        public void doPostRequest​(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
        Specified by:
        doPostRequest in interface WebRequestInterceptor
      • canSync

        public boolean canSync​(SessionContext ctx,
                               User sessionUser,
                               SyncItemJob sync)
        This method will be called by the SynchronizeCatalogVersionWizard for determining if the current user is allowed to execute a synchronization task. (PLA-7821)

        Checks the write permissions of the assigned user
        Following checks will be executed:

      • 1. Checks if the user is a member of the assigned SyncUsers/SyncGroups (see SyncItemJob)
      • 1.1.If TRUE, then write permissions will be granted and no further checking will be processed
      • 2. Depending on the flag 'syncUsersOnly' (see SyncItemJob), users which are NOT specified as SyncUser but have 'general' write permissions
        for this catalog version will get 'Write' permissions, too
Parameters:
ctx -
sessionUser -
sync -
Returns:
true if sync. is permitted for the specified user