Class Category

    • Field Detail

      • DISABLE_SUBCATEGORY_REMOVALCHECK

        public static final java.lang.String DISABLE_SUBCATEGORY_REMOVALCHECK
        SessionContext attribute flag for disabling the subcategory check when removing category
        See Also:
        Constant Field Values
      • DISABLE_SETALLOWEDPRINCIPAL_RECURSIVELY

        public static final java.lang.String DISABLE_SETALLOWEDPRINCIPAL_RECURSIVELY
        SessionContext attribute flag for set allowed principals. If the flag is enabled only for the given category the principals are set
        See Also:
        Constant Field Values
      • DISABLE_CYCLIC_CHECKS

        @Deprecated
        public static final java.lang.String DISABLE_CYCLIC_CHECKS
        Deprecated.
        since ages - please use Constants.DISABLED_CYCLIC_CHECKS instead
        Session attribute to disable checking for cyclic structures. Since cyclic structures are not supported by the category model the caller has to do own checking!
         SessionContext myCtx = jaloSesson.createSessionContext();
         myCtx.setAttribute(Constants.DISABLE_CYCLIC_CHECKS, Boolean.TRUE);
         // now this will not raise an error :
         category.addToSubcategory(category.getSuperCategory());
         
        Since:
        1.31
    • Constructor Detail

      • Category

        public Category()
    • Method Detail

      • createItem

        @Deprecated
        protected Item createItem​(SessionContext ctx,
                                  ComposedType type,
                                  Item.ItemAttributeMap allAttributes)
                           throws JaloBusinessException
        Deprecated.
        since ages
        create the item you can delete this method if you don't want to intercept the creation of this item
        Overrides:
        createItem in class GenericItem
        Parameters:
        ctx - the current session context which this item is created within
        type - the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )
        Returns:
        the new item instance
        Throws:
        JaloBusinessException - indicates an error during creation - any changes will be rollbacked
      • toString

        public java.lang.String toString()
        Description copied from class: Item
        Returns the String representation of this item. This is by default the representation of the primary key of this item.
        Overrides:
        toString in class Item
        Returns:
        the String representation of this item.
      • getCode

        @Deprecated
        public java.lang.String getCode()
        Deprecated.
        since ages
        Description copied from class: GeneratedCategory
        Generated method - Getter of the Category.code attribute.
        Overrides:
        getCode in class GeneratedCategory
        Returns:
        the code - Code
      • getSubcategories

        @Deprecated
        public java.util.Collection<Category> getSubcategories()
        Deprecated.
        since ages
        Gets subcategories of this category.
        Returns:
        subcategories of this category
      • getSubcategories

        @Deprecated
        public java.util.List<Category> getSubcategories​(SessionContext ctx)
        Deprecated.
        since ages
        Gets subcategories of this category.
        Parameters:
        ctx - session context
        Returns:
        subcategories of this category
      • getSubcategoryCount

        @Deprecated
        public long getSubcategoryCount()
        Deprecated.
        since ages
        Returns the amount of subcategories of this category. This method should be preferred over getSubcategories().size() since it does not actually load the subcategories.
      • getAllSubcategories

        @Deprecated
        public java.util.Collection<Category> getAllSubcategories()
        Deprecated.
        since ages - useCategoryModel.getAllSubcategories() instead.
        Gets all subcategories of this category. This includes its own subcategories and all their subcategories.
        Returns:
        all categories below this category
        Since:
        1.3.1
      • getAllSubcategories

        @Deprecated
        public java.util.Collection<Category> getAllSubcategories​(SessionContext ctx)
        Deprecated.
        since ages - useCategoryModel.getAllSubcategories() instead.
        Gets all subcategories of this category. This includes its own subcategories and all their subcategories.
        Parameters:
        ctx - session context
        Returns:
        all categories below this category
        Since:
        1.3.1
      • getAllSubcategoriesCount

        @Deprecated
        public int getAllSubcategoriesCount()
        Deprecated.
        since ages - useCategoryModel.getAllSubcategories() and method size() on result instead.
        Counts all subcategories of this category excluding duplicately linked categories.
        Since:
        2.10
      • setCategories

        @Deprecated
        public void setCategories​(Category... categories)
        Deprecated.
        since ages
      • setCategories

        @Deprecated
        public void setCategories​(SessionContext ctx,
                                  Category... categories)
        Deprecated.
        since ages
      • setSupercategories

        @Deprecated
        public void setSupercategories​(Category... superCategories)
        Deprecated.
        since ages
      • setSupercategories

        @Deprecated
        public void setSupercategories​(SessionContext ctx,
                                       Category... superCategories)
        Deprecated.
        since ages
      • disableChecks

        @Deprecated
        protected boolean disableChecks​(SessionContext ctx)
        Deprecated.
        since ages
      • setSubcategories

        @Deprecated
        public void setSubcategories​(java.util.List<Category> subcategories)
        Deprecated.
        since ages
        Sets the subcategories of this category.
        Parameters:
        subcategories - subcategories to set
      • setSubcategories

        @Deprecated
        public void setSubcategories​(SessionContext ctx,
                                     java.util.List<Category> subcategories)
        Deprecated.
        since ages
        Sets the subcategories of this category.
        Parameters:
        ctx - session context
        subcategories - subcategories to set
      • addSubcategory

        @Deprecated
        public void addSubcategory​(Category category)
        Deprecated.
        since ages
        Adds given category to subcategories of this category.
        Parameters:
        category - the category to be added
      • addSubcategory

        @Deprecated
        public void addSubcategory​(SessionContext ctx,
                                   Category category)
        Deprecated.
        since ages
        Adds given category to subcategories of this category.
        Parameters:
        ctx - session context
        category - the category to be added
      • addSubcategories

        @Deprecated
        public void addSubcategories​(java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Adds given categories to subcategories of this category.
        Parameters:
        categories - Categories to be added
      • addSubcategories

        @Deprecated
        public void addSubcategories​(SessionContext ctx,
                                     java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Adds given categories to subcategories of this category.
        Parameters:
        ctx - session context
        categories - Categories to be added
      • removeSubcategory

        @Deprecated
        public void removeSubcategory​(Category category)
        Deprecated.
        since ages
        Removes given category from subcategories of this category.
        Parameters:
        category - the category to be removed from subcategories
      • removeSubcategory

        @Deprecated
        public void removeSubcategory​(SessionContext ctx,
                                      Category category)
        Deprecated.
        since ages
        Removes given category from subcategories of this category.
        Parameters:
        ctx - session context
        category - the category to be removed from subcategories
      • removeSubcategories

        @Deprecated
        public void removeSubcategories​(java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Removes given categories from subcategories of this category.
        Parameters:
        categories - Categories to be removed from subcategories
      • removeSubcategories

        @Deprecated
        public void removeSubcategories​(SessionContext ctx,
                                        java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Removes given categories from subcategories of this category.
        Parameters:
        ctx - session context
        categories - Categories to be removed from subcategories
      • getSupercategory

        @Deprecated
        public Category getSupercategory()
        Deprecated.
        since ages
        Gets one supercategory of this category or null if none is found. This method should be used only in cases without multiple supercategories - otherwise it cannot be predicted which supercategories is chosen!
        To get all supercategories use GeneratedCategory.getSupercategories().
        Returns:
        the first found supercategory or null if this category has no supercategories
      • getSupercategory

        @Deprecated
        public Category getSupercategory​(SessionContext ctx)
        Deprecated.
        since ages
        Gets one supercategory of this category or null if none is found. This method should be used only in cases without multiple supercategories - otherwise it cannot be predicted which supercategors is chosen!
        To get all supercategories use GeneratedCategory.getSupercategories().
        Parameters:
        ctx - the session context
        Returns:
        the first found supercategory or null if this category has no supercategories
      • getSupercategoryCount

        @Deprecated
        public long getSupercategoryCount()
        Deprecated.
        since ages
        Returns the amount of supercategories of this category. This method should be preferred over getSupercategories().size() since it does not actually load the subcategories.
      • isEmpty

        @Deprecated
        public boolean isEmpty()
        Returns true if neither products nor subcategories belong to this category. This method should be preferred over getProducts().size().isEmpty() && getSubcategories().isEmpty() since it does not actually load the products and categories.
      • getAllSupercategories

        @Deprecated
        public java.util.Collection<Category> getAllSupercategories()
        Deprecated.
        since ages - useCategoryModel.getAllSupercategories() instead.
        Gets all supercategories of this category. This includes its own supercategories and all their supercategories.
        Returns:
        all categories above this category
        Since:
        1.3.1
      • getAllSupercategories

        @Deprecated
        public java.util.Collection<Category> getAllSupercategories​(SessionContext ctx)
        Deprecated.
        since ages - useCategoryModel.getAllSubcategories() instead.
        Gets all supercategories of this category. This includes its own supercategories and all their supercategories.
        Parameters:
        ctx - session context
        Returns:
        all categories above this category
        Since:
        1.3.1
      • addSupercategory

        @Deprecated
        public void addSupercategory​(Category category)
        Deprecated.
        since ages
        Adds given category to supercategories of this category.
        Parameters:
        category - the category to be added
      • addSupercategory

        @Deprecated
        public void addSupercategory​(SessionContext ctx,
                                     Category category)
        Deprecated.
        since ages
        Adds given category to supercategories of this category.
        Parameters:
        ctx - session context
        category - the category to be added
      • addSupercategories

        @Deprecated
        public void addSupercategories​(java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Adds given categories to supercategories of this category.
        Parameters:
        categories - Categories to be added
      • addSupercategories

        @Deprecated
        public void addSupercategories​(SessionContext ctx,
                                       java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Adds given categories to supercategories of this category.
        Parameters:
        ctx - session context
        categories - Categories to be added
      • removeSupercategory

        @Deprecated
        public void removeSupercategory​(Category category)
        Deprecated.
        since ages
        Removes given category from supercategories of this category.
        Parameters:
        category - the category to be removed from supercategories
      • removeSupercategory

        @Deprecated
        public void removeSupercategory​(SessionContext ctx,
                                        Category category)
        Deprecated.
        since ages
        Removes given category from supercategories of this category.
        Parameters:
        ctx - session context
        category - the category to be removed from supercategories
      • removeSupercategories

        @Deprecated
        public void removeSupercategories​(java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Removes given categories from supercategories of this category.
        Parameters:
        categories - Categories to be removed from supercategories
      • removeSupercategories

        @Deprecated
        public void removeSupercategories​(SessionContext ctx,
                                          java.util.Collection<Category> categories)
        Deprecated.
        since ages
        Removes given categories from supercategories of this category.
        Parameters:
        ctx - session context
        categories - Categories to be removed from supercategories
      • addProduct

        @Deprecated
        public void addProduct​(Product product)
        Deprecated.
        since ages
        Adds given product to this category.
        Parameters:
        product - product to be added
      • addProduct

        @Deprecated
        public void addProduct​(SessionContext ctx,
                               Product product)
        Deprecated.
        since ages
        Adds given product to this category.
        Parameters:
        ctx - session context
        product - to be added
      • addProduct

        @Deprecated
        public void addProduct​(Product product,
                               int position,
                               boolean shift)
        Deprecated.
        since ages
        Adds given product to this category at given position.
        Parameters:
        product - product to be added
        position - which will be set and used for sorting products
        shift - whether succeeding products should shift their positions according to new product position or not
      • addProduct

        @Deprecated
        public void addProduct​(SessionContext ctx,
                               Product product,
                               int position,
                               boolean shift)
        Deprecated.
        since ages
        Adds given product to this category at given position.
        Parameters:
        ctx - session context
        product - to be added
        position - which will be set and used for sorting products
        shift - whether succeeding products should shift their positions according to new product position or not
      • addProducts

        @Deprecated
        public void addProducts​(java.util.Collection<Product> products)
        Deprecated.
        since ages
        Adds given products to this category at position 0. Existing products will be shifted.
        Parameters:
        products - to be added
      • addProducts

        @Deprecated
        public void addProducts​(SessionContext ctx,
                                java.util.Collection<Product> products)
        Deprecated.
        since ages
        Adds given products to this category at position 0. Existing products will be shifted.
        Parameters:
        ctx - session context
        products - to be added
      • removeProduct

        @Deprecated
        public void removeProduct​(Product product)
        Deprecated.
        since ages
        Removes given product from this category.
        Parameters:
        product - to be removed from this category
      • removeProduct

        @Deprecated
        public void removeProduct​(SessionContext ctx,
                                  Product product)
        Deprecated.
        since ages
        Removes given product from this category.
        Parameters:
        ctx - session context
        product - to be removed from this category
      • removeProducts

        @Deprecated
        public void removeProducts​(java.util.Collection<Product> products)
        Deprecated.
        since ages
        Removes given products from this category.
        Parameters:
        products - to be removed from this category
      • removeProducts

        @Deprecated
        public void removeProducts​(SessionContext ctx,
                                   java.util.Collection<Product> products)
        Deprecated.
        since ages
        Removes given products from this category.
        Parameters:
        ctx - session context
        products - to be removed from this category
      • isRootAsPrimitive

        public boolean isRootAsPrimitive​(SessionContext ctx)
        Returns:
        true of this is a root category
      • isRootAsPrimitive

        public boolean isRootAsPrimitive()
        Returns:
        true of this is a root category
      • setAllowedPrincipalsOnlyForPassedCategory

        public void setAllowedPrincipalsOnlyForPassedCategory​(SessionContext ctx,
                                                              java.util.List<Principal> value)
      • pullUpAllowedPrincipalInternals

        @Deprecated
        protected void pullUpAllowedPrincipalInternals​(SessionContext ctx,
                                                       Category superCat,
                                                       java.util.List<Principal> newOnes)
        Deprecated.
        since ages - covered byCategoryPrincipalStrategy.
        Just adds principals which are not yet included in allowed principal set. Missing principals are not removed here!
        Parameters:
        ctx -
        newOnes - the principal set to pull up
      • isSubcategoryRemovalCheckDisabled

        @Deprecated
        protected boolean isSubcategoryRemovalCheckDisabled​(SessionContext ctx)
        Deprecated.
        since ages - covered byCategoryRemovalValidator.
        Parameters:
        ctx - the session context
        Returns:
        true if in the given SessionContext the attribute DISABLE_SUBCATEGORY_REMOVALCHECK exists AND the value of this attribute is true