atg.svc.repository.service
Class SolutionMetadataService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.svc.repository.service.BaseService
              extended by atg.svc.repository.service.KnowledgeBaseService
                  extended by atg.svc.repository.service.SolutionMetadataService
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class SolutionMetadataService
extends KnowledgeBaseService

Business methods for the FieldDefinition, SolutionClass and associated objects. These objects form the metadata for a solution.


Nested Class Summary
protected  class SolutionMetadataService.BooleanFieldDefinitionFactory
           
protected  class SolutionMetadataService.DateFieldDefinitionFactory
           
protected  class SolutionMetadataService.DecimalFieldDefinitionFactory
           
protected static interface SolutionMetadataService.FieldDefinitionFactory
          Interface for factory to create field definitions
protected  class SolutionMetadataService.ListFieldDefinitionFactory
           
protected  class SolutionMetadataService.NumberFieldDefinitionFactory
           
protected  class SolutionMetadataService.OrganizationFieldDefinitionFactory
           
protected  class SolutionMetadataService.StatementFieldDefinitionFactory
           
protected  class SolutionMetadataService.TextFieldDefinitionFactory
           
protected  class SolutionMetadataService.TransactionalFragmentFieldDefinitionFactory
           
protected  class SolutionMetadataService.UserFieldDefinitionFactory
           
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String EMPTY_STRING
           
static java.lang.String[] EMPTY_STRING_ARRAY
           
static java.lang.String LIST_FIELD_VALUE_SORT_ORDER_ALPHABETICAL
           
static java.lang.String LIST_FIELD_VALUE_SORT_ORDER_MANUAL
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SolutionMetadataService()
           
 
Method Summary
 atg.svc.repository.beans.FieldDefinition createCustomFieldDefinition(atg.svc.repository.beans.FieldDefinitionType pType)
          Creates a custom field definition and sets the type, purpose, usage and editor accordingly.
 void createDefaultFieldValue(atg.svc.repository.beans.FieldDefinition pFieldDefinition, int pDisplayOrder, java.lang.Object pValue)
          Creates a single default value on a FieldDefinition and commits it to the repository.
 atg.svc.repository.beans.EnumeratedListValue createEnumeratedListValue()
          Creates an enumerated list value object in the repository.
 atg.svc.repository.beans.FieldDefinition createFieldDefinition(atg.svc.repository.beans.FieldDefinitionType pType)
          Creates a new FieldDefinition repository object.
 atg.svc.repository.beans.SolutionClass createSolutionClass()
          Creates a new SolutionClass.
 atg.svc.repository.beans.SolutionClassFieldDefinition createSolutionClassFieldDefinition()
          Creates a new SolutionClassFieldDefinition repository bean.
 void deleteFieldDefinition(java.lang.String pFieldDefinitionId)
          Deletes the given FieldDefinition from the repository.
 void deleteSolutionClass(java.lang.String pSolutionClassId)
          Deletes a SolutionClass and its associated SolutionClassFieldDefinition items.
 void deleteSolutionClassFieldDefinition(java.lang.String pSolutionClassFieldDefinitionId)
          Deletes a SolutionClassFieldDefinition given the id of the SolutionClassFieldDefinition.
 atg.svc.repository.beans.SolutionClass findBySolutionClassFieldDefn(java.lang.String pId)
          Finds the SolutionClass that contains the given SolutionClassFieldDefinition.
 java.util.List getAllCustomFieldDefinitionsByName()
          Returns all custom field definitions sorted by display name.
 java.util.Collection getAllSolutionClasses()
          Retrieves all solution classes
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getBooleanFieldMetadata()
          Gets metadata about the Boolean field type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getDateFieldMetadata()
          Gets metadata about the Date field type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getDecimalFieldMetadata()
          Gets metadata about the Decimal field type.
 java.lang.String getDefaultFalseLabel()
          Gets the default value to set on a BooleanFieldDefinition.falseLabel property when it's created.
 java.lang.String getDefaultListFieldValueSortOrder()
          Gets the default display sort order for list field value of the solution class.
 java.lang.String getDefaultTrueLabel()
          Gets the default value to set on a BooleanFieldDefinition.trueLabel property when it's created.
 java.util.List getDefaultValues(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Gets all default values for the given field definition sorted by display order.
 java.util.List getDefaultValues(java.lang.String pFieldName)
          Gets all default values for the given field definition sorted by display order.
 atg.svc.repository.beans.EnumeratedListValue getEnumeratedListValueByDisplayName(java.lang.String pDisplayName)
          Gets a EnumeratedListValue by its display name.
 atg.svc.repository.beans.EnumeratedListValue getEnumeratedListValueById(java.lang.String pId)
          Gets an EnumeratedListValue by repository id.
 atg.svc.repository.beans.EnumeratedListValue getEnumeratedListValueByName(java.lang.String pName)
          Gets a EnumeratedListValue by its logical name.
 java.util.List getExternallyVisiblePropertyFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Gets the solution class property fields that are visible to everyone external.
 java.util.List getExternallyVisibleStatementFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Gets the solution class statement fields that are visible to everyone external.
 atg.svc.repository.beans.FieldDefinition getFieldDefinitionByDisplayName(java.lang.String pDisplayName)
          Gets a FieldDefinition by its display name.
 atg.svc.repository.beans.FieldDefinition getFieldDefinitionById(java.lang.String pFieldDefinitionId)
          Gets a FieldDefinition by its repository id.
 atg.svc.repository.beans.FieldDefinition getFieldDefinitionByName(java.lang.String pName)
          Gets a FieldDefinition by its logical name.
 atg.svc.repository.beans.FieldDefinitionIndexing getFieldDefinitionIndexing(java.lang.String pName)
          Gets a FieldDefinitionIndexing by name.
 java.lang.String[] getFieldDefinitionIndexingTags()
          Gets the FieldDefinitionIndexing tags - the list of possible string values.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getFieldDefinitionMetadataByType(atg.svc.repository.beans.FieldDefinitionType pType)
          Finds a FieldDefinitionTypeMetadata object given the FieldDefinition type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getFieldDefinitionMetadataByType(java.lang.String pName)
          Finds a FieldDefinitionTypeMetadata object given the FieldDefinition type name.
 atg.svc.repository.beans.FieldDefinitionPurpose getFieldDefinitionPurpose(java.lang.String pName)
          Gets a FieldDefinitionPurpose by name.
 java.lang.String[] getFieldDefinitionPurposeTags()
          Gets the FieldDefinitionPurpose tags - the list of possible string values.
 atg.svc.repository.beans.FieldDefinitionType getFieldDefinitionType(java.lang.String pName)
          Gets a FieldDefinitionType by name.
 java.lang.String[] getFieldDefinitionTypeTags()
          Gets the FieldDefinitionType tags - the list of possible string values.
 java.lang.String[] getInternalOnlyFields()
          Gets the list of field definition types that are internal only.
 atg.svc.repository.beans.ListFieldDefinition getListFieldDefintionByListValueId(java.lang.String pListValueId)
          Gets a ListFieldDefinition that contains the given list field value.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getListFieldMetadata()
          Gets metadata about the List field type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getNumberFieldMetadata()
          Gets metadata about the Number field type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getOrganizationFieldMetadata()
          Gets metadata about the Organization field type.
 SegmentService getSegmentService()
          Gets the SegmentService business component.
 atg.svc.repository.beans.SolutionClass getSolutionClassById(java.lang.String pSolutionClassId)
          Finds a solution class by it's repository id.
 atg.svc.repository.beans.SolutionClassFieldDefinition getSolutionClassFieldDefinitionById(java.lang.String pId)
          Finds a solution class property definition by it's repository id.
 atg.svc.repository.beans.SolutionClassFieldDefinition getSolutionClassFieldDefinitionByName(atg.svc.repository.beans.SolutionClass pSolutionClass, java.lang.String pName)
          Gets a SolutionClassFieldDefinition from a SolutionClass given the name of the FieldDefinition.
 java.util.Set<java.lang.String> getSolutionPropertyNames()
          Gets the set of solution property names.
 atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
          Gets the SolutionSecurityUtils business component.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getStatementFieldMetadata()
          Gets metadata about the Statement field type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getTextFieldMetadata()
          Gets metadata about the Text field type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getTransactionalFragmentFieldMetadata()
          Gets metadata about the Transactional Fragment field type.
 atg.svc.repository.beans.FieldDefinitionTypeMetadata getUserFieldMetadata()
          Gets metadata about the User field type.
 java.util.List getVisibleFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Gets the ordered list of SolutionClassFieldDefinitions that are visible to the current user.
 java.util.List getVisibleListValues(atg.svc.repository.beans.ListFieldDefinition pFieldDefinition)
          Gets the list values that are visible for the current user.
 java.util.List getVisiblePropertyFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Gets the ordered list of property SolutionClassFieldDefinitions that are visible to the current user.
 java.util.List getVisibleStatementFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Gets the ordered list of solution SolutionClassFieldDefinitions that are visible to the current user.
 boolean isEnumeratedListValueByDisplayName(java.lang.String pName)
           
 boolean isEnumeratedListValueByName(java.lang.String pName)
           
 boolean isFieldDefinitionByDisplayName(java.lang.String pDisplayName)
           
 boolean isFieldDefinitionByName(java.lang.String pName)
           
 boolean isFieldEditableForCurrentUser(atg.svc.repository.beans.FieldDefinition pField)
          Returns true if the given property is visible to the current user.
 boolean isFieldExternallyVisible(atg.svc.repository.beans.FieldDefinition pField, java.lang.String pSegment)
          Returns true if the given segment is found on the internalAudience field of the field definition.
 boolean isFieldVisibleForCurrentUser(atg.svc.repository.beans.FieldDefinition pField)
          Returns true if the given property is visible to the current user.
 boolean isInternalOnlyFieldDefinition(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Returns true if the given field definition's type is one of the configured internal-only fields.
 boolean isSolutionBeanProperty(java.lang.String pPropertyName)
          Returns true if the the given property name is an existing property on the generated solution bean class.
 boolean isStatementField(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Returns true if the given FieldDefinition is a statement or text field.
 void saveFieldDefinition(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Writes the given FieldDefinition object to the repository and any list values that have changed underneath the FieldDefinition object.
 void saveSolutionClass(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Writes a SolutionClass object to the repository.
 void saveSolutionClassFieldDefinition(atg.svc.repository.beans.SolutionClassFieldDefinition pSolutionClassFieldDefinition)
          Writes the given SolutionClassFieldDefinition object to the repository if it has been modified.
 void setDefaultFalseLabel(java.lang.String pDefaultFalseLabel)
          Sets the default value to set on a BooleanFieldDefinition.falseLabel property when it's created.
 void setDefaultFieldDefinitionExternalAudience(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Adds the default segment to a field definition external audience if the field definition is not an internal-only field.
 void setDefaultListFieldValueSortOrder(java.lang.String pDefaultListFieldValueSortOrder)
          Sets the default display sort order for list field value of the solution class
 void setDefaultTrueLabel(java.lang.String pDefaultTrueLabel)
          Sets the default value to set on a BooleanFieldDefinition.trueLabel property when it's created.
 void setDefaultValues(java.util.List pValues, atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Sets 1..n default values on a FieldDefinition.
 void setInternalOnlyFields(java.lang.String[] pInternalOnlyFields)
          Sets the list of field definition types that are internal only.
 void setSegmentService(SegmentService pSegmentService)
          Sets the SegmentService business component.
 void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
          Sets the SolutionSecurityUtils business component.
 void validateFieldDefinitionIsUnique(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
          Looks for another checked-in field definition with the same name.
 void validateSolutionClassIsUnique(atg.svc.repository.beans.SolutionClass pSolutionClass)
          Looks for another checked-in solution class with the same name.
 
Methods inherited from class atg.svc.repository.service.KnowledgeBaseService
getKnowledgeHomesFactory, getOptionBeanHomes, getOptionRepositoryHomes, getServiceSegmentBeanHomes, getServiceSegmentRepositoryHomes, getSolutionBeanHomes, getSolutionRepositoryHomes, getUserOptionBeanHomes, getUserOptionRepositoryHomes, setKnowledgeHomesFactory
 
Methods inherited from class atg.svc.repository.service.BaseService
getRepositoryService, getToday, setRepositoryService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
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
Class version string

See Also:
Constant Field Values

EMPTY_STRING_ARRAY

public static final java.lang.String[] EMPTY_STRING_ARRAY

EMPTY_STRING

public static final java.lang.String EMPTY_STRING
See Also:
Constant Field Values

LIST_FIELD_VALUE_SORT_ORDER_MANUAL

public static final java.lang.String LIST_FIELD_VALUE_SORT_ORDER_MANUAL
See Also:
Constant Field Values

LIST_FIELD_VALUE_SORT_ORDER_ALPHABETICAL

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

SolutionMetadataService

public SolutionMetadataService()
Method Detail

setDefaultListFieldValueSortOrder

public void setDefaultListFieldValueSortOrder(java.lang.String pDefaultListFieldValueSortOrder)
Sets the default display sort order for list field value of the solution class

Parameters:
pDefaultListFieldValueSortOrder - The default display sort order for list field value of the solution class Can be one of the folowing: "manual", "alphabetical" Default is "manual"

getDefaultListFieldValueSortOrder

public java.lang.String getDefaultListFieldValueSortOrder()
Gets the default display sort order for list field value of the solution class.

Returns:
The default display sort order for list field value of the solution class

getSegmentService

public SegmentService getSegmentService()
Gets the SegmentService business component.

Returns:
The SegmentService business component.

setSegmentService

public void setSegmentService(SegmentService pSegmentService)
Sets the SegmentService business component.

Parameters:
pSegmentService - The SegmentService business component.

getSolutionSecurityUtils

public atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
Gets the SolutionSecurityUtils business component.

Returns:
The SolutionSecurityUtils business component.

setSolutionSecurityUtils

public void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
Sets the SolutionSecurityUtils business component.

Parameters:
pSolutionSecurityUtils - The SolutionSecurityUtils business component.

getInternalOnlyFields

public java.lang.String[] getInternalOnlyFields()
Gets the list of field definition types that are internal only. This means they will their external audience defaulted to none.

Returns:
The String array of field definition types by name.

setInternalOnlyFields

public void setInternalOnlyFields(java.lang.String[] pInternalOnlyFields)
Sets the list of field definition types that are internal only. This means they will their external audience defaulted to none.

Parameters:
pInternalOnlyFields - The String array of field definition types by name.

getDefaultFalseLabel

public java.lang.String getDefaultFalseLabel()
Gets the default value to set on a BooleanFieldDefinition.falseLabel property when it's created.

Returns:
The default value to set on a BooleanFieldDefinition.falseLabel when it's created.

setDefaultFalseLabel

public void setDefaultFalseLabel(java.lang.String pDefaultFalseLabel)
Sets the default value to set on a BooleanFieldDefinition.falseLabel property when it's created.

Parameters:
pDefaultFalseLabel - The default value to set on a BooleanFieldDefinition.falseLabel when it's created.

getDefaultTrueLabel

public java.lang.String getDefaultTrueLabel()
Gets the default value to set on a BooleanFieldDefinition.trueLabel property when it's created.

Returns:
The default value to set on a BooleanFieldDefinition.trueLabel when it's created.

setDefaultTrueLabel

public void setDefaultTrueLabel(java.lang.String pDefaultTrueLabel)
Sets the default value to set on a BooleanFieldDefinition.trueLabel property when it's created.

Parameters:
pDefaultTrueLabel - The default value to set on a BooleanFieldDefinition.trueLabel when it's created.

isFieldVisibleForCurrentUser

public boolean isFieldVisibleForCurrentUser(atg.svc.repository.beans.FieldDefinition pField)
Returns true if the given property is visible to the current user.

Returns:
True if the given property is visible to the current user.

isFieldEditableForCurrentUser

public boolean isFieldEditableForCurrentUser(atg.svc.repository.beans.FieldDefinition pField)
Returns true if the given property is visible to the current user.

Returns:
True if the given property is visible to the current user.

isFieldExternallyVisible

public boolean isFieldExternallyVisible(atg.svc.repository.beans.FieldDefinition pField,
                                        java.lang.String pSegment)
Returns true if the given segment is found on the internalAudience field of the field definition.

Parameters:
pField - The field definition to examine.
pSegment - The segment to search for on the field definition.
Returns:
True if the segment is found on the given field definition. Otherwise false.

getVisibleFields

public java.util.List getVisibleFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
Gets the ordered list of SolutionClassFieldDefinitions that are visible to the current user.

Parameters:
pSolutionClass - The SolutionClass to get the list from.
Returns:
The ordered list of SolutionClassFieldDefinitions that are visible to the current user or Collections.EMPTY_LIST if none are visible.

getVisibleStatementFields

public java.util.List getVisibleStatementFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
Gets the ordered list of solution SolutionClassFieldDefinitions that are visible to the current user.

Parameters:
pSolutionClass - The SolutionClass to get the list from.
Returns:
The ordered list of SolutionClassFieldDefinitions that are visible to the current user or Collections.EMPTY_LIST if none are visible.

getVisiblePropertyFields

public java.util.List getVisiblePropertyFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
Gets the ordered list of property SolutionClassFieldDefinitions that are visible to the current user.

Parameters:
pSolutionClass - The SolutionClass to get the list from.
Returns:
The ordered list of SolutionClassFieldDefinitions that are visible to the current user or Collections.EMPTY_LIST if none are visible.

getExternallyVisiblePropertyFields

public java.util.List getExternallyVisiblePropertyFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
Gets the solution class property fields that are visible to everyone external.

Parameters:
pSolutionClass - The SolutionClass to get the statement fields from.
Returns:
The List of SolutionClassClassFieldDefinition objects that are viewable for all external users.

getExternallyVisibleStatementFields

public java.util.List getExternallyVisibleStatementFields(atg.svc.repository.beans.SolutionClass pSolutionClass)
Gets the solution class statement fields that are visible to everyone external.

Parameters:
pSolutionClass - The SolutionClass to get the statement fields from.
Returns:
The List of SolutionClassClassFieldDefinition objects that are viewable for all external users.

getSolutionClassFieldDefinitionByName

public atg.svc.repository.beans.SolutionClassFieldDefinition getSolutionClassFieldDefinitionByName(atg.svc.repository.beans.SolutionClass pSolutionClass,
                                                                                                   java.lang.String pName)
Gets a SolutionClassFieldDefinition from a SolutionClass given the name of the FieldDefinition.

Parameters:
pSolutionClass - The SolutionClass to search.
pName - The name of the field to find.
Returns:
The SolutionClassFieldDefinition whose FieldDefinition name property matches the paramemeter.

getSolutionClassById

public atg.svc.repository.beans.SolutionClass getSolutionClassById(java.lang.String pSolutionClassId)
                                                            throws ObjectNotFoundException
Finds a solution class by it's repository id.

Parameters:
pSolutionClassId - The repository id.
Returns:
The SolutionClass ReposImpl
Throws:
ObjectNotFoundException - If the id is not found.

createSolutionClass

public atg.svc.repository.beans.SolutionClass createSolutionClass()
                                                           throws javax.ejb.CreateException
Creates a new SolutionClass.

Returns:
The new SolutionClass bean.
Throws:
javax.ejb.CreateException - If the create operation fails.

saveSolutionClass

public void saveSolutionClass(atg.svc.repository.beans.SolutionClass pSolutionClass)
                       throws DuplicateRecordException,
                              PersistenceException
Writes a SolutionClass object to the repository. Also writes any SolutionClassFieldDefinition objects in the fields property that have been modified.

Parameters:
pSolutionClass - The SolutionClass to write.
Throws:
DuplicateRecordException - thrown if a solution class already exists with the same solution class name.
PersistenceException - If the write fails.

validateSolutionClassIsUnique

public void validateSolutionClassIsUnique(atg.svc.repository.beans.SolutionClass pSolutionClass)
                                   throws DuplicateRecordException,
                                          PersistenceException
Looks for another checked-in solution class with the same name. Throws a DuplicateRecordException if another solution class exists with the same name.

Parameters:
pSolutionClass - the solution class we wish to validate
Throws:
DuplicateRecordException - thrown if a solution class already exists with the same name.
PersistenceException - thrown if an unexpected error occurred while performing this function.

validateFieldDefinitionIsUnique

public void validateFieldDefinitionIsUnique(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
                                     throws DuplicateRecordException,
                                            PersistenceException
Looks for another checked-in field definition with the same name. Throws a DuplicateRecordException if another field definition exists with the same name.

Parameters:
pFieldDefinition - the solution class we wish to validate
Throws:
DuplicateRecordException - thrown if a field definition already exists with the same name.
PersistenceException - thrown if an unexpected error occurred while performing this function.

deleteSolutionClass

public void deleteSolutionClass(java.lang.String pSolutionClassId)
                         throws javax.ejb.FinderException,
                                ObjectNotFoundException,
                                PersistenceException,
                                ReferentialIntegrityException
Deletes a SolutionClass and its associated SolutionClassFieldDefinition items.

Parameters:
pSolutionClassId - The id of the SolutionClass to delete.
Throws:
javax.ejb.FinderException - If the finder for the SolutionClass references fails.
ObjectNotFoundException - If the SolutionClass is not found.
PersistenceException - If the delete operation fails.
ReferentialIntegrityException - If the SolutionClass object is being used by a Solution

getAllSolutionClasses

public java.util.Collection getAllSolutionClasses()
                                           throws ObjectNotFoundException
Retrieves all solution classes

Returns:
Collection of SolutionClass objects
Throws:
ObjectNotFoundException

createSolutionClassFieldDefinition

public atg.svc.repository.beans.SolutionClassFieldDefinition createSolutionClassFieldDefinition()
                                                                                         throws javax.ejb.CreateException
Creates a new SolutionClassFieldDefinition repository bean.

Returns:
The new SolutionClassFieldDefinition bean repository bean. The object is not commited to the repository until saveSolutionClassFieldDefinition() is called.
Throws:
javax.ejb.CreateException - If the repository create operation fails.

saveSolutionClassFieldDefinition

public void saveSolutionClassFieldDefinition(atg.svc.repository.beans.SolutionClassFieldDefinition pSolutionClassFieldDefinition)
                                      throws PersistenceException
Writes the given SolutionClassFieldDefinition object to the repository if it has been modified.

Parameters:
pSolutionClassFieldDefinition - The SolutionClassFieldDefinition to save.
Throws:
PersistenceException - If the save operation fails.

getSolutionClassFieldDefinitionById

public atg.svc.repository.beans.SolutionClassFieldDefinition getSolutionClassFieldDefinitionById(java.lang.String pId)
                                                                                          throws ObjectNotFoundException
Finds a solution class property definition by it's repository id.

Parameters:
pId - The SolutionClassFieldDefinition repository.
Returns:
The SolutionClassFieldDefinition ReposImpl
Throws:
ObjectNotFoundException - If the SolutionClassFieldDefinition is not found.

deleteSolutionClassFieldDefinition

public void deleteSolutionClassFieldDefinition(java.lang.String pSolutionClassFieldDefinitionId)
                                        throws ObjectNotFoundException,
                                               javax.ejb.RemoveException
Deletes a SolutionClassFieldDefinition given the id of the SolutionClassFieldDefinition.

Parameters:
pSolutionClassFieldDefinitionId - The id of the SolutionClassFieldDefinition to remove.
Throws:
ObjectNotFoundException - If the SolutioNClassFieldDefinition is not found.
javax.ejb.RemoveException - If the delete operation fails.

getFieldDefinitionById

public atg.svc.repository.beans.FieldDefinition getFieldDefinitionById(java.lang.String pFieldDefinitionId)
                                                                throws ObjectNotFoundException
Gets a FieldDefinition by its repository id.

Parameters:
pFieldDefinitionId - The id of the field definition to find.
Returns:
The FieldDefinition with the given repository id.
Throws:
ObjectNotFoundException - If the field definition could not be found.

getFieldDefinitionByName

public atg.svc.repository.beans.FieldDefinition getFieldDefinitionByName(java.lang.String pName)
                                                                  throws ObjectNotFoundException
Gets a FieldDefinition by its logical name.

Parameters:
pName - The name of the field definition to find.
Returns:
The FieldDefinition with the given logical name.
Throws:
ObjectNotFoundException - If the field definition could not be found.

isFieldDefinitionByName

public boolean isFieldDefinitionByName(java.lang.String pName)
Returns:
true if the field exists with the given name, else returns false

getListFieldDefintionByListValueId

public atg.svc.repository.beans.ListFieldDefinition getListFieldDefintionByListValueId(java.lang.String pListValueId)
                                                                                throws ObjectNotFoundException
Gets a ListFieldDefinition that contains the given list field value.

Parameters:
pListValueId - The id of the EnumeratedListValue
Returns:
The ListFieldDefinition containing the given list value.
Throws:
ObjectNotFoundException - If the field definition could not be found.

getFieldDefinitionByDisplayName

public atg.svc.repository.beans.FieldDefinition getFieldDefinitionByDisplayName(java.lang.String pDisplayName)
                                                                         throws ObjectNotFoundException
Gets a FieldDefinition by its display name.

Parameters:
pDisplayName - The display name of the field definition to find.
Returns:
The FieldDefinition with the given display name.
Throws:
ObjectNotFoundException - If the field definition could not be found.

getAllCustomFieldDefinitionsByName

public java.util.List getAllCustomFieldDefinitionsByName()
                                                  throws ObjectNotFoundException
Returns all custom field definitions sorted by display name.

Returns:
List of FieldDefinition r2j items.
Throws:
ObjectNotFoundException - If the field definition could not be found.

isFieldDefinitionByDisplayName

public boolean isFieldDefinitionByDisplayName(java.lang.String pDisplayName)
Returns:
true if the field exists with the given name, else returns false

isSolutionBeanProperty

public boolean isSolutionBeanProperty(java.lang.String pPropertyName)
                               throws java.beans.IntrospectionException
Returns true if the the given property name is an existing property on the generated solution bean class. This does not check for custom properties but only actual properties on the Solution.class.

Parameters:
pPropertyName - The name of the property.
Returns:
True if the property exists, else false.
Throws:
java.beans.IntrospectionException - If the Introspector.getBeanInfo(Solution.class) throws said exception.
java.lang.IllegalArgumentException - If pPropertyName is blank.

getSolutionPropertyNames

public java.util.Set<java.lang.String> getSolutionPropertyNames()
                                                         throws java.beans.IntrospectionException
Gets the set of solution property names.

Returns:
The set of solution property names.
Throws:
java.beans.IntrospectionException - If the Solution class cannot be introspected to determine the property names.

createFieldDefinition

public atg.svc.repository.beans.FieldDefinition createFieldDefinition(atg.svc.repository.beans.FieldDefinitionType pType)
                                                               throws javax.ejb.CreateException
Creates a new FieldDefinition repository object. The new object will not exist in the repository until the saveFieldDefinition method is called.

Returns:
The new FieldDefinition repository object whose underlying implementation depends on the given type.
Throws:
javax.ejb.CreateException - If the FieldDefinition could not be created in the repository.

createCustomFieldDefinition

public atg.svc.repository.beans.FieldDefinition createCustomFieldDefinition(atg.svc.repository.beans.FieldDefinitionType pType)
                                                                     throws javax.ejb.CreateException
Creates a custom field definition and sets the type, purpose, usage and editor accordingly.

Parameters:
pType - The type of custom field to create.
Returns:
The new FieldDefinition repository object whose underlying implementation depends on the given type.
Throws:
javax.ejb.CreateException - If the FieldDefinition could not be created in the repository.

saveFieldDefinition

public void saveFieldDefinition(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
                         throws DuplicateRecordException,
                                PersistenceException
Writes the given FieldDefinition object to the repository and any list values that have changed underneath the FieldDefinition object.

Parameters:
pFieldDefinition - The FieldDefinition to save.
Throws:
PersistenceException - If the save operation fails.
DuplicateRecordException

getVisibleListValues

public java.util.List getVisibleListValues(atg.svc.repository.beans.ListFieldDefinition pFieldDefinition)
Gets the list values that are visible for the current user.

Parameters:
pFieldDefinition - The field definition to get the list values from.
Returns:
A List of EnumeratedListValue visible for the current user. If none are visible an empty List is returned.

getFieldDefinitionType

public atg.svc.repository.beans.FieldDefinitionType getFieldDefinitionType(java.lang.String pName)
Gets a FieldDefinitionType by name.

Parameters:
pName - The name of the FieldDefinitionType.
Returns:
The FieldDefinitionType.

getFieldDefinitionTypeTags

public java.lang.String[] getFieldDefinitionTypeTags()
Gets the FieldDefinitionType tags - the list of possible string values.

Returns:
The list of possible FieldDefinitionType tags.

getFieldDefinitionPurpose

public atg.svc.repository.beans.FieldDefinitionPurpose getFieldDefinitionPurpose(java.lang.String pName)
Gets a FieldDefinitionPurpose by name.

Parameters:
pName - The name of the FieldDefinitionPurpose.
Returns:
The FieldDefinitionPurpose.

getFieldDefinitionPurposeTags

public java.lang.String[] getFieldDefinitionPurposeTags()
Gets the FieldDefinitionPurpose tags - the list of possible string values.

Returns:
The list of possible FieldDefinitionPurpose tags.

getFieldDefinitionIndexing

public atg.svc.repository.beans.FieldDefinitionIndexing getFieldDefinitionIndexing(java.lang.String pName)
Gets a FieldDefinitionIndexing by name.

Parameters:
pName - The name of the FieldDefinitionIndexing.
Returns:
The FieldDefinitionIndexing.

getFieldDefinitionIndexingTags

public java.lang.String[] getFieldDefinitionIndexingTags()
Gets the FieldDefinitionIndexing tags - the list of possible string values.

Returns:
The list of possible FieldDefinitionIndexing tags.

findBySolutionClassFieldDefn

public atg.svc.repository.beans.SolutionClass findBySolutionClassFieldDefn(java.lang.String pId)
                                                                    throws ObjectNotFoundException
Finds the SolutionClass that contains the given SolutionClassFieldDefinition.

Parameters:
pId - The id of the SolutionClassFieldDefinition.
Returns:
The SolutionClass.
Throws:
ObjectNotFoundException - If not SolutionClass is found that contains the given SolutionClassFieldDefinition.

deleteFieldDefinition

public void deleteFieldDefinition(java.lang.String pFieldDefinitionId)
                           throws javax.ejb.FinderException,
                                  ObjectNotFoundException,
                                  PersistenceException,
                                  ReferentialIntegrityException
Deletes the given FieldDefinition from the repository.

Parameters:
pFieldDefinitionId - The id of the FieldDefinition to delete.
Throws:
javax.ejb.FinderException - If the finder to get the field definition references fails
ObjectNotFoundException - If the FieldDefinition is not found.
PersistenceException - If the FieldDefinition delete operation fails.
ReferentialIntegrityException - If the FieldDefinition is in use by a SolutionClass and cannot be removed

getEnumeratedListValueById

public atg.svc.repository.beans.EnumeratedListValue getEnumeratedListValueById(java.lang.String pId)
                                                                        throws ObjectNotFoundException
Gets an EnumeratedListValue by repository id.

Parameters:
pId - The repository id of the EnumeratedListValue.
Returns:
The EnumeratedListValue object.
Throws:
ObjectNotFoundException - If the EnumeratedListValue is not found.

getEnumeratedListValueByName

public atg.svc.repository.beans.EnumeratedListValue getEnumeratedListValueByName(java.lang.String pName)
                                                                          throws ObjectNotFoundException
Gets a EnumeratedListValue by its logical name.

Parameters:
pName - The name of the field definition to find.
Returns:
The EnumeratedListValue with the given logical name.
Throws:
ObjectNotFoundException - If the list value could not be found.

isEnumeratedListValueByName

public boolean isEnumeratedListValueByName(java.lang.String pName)
Returns:
true if the list value exists with the given name, else returns false

getEnumeratedListValueByDisplayName

public atg.svc.repository.beans.EnumeratedListValue getEnumeratedListValueByDisplayName(java.lang.String pDisplayName)
                                                                                 throws ObjectNotFoundException
Gets a EnumeratedListValue by its display name.

Parameters:
pName - The display name of the field definition to find.
Returns:
The EnumeratedListValue with the given display name.
Throws:
ObjectNotFoundException - If the list value could not be found.

isEnumeratedListValueByDisplayName

public boolean isEnumeratedListValueByDisplayName(java.lang.String pName)
Returns:
true if the list value exists with the given name, else returns false

createEnumeratedListValue

public atg.svc.repository.beans.EnumeratedListValue createEnumeratedListValue()
                                                                       throws javax.ejb.CreateException
Creates an enumerated list value object in the repository.

Returns:
The EnumeratedListValue repository impl.
Throws:
javax.ejb.CreateException - If the create fails.

isInternalOnlyFieldDefinition

public boolean isInternalOnlyFieldDefinition(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Returns true if the given field definition's type is one of the configured internal-only fields.

Parameters:
pFieldDefinition - The field definition to test.
Returns:
True if it is internal-only else false.

setDefaultFieldDefinitionExternalAudience

public void setDefaultFieldDefinitionExternalAudience(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Adds the default segment to a field definition external audience if the field definition is not an internal-only field.

Parameters:
pFieldDefinition - The field definition to add the default segment to.

isStatementField

public boolean isStatementField(atg.svc.repository.beans.FieldDefinition pFieldDefinition)
Returns true if the given FieldDefinition is a statement or text field.

Parameters:
pFieldDefinition - The FieldDefinition to test.
Returns:
True if the FieldDefinition is a statement or text type else false.

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 1..n default values on a FieldDefinition. A DefaultValue object is created from each value parameter and set on the given FieldDefinition. When saveFieldDefinition is called any new DefaultValue objects will be committed along with the FieldDefinition.

Parameters:
pFieldDefinition - The FieldDefinition to set the value(s) on.
pValues - The value(s) to set on the FieldDefinition.
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 values 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 all default values for the given field definition sorted by display order.

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

getDefaultValues

public java.util.List getDefaultValues(java.lang.String pFieldName)
                                throws javax.ejb.FinderException
Gets all default values for the given field definition sorted by display order.

Returns:
The Collection of DefaultFieldValue or empty if none is found.
Throws:
javax.ejb.FinderException - If the finder execution fails.

createDefaultFieldValue

public void createDefaultFieldValue(atg.svc.repository.beans.FieldDefinition pFieldDefinition,
                                    int pDisplayOrder,
                                    java.lang.Object pValue)
                             throws javax.ejb.CreateException,
                                    PersistenceException
Creates a single default value on a FieldDefinition and commits it to the repository.

Parameters:
pFieldDefinition - The field definition the default value belongs to.
pValue - The value.
Throws:
javax.ejb.CreateException - If the create of the DefaultFieldValue object fails.
PersistenceException - If the commit of the DefaultFieldValue object fails.

getBooleanFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getBooleanFieldMetadata()
                                                                             throws ObjectNotFoundException
Gets metadata about the Boolean field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getDecimalFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getDecimalFieldMetadata()
                                                                             throws ObjectNotFoundException
Gets metadata about the Decimal field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getDateFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getDateFieldMetadata()
                                                                          throws ObjectNotFoundException
Gets metadata about the Date field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getListFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getListFieldMetadata()
                                                                          throws ObjectNotFoundException
Gets metadata about the List field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getNumberFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getNumberFieldMetadata()
                                                                            throws ObjectNotFoundException
Gets metadata about the Number field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getOrganizationFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getOrganizationFieldMetadata()
                                                                                  throws ObjectNotFoundException
Gets metadata about the Organization field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getStatementFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getStatementFieldMetadata()
                                                                               throws ObjectNotFoundException
Gets metadata about the Statement field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getTextFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getTextFieldMetadata()
                                                                          throws ObjectNotFoundException
Gets metadata about the Text field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getTransactionalFragmentFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getTransactionalFragmentFieldMetadata()
                                                                                           throws ObjectNotFoundException
Gets metadata about the Transactional Fragment field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getUserFieldMetadata

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getUserFieldMetadata()
                                                                          throws ObjectNotFoundException
Gets metadata about the User field type.

Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If no metadata object is found for the type.

getFieldDefinitionMetadataByType

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getFieldDefinitionMetadataByType(atg.svc.repository.beans.FieldDefinitionType pType)
                                                                                      throws ObjectNotFoundException
Finds a FieldDefinitionTypeMetadata object given the FieldDefinition type.

Parameters:
pType - The type to find
Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If a FieldDefinitionTypeMetadata is not found with the given type.

getFieldDefinitionMetadataByType

public atg.svc.repository.beans.FieldDefinitionTypeMetadata getFieldDefinitionMetadataByType(java.lang.String pName)
                                                                                      throws ObjectNotFoundException
Finds a FieldDefinitionTypeMetadata object given the FieldDefinition type name.

Parameters:
pName - The name of the type to find
Returns:
The FieldDefinitionTypeMetadata object
Throws:
ObjectNotFoundException - If a FieldDefinitionTypeMetadata is not found with the given type name.