com.ibm.gre.samples.collectionhelpers
Class IRMFields

java.lang.Object
  |
  +--com.ibm.gre.samples.collectionhelpers.IRMFields

public class IRMFields
extends java.lang.Object

The IRMFields class encapsulates a Fields element from a Records manager Complex Fields Collection returned by one of the TemplateControllerEJB methods. This class can be used to help get and set values for Adding, Editing and Displaying Records Manager Components. See the documentation for the TemplateControllerEJB interface contained in the com.ibm.gre.engine.ejb.facade package in the IBM DB2 Records Manager API Reference for examples and explanations of methods that will return or accept Complex Fields Collection XML values.


Constructor Summary
IRMFields(java.lang.String xml)
          Constructor
 
Method Summary
 int getDisplayCount()
          The number of Field objects that have been specified to be displayed.
 IRMField getField(int index)
          Get the IRMField object for the specified index.
 IRMField getFieldByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm)
          Gets the IRMField object for the specified FlPlnCmpntAttrDefColNm.
 int getFieldsCount()
          The number of Field objects that the class contains.
 int getFlPlnCmpntDefID()
          The ID of the Component Definition type that the Fields class reprepresents.
 java.lang.String getMaxCaption()
          This method returns the number of characters contained in the longest Caption in the Fields Collection.
 java.lang.String getXMLForAdd()
          This method returns a properly formatted XML String that can be used as input to calls to the Records Manager TemplateControllerEJB methods addNewFilePlanComponent or addNewSystemComponent.
 void hideSecurityFields()
          This is a convenience method for setting the visability attribute to Security Fields, indicating they should not be displayed.
 void inactivateSecurityFields()
          A convenience method for in-activating security fields.
 void setActiveStateByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm, boolean active)
          Sets a flag indicating whether a specified field should be include in values for Add or update.
 boolean setFieldByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm, java.lang.String val)
          Set the value of the underlying Field Element for the Component Attribute specified by the FlPlnCmpntAttrDefColNm.
 void setVisabilityByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm, boolean makeVisable)
          Set the visability of a specified Field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IRMFields

public IRMFields(java.lang.String xml)
          throws com.ibm.gre.engine.util.RecordManagerException,
                 java.lang.Exception
Constructor

Parameters:
xml - A Complex Fields Collection String value.
Throws:
com.ibm.gre.engine.util.RecordManagerException
java.lang.Exception
Method Detail

getFlPlnCmpntDefID

public int getFlPlnCmpntDefID()
The ID of the Component Definition type that the Fields class reprepresents.

Returns:
int

getFieldsCount

public int getFieldsCount()
The number of Field objects that the class contains.

Returns:
int

getDisplayCount

public int getDisplayCount()
The number of Field objects that have been specified to be displayed.

Returns:
int

getField

public IRMField getField(int index)
Get the IRMField object for the specified index.

Parameters:
index - The integer value from 0 to n indicating the IRMField object to return.
Returns:
An IRMField object containing attributes and values.

getFieldByFlPlnCmpntAttrDefColNm

public IRMField getFieldByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm)
                                          throws java.lang.Exception
Gets the IRMField object for the specified FlPlnCmpntAttrDefColNm.

Parameters:
strFlPlnCmpntAttrDefColNm - File Plan Attribute Definition Column Name.
Returns:
An IRMField object containing attributes and values.
Throws:
java.lang.Exception

setFieldByFlPlnCmpntAttrDefColNm

public boolean setFieldByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm,
                                                java.lang.String val)
                                         throws java.lang.Exception
Set the value of the underlying Field Element for the Component Attribute specified by the FlPlnCmpntAttrDefColNm.

Parameters:
strFlPlnCmpntAttrDefColNm - File Plan Attribute Definition Column Name.
val - The value to assign to the specified Field.
Returns:
Returns true if the value was successfully set.
Throws:
java.lang.Exception

setVisabilityByFlPlnCmpntAttrDefColNm

public void setVisabilityByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm,
                                                  boolean makeVisable)
                                           throws java.lang.Exception
Set the visability of a specified Field.

Parameters:
strFlPlnCmpntAttrDefColNm - File Plan Attribute Definition Column Name.
makeVisable - Setting this value to false indicates the field should not be displayed.
Throws:
java.lang.Exception

hideSecurityFields

public void hideSecurityFields()
                        throws java.lang.Exception
This is a convenience method for setting the visability attribute to Security Fields, indicating they should not be displayed. Host applications that do not use Security Fields can use this method.

Throws:
java.lang.Exception

setActiveStateByFlPlnCmpntAttrDefColNm

public void setActiveStateByFlPlnCmpntAttrDefColNm(java.lang.String strFlPlnCmpntAttrDefColNm,
                                                   boolean active)
                                            throws java.lang.Exception
Sets a flag indicating whether a specified field should be include in values for Add or update.

Parameters:
strFlPlnCmpntAttrDefColNm - File Plan Attribute Definition Column Name.
active - Set this value to false to indicate the field should not be used.
Throws:
java.lang.Exception

inactivateSecurityFields

public void inactivateSecurityFields()
                              throws java.lang.Exception
A convenience method for in-activating security fields. Host applications that do not use security can use this method.

Throws:
java.lang.Exception

getXMLForAdd

public java.lang.String getXMLForAdd()
                              throws com.ibm.gre.engine.util.RecordManagerException
This method returns a properly formatted XML String that can be used as input to calls to the Records Manager TemplateControllerEJB methods addNewFilePlanComponent or addNewSystemComponent. Can also be used as input to the Records Manager Component Update methods.

Returns:
Correctly formatted XML String.
Throws:
com.ibm.gre.engine.util.RecordManagerException

getMaxCaption

public java.lang.String getMaxCaption()
                               throws java.lang.Exception
This method returns the number of characters contained in the longest Caption in the Fields Collection.

Returns:
String
Throws:
java.lang.Exception