atg.svc.repository.service
Class FavoritesService

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.SharedService
                  extended by atg.svc.repository.service.FavoritesService
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

@Service(requiredProperties={"profileService","solutionService","optionService"})
public class FavoritesService
extends SharedService

Service to manage favorite solutions.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
FavoritesService()
           
 
Method Summary
 atg.svc.repository.beans.Favorites createFavorites()
          Creates a new transient Favorites repository bean.
 void deleteFavorite(java.lang.String pFavoritesId)
          Delete the specified favorites from repository.
 atg.svc.repository.beans.Favorites edit(java.lang.String pFavoritesId)
          Gets an editable version of a favorite given the repository id of the favorite .
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites()
          Returns a list of favorites visible to the current user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites(java.lang.String pProfileId)
          Returns a list of favorite visible to the user.
 atg.svc.repository.beans.Favorites getFavoritesById(java.lang.String pFavoritesId)
          Finds a Favorites by it's repository id.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByIdAndType(java.lang.String pProfileId, atg.svc.repository.beans.FavoritesType pType)
          Returns a list favorite of the specified type that are visible for the given user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByIdAndType(java.lang.String pProfileId, java.lang.String pType)
          Returns a list favorite of the specified type that are visible for the given user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesBySolutionId(java.lang.String pSolutionId)
          Gets the collection of Favorites for the given solution id.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByType(atg.svc.repository.beans.FavoritesType pType)
          Returns a list of favorite of type 'PDFDocument' or 'document' or 'solution' that are visible to the current user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByType(java.lang.String pType)
          Returns a list of favorite of type 'PDFDocument' or 'document' or 'solution' that are visible to the current user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesDocument()
          Returns a list of favorite of type 'document' that are visible to the current user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesDocument(java.lang.String pProfileId)
          Returns a list of favorite of type 'document' that are visible to the specified user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesPDFDocument()
          Returns a list of favorite of type 'PDFDocument' that are visible to the current user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesPDFDocument(java.lang.String pProfileId)
          Returns a list of favorite of type 'PDFDocument' that are visible to the specifed user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesSolution()
          Returns a list of favorite of type 'solution' that are visible to the current user.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesSolution(java.lang.String pProfileId)
          Returns a list of favorite of type 'solution' that are visible specified user.
 atg.svc.repository.service.OptionService getOptionService()
           
 ProfileService getProfileService()
           
 SolutionService getSolutionService()
           
 boolean isRecordAlreadyExists(atg.svc.repository.beans.Favorites pFavorites)
          Checks if record already created for the specified solution id, context id , group id and URL
 void saveFavorites(atg.svc.repository.beans.Favorites pFavorites)
          If the user already has saved the maximum number of favorites, removes oldest favorites.
 void setOptionService(atg.svc.repository.service.OptionService pOptionService)
           
 void setProfileService(ProfileService pProfileService)
           
 void setSolutionService(SolutionService pSolutionService)
           
 
Methods inherited from class atg.svc.repository.service.SharedService
getServiceSharedBeanHomes, getServiceSharedBeanHomesName, getServiceSharedRepositoryHomes, getServiceSharedRepositoryHomesName, setServiceSharedBeanHomesName, setServiceSharedRepositoryHomesName
 
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, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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
Constructor Detail

FavoritesService

public FavoritesService()
Method Detail

getProfileService

public ProfileService getProfileService()

setProfileService

public void setProfileService(ProfileService pProfileService)

getOptionService

public atg.svc.repository.service.OptionService getOptionService()

setOptionService

public void setOptionService(atg.svc.repository.service.OptionService pOptionService)

getSolutionService

public SolutionService getSolutionService()

setSolutionService

public void setSolutionService(SolutionService pSolutionService)

createFavorites

public atg.svc.repository.beans.Favorites createFavorites()
                                                   throws javax.ejb.CreateException
Creates a new transient Favorites repository bean. Pouplates the user currently logged in user. After calling the appropriate setters, pass this object into the saveFavorites method to persist it to the db.

Returns:
transient Favorites r2j bean.
Throws:
javax.ejb.CreateException

edit

public atg.svc.repository.beans.Favorites edit(java.lang.String pFavoritesId)
                                        throws ObjectNotFoundException
Gets an editable version of a favorite given the repository id of the favorite .

Parameters:
pFavoritesId - Id of the favorite
Returns:
A Favorites ReposImpl.
Throws:
ObjectNotFoundException

getFavoritesById

public atg.svc.repository.beans.Favorites getFavoritesById(java.lang.String pFavoritesId)
                                                    throws ObjectNotFoundException
Finds a Favorites by it's repository id.

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

saveFavorites

public void saveFavorites(atg.svc.repository.beans.Favorites pFavorites)
                   throws ObjectNotFoundException,
                          DuplicateRecordException,
                          SvcException
If the user already has saved the maximum number of favorites, removes oldest favorites.

Parameters:
pFavorites - that should added for the user
Throws:
javax.ejb.CreateException - If the create fails.
ObjectNotFoundException - If the save fails.
atg.svc.repository.service.exception.SvcException - If the save fails.
DuplicateRecordException
SvcException

isRecordAlreadyExists

public boolean isRecordAlreadyExists(atg.svc.repository.beans.Favorites pFavorites)
Checks if record already created for the specified solution id, context id , group id and URL

Parameters:
pFavorites -

deleteFavorite

public void deleteFavorite(java.lang.String pFavoritesId)
                    throws ObjectNotFoundException,
                           PersistenceException
Delete the specified favorites from repository.

Parameters:
pFavoritesId - - favorite id.
Throws:
ObjectNotFoundException
PersistenceException

getFavorites

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites()
Returns a list of favorites visible to the current user. The list is ordered alphabetically by favorite name.

Returns:
A list of favorites visible to the user

getFavorites

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites(java.lang.String pProfileId)
Returns a list of favorite visible to the user. The list is ordered alphabetically by favorite id.

Parameters:
pProfileId - profile id of the user we're looking up.
Returns:
A list of favorites visible to the user

getFavoritesSolution

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesSolution()
Returns a list of favorite of type 'solution' that are visible to the current user.

Returns:
A list of the user's favorites solutions

getFavoritesSolution

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesSolution(java.lang.String pProfileId)
Returns a list of favorite of type 'solution' that are visible specified user.

Parameters:
pProfileId - profile id of the user we're looking up.
Returns:
A list of the user's favorites solutions

getFavoritesDocument

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesDocument()
Returns a list of favorite of type 'document' that are visible to the current user.

Returns:
A list of the user's favorites Documents

getFavoritesDocument

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesDocument(java.lang.String pProfileId)
Returns a list of favorite of type 'document' that are visible to the specified user.

Parameters:
pProfileId - profile id of the user we're looking up.
Returns:
A list of the user's favorites Documents

getFavoritesPDFDocument

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesPDFDocument()
Returns a list of favorite of type 'PDFDocument' that are visible to the current user.

Returns:
A list of the user's favorites PDF Documents

getFavoritesPDFDocument

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesPDFDocument(java.lang.String pProfileId)
Returns a list of favorite of type 'PDFDocument' that are visible to the specifed user.

Parameters:
pProfileId - profile id of the user we're looking up.
Returns:
A list of the user's favorites PDF Documents

getFavoritesByType

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByType(atg.svc.repository.beans.FavoritesType pType)
Returns a list of favorite of type 'PDFDocument' or 'document' or 'solution' that are visible to the current user.

Parameters:
pType - - favorite type.'PDFDocument' or 'document' or 'solution'
Returns:
A list of the user's favorites PDF Documents

getFavoritesByType

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByType(java.lang.String pType)
Returns a list of favorite of type 'PDFDocument' or 'document' or 'solution' that are visible to the current user.

Parameters:
pType - - favorite type.'PDFDocument' or 'document' or 'solution'
Returns:
A list of the user's favorites PDF Documents

getFavoritesByIdAndType

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByIdAndType(java.lang.String pProfileId,
                                                                                        atg.svc.repository.beans.FavoritesType pType)
Returns a list favorite of the specified type that are visible for the given user.

Parameters:
pProfileId - profile id of the user we're looking up.
pType - type "solution" or "document" or 'PDFDocument'
Returns:
A list of the user's favorite

getFavoritesByIdAndType

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesByIdAndType(java.lang.String pProfileId,
                                                                                        java.lang.String pType)
Returns a list favorite of the specified type that are visible for the given user.

Parameters:
pProfileId - profile id of the user we're looking up.
pType - type "solution" or "document" or 'PDFDocument'
Returns:
A list of the user's favorites

getFavoritesBySolutionId

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavoritesBySolutionId(java.lang.String pSolutionId)
                                                                                  throws javax.ejb.FinderException
Gets the collection of Favorites for the given solution id.

Parameters:
pSolutionId - The id of the solution.
Returns:
The Collection of Favorites objects.
Throws:
javax.ejb.FinderException - If the finder fails.