atg.svc.repository.service
Class FavoriteQueryService

java.lang.Object
  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.FavoriteQueryService
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, java.util.EventListener

public class FavoriteQueryService
extends SharedService

Business methods for atg.svc.repository.beans.Session objects. A Session is a problem solving session and it captures a history of the following events; search, browse, view answer


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
FavoriteQueryService()
           
 
Method Summary
 FavoriteQuery createFavoriteQuery()
          Creates a new transient FavoriteQuery repository bean.
 FavoriteQuery createFavoriteQuery(java.lang.String pQueryId)
          Creates a new transient FavoriteQuery repository bean.
 void deleteFavoriteQuery(java.lang.String pFavoriteQueryId)
           
 FavoriteQuery edit(java.lang.String pFavoriteQueryId)
          Gets an editable version of a favorite query given the repository id of the favorite query.
 java.util.Collection getFavoriteQueries()
          Returns a list of personal and public favorite queries visible to the current user.
 java.util.Collection getFavoriteQueries(java.lang.String pProfileId)
          Returns a list of personal and public favorite queries visible to the user.
 java.util.Collection getFavoriteQueriesByType(java.lang.String pType)
          Returns a list of personal and public favorite queries of the specified type that are visible to the current user.
 java.util.Collection getFavoriteQueriesByType(java.lang.String pProfileId, java.lang.String pType)
          Returns a list of personal and public favorite queries of the specified type that are visible for the given user.
 FavoriteQuery getFavoriteQueryById(java.lang.String pFavoriteQueryId)
          Finds a FavoriteQuery by it's repository id.
 java.util.Collection getFavoriteReviewQueries()
          Returns a list of the personal and public favorite queries of type 'review' that are visible to the current user.
 java.util.Collection getFavoriteSolutionQueries()
          Returns a list of the personal and public favorite queries of type 'solution' that are visible to the current user.
 java.util.Collection getPersonalFavoriteQueries()
          A list of the user's favorite personal queries - may include queries that the user has been pushed to groups.
 java.util.Collection getPersonalFavoriteQueries(java.lang.String pProfileId)
           
 java.util.Collection getPersonalFavoriteQueriesByType(java.lang.String pType)
           
 java.util.Collection getPersonalFavoriteQueriesByType(java.lang.String pProfileId, java.lang.String pType)
           
 java.util.Collection getPublicFavoriteQueries()
           
 java.util.Collection getPublicFavoriteQueries(java.lang.String pProfileId)
           
 java.util.Collection getPublicFavoriteQueriesByType(java.lang.String pType)
           
 java.util.Collection getPublicFavoriteQueriesByType(java.lang.String pProfileId, java.lang.String pType)
           
 QueryService getQueryService()
           
 java.util.List getRecentQueries()
          Returns the N most recent seraches performed by the currently logged in user.
 java.util.List getRecentQueries(atg.userprofiling.Profile pProfile)
          Returns the N most recent searches performed by the user.
 SessionService getSessionService()
           
 UserOptionsService getUserOptionsService()
           
 void saveFavoriteQuery(FavoriteQuery pFavoriteQuery)
          Adds a query to a user's list of favorite searches.
 void setQueryService(QueryService pQueryService)
           
 void setSessionService(SessionService pSessionService)
           
 void setUserOptionsService(UserOptionsService pUserOptionsService)
           
 
Methods inherited from class atg.svc.repository.service.SharedService
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, doStartService, 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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

FavoriteQueryService

public FavoriteQueryService()
Method Detail

getUserOptionsService

public UserOptionsService getUserOptionsService()

setUserOptionsService

public void setUserOptionsService(UserOptionsService pUserOptionsService)

getSessionService

public SessionService getSessionService()

setSessionService

public void setSessionService(SessionService pSessionService)

getQueryService

public QueryService getQueryService()

setQueryService

public void setQueryService(QueryService pQueryService)

createFavoriteQuery

public FavoriteQuery createFavoriteQuery()
                                  throws javax.ejb.CreateException
Creates a new transient FavoriteQuery repository bean. Pouplates the user and timestamp with the currently logged in user and timestamp. After calling the appropriate setters, pass this object into the saveFavoriteQuery method to persist it to the db.

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

createFavoriteQuery

public FavoriteQuery createFavoriteQuery(java.lang.String pQueryId)
                                  throws javax.ejb.CreateException,
                                         ObjectNotFoundException
Creates a new transient FavoriteQuery repository bean. Pouplates the user and timestamp with the currently logged in user and timestamp. Populates the query with information from the input KnowledgeQuery. After calling the appropriate setters, pass this object into the saveFavoriteQuery method to persist it to the db.

Parameters:
pQueryId - The repository id of a KnowledgeQuery that we want to copy. Generally comes from a query in the KnowledgeSession.
Returns:
transient FavoriteQuery r2j bean.
Throws:
javax.ejb.CreateException
ObjectNotFoundException

edit

public FavoriteQuery edit(java.lang.String pFavoriteQueryId)
                   throws ObjectNotFoundException
Gets an editable version of a favorite query given the repository id of the favorite query.

Parameters:
pFavoriteQueryId - Id of the favorite query
Returns:
A FavoriteQuery ReposImpl.
Throws:
ObjectNotFoundException

getFavoriteQueryById

public FavoriteQuery getFavoriteQueryById(java.lang.String pFavoriteQueryId)
                                   throws ObjectNotFoundException
Finds a FavoriteQuery by it's repository id.

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

saveFavoriteQuery

public void saveFavoriteQuery(FavoriteQuery pFavoriteQuery)
                       throws javax.ejb.CreateException,
                              ObjectNotFoundException,
                              PersistenceException,
                              TransactionException,
                              javax.ejb.FinderException
Adds a query to a user's list of favorite searches. If the user already has saved the maximum number of searches, removes oldest search.

Parameters:
pProfile - user's profile favorite should be added to.
pQueryId - the repository id of an existing query you want to copy into a favorite query
Throws:
javax.ejb.CreateException - If the create fails.
ObjectNotFoundException - If the save fails.
PersistenceException - If the save fails.
TransactionException
javax.ejb.FinderException

deleteFavoriteQuery

public void deleteFavoriteQuery(java.lang.String pFavoriteQueryId)
                         throws ObjectNotFoundException,
                                PersistenceException
Throws:
ObjectNotFoundException
PersistenceException

getFavoriteQueries

public java.util.Collection getFavoriteQueries()
Returns a list of personal and public favorite queries visible to the current user. The list is ordered alphabetically by favorite query name.

Returns:
A list of the personal and public favorite queries visible to the user

getFavoriteQueries

public java.util.Collection getFavoriteQueries(java.lang.String pProfileId)
Returns a list of personal and public favorite queries visible to the user. The list is ordered alphabetically by favorite query name.

Parameters:
pProfileId - profile id of the user we're looking up.
Returns:
A list of the personal and public favorite queries visible to the user

getPersonalFavoriteQueries

public java.util.Collection getPersonalFavoriteQueries()
A list of the user's favorite personal queries - may include queries that the user has been pushed to groups.

Returns:
A list of the personal favorite queries for the current user listed alphabetically

getPersonalFavoriteQueries

public java.util.Collection getPersonalFavoriteQueries(java.lang.String pProfileId)
Parameters:
pProfileId - profile id of the user we're looking up.
Returns:
A list of the user's personal favorite queries listed alphabetically

getPublicFavoriteQueries

public java.util.Collection getPublicFavoriteQueries()
Returns:
A list of the public favorite queries visible to the current user. The list is ordered alphabetically by favorite query name.

getPublicFavoriteQueries

public java.util.Collection getPublicFavoriteQueries(java.lang.String pProfileId)
Parameters:
pProfileId - profile id of the user we're looking up.
Returns:
A list of the user's personal favorite queries listed from newest to oldest

getFavoriteSolutionQueries

public java.util.Collection getFavoriteSolutionQueries()
Returns a list of the personal and public favorite queries of type 'solution' that are visible to the current user. The list is ordered alphabetically by favorite query name.

Returns:
A list of the user's personal and public favorite solution queries

getFavoriteReviewQueries

public java.util.Collection getFavoriteReviewQueries()
Returns a list of the personal and public favorite queries of type 'review' that are visible to the current user. The list is ordered alphabetically by favorite query name.

Returns:
A list of the user's personal and public favorite review queries

getFavoriteQueriesByType

public java.util.Collection getFavoriteQueriesByType(java.lang.String pType)
Returns a list of personal and public favorite queries of the specified type that are visible to the current user. The list is ordered alphabetically by favorite query name.

Parameters:
queryType - query type "solution" or "review"
Returns:
A list of the user's personal and public favorite queries

getFavoriteQueriesByType

public java.util.Collection getFavoriteQueriesByType(java.lang.String pProfileId,
                                                     java.lang.String pType)
Returns a list of personal and public favorite queries of the specified type that are visible for the given user. The list is ordered alphabetically by favorite query name.

Parameters:
profileId - profile id of the user we're looking up.
queryType - query type "solution" or "review"
Returns:
A list of the user's favorite queries listed from newest to oldest

getPersonalFavoriteQueriesByType

public java.util.Collection getPersonalFavoriteQueriesByType(java.lang.String pType)
Parameters:
queryType - query type "solution" or "review"
Returns:
A list of the personal favorite queries for the current user listed alphabetically

getPersonalFavoriteQueriesByType

public java.util.Collection getPersonalFavoriteQueriesByType(java.lang.String pProfileId,
                                                             java.lang.String pType)
Parameters:
pProfileId - profile id of the user we're looking up.
queryType - query type "solution" or "review"
Returns:
A list of the user's personal favorite queries listed alphabetically

getPublicFavoriteQueriesByType

public java.util.Collection getPublicFavoriteQueriesByType(java.lang.String pType)
Parameters:
queryType - query type "solution" or "review"
Returns:
A list of the public favorite queries visible to the current user. The list is ordered alphabetically by favorite query name.

getPublicFavoriteQueriesByType

public java.util.Collection getPublicFavoriteQueriesByType(java.lang.String pProfileId,
                                                           java.lang.String pType)
Parameters:
pProfileId - profile id of the user we're looking up.
queryType - query type "solution" or "review"
Returns:
A list of the user's personal favorite queries listed alphabetically

getRecentQueries

public java.util.List getRecentQueries()
Returns the N most recent seraches performed by the currently logged in user.

See Also:
getRecentQueries(Profile)

getRecentQueries

public java.util.List getRecentQueries(atg.userprofiling.Profile pProfile)
Returns the N most recent searches performed by the user. Number of searches is configured in site option 'RecentSearchesMaximum'. The recent searches can span multiple knowledge sessions

Parameters:
pProfileId - user profile id to retrieve recent searches for
Returns:
List of KnowledgeQuery objects ordered from most recent to least recent.