atg.svc.repository.service
Class FavoriteQueryService

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.FavoriteQueryService
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 FavoriteQueryService
extends SharedService

Business methods for KnowledgeSession 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.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
FavoriteQueryService()
           
 
Method Summary
 atg.svc.repository.beans.FavoriteQuery createFavoriteQuery()
          Creates a new transient FavoriteQuery repository bean.
 atg.svc.repository.beans.FavoriteQuery createFavoriteQuery(java.lang.String pQueryId)
          Creates a new transient FavoriteQuery repository bean.
 void deleteFavoriteQuery(java.lang.String pFavoriteQueryId)
           
 atg.svc.repository.beans.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.
 atg.svc.repository.beans.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()
           
 SessionService getSessionService()
           
 UserOptionsService getUserOptionsService()
           
 void saveFavoriteQuery(atg.svc.repository.beans.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
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, 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
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 atg.svc.repository.beans.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 atg.svc.repository.beans.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 atg.svc.repository.beans.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 atg.svc.repository.beans.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(atg.svc.repository.beans.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:
pFavoriteQuery - Query to add.
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:
pType - 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:
pProfileId - profile id of the user we're looking up.
pType - 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:
pType - 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.
pType - 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:
pType - 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.
pType - query type "solution" or "review"
Returns:
A list of the user's personal favorite queries listed alphabetically