atg.svc.repository.service
Class ProfileService

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.FrameworkProfileService
                  extended by atg.svc.repository.service.ProfileService
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={"optionService","sessionService","favoriteQueryService","queryService","foravoritesService","recommendedReadingService"})
public class ProfileService
extends FrameworkProfileService

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
ProfileService()
           
 
Method Summary
 void clearProfile()
          Clears all Service-related profile attributes including problems, knowledge sessions and all favorite queries.
 void clearProfile(java.lang.String pProfile)
          Clears all Service-related profile attributes including problems, knowledge sessions and all favorite queries.
 FavoriteQueryService getFavoriteQueryService()
           
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites()
          Returns the Collection of the Favorites of the currently logged in users.
 java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites(java.lang.String pProfile)
          Returns the Collection of the Favorites of specified users.
 FavoritesService getFavoritesService()
           
 java.util.List<atg.svc.repository.beans.KnowledgeQuery> getLastVisitQueries()
          Returns the N most recent searches performed during the last visit.
 java.util.List<atg.svc.repository.beans.KnowledgeQuery> getLastVisitQueries(atg.userprofiling.Profile pProfile)
          Returns the N most recent searches performed during the last visit.
 java.util.List<ViewedAnswer> getLastVisitViewedAnswers()
          Returns the N most recent answers viewed by the currently logged in user during the last session.
 java.util.List<ViewedAnswer> getLastVisitViewedAnswers(atg.userprofiling.Profile pProfile)
          Returns the N most recent answers viewed by the user during the last visit.
 int getMaxRecentSessions()
          maxRecentSessions limits the number of recent sessions we iterate thru when building recent searches, recent viewed answers and recent topics.
 atg.svc.repository.beans.KnowledgeQuery getMostRecentQuery()
          Returns the most recent qurery performed.
 atg.svc.repository.service.OptionService getOptionService()
           
 java.lang.String getOrganizationNameById(java.lang.String pOrgId)
          Gets the name of an organization item from the current user's profile repository given the id.
 java.lang.String getOrganizationViewName()
          "organization" item descriptor name
 QueryService getQueryService()
           
 java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueries()
          Returns the N most recent seraches performed by the currently logged in user in SelfService.
 java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueries(atg.userprofiling.Profile pProfile)
          Returns the N most recent searches performed by the user.
 java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueries(atg.userprofiling.Profile pProfile, java.lang.String pOptionName)
          Returns the N most recent searches performed by the user.
 java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueriesForAgent()
          Returns the N most recent seraches performed by the currently logged in user in Agent WorkSpace.
 java.util.List<ViewedAnswer> getRecentViewedAnswers()
          Returns the N most recent answers viewed by the currently logged in user using SelfService option.
 java.util.List<ViewedAnswer> getRecentViewedAnswers(atg.userprofiling.Profile pProfile)
          Returns the N most recent answers viewed by the user.
 java.util.List<ViewedAnswer> getRecentViewedAnswers(atg.userprofiling.Profile pProfile, java.lang.String pOptionName)
          Returns the N most recent answers viewed by the user.
 java.util.List<ViewedAnswer> getRecentViewedAnswersForAgent()
          Returns the N most recent answers viewed by the currently logged in user using Agent option.
 java.util.Collection<atg.svc.repository.beans.RecommendedReading> getRecommendedReading()
          Returns the Collection of the RecommendedReading of the currently logged in users.
 RecommendedReadingService getRecommendedReadingService()
           
 SessionService getSessionService()
           
 void setFavoriteQueryService(FavoriteQueryService pFavoriteQueryService)
           
 void setFavoritesService(FavoritesService pFavoritesService)
           
 void setMaxRecentSessions(int pMaxRecentSessions)
          maxRecentSessions limits the number of recent sessions we iterate thru when building recent searches, recent viewed answers and recent topics.
 void setOptionService(atg.svc.repository.service.OptionService pOptionService)
           
 void setOrganizationViewName(java.lang.String pOrganizationViewName)
          "organization" item descriptor name
 void setQueryService(QueryService pQueryService)
           
 void setRecommendedReadingService(RecommendedReadingService pRecommendedReadingService)
           
 void setSessionService(SessionService pSessionService)
           
 
Methods inherited from class atg.svc.repository.service.FrameworkProfileService
getExternalProfileTools, getExternalUserById, getProfileTools, getRecentTickets, getRecentTickets, getRecentTickets, getRecentTickets, getRecentTicketsService, getRecentTicketsViewed, getRecentTicketsWorked, getUserById, setExternalProfileTools, setProfileTools, setRecentTicketsService
 
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

ProfileService

public ProfileService()
Method Detail

getOptionService

public atg.svc.repository.service.OptionService getOptionService()
See Also:
OptionService

setOptionService

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

getSessionService

public SessionService getSessionService()
See Also:
SessionService

setSessionService

public void setSessionService(SessionService pSessionService)
See Also:
SessionService

getFavoriteQueryService

public FavoriteQueryService getFavoriteQueryService()
See Also:
FavoriteQueryService

setFavoriteQueryService

public void setFavoriteQueryService(FavoriteQueryService pFavoriteQueryService)
See Also:
FavoriteQueryService

getQueryService

public QueryService getQueryService()
See Also:
QueryService

setQueryService

public void setQueryService(QueryService pQueryService)
See Also:
QueryService

getFavoritesService

public FavoritesService getFavoritesService()
See Also:
FavoritesService

setFavoritesService

public void setFavoritesService(FavoritesService pFavoritesService)
See Also:
FavoritesService

getRecommendedReadingService

public RecommendedReadingService getRecommendedReadingService()
See Also:
RecommendedReadingService

setRecommendedReadingService

public void setRecommendedReadingService(RecommendedReadingService pRecommendedReadingService)
See Also:
RecommendedReadingService

getMaxRecentSessions

public int getMaxRecentSessions()
maxRecentSessions limits the number of recent sessions we iterate thru when building recent searches, recent viewed answers and recent topics. This limit is done for performance reasons to prevent iterating thru all the users sessions. It's extremely unlikely we will hit this limit except when tested by a really brain-dead load test that always asks the same question, but since customers may write such a load test, this is here just as a precaution.


setMaxRecentSessions

public void setMaxRecentSessions(int pMaxRecentSessions)
maxRecentSessions limits the number of recent sessions we iterate thru when building recent searches, recent viewed answers and recent topics. This limit is done for performance reasons to prevent iterating thru all the users sessions. It's extremely unlikely we will hit this limit except when tested by a really brain-dead load test that always asks the same question, but since customers may write such a load test, this is here just as a precaution.


getOrganizationViewName

public java.lang.String getOrganizationViewName()
"organization" item descriptor name


setOrganizationViewName

public void setOrganizationViewName(java.lang.String pOrganizationViewName)
"organization" item descriptor name


getFavorites

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites()
Returns the Collection of the Favorites of the currently logged in users.

Returns:
Collection

getFavorites

public java.util.Collection<atg.svc.repository.beans.Favorites> getFavorites(java.lang.String pProfile)
Returns the Collection of the Favorites of specified users.

Parameters:
pProfile - user profile to retrieve favorites
Returns:
Collection

getRecommendedReading

public java.util.Collection<atg.svc.repository.beans.RecommendedReading> getRecommendedReading()
                                                                                        throws SvcException
Returns the Collection of the RecommendedReading of the currently logged in users.

Returns:
Collection
Throws:
SvcException

getMostRecentQuery

public atg.svc.repository.beans.KnowledgeQuery getMostRecentQuery()
Returns the most recent qurery performed.

Returns:
KnowledgeQuery or null if no previous queries have been performed.

getRecentQueriesForAgent

public java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueriesForAgent()
Returns the N most recent seraches performed by the currently logged in user in Agent WorkSpace.

Returns:
List of KnowledgeQuery objects ordered from most recent to least recent.
See Also:
getRecentQueries(Profile)

getRecentQueries

public java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueries()
Returns the N most recent seraches performed by the currently logged in user in SelfService.

Returns:
List of KnowledgeQuery objects ordered from most recent to least recent.
See Also:
getRecentQueries(Profile)

getRecentQueries

public java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueries(atg.userprofiling.Profile pProfile)
Returns the N most recent searches performed by the user. Number of searches is configured for SelfService in site option 'UserRecentHistoryMax'. The recent searches can span multiple knowledge sessions

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

getRecentQueries

public java.util.List<atg.svc.repository.beans.KnowledgeQuery> getRecentQueries(atg.userprofiling.Profile pProfile,
                                                                                java.lang.String pOptionName)
Returns the N most recent searches performed by the user. Number of searches is configured in site option 'UserRecentHistoryMax'. The recent searches can span multiple knowledge sessions

Parameters:
pProfile - user profile to retrieve recent searches for
pOptionName - name of the option to limit query
Returns:
List of KnowledgeQuery objects ordered from most recent to least recent.

getLastVisitQueries

public java.util.List<atg.svc.repository.beans.KnowledgeQuery> getLastVisitQueries()
Returns the N most recent searches performed during the last visit.

See Also:
getLastVisitQueries(Profile)

getLastVisitQueries

public java.util.List<atg.svc.repository.beans.KnowledgeQuery> getLastVisitQueries(atg.userprofiling.Profile pProfile)
Returns the N most recent searches performed during the last visit. Number of searches to return is configured in site option 'UserResultsHistoryMax'

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

getRecentViewedAnswersForAgent

public java.util.List<ViewedAnswer> getRecentViewedAnswersForAgent()
Returns the N most recent answers viewed by the currently logged in user using Agent option.


getRecentViewedAnswers

public java.util.List<ViewedAnswer> getRecentViewedAnswers()
Returns the N most recent answers viewed by the currently logged in user using SelfService option.

See Also:
getRecentViewedAnswers(Profile)

getRecentViewedAnswers

public java.util.List<ViewedAnswer> getRecentViewedAnswers(atg.userprofiling.Profile pProfile)
Returns the N most recent answers viewed by the user. Number of answers viewed is configured in site option 'UserRecentAnswersMax'. The recent answers viewed can span multiple knowledge sessions This method uses the SelfService option for max recent viewed answers

Parameters:
pProfile - user profile to retrieve recent searches for
Returns:
List of ViewedAnswer objects ordered from most recent to least recent.

getRecentViewedAnswers

public java.util.List<ViewedAnswer> getRecentViewedAnswers(atg.userprofiling.Profile pProfile,
                                                           java.lang.String pOptionName)
Returns the N most recent answers viewed by the user. Number of answers viewed is configured in site option 'UserRecentAnswersMax'. The recent answers viewed can span multiple knowledge sessions

Parameters:
pProfile - user profile to retrieve recent searches for
pOptionName - name of the option to limit query
Returns:
List of ViewedAnswer objects ordered from most recent to least recent.

getLastVisitViewedAnswers

public java.util.List<ViewedAnswer> getLastVisitViewedAnswers()
Returns the N most recent answers viewed by the currently logged in user during the last session.

See Also:
getLastVisitViewedAnswers(Profile)

getLastVisitViewedAnswers

public java.util.List<ViewedAnswer> getLastVisitViewedAnswers(atg.userprofiling.Profile pProfile)
Returns the N most recent answers viewed by the user during the last visit. The number of answers viewed is configured in site option 'UserResultsAnswersMax'. The recent answers viewed can span multiple knowledge sessions

Parameters:
pProfile - user profile to retrieve recent searches for
Returns:
List of ViewedAnswer objects ordered from most recent to least recent.

clearProfile

public void clearProfile()
                  throws ObjectNotFoundException,
                         PersistenceException
Clears all Service-related profile attributes including problems, knowledge sessions and all favorite queries. Used by SystemTests to clear changes after each unit test.

Throws:
ObjectNotFoundException
PersistenceException

clearProfile

public void clearProfile(java.lang.String pProfile)
                  throws ObjectNotFoundException,
                         PersistenceException
Clears all Service-related profile attributes including problems, knowledge sessions and all favorite queries. Used by SystemTests to clear changes after each unit test.

Throws:
ObjectNotFoundException
PersistenceException

getOrganizationNameById

public java.lang.String getOrganizationNameById(java.lang.String pOrgId)
                                         throws ObjectNotFoundException
Gets the name of an organization item from the current user's profile repository given the id.

Parameters:
pOrgId - The repository id of the organization.
Returns:
The name of the organization.
Throws:
ObjectNotFoundException - If the item cannot be found in the repository.