com.dotmarketing.portlets.categories.business
Interface CategoryAPI

All Known Implementing Classes:
CategoryAPIImpl

public interface CategoryAPI

This class defines the API contract of methods usable to control cms categories

Since:
1.5.1.1
Author:
David Torres

Method Summary
 void addChild(Categorizable parent, Category child, java.lang.String relationType, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This method adds the given category to parent children list
 void addChild(Categorizable parent, Category child, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This method adds the given category to parent children list
 void addParent(Categorizable child, Category parent, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Adds the given category as a parent of the given children category
 boolean canAddChildren(Category cat, com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
 boolean canAddToTopLevel(com.liferay.portal.model.User user)
           
 boolean canEditCategory(Category cat, com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
 boolean canUseCategory(Category cat, com.liferay.portal.model.User user, boolean respectFrontendRoles)
           
 void clearCache()
          This is a low level method only intended to be use for maintenance purposes
 void delete(Category object, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Totally removes a category from the system
 Category find(java.lang.String id, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This method get a category object from the cache based on the passed inode, if the object does not exist a null value is returned
 java.util.List<Category> findAll(com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of all the categories in the system
 Category findByKey(java.lang.String key, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This method get a category object from the cache based on the passed key, if the object does not exist a null value is returned
 Category findByName(java.lang.String name, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Deprecated. This method shouldn't be used because it might have more than one category with the same name
 java.util.List<Category> findTopLevelCategories(com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of all top level categories in the system
 void flushChildrenCache()
          This method flushes the children cache
 java.util.List<Category> getAllChildren(Category category, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Recursive Method that returns a list of categories given a parent category, it does not take into account the whole hierarchy, instead all categories are being added to the categories list being returned.
 java.util.List<Category> getCategoryTreeDown(Categorizable categorizable, Category catToSearchFrom, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Will return to you all category hierarchy (children and subchildren and so on) who are attached to the categorizable and are below the passed category
 java.util.List<Category> getCategoryTreeUp(Category child, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves a list all the line of parent categories of the given child category a final fake top category is added at the beginning of the list to represent the top of the hierarchy
 java.util.List<Category> getChildren(Categorizable parent, boolean onlyActive, java.lang.String orderBy, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets
 java.util.List<Category> getChildren(Categorizable parent, boolean onlyActive, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets
 java.util.List<Category> getChildren(Categorizable parent, java.lang.String relationType, boolean onlyActive, java.lang.String orderBy, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets
 java.util.List<Category> getChildren(Categorizable parent, java.lang.String orderBy, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets
 java.util.List<Category> getChildren(Categorizable parent, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets
 java.util.List<Category> getParents(Categorizable child, boolean onlyActive, java.lang.String relationType, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of parents categories associated to the given id/inode
 java.util.List<Category> getParents(Categorizable child, boolean onlyActive, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of parents categories associated to the given id/inode
 java.util.List<Category> getParents(Categorizable child, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Retrieves the list of parents categories associated to the given id/inode
 boolean hasDependencies(Category cat)
          check If the category has dependencies.
 void removeChild(Categorizable parent, Category child, java.lang.String relationType, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Removes from the list of children categories the given child
 void removeChild(Categorizable parent, Category child, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Removes from the list of children categories the given child
 void removeChildren(Categorizable parent, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Removes all the associated children categories of the given parent
 void removeParent(Categorizable child, Category parent, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Associates the given the list of categories as parents of the given children id Older parents gets removed from the list
 void removeParents(Categorizable child, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Removes the parents associated to the given children category
 void save(Category parent, Category object, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Saves categories, When saving a new category the parent should be passed to the API to check if the user has permissions to add children to the parent and the parent will be associated to the passed category object
 void setChildren(Categorizable parent, java.util.List<Category> children, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          This methods associates the given children list to the given parent
 void setParents(Categorizable child, java.util.List<Category> parents, com.liferay.portal.model.User user, boolean respectFrontendRoles)
          Associates to the given list of categories as parents of the child id/inode Older parents gets replaced by the new list
 

Method Detail

canUseCategory

boolean canUseCategory(Category cat,
                       com.liferay.portal.model.User user,
                       boolean respectFrontendRoles)
                       throws DotDataException
Parameters:
cat -
user -
respectFrontendRoles -
Returns:
boolean on whether or not a user can use a category.
Throws:
DotDataException

canAddChildren

boolean canAddChildren(Category cat,
                       com.liferay.portal.model.User user,
                       boolean respectFrontendRoles)
                       throws DotDataException
Parameters:
cat -
user -
respectFrontendRoles -
Returns:
boolean on whether or not a user can add a child category.
Throws:
DotDataException

canAddToTopLevel

boolean canAddToTopLevel(com.liferay.portal.model.User user)
Parameters:
user -
Returns:
Whether the user can add a category to the top level. If it is a top parent category.

canEditCategory

boolean canEditCategory(Category cat,
                        com.liferay.portal.model.User user,
                        boolean respectFrontendRoles)
                        throws DotDataException
Parameters:
cat -
user -
respectFrontendRoles -
Returns:
boolean on whether or not a user can edit a category.
Throws:
DotDataException

delete

void delete(Category object,
            com.liferay.portal.model.User user,
            boolean respectFrontendRoles)
            throws DotDataException,
                   DotSecurityException
Totally removes a category from the system

Parameters:
object -
Throws:
DotDataException
DotSecurityException

find

Category find(java.lang.String id,
              com.liferay.portal.model.User user,
              boolean respectFrontendRoles)
              throws DotDataException,
                     DotSecurityException
This method get a category object from the cache based on the passed inode, if the object does not exist a null value is returned

Parameters:
id -
Returns:
Throws:
DotDataException
DotSecurityException

findByKey

Category findByKey(java.lang.String key,
                   com.liferay.portal.model.User user,
                   boolean respectFrontendRoles)
                   throws DotDataException,
                          DotSecurityException
This method get a category object from the cache based on the passed key, if the object does not exist a null value is returned

Parameters:
id -
Returns:
Throws:
DotDataException
DotSecurityException

findByName

Category findByName(java.lang.String name,
                    com.liferay.portal.model.User user,
                    boolean respectFrontendRoles)
                    throws DotDataException,
                           DotSecurityException
Deprecated. This method shouldn't be used because it might have more than one category with the same name

This method get a category object based on its name this method needs to be used carefully because it might have more than one category with the same name

Parameters:
name -
Returns:
Throws:
DotDataException
DotSecurityException

findAll

java.util.List<Category> findAll(com.liferay.portal.model.User user,
                                 boolean respectFrontendRoles)
                                 throws DotDataException,
                                        DotSecurityException
Retrieves the list of all the categories in the system

Returns:
Throws:
DotDataException
DotSecurityException

findTopLevelCategories

java.util.List<Category> findTopLevelCategories(com.liferay.portal.model.User user,
                                                boolean respectFrontendRoles)
                                                throws DotDataException,
                                                       DotSecurityException
Retrieves the list of all top level categories in the system

Returns:
Throws:
DotDataException
DotSecurityException

save

void save(Category parent,
          Category object,
          com.liferay.portal.model.User user,
          boolean respectFrontendRoles)
          throws DotDataException,
                 DotSecurityException
Saves categories, When saving a new category the parent should be passed to the API to check if the user has permissions to add children to the parent and the parent will be associated to the passed category object

Parameters:
parent - Parent can be null if saving an old category
object -
user -
Throws:
DotDataException
DotSecurityException

getChildren

java.util.List<Category> getChildren(Categorizable parent,
                                     boolean onlyActive,
                                     com.liferay.portal.model.User user,
                                     boolean respectFrontendRoles)
                                     throws DotDataException,
                                            DotSecurityException
Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets

Parameters:
id -
Returns:
Throws:
DotDataException
DotSecurityException

getChildren

java.util.List<Category> getChildren(Categorizable parent,
                                     java.lang.String relationType,
                                     boolean onlyActive,
                                     java.lang.String orderBy,
                                     com.liferay.portal.model.User user,
                                     boolean respectFrontendRoles)
                                     throws DotDataException,
                                            DotSecurityException
Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets

Parameters:
id -
relationType -
orderBy - - can be null
Returns:
Throws:
DotDataException
DotSecurityException

getChildren

java.util.List<Category> getChildren(Categorizable parent,
                                     com.liferay.portal.model.User user,
                                     boolean respectFrontendRoles)
                                     throws DotDataException,
                                            DotSecurityException
Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets

Parameters:
id -
Returns:
Throws:
DotDataException
DotSecurityException

getChildren

java.util.List<Category> getChildren(Categorizable parent,
                                     boolean onlyActive,
                                     java.lang.String orderBy,
                                     com.liferay.portal.model.User user,
                                     boolean respectFrontendRoles)
                                     throws DotDataException,
                                            DotSecurityException
Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets

Parameters:
parent -
orderBy -
Returns:
Throws:
DotDataException
DotSecurityException

getChildren

java.util.List<Category> getChildren(Categorizable parent,
                                     java.lang.String orderBy,
                                     com.liferay.portal.model.User user,
                                     boolean respectFrontendRoles)
                                     throws DotDataException,
                                            DotSecurityException
Retrieves the list of children categories associated to the given id/inode, this method can be used to retrived associated categories to another type of objects like categories associated to contentlets

Parameters:
parent -
orderBy -
Returns:
Throws:
DotDataException
DotSecurityException

setChildren

void setChildren(Categorizable parent,
                 java.util.List<Category> children,
                 com.liferay.portal.model.User user,
                 boolean respectFrontendRoles)
                 throws DotDataException,
                        DotSecurityException
This methods associates the given children list to the given parent

Parameters:
parentId -
children -
Throws:
DotDataException
DotSecurityException

addChild

void addChild(Categorizable parent,
              Category child,
              com.liferay.portal.model.User user,
              boolean respectFrontendRoles)
              throws DotDataException,
                     DotSecurityException
This method adds the given category to parent children list

Parameters:
parentId -
children -
Throws:
DotDataException
DotSecurityException

addChild

void addChild(Categorizable parent,
              Category child,
              java.lang.String relationType,
              com.liferay.portal.model.User user,
              boolean respectFrontendRoles)
              throws DotDataException,
                     DotSecurityException
This method adds the given category to parent children list

Parameters:
parentId -
children -
Throws:
DotDataException
DotSecurityException

removeChildren

void removeChildren(Categorizable parent,
                    com.liferay.portal.model.User user,
                    boolean respectFrontendRoles)
                    throws DotDataException,
                           DotSecurityException
Removes all the associated children categories of the given parent

Parameters:
parentId -
children -
Throws:
DotDataException
DotSecurityException

removeChild

void removeChild(Categorizable parent,
                 Category child,
                 com.liferay.portal.model.User user,
                 boolean respectFrontendRoles)
                 throws DotDataException,
                        DotSecurityException
Removes from the list of children categories the given child

Parameters:
parentId -
children -
Throws:
DotDataException
DotSecurityException

removeChild

void removeChild(Categorizable parent,
                 Category child,
                 java.lang.String relationType,
                 com.liferay.portal.model.User user,
                 boolean respectFrontendRoles)
                 throws DotDataException,
                        DotSecurityException
Removes from the list of children categories the given child

Parameters:
parent -
child -
user -
relationType -
respectFrontendRoles -
Throws:
DotDataException
DotSecurityException

getParents

java.util.List<Category> getParents(Categorizable child,
                                    com.liferay.portal.model.User user,
                                    boolean respectFrontendRoles)
                                    throws DotDataException,
                                           DotSecurityException
Retrieves the list of parents categories associated to the given id/inode

Parameters:
id -
Returns:
Throws:
DotDataException
DotSecurityException

getParents

java.util.List<Category> getParents(Categorizable child,
                                    boolean onlyActive,
                                    java.lang.String relationType,
                                    com.liferay.portal.model.User user,
                                    boolean respectFrontendRoles)
                                    throws DotDataException,
                                           DotSecurityException
Retrieves the list of parents categories associated to the given id/inode

Parameters:
relationType -
id -
onlyActive -
Returns:
Throws:
DotDataException
DotSecurityException

getParents

java.util.List<Category> getParents(Categorizable child,
                                    boolean onlyActive,
                                    com.liferay.portal.model.User user,
                                    boolean respectFrontendRoles)
                                    throws DotDataException,
                                           DotSecurityException
Retrieves the list of parents categories associated to the given id/inode

Parameters:
id -
Returns:
Throws:
DotDataException
DotSecurityException

setParents

void setParents(Categorizable child,
                java.util.List<Category> parents,
                com.liferay.portal.model.User user,
                boolean respectFrontendRoles)
                throws DotDataException,
                       DotSecurityException
Associates to the given list of categories as parents of the child id/inode Older parents gets replaced by the new list

Parameters:
children -
parents -
Throws:
DotDataException
DotSecurityException

addParent

void addParent(Categorizable child,
               Category parent,
               com.liferay.portal.model.User user,
               boolean respectFrontendRoles)
               throws DotDataException,
                      DotSecurityException
Adds the given category as a parent of the given children category

Parameters:
children -
parents -
Throws:
DotDataException
DotSecurityException

removeParents

void removeParents(Categorizable child,
                   com.liferay.portal.model.User user,
                   boolean respectFrontendRoles)
                   throws DotDataException,
                          DotSecurityException
Removes the parents associated to the given children category

Parameters:
children -
parents -
Throws:
DotDataException
DotSecurityException

removeParent

void removeParent(Categorizable child,
                  Category parent,
                  com.liferay.portal.model.User user,
                  boolean respectFrontendRoles)
                  throws DotDataException,
                         DotSecurityException
Associates the given the list of categories as parents of the given children id Older parents gets removed from the list

Parameters:
children -
parents -
Throws:
DotDataException
DotSecurityException

getAllChildren

java.util.List<Category> getAllChildren(Category category,
                                        com.liferay.portal.model.User user,
                                        boolean respectFrontendRoles)
                                        throws DotDataException,
                                               DotSecurityException
Recursive Method that returns a list of categories given a parent category, it does not take into account the whole hierarchy, instead all categories are being added to the categories list being returned.

Parameters:
category -
Returns:
Throws:
DotDataException
DotSecurityException

getCategoryTreeUp

java.util.List<Category> getCategoryTreeUp(Category child,
                                           com.liferay.portal.model.User user,
                                           boolean respectFrontendRoles)
                                           throws DotDataException,
                                                  DotSecurityException
Retrieves a list all the line of parent categories of the given child category a final fake top category is added at the beginning of the list to represent the top of the hierarchy

Parameters:
cat -
l -
Returns:
Throws:
DotDataException
DotSecurityException

getCategoryTreeDown

java.util.List<Category> getCategoryTreeDown(Categorizable categorizable,
                                             Category catToSearchFrom,
                                             com.liferay.portal.model.User user,
                                             boolean respectFrontendRoles)
                                             throws DotDataException,
                                                    DotSecurityException
Will return to you all category hierarchy (children and subchildren and so on) who are attached to the categorizable and are below the passed category

Parameters:
categorizable -
catToSearchFrom -
user -
respectFrontendRoles -
Returns:
Throws:
DotDataException
DotSecurityException

clearCache

void clearCache()
This is a low level method only intended to be use for maintenance purposes


hasDependencies

boolean hasDependencies(Category cat)
                        throws DotDataException
check If the category has dependencies.

Parameters:
category -
Returns:
Throws:
DotSecurityException
DotDataException

flushChildrenCache

void flushChildrenCache()
This method flushes the children cache



Copyright © 2010 dotCMS Inc. All Rights Reserved.