All Classes Namespaces Functions Properties Pages
Public Member Functions | List of all members
CategoryService Class Reference

Provides methods to create, update, delete and retrieve the categories. More...

Public Member Functions

CategoryIdentity AddCategory (string sessionId, Category category)
 Adds a new category, and associated resources, with the specified details. More...
 
void DeleteCategory (string sessionId, CategoryIdentity category)
 Deletes the specified category. More...
 
CategorySummaryCollection GetCategories (string sessionId, CategoryFilter categoryFilter)
 Retrieves the list of categories for the specified search criteria. More...
 
Category GetCategory (string sessionId, CategoryIdentity categoryIdentity)
 Retrieves the specified category. More...
 
CategorySummaryCollection GetImmediateSubcategories (string sessionId, CategoryIdentity parentCategoryIdentity)
 Retrieves the immediate subcategories of the specified category. More...
 
bool HasAccess (string sessionId, CategoryIdentity category)
 Determines whether the resource has access to a specified category. More...
 
void UpdateCategory (string sessionId, Category category)
 Updates a category with the specified details More...
 

Description

Provides methods to create, update, delete and retrieve the categories.

Member Functions

CategoryIdentity AddCategory ( string  sessionId,
Category  category 
)

Adds a new category, and associated resources, with the specified details.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
categoryA Category object containing the category information that needs to be added.
Name Type Comment Required
Identity Identity Id of the category Yes - Name is required
Description String Text description of the category No
ResourceAccess Collection List of resources with access to the category Yes - at least one must be specified
ParentCategory Identity Category to mark as the parent of this one No

Details of ResourceAccess
Name Type Comment Required
Id Identity Id of the resource Yes - Name is required
AccessType Int16 Not used No
PermissionType Int16 Not used No
Returns
A CategoryIdentity object that contains the unique identity of the category that has been added.
Name Type Comment
Id String Id of the category
Name String Name of the category
Security
Resource must have at least Read Write access permission on Server ACL.
void DeleteCategory ( string  sessionId,
CategoryIdentity  category 
)

Deletes the specified category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
categoryA CategoryIdentity object containing the category identity that needs to be deleted.
Name Type Comment Required
Id String Id of the category Yes, if Name is not specified
Name String Name of the category Yes, if Id is not specified
Security
Resource must have at least Read Write access permission on Server ACL.
CategorySummaryCollection GetCategories ( string  sessionId,
CategoryFilter  categoryFilter 
)

Retrieves the list of categories for the specified search criteria.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
categoryFilterA CategoryFilter object containing the search criteria to retrieve the categories.
Name Type Comment Required
CategoryLevel Int16 Whether the category is a parent, child or both No
ParentCategory Identity The parent category Yes - if CategoryLevel is 1 (Child)
CheckAccess Boolean Whether to check if the user has access to each category No
SearchText String Narrows the search to categories whose names contain the specified text No
Returns
A CategorySummaryCollection collection of CategorySummary that has the details of the categories that match the search criteria.
Name Type Comment Required
Identity Identity Id of the category No
Description String Text description of the category No
ParentCategory Identity Details of the category's parent category No
CategorySummaryCollection Collection A collection of CategorySummary that have this category marked as their parent category. No
Remarks
At least one field of CategoryFilter must be populated
CheckAccess is not used if sessionId is set to SPP_SYSTEM_SESSION_ID
This method does different things depending on the value of CategoryLevel:
  • CategoryLevel = 0 (Parent) This returns only categories that have no parent category
  • CategoryLevel = 1 (Child) This is the equivalent of GetImmediateSubcategories except it is affected by CheckAccess and SearchText
  • CategoryLevel = 2 (All) This returns all categories except those the user doesn't have access to if CheckAccess is set to true
Security
No restrictions apply.
Category GetCategory ( string  sessionId,
CategoryIdentity  categoryIdentity 
)

Retrieves the specified category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
categoryIdentityA CategoryIdentity object containing the category identity that needs to be retrieved.
Name Type Comment Required
Id String Id of the category Yes, if Name is not specified
Name String Name of the category Yes, if Id is not specified
Returns
A Category object that contains the category information.
Name Type Comment
Identity Identity Id of the category
Description String Text description of the category
ResourceAccess Collection List of resources with access to the category
ParentCategory Identity Details of the category's parent category
Security
No restrictions apply.
CategorySummaryCollection GetImmediateSubcategories ( string  sessionId,
CategoryIdentity  parentCategoryIdentity 
)

Retrieves the immediate subcategories of the specified category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
parentCategoryIdentityA Model.Categories.CategoryIdentity containing the unique identity of the parent category to retrieve its immediate sub categories.
Name Type Comment Required
Id String Id of the category Yes, if Name is not specified
Name String Name of the category Yes, if Id is not specified
Returns
A Model.Categories.CategorySummaryCollection object contains the summary of the immediate sub categories of the specified parent category.
Name Type Comment
Identity Identity Id of the category
Description String Text description of the category
ParentCategory Identity Details of the category's parent category
CategorySummaryCollection Collection Not populated
Security
No restrictions apply.
bool HasAccess ( string  sessionId,
CategoryIdentity  category 
)

Determines whether the resource has access to a specified category.

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
categoryDetails of the Category to check.
Name Type Comment Required
Id String Id of the category Yes, if Name is not specified
Name String Name of the category Yes, if Id is not specified
Returns
true if the resource has access to a specified category; otherwise, false.
Security
No restrictions apply.
void UpdateCategory ( string  sessionId,
Category  category 
)

Updates a category with the specified details

Parameters
sessionIdA string that uniquely identifies the Session for the current logged on user. If the SessionId is invalid then an exception will be raised.
categoryA Category object containing the category information that needs to be updated.
Name Type Comment Required
Identity Identity Id of the category Yes - Id or Name is required
Description String Text description of the category No
ResourceAccess Collection List of resources with access to the category No
ParentCategory Identity Details of the category's parent category No
Security
Resource must have at least Read Write access permission on Server ACL.