atg.svc.repository.beans.methods
Class FieldDefinitionMethods

java.lang.Object
  extended by atg.svc.repository.beans.methods.BaseMethods
      extended by atg.svc.repository.beans.methods.FieldDefinitionMethods

public class FieldDefinitionMethods
extends BaseMethods

Defines extension methods for the FieldDefinition object.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
FieldDefinitionMethods()
           
 
Method Summary
 SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Creates a SolutionFieldValue object that is associated with this field.
 java.util.List getDefaultValues(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Gets the default values for the given field definition in the correct display order.
 boolean getIsEditable(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Returns true if the field is editable for the current user.
 boolean getIsExternallyVisibleToEveryone(atg.svc.repository.beans.FieldDefinition pField)
          Returns true if this field is always externally visible.
 boolean getIsExternallyVisibleToSegment(java.lang.String pSegment, atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Returns true if the given segment is found on the externalAudience property of the FieldDefinition.
 boolean getIsInternalOnly(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Returns true if the field definition is for internal use only/
 boolean getIsMultiValued(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Returns true if the field definition is multi-valued or false if single-valued.
 boolean getIsVisible(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Returns true if the field is visible for the current user.
 void setDefaultValues(java.util.List pValues, atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Sets the default value on a Field Definition.
 
Methods inherited from class atg.svc.repository.beans.methods.BaseMethods
getServiceFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Constructor Detail

FieldDefinitionMethods

public FieldDefinitionMethods()
Method Detail

getIsMultiValued

public boolean getIsMultiValued(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Returns true if the field definition is multi-valued or false if single-valued. This is included for convenience because r2j outputs booleans without the get/set prefix and therefore the property cannot be accessed via EL.

Returns:

getIsVisible

public boolean getIsVisible(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Returns true if the field is visible for the current user.

Returns:
True if the field is visible for the current user.

getIsExternallyVisibleToEveryone

public boolean getIsExternallyVisibleToEveryone(atg.svc.repository.beans.FieldDefinition pField)
Returns true if this field is always externally visible.

Parameters:
pField - The field to check.
Returns:
True if the field is externally visible to everyone else false.

getIsExternallyVisibleToSegment

public boolean getIsExternallyVisibleToSegment(java.lang.String pSegment,
                                               atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Returns true if the given segment is found on the externalAudience property of the FieldDefinition.

Parameters:
pSegment - The segment to search on the externalAudience.
pFieldDefinition - The FieldDefinition to check.
Returns:
True if the given segment is found on the externalAudience property of the FieldDefinition.

getIsEditable

public boolean getIsEditable(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Returns true if the field is editable for the current user.

Returns:
True if the field is editable for the current user.

getIsInternalOnly

public boolean getIsInternalOnly(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Returns true if the field definition is for internal use only/

Parameters:
pFieldDefinition - The field definition to check.
Returns:
True if the field is internal user only else false.

createSolutionFieldValue

public SolutionFieldValue createSolutionFieldValue(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
                                            throws javax.ejb.CreateException
Creates a SolutionFieldValue object that is associated with this field.

Parameters:
pFieldDefinition - The field metadata to set on the SolutionFieldValue.
Returns:
The new SolutionFieldValue.
Throws:
javax.ejb.CreateException

setDefaultValues

public void setDefaultValues(java.util.List pValues,
                             atg.svc.repository.beans.FieldDefinition pFieldDefinition)
                      throws javax.ejb.CreateException,
                             javax.ejb.FinderException,
                             PersistenceException,
                             javax.ejb.RemoveException
Sets the default value on a Field Definition. Any old values are removed and a new DefaultFieldValue is created and committed to the repository for each Object value passed in.

Parameters:
pValues - The new default value to set on the FieldDefinition
pFieldDefinition - The FieldDefinition to set the new default values on.
Throws:
javax.ejb.CreateException - If the create of a DefaultFieldValue object fails.
javax.ejb.FinderException - If the finder to get the old defaults fails.
PersistenceException - If the write of a new value fails.
javax.ejb.RemoveException - If the remove of any existing values fails.

getDefaultValues

public java.util.List getDefaultValues(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
                                throws javax.ejb.FinderException
Gets the default values for the given field definition in the correct display order.

Parameters:
pFieldDefinition - The field definition to find the default values for.
Returns:
The Collection of DefaultFieldValue or empty if none is found.
Throws:
javax.ejb.FinderException - If the finder execution fails.