Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Class DKAttrGroupDefICM

java.lang.Object
  |
  +--com.ibm.mm.sdk.common.dkAbstractAttrGroupDef
        |
        +--com.ibm.mm.sdk.common.DKAttrGroupDefICM
All Implemented Interfaces:
dkAttrGroupDef, DKMessageId, java.io.Serializable

public class DKAttrGroupDefICM
extends dkAbstractAttrGroupDef
implements java.io.Serializable

DKAttrGroupDefICM : This class is used to represent attribute group definition in Content Manager server. An attribute group is composed of several related individual attributes that must exist together as a group. For example, the attribute group Address can be defined to contain attributes StreetAddress, City, and ZipCode. These attributes must be defined together as a group in order to make the definition valid. As a regular attribute, an attribute group has basic properties, such as, name, description, and so forth. Persistent operations on attribute group definition are also supported via add, update, and delete methods. This class has methods to manage the list of attributes belong to this group. Reference attributes are represented using this attribute group class. When defining an item-type, you can include attribute groups as well as regular attributes. See related classes DKAttrDefICM, DKItemTypeDefICM, and DKItemTypeViewDefICM. Since Version 8

See Also:
Serialized Form

Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Constructor Summary
DKAttrGroupDefICM()
          The default constructor for constructing an attribute group
DKAttrGroupDefICM(DKAttrGroupDefICM group)
          A copy constructor for attribute group definition for ICM datastore.
DKAttrGroupDefICM(dkDatastore ds)
          Constructs an attribute group definition for the given ICM datastore
DKAttrGroupDefICM(dkDatastore ds, int opt)
          Constructs an attribute group definition for the given ICM datastore
 
Method Summary
 void add()
          Adds this attribute group defintion to the persistent store
 void addAttr(dkAttrDef attr)
          Adds a new attribute to this attribute group.
 void del()
          Deletes this attribute group definition from the persistent store.
 int getAttrCount()
          Gets the number of attributes in this attribute group
 java.lang.String getDescription()
          Gets the description of this attribute group
 java.lang.String getDescription(java.lang.String langCode)
          Gets the description of this attribute group in the given language.
 int getID()
          Gets this attribute group identifier
 short getRefDeleteRule()
          Gets the delete rule for this reference attribute group
 int getReferenceSequenceNumber()
          Gets the first sequence number for this reference attribute group.
 boolean isReferenceAttributeGroup()
          Checks if this attribute group is a reference attribute.
 java.lang.String[] listAttrNames()
          Lists the names of attribute defined in the attribute group.
 java.lang.String[] listAttrNames(int option)
          Lists the names of attribute defined in this attribute group filterd according to the specified options.
 dkCollection listAttrs()
          List attributes defined in this attribute group
 dkCollection listAttrs(int option)
          List attributes defined in this attribute group filtered according to the specified option.
 void removeAttr(java.lang.String attrName)
          Removes the specified attribute from this attribute group.
 void setDescription(java.lang.String descrip)
          Sets the description for this attribute group the language code for this method is 'ENU'
 void setDescription(java.lang.String desc, java.lang.String langCode)
          Sets the description of this attribute group for the given language.
 void setID(int id)
          Sets the attribute group identifier
 void setRefDeleteRule(short refDeleteRule)
          Sets the reference delete rule for this reference attribute group The reference delete rule governs the action to be done to the target reference when the instance of the component having this reference attribute (or source reference) is deleted.
 void setReferenceSequenceNumber(int seqNo)
          Set the first sequence number for this reference attribute group.
 void update()
          Updates this attribute group definition in the persistent store You can not update an attribute group if it is already associated with an item-type.
 void updateAttr(dkAttrDef def)
          Updates the definition of the given attribute in this attribute group.
 
Methods inherited from class com.ibm.mm.sdk.common.dkAbstractAttrGroupDef
clearCache, datastoreType, getDatastore, getName, setDatastore, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DKAttrGroupDefICM

public DKAttrGroupDefICM()
The default constructor for constructing an attribute group

DKAttrGroupDefICM

public DKAttrGroupDefICM(dkDatastore ds)
Constructs an attribute group definition for the given ICM datastore
Parameters:
ds - the ICM datastore

DKAttrGroupDefICM

public DKAttrGroupDefICM(dkDatastore ds,
                         int opt)
Constructs an attribute group definition for the given ICM datastore
Parameters:
ds - - the ICM datastore
option - to indicate if this attribute group is a reference attribute. The caller need to set this option value to DKConstantICM.DK_ICM_REFERENCE_ATTRGROUP to specify that this attribute is a reference attribute. This is the way to create a reference attribute. The default is a regular attribute group, not a reference attribute, so in this case the other two constructors can be used instead.

DKAttrGroupDefICM

public DKAttrGroupDefICM(DKAttrGroupDefICM group)
A copy constructor for attribute group definition for ICM datastore.
Parameters:
an - DKAttrGroupDefICM object
Method Detail

add

public void add()
         throws DKException,
                java.lang.Exception
Adds this attribute group defintion to the persistent store
Throws:
if - there is no attribute defined in this attribute group.

del

public void del()
         throws DKException,
                java.lang.Exception
Deletes this attribute group definition from the persistent store. This attribute group can not be associated with an existing item-type, otherwise the delete operation will throw an exception.
Throws:
if - user tried to delete an attribute group that associates with an item type

update

public void update()
            throws DKException,
                   java.lang.Exception
Updates this attribute group definition in the persistent store You can not update an attribute group if it is already associated with an item-type. You only can update attribute group description in this release. If you want to change the number of attributes( add or delete) in this group you can call delete first and then add method.
Throws:
if - user tried to update an attribute group that assoicates with an item type or user tried to add or remove attribute from this attribute group.

getAttrCount

public int getAttrCount()
                 throws DKException,
                        java.lang.Exception
Gets the number of attributes in this attribute group
Returns:
the number of attributes in this attribute group
Throws:
if - attribute group doesn't exist in persistent store.

getID

public int getID()
Gets this attribute group identifier
Returns:
the identifier of this attribute group

setID

public void setID(int id)
Sets the attribute group identifier
Parameters:
id, - the identifier of this attribute group

getDescription

public java.lang.String getDescription()
Gets the description of this attribute group
Returns:
the description of this attribute group.

setDescription

public void setDescription(java.lang.String descrip)
                    throws DKException,
                           java.lang.Exception
Sets the description for this attribute group the language code for this method is 'ENU'
Parameters:
descrip, - the description to be assigned to this attribute group
Throws:
if - the length of this attribute group description exceeds 254 characters.

getDescription

public java.lang.String getDescription(java.lang.String langCode)
                                throws DKException,
                                       java.lang.Exception
Gets the description of this attribute group in the given language.
Parameters:
langCode, - the language code The valid language codes are: "AFR", "ARA", "BEL", "BGR", "CAT", "CHT", "CHS", "CSY", "CZE", "DAN", "DEU", "DES", "ELL", "ENA", "ENG", "ENU", "FRB", "FRC", "ENP", "ESP", "FIN", "FRA", "FRS", "GAE", "HEB", "HRV", "HUN", "ISL", "ITA", "ITS", "JPN", "KOR", "MKD", "NLD", "NLB", "NON", "NOR", "PLK", "PTB", "PTG", "RMS", "ROM", "RUS", "SKY", "SLO", "SQI", "SRB", "SRL", "SVE", "THA", "TRK", "UKR", "URD"
Returns:
the description for this attribute group

setDescription

public void setDescription(java.lang.String desc,
                           java.lang.String langCode)
                    throws DKException,
                           java.lang.Exception
Sets the description of this attribute group for the given language.
Parameters:
langCode, - the language code
desc, - the description of this attribute group
Throws:
if - the length of this attribute group description exceeds 254 characters.

listAttrs

public dkCollection listAttrs()
                       throws DKException,
                              java.lang.Exception
List attributes defined in this attribute group
Overrides:
listAttrs in class dkAbstractAttrGroupDef
Returns:
a dkCollection of DKAttrDefICM objects
Throws:
if - the attribute group doesn't exist in the persistent store

listAttrs

public dkCollection listAttrs(int option)
                       throws DKException,
                              java.lang.Exception
List attributes defined in this attribute group filtered according to the specified option.
Returns:
a dkCollection of DKAttrDefICM objects
Throws:
if - the attribute group doesn't exist in the persistent store

listAttrNames

public java.lang.String[] listAttrNames()
                                 throws DKException,
                                        java.lang.Exception
Lists the names of attribute defined in the attribute group.
Overrides:
listAttrNames in class dkAbstractAttrGroupDef
Returns:
an array of attribute names for attributes in this attribute group.
Throws:
if - the attribute group doesn't exist in the persistent store.

listAttrNames

public java.lang.String[] listAttrNames(int option)
                                 throws DKException,
                                        java.lang.Exception
Lists the names of attribute defined in this attribute group filterd according to the specified options.
Returns:
an array of attribute names
Throws:
if - this attribute group doesn't exist in the persistent store

addAttr

public void addAttr(dkAttrDef attr)
             throws DKAlreadyExistException,
                    DKException,
                    java.lang.Exception
Adds a new attribute to this attribute group. This is in-memory operation only. The new definition of this attribute group will be made persistent when the user calls add() or update() method on this class.
Overrides:
addAttr in class dkAbstractAttrGroupDef
Parameters:
attr - A DKAttrDefICM object
Throws:
DKAlreadyExistException - if the attribute already exists in the attribute group

updateAttr

public void updateAttr(dkAttrDef def)
                throws DKException,
                       java.lang.Exception
Updates the definition of the given attribute in this attribute group. This is in-memory operation only. The new definition of this attribute group will be made persistent when the user calls add() or update() method on this class.
Parameters:
attr - A DKAttrDefICM object
Throws:
if - the attribute doesn't exist in this attribute group.

removeAttr

public void removeAttr(java.lang.String attrName)
                throws DKNotExistException,
                       DKException
Removes the specified attribute from this attribute group. This is in-memory operation only. The new definition of this attribute group will be made persistent when the user calls add() or update() method on this class.
Overrides:
removeAttr in class dkAbstractAttrGroupDef
Parameters:
attrName - name of the attribute need to be removed
Throws:
DKNotExistException - if the attribute name does not exists in this attribute group

getReferenceSequenceNumber

public int getReferenceSequenceNumber()
Gets the first sequence number for this reference attribute group. The sequence number is determined according to the position of this reference attribute in the component type where it belongs. This call only applies for reference attribute.
Returns:
the first attribute sequence number in this reference attribute group
See Also:
setReferenceSequenceNumber(int)

setReferenceSequenceNumber

public void setReferenceSequenceNumber(int seqNo)
Set the first sequence number for this reference attribute group. The first sequence number is equal to the position of this reference attribute in the component type where it belongs. This call only applicable for reference attribute.
Parameters:
seqNo - the sequence number

isReferenceAttributeGroup

public boolean isReferenceAttributeGroup()
Checks if this attribute group is a reference attribute. Returns true if this attribute group is a reference attribute. Returns false if it is a regular attribute group.
Returns:
a boolean value true or false.

getRefDeleteRule

public short getRefDeleteRule()
Gets the delete rule for this reference attribute group
Returns:
the delete rule of the attibute group. See the method setRefDeleteRule(short) in this class for more information on delete rules..
See Also:
setRefDeleteRule(short)

setRefDeleteRule

public void setRefDeleteRule(short refDeleteRule)
Sets the reference delete rule for this reference attribute group The reference delete rule governs the action to be done to the target reference when the instance of the component having this reference attribute (or source reference) is deleted.
Parameters:
refDeleteRule - reference delete rule The possible values are:
  • DKConstantICM.DK_ICM_DELETE_RULE_NO_ACTION No action. Delete is prevented and an exception is thrown
  • DKConstantICM.DK_ICM_DELETE_RULE_SET_NULLSet null. The source reference is deleted and relationship with the target reference is removed.
  • DKConstantICM.DK_ICM_DELETE_RULE_CASCADECascade on deletion. The source and target reference are both deleted.
  • DKConstantICM.DK_ICM_DELETE_RULE_RESTRICTRestrict on deletion. Same as no action

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.