atg.svc.repository.service
Class OrganizationValueService

java.lang.Object
  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.OrganizationValueService
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.repository.PropertiesChangedListener, java.util.EventListener

public class OrganizationValueService
extends KnowledgeBaseService
implements atg.repository.PropertiesChangedListener

OrganizationValueService Business API for OrganizationValue objects

Version:
$Id: //application/service/version/2007.3/common/src/classes/atg/svc/repository/service/OrganizationValueService.java#2 $$Change: 632007 $
Author:
dkenyon

Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.svc.repository.service.BaseService
mBeanHomes, mBeanHomesName, mRepositoryHomes, mRepositoryHomesName
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
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
OrganizationValueService()
           
 
Method Summary
protected  void clearCachedAllInternalAudiences()
           
protected  void clearCachedAllOwningGroups()
           
 void deleteOrganizationValues(java.lang.String pOrgId)
          Deletes all organization values that wrap the given organization id.
 void doStartService()
           
 OrganizationValue findOrganizationValue(OrganizationValueType pType, java.lang.String pOrgId)
          Finds an OrganizationValue given its type and organization id.
 java.util.Collection getAllInternalAudienceOrganizationValues()
          Gets all internal audience OrganizationValue objects.
 java.util.Collection getAllOrganizationValues()
          Gets all OrganizationValue objects.
 java.util.Collection getAllOwningGroupOrganizationValues()
          Gets all owning group OrganizationValue objects.
protected  java.util.List getCachedAllInternalAudiences()
           
protected  java.util.List getCachedAllOwningGroups()
           
 atg.repository.RepositoryItemDescriptor getOrganizationItemDescriptor()
           
 OrganizationValue getOrganizationValueById(java.lang.String pOrgValueId)
          Gets an OrgnizationValue given its repository id.
 OrganizationValue getOrganizationValueFromOrganization(OrganizationValueType pType, java.lang.String pOrgId, java.lang.String pOrgName)
          Gets an organization value given the type and organization id.
 atg.repository.RepositoryItemDescriptor getOrganizationValueItemDescriptor()
           
 java.util.List getOrganizationValueListById(java.lang.String[] pOrgValueIds)
          Gets a list of OrgnizationValue objects given a list of repository ids.
 java.lang.String getOrganiztionValueDisplayName(OrganizationValue pOrganizationValue)
          Gets the display name of the OrganizationValue.
 ProfileService getProfileService()
           
 SegmentService getSegmentService()
           
 atg.repository.Repository getServiceRepository()
           
 atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
           
 atg.userdirectory.UserDirectory getUserDirectory()
           
 boolean isAgentModule()
           
 boolean isEnableMonitoring()
           
 boolean isOrganizationValueVisibleForCurrentUser(OrganizationValue pOrganizationValue)
          Returns true if the OrganizationValue is visible for the current user.
 void performAction()
           
 void propertiesChanged(atg.repository.PropertiesChangedEvent pEvent)
          Remove an organization from the OrganizationNameCache when an internal organization item is modified or deleted.
 void setAgentModule(boolean pAgentModule)
           
protected  void setCachedAllInternalAudiences(java.util.List pCachedAllInternalAudiences)
           
protected  void setCachedAllOwningGroups(java.util.List pCachedAllOwningGroups)
           
 void setEnableMonitoring(boolean pEnableMonitoring)
           
 void setProfileService(ProfileService pProfileService)
           
 void setSegmentService(SegmentService pSegmentService)
           
 void setServiceRepository(atg.repository.Repository pServiceRepository)
           
 void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
           
 void setUserDirectory(atg.userdirectory.UserDirectory pUserDirectory)
           
 void startMonitoring()
          Registers this class as a PropertiesChangedListener listening for property changes to solutions
 
Methods inherited from class atg.svc.repository.service.KnowledgeBaseService
getBeanHomes, getRepositoryHomes
 
Methods inherited from class atg.svc.repository.service.BaseService
getBaseBeanHomes, getBaseRepositoryHomes, getBeanHomesName, getRepositoryHomesName, getRepositoryService, getToday, setBeanHomesName, setRepositoryHomesName, setRepositoryService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning, setServiceInfo, startService, stopService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

OrganizationValueService

public OrganizationValueService()
Method Detail

getSegmentService

public SegmentService getSegmentService()

setSegmentService

public void setSegmentService(SegmentService pSegmentService)

getProfileService

public ProfileService getProfileService()

setProfileService

public void setProfileService(ProfileService pProfileService)

getSolutionSecurityUtils

public atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()

setSolutionSecurityUtils

public void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)

getUserDirectory

public atg.userdirectory.UserDirectory getUserDirectory()

setUserDirectory

public void setUserDirectory(atg.userdirectory.UserDirectory pUserDirectory)

setServiceRepository

public void setServiceRepository(atg.repository.Repository pServiceRepository)

getServiceRepository

public atg.repository.Repository getServiceRepository()

setEnableMonitoring

public void setEnableMonitoring(boolean pEnableMonitoring)

isEnableMonitoring

public boolean isEnableMonitoring()

getCachedAllOwningGroups

protected java.util.List getCachedAllOwningGroups()

setCachedAllOwningGroups

protected void setCachedAllOwningGroups(java.util.List pCachedAllOwningGroups)

clearCachedAllOwningGroups

protected void clearCachedAllOwningGroups()

getCachedAllInternalAudiences

protected java.util.List getCachedAllInternalAudiences()

setCachedAllInternalAudiences

protected void setCachedAllInternalAudiences(java.util.List pCachedAllInternalAudiences)

clearCachedAllInternalAudiences

protected void clearCachedAllInternalAudiences()

isAgentModule

public boolean isAgentModule()

setAgentModule

public void setAgentModule(boolean pAgentModule)

getOrganizationItemDescriptor

public atg.repository.RepositoryItemDescriptor getOrganizationItemDescriptor()
                                                                      throws atg.repository.RepositoryException
Throws:
atg.repository.RepositoryException

getOrganizationValueItemDescriptor

public atg.repository.RepositoryItemDescriptor getOrganizationValueItemDescriptor()
                                                                           throws atg.repository.RepositoryException
Throws:
atg.repository.RepositoryException

getOrganizationValueById

public OrganizationValue getOrganizationValueById(java.lang.String pOrgValueId)
                                           throws ObjectNotFoundException
Gets an OrgnizationValue given its repository id.

Parameters:
pOrgValueId - The id of the OrganizationValue.
Returns:
The OrganizationValue object.
Throws:
ObjectNotFoundException - If the OrganizationValue is not found.

getOrganizationValueListById

public java.util.List getOrganizationValueListById(java.lang.String[] pOrgValueIds)
                                            throws ObjectNotFoundException
Gets a list of OrgnizationValue objects given a list of repository ids.

Parameters:
pOrgValueIds - The array of OrganizationValue ids.
Returns:
The List of OrganizationValue objects.
Throws:
ObjectNotFoundException - If an OrganizationValue is not found.

getOrganizationValueFromOrganization

public OrganizationValue getOrganizationValueFromOrganization(OrganizationValueType pType,
                                                              java.lang.String pOrgId,
                                                              java.lang.String pOrgName)
                                                       throws javax.ejb.CreateException,
                                                              PersistenceException
Gets an organization value given the type and organization id. If the OrganizationValue does not exist it will be created using the given organization name and id, saved and returned.

Parameters:
pType - The organization value type to get or create
pOrgId - The repository id of the organization the organization value is wrapping.
pOrgName - The name of the organization.
Returns:
The found OrganizationValue or the new one if it's created.
Throws:
PersistenceException - If a PersistenceException is thrown on the save if a new OrganizationValue is created.
javax.ejb.CreateException

findOrganizationValue

public OrganizationValue findOrganizationValue(OrganizationValueType pType,
                                               java.lang.String pOrgId)
                                        throws ObjectNotFoundException
Finds an OrganizationValue given its type and organization id.

Parameters:
pType - The OrganizationValueType
pOrgId - The organization id
Returns:
The OrganizationValue that matches the input parameters
Throws:
ObjectNotFoundException - If the OrganizationValue was not found.

getAllOrganizationValues

public java.util.Collection getAllOrganizationValues()
Gets all OrganizationValue objects. The returned list is sorted by displayName. The sort is done in memory because the displayName value is a runtime computed property.

Returns:
A Collection of OrganizationValue objects.

getAllOwningGroupOrganizationValues

public java.util.Collection getAllOwningGroupOrganizationValues()
Gets all owning group OrganizationValue objects. The returned list is sorted by displayName. The sort is done in memory because the displayName value is a runtime computed property.

Returns:
A Collection of OrganizationValue objects.

getAllInternalAudienceOrganizationValues

public java.util.Collection getAllInternalAudienceOrganizationValues()
Gets all internal audience OrganizationValue objects. The returned list is sorted by displayName. The sort is done in memory because the displayName value is a runtime computed property.

Returns:
A Collection of OrganizationValue objects.

deleteOrganizationValues

public void deleteOrganizationValues(java.lang.String pOrgId)
                              throws ObjectNotFoundException,
                                     PersistenceException
Deletes all organization values that wrap the given organization id.

Parameters:
pOrgId - The organizationId to find the OrganizationValue objects by.
Throws:
ObjectNotFoundException - If an underlying method throws ObjectNotFoundException
PersistenceException - If the delete fails.

isOrganizationValueVisibleForCurrentUser

public boolean isOrganizationValueVisibleForCurrentUser(OrganizationValue pOrganizationValue)
Returns true if the OrganizationValue is visible for the current user.

Parameters:
pOrganizationValue - The OrganizationValue to check.
Returns:
True if the OrganizationValue is visible for the current user.

getOrganiztionValueDisplayName

public java.lang.String getOrganiztionValueDisplayName(OrganizationValue pOrganizationValue)
Gets the display name of the OrganizationValue. The display name is calculated by first trying to lookup the organization in the profile repository to get its name and if it exists return it. Otherwise, the organizationName property is returned.

Parameters:
pOrganizationValue - The OrganizationValue to compute the display name for.
Returns:
The display name String.

propertiesChanged

public void propertiesChanged(atg.repository.PropertiesChangedEvent pEvent)
Remove an organization from the OrganizationNameCache when an internal organization item is modified or deleted.

Specified by:
propertiesChanged in interface atg.repository.PropertiesChangedListener
See Also:
PropertiesChangedListener.propertiesChanged(atg.repository.PropertiesChangedEvent)

startMonitoring

public void startMonitoring()
Registers this class as a PropertiesChangedListener listening for property changes to solutions


doStartService

public void doStartService()
                    throws atg.nucleus.ServiceException
Overrides:
doStartService in class atg.nucleus.GenericService
Throws:
atg.nucleus.ServiceException

performAction

public void performAction()