com.ibm.pim.interfaces.category
Interface Category


public interface Category

Read-only interface for Category object (belongs to a Hierarchy, and groups Items)


Field Summary
static java.lang.String copyright
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String path)
          Get an attribute value.
 int getAttributeOccurrenceCount(java.lang.String path)
          Returns the number of occurrences of a particular attribute of this Category, specified by path
 PIMCollection getChildCategories()
          Retrieves a collection of Categories that are children of this Category
 java.lang.String getDisplayName()
          Returns the name of this Category object
 Hierarchy getHierarchy()
          Returns the Hierarchy object containing this Category object.
 java.lang.String getPrimaryKey()
          Return the primary key of this Category
 boolean isRoot()
          Identifies whether this Category is the root Category of the Hierarchy it lives within
 

Field Detail

copyright

public static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

getHierarchy

public Hierarchy getHierarchy()
                       throws PIMInternalException,
                              PIMAuthorizationException
Returns the Hierarchy object containing this Category object.

Returns:
the Hierarchy object to which this Category object belongs
Throws:
PIMInternalException - if an internal error occurs
PIMAuthorizationException - if the user is not authorized to perform this operation

getDisplayName

public java.lang.String getDisplayName()
                                throws PIMInternalException,
                                       PIMAuthorizationException
Returns the name of this Category object

Returns:
The name of the Category object as a String
Throws:
PIMInternalException - if an internal error occurs
PIMAuthorizationException - if the user is not authorized to perform this operation *

getChildCategories

public PIMCollection getChildCategories()
                                 throws PIMInternalException,
                                        PIMAuthorizationException
Retrieves a collection of Categories that are children of this Category

Returns:
A PIMCollection of Category objects representing the immediate child categories. Please note this is a lazily instantiated collection
Throws:
PIMInternalException - if an internal error occurs
PIMAuthorizationException - if the user is not authorized to perform this operation *
See Also:
for more info

isRoot

public boolean isRoot()
               throws PIMInternalException,
                      PIMAuthorizationException
Identifies whether this Category is the root Category of the Hierarchy it lives within

Returns:
true if this Category is the root category of its Hierarchy, otherwise false
Throws:
PIMInternalException - if an internal error occurs
PIMAuthorizationException - if the user is not authorized to perform this operation *

getAttribute

public java.lang.Object getAttribute(java.lang.String path)
                              throws PIMInternalException,
                                     PIMAuthorizationException
Get an attribute value.

Multi-Occurrence attributes will be returned as a java.util.List of Occurrences. You can determine whether a particular attribute is single or multi-Occurrence by calling getAttributeOccurrenceCount(String).

Parameters:
path - A path to an existing attribute or a multi-Occurrence parent attribute. This should contain the full path of the attribute required, e.g. "MySpec/MyString1"
Returns:
The attribute value as an Object. The type of that Object corresponds to the attribute types as follows

Attribute typeJava type Notes
Binary String This is the file name
Currency Double The currency symbol needs to be retrieved from the SpecNode
Date Date
Flag Boolean
Image String This is the file name
Image URL String
Integer Integer
Lookup Table String This is the lookup table entry key. It is left to the caller to retrieve values from the appropriate lookup table
Number Double
Number Enumeration Double
Password String Password is returned in the clear
Relationship Item The Item which this relationship points to
Sequence Integer
String String
String Enumeration String
Thumbnail Image String This is the file name
Thumbnail Image URL String
Timezone String Timezone is returned in WPC native form
URL String

It is left to the caller to cast the returned Object to the appropriate type.

Throws:
java.lang.IllegalArgumentException
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - If the user is not allowed to perform this operation

getAttributeOccurrenceCount

public int getAttributeOccurrenceCount(java.lang.String path)
                                throws PIMInternalException,
                                       PIMAuthorizationException
Returns the number of occurrences of a particular attribute of this Category, specified by path

Parameters:
path - A String containing the full path of the attribute required, e.g. "MySpec/MyString1"
Returns:
An integer containing the total number of occurrences of this attribute.
Throws:
PIMInternalException - if an internal error occurs
PIMAuthorizationException - if the user is not authorized to perform this operation

getPrimaryKey

public java.lang.String getPrimaryKey()
                               throws PIMInternalException,
                                      PIMAuthorizationException
Return the primary key of this Category

Returns:
The primary key for this Category represented as a String
Throws:
PIMInternalException - if an internal error occurs
PIMAuthorizationException - if the user is not authorized to perform this operation