atg.svc.repository.service
Class SolutionScoringService

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.SolutionScoringService
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
Direct Known Subclasses:
AsyncSolutionScoringService

public class SolutionScoringService
extends SharedService

Maintains the solution scoring. Also supports the retrieval of the the pre-defined solution lists

The lists:

Currently, other kind of list are not supported.

Updating the solution use count

The use count as defined means how many times a particular solution is refered to by a problem object. Hence, whenever a solution is linked to a problem the solution's use count should be incremented via incrementUseCount and whenever a solution is unlinked from a problem the use count should be decremented via decrementViewCount

Updating the solution view count

The view count as defined means how many times a particular solution is viewed. Hence, whenever a solution is viewed the solution's view count should be incremented via incrementViewCount. View count never decreases.

Updating the solution hot use count

Hot Use Count as defined means how many times a particular solution has been referred to within the specified duration in days in the past. For this a scheduler service needs to be run that will refresh the hot use count. This service would compute the hot use count and set the hot use count.

Issue: While updating the solution's hot use count it is possible that it's use/view count may change before saving the solution relevance object as a result a stale value for use/view count may get persisted. If the solution's use count changed, it may not be considered while computing the hot use count.

Defining the Utility Formulas for Solution's scores per list

When the fomula changes, the solution relevance scores would have to be recomputed.

In order to recompute the score for all the solutions a special method would have to be called that would compute and persist the score in batch mode for every solution relevance object.

Formulas can be defined as per the JEP specs.

There are three type of lists that are supported

  1. hot
  2. top
  3. qoaa all the solution that have been specifically defined as QOAA or are marked as Best Bet When the useBestBetOnly is set to true, explicitly defined QOAAs are ignored.

The service configuration property listFormulas should be used to set the formulas for the each list with the exception of hot solutions list. The service properties file is used to configuration.

The formulas can use the following restricted list of variables that correspond to the properties of solution relevance

  1. useCount
  2. viewCount
  3. hotUseCount

The solution relevance property names are configurable via the following methods

  1. For useCount getSolutionRelevanceUseCountPropertyName()
  2. For viewCount getSolutionRelevanceViewCountPropertyName()
  3. For hotUseCount getSolutionRelevanceHotUseCountPropertyName()

The default formulas are:

  1. hot the formula is empty and when it is not defined in this list, the one defined via the admin option is used. useCountWeight*hotUseCount+viewCountWeight*viewCount useCountWeight is provided via the admin option specified via getHotUseCountWeightPropertyName() viewCountWeight is provided via the admin option specified via getHotViewCountWeightPropertyName()
  2. top the formula is viewCount
  3. qoaathe formula is useCount

Defining the duration for Hot Counts

For hot use count durations can be specified via the admin option in days. The admin option is specified via getHotUseCountDurationPropertyName()

  1. Hot use count duration reads the site option gives the number of days.
NOTE: Don't call incrementUseCount or decrementUseCount directly. The use count is updated when you save a RecommendedAnswer that uses a solution. @see atg.svc.repository.service.RecommendedAnswerService#saveRecommendedAnswer(RecommendedAnswer, boolean)RecommendedAnswer(RecommendedAnswer, boolean)(RecommendedAnswer, boolean)


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static int sLISTORDERING_ASC
           
static int sLISTORDERING_DESC
           
static java.lang.String sLISTTYPE_HOT
           
static java.lang.String sLISTTYPE_QOAA
           
static java.lang.String sLISTTYPE_TOP
           
static java.lang.String sSOLUTION_SCORING_FILTER_CONTEXT_PATH
          The component path of the request scoped nucleus component that stores the filter context for filtering hot solutions, top questions and QOAA by topic and solution class.
 
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
SolutionScoringService()
           
 
Method Summary
 int computeHotScore(SolutionRelevance pSolutionRelevance)
          Computes the hot solution score, but does not update the SolutionRelevance item
 int computeHotUseCount(java.lang.String pSolutionId)
           
 int computeQOAAScore(SolutionRelevance pSolutionRelevance)
          Computes the hot solution score, but does not update the SolutionRelevance item
 void computeScore(SolutionRelevance pSolutionRelevance)
          Computes the hot, top and qoaa scores and updates those scores in the SolutionRelevance item
 int computeTopScore(SolutionRelevance pSolutionRelevance)
          Computes the hot solution score, but does not update the SolutionRelevance item
 SolutionRelevance create(atg.svc.repository.beans.Solution pSolution)
          Creates a new solution relevance bean for the specified solution.
 SolutionRelevance create(java.lang.String pSolutionId)
          Creates a new solution relevance bean for the specified solution.
 SolutionRelevance create(java.lang.String pSolutionId, java.lang.String pSolutionClassId)
          Creates a new solution relevance bean for the specified solution.
 int decrementHotUseCount(java.lang.String pSolutionId)
          Decrements the hot use count for the solution and saves it.
 int decrementUseCount(java.lang.String pSolutionId)
          Decrements the Use count for the solution and saves it.
 SolutionRelevance findByPrimaryKey(java.lang.String pSolutionRelevanceId)
          Finds a solution relevance object by the SolutionRelevance repository id.
 SolutionRelevance findBySolutionId(java.lang.String pSolutionId)
          Finds a solution relevance object by the solution's repository id.
 java.util.Collection getAllSolutionRelevance()
           
 java.util.Collection getBatchSolutionRelevance(java.lang.String pLastSolutionRelevanceId, int pBatchSize)
           
 atg.search.routing.command.search.DocumentSetConstraint[] getBestBetsCustomConstraints()
          A list of custom constraint components that can be used to further constrain the best bets (a.k.a.
 int getDefaultMax()
           
 int getDefaultOrdering()
           
 java.util.Locale getFilterLocale()
          Sets the locale used to fitler the results.
 java.util.List getHotSolutionClasses()
          get the HotSolutionClasses as configured in the options.
 java.lang.String getHotSolutionClassesPropertyName()
           
 java.util.Collection getHotSolutions()
          Deprecated. This function is being retained for backward compatibility but you should use getHotSolutionsAsSolutions() instead. Most callers want a list of Solution rather than a list of SolutionRelevance and getHotSolutionsAsSolutions() is more efficient than getting the SolutionRelevance and then retrieving the Solution by id. getHotSolutionsAsSolutions() will also make sure that non-deployed solutions are not returned in self-service.
NOTE: If you want to get the SolutionRelevance, you can also get it from Solution.getSolutionRelevance().
 java.util.Collection getHotSolutions(java.lang.String pSolutionClassId)
          Gets the Hot Solutions list
 java.util.Collection getHotSolutionsAsSolutions()
          Gets the Hot Solutions list
 java.util.List getHotSolutionsAsSolutions(int pMaxSolutions, java.util.Collection pTopicIds, java.util.Collection pSolutionClassIds)
          Gets the Hot Solutions list filtered by constraints and sorted by their hot score.
 atg.search.routing.command.search.DocumentSetConstraint[] getHotSolutionsCustomConstraints()
          A list of custom constraint components that can be used to further constrain the hot solutions query.
 java.util.List getHotSolutionTopics()
          get the HotSolutionTopics as configured in the options.
 java.lang.String getHotSolutionTopicsPropertyName()
           
 int getHotUseCountDuration()
          Get the HotUseCountDuration to be used in the scoring formula as defined in the site options.
 java.lang.String getHotUseCountDurationPropertyName()
           
 int getHotUseCountWeight()
          Get the HotUseCountWeight to be used in the scoring formula as defined in the site options.
 java.lang.String getHotUseCountWeightPropertyName()
           
 int getHotViewCountWeight()
          Get the HotViewCountWeight to be used in the scoring formula as defined in the site options.
 java.lang.String getHotViewCountWeightPropertyName()
           
 java.util.Map getListFormulas()
           
 java.util.Map getListMax()
           
 int getListOrderHotSolutions()
           
 java.util.Map getListOrdering()
           
 int getListOrderQOAASolutions()
           
 int getListOrderTopSolutions()
           
 java.lang.String[] getLists()
           
 int getMaxBestBets()
           
 int getMaxBestBets(atg.repository.RepositoryItem pProfile)
           
 java.lang.String getMaxBestBetsPropertyName()
           
 int getMaxHotSolutions()
           
 int getMaxHotSolutions(atg.repository.RepositoryItem pProfile)
           
 java.lang.String getMaxHotSolutionsPropertyName()
           
 int getMaxTopQuestions()
           
 int getMaxTopQuestions(atg.repository.RepositoryItem pProfile)
           
 java.lang.String getMaxTopQuestionsPropertyName()
           
 java.util.Collection getQOAAList()
          Gets the Questions Others are Asking List
 QOAAService getQOAAService()
           
 RecommendedAnswerService getRecommendedAnswerService()
           
 atg.svc.search.SearchLanguageService getSearchLanguageService()
           
 atg.svc.search.SearchService getSearchService()
           
 SiteService getSiteService()
           
 SolutionRelevance getSolutionRelevance(java.lang.String pSolutionId)
          Gets a SolutionRelevance object for the given solution id.
 java.lang.String getSolutionRelevanceHotUseCountPropertyName()
           
 java.lang.String getSolutionRelevanceUseCountPropertyName()
           
 java.lang.String getSolutionRelevanceViewCountPropertyName()
           
 atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
           
 SolutionService getSolutionService()
           
 java.util.Collection getTopSolutions()
          Deprecated. This function is being retained for backward compatibility but you should use getTopSolutionsAsSolutions() instead. Most callers want a list of Solution rather than a list of SolutionRelevance and getTopSolutionsAsSolutions() is more efficient than getting the SolutionRelevance and then retrieving the Solution by id. getTopSolutionsAsSolutions() will also make sure that non-deployed solutions are not returned in self-service.
NOTE: If you want to get the SolutionRelevance, you can also get it from Solution.getSolutionRelevance().
 java.util.Collection getTopSolutions(int pMaxSolutions, java.util.Collection pTopicIds, java.util.Collection pSolutionClassIds)
          Gets the Top Solutions list filtered by constraints and sorted by their top score.
 java.util.Collection getTopSolutions(java.lang.String pSolutionClassId)
          Gets the Top Solutions list
 java.util.Collection getTopSolutionsAsSolutions()
          Gets the Top Solutions list
 java.util.Collection getTopSolutionsAsSolutions(int pMaxSolutions, java.util.Collection pTopicIds, java.util.Collection pSolutionClassIds)
          Gets the Top Solutions list filtered by constraints and sorted by their top score.
 atg.search.routing.command.search.DocumentSetConstraint[] getTopSolutionsCustomConstraints()
          A list of custom constraint components that can be used to further constrain the top solutions query.
 UserOptionsService getUserOptionsService()
           
 int incrementHotUseCount(java.lang.String pSolutionId)
          Increments the hot use count for the solution and saves it.
 int incrementUseCount(java.lang.String pSolutionId)
          Increments the Use count for the solution and saves it.
 int incrementViewCount(java.lang.String pSolutionId)
          Increments the view count for the solution and saves it.
 boolean isAgentModule()
           
 boolean isFlexibleHotUseCount()
           
 boolean isUseBestBetOnly()
           
 void save(SolutionRelevance pSolutionRelevance)
          Saves a solution relevance object to the repository.
 void setAgentModule(boolean pAgentModule)
           
 void setBestBetsCustomConstraints(atg.search.routing.command.search.DocumentSetConstraint[] pBestBetsCustomConstraints)
           
 void setDefaultMax(int pDefaultMax)
           
 void setDefaultOrdering(int pDefaultOrdering)
           
 void setFlexibleHotUseCount(boolean pFlexibleHotUseCount)
           
 void setHotSolutionClassesPropertyName(java.lang.String pHotSolutionClassesPropertyName)
           
 void setHotSolutionsCustomConstraints(atg.search.routing.command.search.DocumentSetConstraint[] pHotSolutionsCustomConstraints)
           
 void setHotSolutionTopicsPropertyName(java.lang.String pHotSolutionTopicsPropertyName)
           
 int setHotUseCount(java.lang.String pSolutionId, int pHotUseCount)
          Sets the hot use count for the solution and saves it.
 void setHotUseCountDurationPropertyName(java.lang.String pHotUseCountDurationProperties)
           
 void setHotUseCountWeightPropertyName(java.lang.String pHotUseCountWeightPropertyName)
           
 void setHotViewCountWeightPropertyName(java.lang.String pHotViewCountWeightPropertyName)
           
 void setListFormulas(java.util.Map pListFormulas)
           
 void setListMax(java.util.Map pListMax)
           
 void setListOrdering(java.util.Map pListOrdering)
           
 void setLists(java.lang.String[] pLists)
           
 void setMaxBestBetsPropertyName(java.lang.String pMaxBestBetsPropertyName)
           
 void setMaxHotSolutionsPropertyName(java.lang.String pMaxHotSolutionsPropertyName)
           
 void setMaxTopQuestionsPropertyName(java.lang.String pMaxTopQuestionsPropertyName)
           
 void setQOAAService(QOAAService pQOAAService)
           
 void setRecommendedAnswerService(RecommendedAnswerService pRecommendedAnswerService)
           
 void setSearchLanguageService(atg.svc.search.SearchLanguageService pSearchLanguageService)
           
 void setSearchService(atg.svc.search.SearchService pSearchService)
           
 void setSiteService(SiteService pSiteService)
           
 void setSolutionRelevanceHotUseCountPropertyName(java.lang.String pSolutionRelevanceHotUseCountPropertyName)
           
 void setSolutionRelevanceUseCountPropertyName(java.lang.String pSolutionRelevanceUseCountPropertyName)
           
 void setSolutionRelevanceViewCountPropertyName(java.lang.String pSolutionRelevanceViewCountPropertyName)
           
 void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
           
 void setSolutionService(SolutionService pSolutionService)
           
 void setTopSolutionsCustomConstraints(atg.search.routing.command.search.DocumentSetConstraint[] pTopSolutionsCustomConstraints)
           
 void setUseBestBetOnly(boolean pUseBestBetOnly)
           
 void setUserOptionsService(UserOptionsService pUserOptionsService)
           
 int updateHotUseCount(SolutionRelevance pSolutionRelevance)
          Updates the hot use count and recomputes the score for the solution and saves the updated SolutionRelevance repository item.
 int updateHotUseCount(java.lang.String pSolutionId)
          Updates the hot use count and recomputes the score for the solution and saves the updated SolutionRelevance repository item.
 
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

sLISTTYPE_HOT

public static java.lang.String sLISTTYPE_HOT

sLISTTYPE_TOP

public static java.lang.String sLISTTYPE_TOP

sLISTTYPE_QOAA

public static java.lang.String sLISTTYPE_QOAA

sLISTORDERING_DESC

public static int sLISTORDERING_DESC

sLISTORDERING_ASC

public static int sLISTORDERING_ASC

sSOLUTION_SCORING_FILTER_CONTEXT_PATH

public static java.lang.String sSOLUTION_SCORING_FILTER_CONTEXT_PATH
The component path of the request scoped nucleus component that stores the filter context for filtering hot solutions, top questions and QOAA by topic and solution class. This component is used by the SolutionScoringTopicFilter and SolutionScoringSolutionClassFilter during filtering of hot solutions, top questions and best bets (i.e. questions others are asking - qoaa).

Constructor Detail

SolutionScoringService

public SolutionScoringService()
Method Detail

getRecommendedAnswerService

public RecommendedAnswerService getRecommendedAnswerService()

setRecommendedAnswerService

public void setRecommendedAnswerService(RecommendedAnswerService pRecommendedAnswerService)

getQOAAService

public QOAAService getQOAAService()

setQOAAService

public void setQOAAService(QOAAService pQOAAService)

getSiteService

public SiteService getSiteService()

setSiteService

public void setSiteService(SiteService pSiteService)

getUserOptionsService

public UserOptionsService getUserOptionsService()

setUserOptionsService

public void setUserOptionsService(UserOptionsService pUserOptionsService)

getSearchLanguageService

public atg.svc.search.SearchLanguageService getSearchLanguageService()

setSearchLanguageService

public void setSearchLanguageService(atg.svc.search.SearchLanguageService pSearchLanguageService)

getSearchService

public atg.svc.search.SearchService getSearchService()

setSearchService

public void setSearchService(atg.svc.search.SearchService pSearchService)

isAgentModule

public boolean isAgentModule()

setAgentModule

public void setAgentModule(boolean pAgentModule)

getHotSolutionsCustomConstraints

public atg.search.routing.command.search.DocumentSetConstraint[] getHotSolutionsCustomConstraints()
A list of custom constraint components that can be used to further constrain the hot solutions query. See /atg/svc/repository/service/util/CountryConstraint for an example constraint.

See Also:
CountryConstraint

setHotSolutionsCustomConstraints

public void setHotSolutionsCustomConstraints(atg.search.routing.command.search.DocumentSetConstraint[] pHotSolutionsCustomConstraints)

getTopSolutionsCustomConstraints

public atg.search.routing.command.search.DocumentSetConstraint[] getTopSolutionsCustomConstraints()
A list of custom constraint components that can be used to further constrain the top solutions query.

See Also:
atg.svc.repository.service.util.SolutionScoringConstraintImpl

setTopSolutionsCustomConstraints

public void setTopSolutionsCustomConstraints(atg.search.routing.command.search.DocumentSetConstraint[] pTopSolutionsCustomConstraints)

getBestBetsCustomConstraints

public atg.search.routing.command.search.DocumentSetConstraint[] getBestBetsCustomConstraints()
A list of custom constraint components that can be used to further constrain the best bets (a.k.a. QOAA) query.

See Also:
atg.svc.repository.service.util.SolutionScoringConstraintImpl

setBestBetsCustomConstraints

public void setBestBetsCustomConstraints(atg.search.routing.command.search.DocumentSetConstraint[] pBestBetsCustomConstraints)

getSolutionSecurityUtils

public atg.svc.repository.service.util.SolutionSecurityUtils getSolutionSecurityUtils()
Returns:
Returns the solutionSecurityUtils.

setSolutionSecurityUtils

public void setSolutionSecurityUtils(atg.svc.repository.service.util.SolutionSecurityUtils pSolutionSecurityUtils)
Parameters:
pSolutionSecurityUtils - The solutionSecurityUtils to set.

getSolutionService

public SolutionService getSolutionService()
Returns:
Returns the solutionService.

setSolutionService

public void setSolutionService(SolutionService pSolutionService)
Parameters:
pSolutionService - The solutionService to set.

getDefaultMax

public int getDefaultMax()
Returns:
Returns the defaultMax.

setDefaultMax

public void setDefaultMax(int pDefaultMax)
Parameters:
pDefaultMax - The defaultMax to set.

getDefaultOrdering

public int getDefaultOrdering()
Returns:
Returns the defaultOrdering.

setDefaultOrdering

public void setDefaultOrdering(int pDefaultOrdering)
Parameters:
pDefaultOrdering - The defaultOrdering to set.

getLists

public java.lang.String[] getLists()
Returns:
Returns the lists.

setLists

public void setLists(java.lang.String[] pLists)
Parameters:
pLists - The lists to set.

getListFormulas

public java.util.Map getListFormulas()
Returns:
Returns the listFormulas.

setListFormulas

public void setListFormulas(java.util.Map pListFormulas)
Parameters:
pListFormulas - The listFormulas to set.

getListMax

public java.util.Map getListMax()
Returns:
Returns the listMax.

setListMax

public void setListMax(java.util.Map pListMax)
Parameters:
pListMax - The listMax to set.

getMaxHotSolutions

public int getMaxHotSolutions()
Returns:
Returns the maxHotSolutions.

getMaxHotSolutions

public int getMaxHotSolutions(atg.repository.RepositoryItem pProfile)
Returns:
Returns the maxHotSolutions.

getMaxTopQuestions

public int getMaxTopQuestions()
Returns:
Returns the maxTopSolutions.

getMaxTopQuestions

public int getMaxTopQuestions(atg.repository.RepositoryItem pProfile)
Returns:
Returns the maxTopSolutions.

getMaxBestBets

public int getMaxBestBets()
Returns:
Returns the maxQOAASolutions.

getMaxBestBets

public int getMaxBestBets(atg.repository.RepositoryItem pProfile)
Returns:
Returns the maxQOAASolutions.

getListOrdering

public java.util.Map getListOrdering()
Returns:
Returns the listOrdering.

setListOrdering

public void setListOrdering(java.util.Map pListOrdering)
Parameters:
pListOrdering - The listOrdering to set.

getListOrderHotSolutions

public int getListOrderHotSolutions()
Returns:
Returns the maxHotSolutions.

getListOrderTopSolutions

public int getListOrderTopSolutions()
Returns:
Returns the maxTopSolutions.

getListOrderQOAASolutions

public int getListOrderQOAASolutions()
Returns:
Returns the maxQOAASolutions.

isFlexibleHotUseCount

public boolean isFlexibleHotUseCount()
Returns:
Returns the flexibleHotUseCount.

setFlexibleHotUseCount

public void setFlexibleHotUseCount(boolean pFlexibleHotUseCount)
Parameters:
pFlexibleHotUseCount - The flexibleHotUseCount to set.

isUseBestBetOnly

public boolean isUseBestBetOnly()
Returns:
Returns the useBestBetOnly.

setUseBestBetOnly

public void setUseBestBetOnly(boolean pUseBestBetOnly)
Parameters:
pUseBestBetOnly - The useBestBetOnly to set.

getHotSolutionClassesPropertyName

public java.lang.String getHotSolutionClassesPropertyName()
Returns:
Returns the hotSolutionClassesPropertyName.

setHotSolutionClassesPropertyName

public void setHotSolutionClassesPropertyName(java.lang.String pHotSolutionClassesPropertyName)
Parameters:
pHotSolutionClassesPropertyName - The hotSolutionClassesPropertyName to set.

getHotSolutionTopicsPropertyName

public java.lang.String getHotSolutionTopicsPropertyName()
Returns:
Returns the hotSolutionTopicsPropertyName.

setHotSolutionTopicsPropertyName

public void setHotSolutionTopicsPropertyName(java.lang.String pHotSolutionTopicsPropertyName)
Parameters:
pHotSolutionTopicsPropertyName - The hotSolutionTopicsPropertyName to set.

getMaxHotSolutionsPropertyName

public java.lang.String getMaxHotSolutionsPropertyName()

setMaxHotSolutionsPropertyName

public void setMaxHotSolutionsPropertyName(java.lang.String pMaxHotSolutionsPropertyName)

getMaxTopQuestionsPropertyName

public java.lang.String getMaxTopQuestionsPropertyName()

setMaxTopQuestionsPropertyName

public void setMaxTopQuestionsPropertyName(java.lang.String pMaxTopQuestionsPropertyName)

getMaxBestBetsPropertyName

public java.lang.String getMaxBestBetsPropertyName()

setMaxBestBetsPropertyName

public void setMaxBestBetsPropertyName(java.lang.String pMaxBestBetsPropertyName)

getHotUseCountDurationPropertyName

public java.lang.String getHotUseCountDurationPropertyName()
Returns:
Returns the hotUseCountDurationProperties.

setHotUseCountDurationPropertyName

public void setHotUseCountDurationPropertyName(java.lang.String pHotUseCountDurationProperties)
Parameters:
pHotUseCountDurationProperties - The hotUseCountDurationProperties to set.

getHotUseCountWeightPropertyName

public java.lang.String getHotUseCountWeightPropertyName()
Returns:
Returns the hotUseCountWeightPropertyName.

setHotUseCountWeightPropertyName

public void setHotUseCountWeightPropertyName(java.lang.String pHotUseCountWeightPropertyName)
Parameters:
pHotUseCountWeightPropertyName - The hotUseCountWeightPropertyName to set.

getHotViewCountWeightPropertyName

public java.lang.String getHotViewCountWeightPropertyName()
Returns:
Returns the hotViewCountWeightPropertyName.

setHotViewCountWeightPropertyName

public void setHotViewCountWeightPropertyName(java.lang.String pHotViewCountWeightPropertyName)
Parameters:
pHotViewCountWeightPropertyName - The hotViewCountWeightPropertyName to set.

getSolutionRelevanceUseCountPropertyName

public java.lang.String getSolutionRelevanceUseCountPropertyName()
Returns:
Returns the solutionRelevanceUseCountPropertyName.

setSolutionRelevanceUseCountPropertyName

public void setSolutionRelevanceUseCountPropertyName(java.lang.String pSolutionRelevanceUseCountPropertyName)
Parameters:
pSolutionRelevanceUseCountPropertyName - The solutionRelevanceUseCountPropertyName to set.

getSolutionRelevanceHotUseCountPropertyName

public java.lang.String getSolutionRelevanceHotUseCountPropertyName()
Returns:
Returns the solutionRelevanceHotUseCountPropertyName.

setSolutionRelevanceHotUseCountPropertyName

public void setSolutionRelevanceHotUseCountPropertyName(java.lang.String pSolutionRelevanceHotUseCountPropertyName)
Parameters:
pSolutionRelevanceHotUseCountPropertyName - The solutionRelevanceHotUseCountPropertyName to set.

getSolutionRelevanceViewCountPropertyName

public java.lang.String getSolutionRelevanceViewCountPropertyName()
Returns:
Returns the solutionRelevanceViewCountPropertyName.

setSolutionRelevanceViewCountPropertyName

public void setSolutionRelevanceViewCountPropertyName(java.lang.String pSolutionRelevanceViewCountPropertyName)
Parameters:
pSolutionRelevanceViewCountPropertyName - The solutionRelevanceViewCountPropertyName to set.

getHotSolutionClasses

public java.util.List getHotSolutionClasses()
                                     throws javax.ejb.FinderException,
                                            ObjectNotFoundException
get the HotSolutionClasses as configured in the options. Check the current user's preferences UserOptionsService.getArrayValue(String) If the option is set to null, an empty list is returned which implies "ALL SOLUTION CLASSES"

Throws:
javax.ejb.FinderException
ObjectNotFoundException

getHotSolutionTopics

public java.util.List getHotSolutionTopics()
                                    throws javax.ejb.FinderException,
                                           ObjectNotFoundException
get the HotSolutionTopics as configured in the options. Check the current user's preferences UserOptionsService.getArrayValue(String) If the option is set to null, an empty list is returned which implies "ALL TOPICS"

Throws:
javax.ejb.FinderException
ObjectNotFoundException

getHotUseCountWeight

public int getHotUseCountWeight()
                         throws ObjectNotFoundException
Get the HotUseCountWeight to be used in the scoring formula as defined in the site options. Check the current site option value preferences SiteService.getIntegerValue(String)

Throws:
ObjectNotFoundException - when the site option getHotUseCountWeightPropertyName() is not found.

getHotViewCountWeight

public int getHotViewCountWeight()
                          throws ObjectNotFoundException
Get the HotViewCountWeight to be used in the scoring formula as defined in the site options. Check the current site option value preferences SiteService.getIntegerValue(String)

Throws:
ObjectNotFoundException - when the site option getHotViewCountWeightPropertyName() is not found.

getHotUseCountDuration

public int getHotUseCountDuration()
                           throws ObjectNotFoundException
Get the HotUseCountDuration to be used in the scoring formula as defined in the site options. Check the current site option value preferences SiteService.getIntegerValue(String)

Throws:
ObjectNotFoundException - when the site option getHotUseCountDurationPropertyName() is not found.

getHotSolutions

public java.util.Collection getHotSolutions()
                                     throws javax.ejb.FinderException,
                                            ObjectNotFoundException
Deprecated. This function is being retained for backward compatibility but you should use getHotSolutionsAsSolutions() instead. Most callers want a list of Solution rather than a list of SolutionRelevance and getHotSolutionsAsSolutions() is more efficient than getting the SolutionRelevance and then retrieving the Solution by id. getHotSolutionsAsSolutions() will also make sure that non-deployed solutions are not returned in self-service.
NOTE: If you want to get the SolutionRelevance, you can also get it from Solution.getSolutionRelevance().

Gets the Hot Solutions list

Returns:
A collection of Solution Releavance objects
Throws:
javax.ejb.FinderException - When an error occurs
ObjectNotFoundException - When solution not found
See Also:
getHotSolutionsAsSolutions()

getHotSolutionsAsSolutions

public java.util.Collection getHotSolutionsAsSolutions()
                                                throws javax.servlet.jsp.JspException
Gets the Hot Solutions list

Returns:
A collection of Solution objects
Throws:
javax.servlet.jsp.JspException - When an error occurs

getHotSolutions

public java.util.Collection getHotSolutions(java.lang.String pSolutionClassId)
                                     throws javax.ejb.FinderException,
                                            ObjectNotFoundException
Gets the Hot Solutions list

Parameters:
pSolutionClass - The solution class RepItem
Returns:
A collection of Solution Releavance objects
Throws:
javax.ejb.FinderException - When an error occurs
ObjectNotFoundException - When solution not found

getHotSolutionsAsSolutions

public java.util.List getHotSolutionsAsSolutions(int pMaxSolutions,
                                                 java.util.Collection pTopicIds,
                                                 java.util.Collection pSolutionClassIds)
                                          throws javax.ejb.FinderException,
                                                 ObjectNotFoundException
Gets the Hot Solutions list filtered by constraints and sorted by their hot score.

Parameters:
pMaxSolutions - The max number of solutions to be returned.
pTopicIds - A collection of topic repIds that will used as filter constraints. Empty or null means all topics
pSolutionClassIds - A collection of solution class repIds that will be used as filter constraints. Empty or null means all solution classes
Returns:
A collection of Solution objects
Throws:
javax.ejb.FinderException - When an error occurs
javax.ejb.EJBException
ObjectNotFoundException

getTopSolutions

public java.util.Collection getTopSolutions()
                                     throws javax.ejb.FinderException,
                                            ObjectNotFoundException
Deprecated. This function is being retained for backward compatibility but you should use getTopSolutionsAsSolutions() instead. Most callers want a list of Solution rather than a list of SolutionRelevance and getTopSolutionsAsSolutions() is more efficient than getting the SolutionRelevance and then retrieving the Solution by id. getTopSolutionsAsSolutions() will also make sure that non-deployed solutions are not returned in self-service.
NOTE: If you want to get the SolutionRelevance, you can also get it from Solution.getSolutionRelevance().

Gets the Top Solutions list

Returns:
A collection of Solution Releavance objects
Throws:
javax.ejb.FinderException - When an error occurs
ObjectNotFoundException - When solution not found
See Also:
getTopSolutionsAsSolutions()

getTopSolutions

public java.util.Collection getTopSolutions(java.lang.String pSolutionClassId)
                                     throws javax.ejb.FinderException,
                                            ObjectNotFoundException
Gets the Top Solutions list

Parameters:
pSolutionClass - The solution class RepItem
Returns:
A collection of Solution Releavance objects
Throws:
javax.ejb.FinderException - When an error occurs
ObjectNotFoundException - When solution not found

getTopSolutions

public java.util.Collection getTopSolutions(int pMaxSolutions,
                                            java.util.Collection pTopicIds,
                                            java.util.Collection pSolutionClassIds)
                                     throws javax.ejb.FinderException,
                                            ObjectNotFoundException,
                                            javax.ejb.EJBException
Gets the Top Solutions list filtered by constraints and sorted by their top score.

Parameters:
pMaxSolutions - The max number of solutions to be returned.
pTopicIds - A collection of topic repIds that will used as filter constraints. Empty or null means all topics
pSolutionClassIds - A collection of solution class repIds that will be used as filter constraints. Empty or null means all solution classes
Returns:
A collection of Solution Releavance objects
Throws:
javax.ejb.FinderException - When an error occurs
javax.ejb.EJBException
ObjectNotFoundException - When solution not found

getTopSolutionsAsSolutions

public java.util.Collection getTopSolutionsAsSolutions()
                                                throws javax.servlet.jsp.JspException
Gets the Top Solutions list

Returns:
A collection of Solution objects
Throws:
javax.ejb.FinderException - When an error occurs
ObjectNotFoundException - When solution not found
javax.servlet.jsp.JspException

getTopSolutionsAsSolutions

public java.util.Collection getTopSolutionsAsSolutions(int pMaxSolutions,
                                                       java.util.Collection pTopicIds,
                                                       java.util.Collection pSolutionClassIds)
                                                throws javax.ejb.FinderException,
                                                       ObjectNotFoundException,
                                                       javax.ejb.EJBException
Gets the Top Solutions list filtered by constraints and sorted by their top score.

Parameters:
pMaxSolutions - The max number of solutions to be returned.
pTopicIds - A collection of topic repIds that will used as filter constraints. Empty or null means all topics
pSolutionClassIds - A collection of solution class repIds that will be used as filter constraints. Empty or null means all solution classes
Returns:
A collection of Solution objects
Throws:
javax.ejb.FinderException - When an error occurs
javax.ejb.EJBException
ObjectNotFoundException

getQOAAList

public java.util.Collection getQOAAList()
                                 throws javax.servlet.jsp.JspException
Gets the Questions Others are Asking List

Returns:
A collection of Solution is returned for both best bets and questions others are asking settings If useBestBetOnly is true, returns only solutions marked as best bets. If false, uses the questions others are asking (QOAA) list.
Throws:
javax.ejb.FinderException - When an error occurs
ObjectNotFoundException - When solution not found
javax.servlet.jsp.JspException

findByPrimaryKey

public SolutionRelevance findByPrimaryKey(java.lang.String pSolutionRelevanceId)
                                   throws ObjectNotFoundException
Finds a solution relevance object by the SolutionRelevance repository id.

Parameters:
pSolutionRelevanceId - The repository id of solution relevance object
Returns:
The SolutionRelevance ReposImpl
Throws:
ObjectNotFoundException - If the id is not found.

findBySolutionId

public SolutionRelevance findBySolutionId(java.lang.String pSolutionId)
Finds a solution relevance object by the solution's repository id.

Parameters:
pSolutionId - The repository id of Solution object
Returns:
The SolutionRelevance ReposImpl or null if the SolutionRelevance doesn't exist

create

public SolutionRelevance create(java.lang.String pSolutionId)
                         throws javax.ejb.CreateException,
                                ObjectNotFoundException
Creates a new solution relevance bean for the specified solution. Use save to persist the solution relevance object.

Parameters:
pSolutionId - Solution RepId
Returns:
new SolutionRelevance repository item.
Throws:
javax.ejb.CreateException - If the create fails.
ObjectNotFoundException - when the solution is not found.

create

public SolutionRelevance create(atg.svc.repository.beans.Solution pSolution)
                         throws javax.ejb.CreateException
Creates a new solution relevance bean for the specified solution. Use save to persist the solution relevance object.

Parameters:
pSolution - Solution Repository item.
Returns:
new SolutionRelevance repository item.
Throws:
javax.ejb.CreateException - If the create fails.

create

public SolutionRelevance create(java.lang.String pSolutionId,
                                java.lang.String pSolutionClassId)
                         throws javax.ejb.CreateException
Creates a new solution relevance bean for the specified solution. Use save to persist the solution relevance object.

Parameters:
pSolution - Solution id
pSolutionClassId - SolutionClass id of the solution
Returns:
new SolutionRelevance repository item.
Throws:
javax.ejb.CreateException - If the create fails.

getSolutionRelevance

public SolutionRelevance getSolutionRelevance(java.lang.String pSolutionId)
                                       throws ObjectNotFoundException,
                                              javax.ejb.CreateException,
                                              PersistenceException
Gets a SolutionRelevance object for the given solution id. In case it does not exist a new SolutionRelevance object would be created.

Parameters:
pSolutionId - Solution RepId
Returns:
new SolutionRelevance Repository item
Throws:
ObjectNotFoundException - when the solution is not found
javax.ejb.CreateException - If the create for solution relevance object fails.
PersistenceException - If unable to save the newly created solution relevance object

save

public void save(SolutionRelevance pSolutionRelevance)
          throws ObjectNotFoundException,
                 PersistenceException
Saves a solution relevance object to the repository. It should have the id. The existing object is updated.

Parameters:
pSolutionRelevance - The solution relevance to save.
Throws:
ObjectNotFoundException
PersistenceException

incrementUseCount

public int incrementUseCount(java.lang.String pSolutionId)
                      throws javax.ejb.CreateException,
                             ObjectNotFoundException,
                             PersistenceException
Increments the Use count for the solution and saves it.

Parameters:
pSolutionId - The RepId of the solution
Returns:
the old use count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

decrementUseCount

public int decrementUseCount(java.lang.String pSolutionId)
                      throws javax.ejb.CreateException,
                             ObjectNotFoundException,
                             PersistenceException
Decrements the Use count for the solution and saves it.

Parameters:
pSolutionId - The RepId of the solution
Returns:
the old use count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

incrementViewCount

public int incrementViewCount(java.lang.String pSolutionId)
                       throws javax.ejb.CreateException,
                              ObjectNotFoundException,
                              PersistenceException
Increments the view count for the solution and saves it.

Parameters:
pSolutionId - The RepId of the solution
Returns:
the old view count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

computeHotUseCount

public int computeHotUseCount(java.lang.String pSolutionId)
                       throws ObjectNotFoundException
Throws:
ObjectNotFoundException

updateHotUseCount

public int updateHotUseCount(java.lang.String pSolutionId)
                      throws javax.ejb.CreateException,
                             ObjectNotFoundException,
                             PersistenceException
Updates the hot use count and recomputes the score for the solution and saves the updated SolutionRelevance repository item.

Parameters:
pSolutionId - The RepId of the solution
pSolutionClassId - The repId of the SolutionClass
Returns:
the old hot use count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

updateHotUseCount

public int updateHotUseCount(SolutionRelevance pSolutionRelevance)
                      throws javax.ejb.CreateException,
                             ObjectNotFoundException,
                             PersistenceException
Updates the hot use count and recomputes the score for the solution and saves the updated SolutionRelevance repository item.

Parameters:
pSolutionId - The RepId of the solution
pSolutionClassId - The repId of the SolutionClass
Returns:
the old hot use count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

incrementHotUseCount

public int incrementHotUseCount(java.lang.String pSolutionId)
                         throws javax.ejb.CreateException,
                                ObjectNotFoundException,
                                PersistenceException
Increments the hot use count for the solution and saves it.

Parameters:
pSolutionId - The RepId of the solution
Returns:
the old hot use count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

decrementHotUseCount

public int decrementHotUseCount(java.lang.String pSolutionId)
                         throws javax.ejb.CreateException,
                                ObjectNotFoundException,
                                PersistenceException
Decrements the hot use count for the solution and saves it.

Parameters:
pSolutionId - The RepId of the solution
Returns:
the old hot use count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

setHotUseCount

public int setHotUseCount(java.lang.String pSolutionId,
                          int pHotUseCount)
                   throws javax.ejb.CreateException,
                          ObjectNotFoundException,
                          PersistenceException
Sets the hot use count for the solution and saves it.

Parameters:
pSolutionId - The RepId of the solution
pHotUseCount -
Returns:
the old hot use count
Throws:
javax.ejb.CreateException - If the create for solution relevance object fails.
ObjectNotFoundException - when a solution is not found
PersistenceException - problems saving the solution relevance object

computeScore

public void computeScore(SolutionRelevance pSolutionRelevance)
Computes the hot, top and qoaa scores and updates those scores in the SolutionRelevance item


computeHotScore

public int computeHotScore(SolutionRelevance pSolutionRelevance)
Computes the hot solution score, but does not update the SolutionRelevance item

Returns:
The hot solution score

computeTopScore

public int computeTopScore(SolutionRelevance pSolutionRelevance)
Computes the hot solution score, but does not update the SolutionRelevance item

Returns:
The top solution score

computeQOAAScore

public int computeQOAAScore(SolutionRelevance pSolutionRelevance)
Computes the hot solution score, but does not update the SolutionRelevance item

Returns:
The qoaa solution score

getFilterLocale

public java.util.Locale getFilterLocale()
Sets the locale used to fitler the results. Agent uses the default query locale. Overriden in self-service to use the display language


getAllSolutionRelevance

public java.util.Collection getAllSolutionRelevance()
                                             throws ObjectNotFoundException
Throws:
ObjectNotFoundException

getBatchSolutionRelevance

public java.util.Collection getBatchSolutionRelevance(java.lang.String pLastSolutionRelevanceId,
                                                      int pBatchSize)
                                               throws ObjectNotFoundException
Parameters:
pLastSolutionRelevanceId - - the id of the last item returned in the previous batch or null if this is the first batch. We retrieve items greater than this id.
pBatchSize - - the number of SolutionRelevance to retrieve
Returns:
Throws:
ObjectNotFoundException