atg.svc.repository.service
Class TopicServiceImpl

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.searchadmin.repository.service.TopicRepositoryService
              extended by atg.searchadmin.repository.service.TopicServiceImpl
                  extended by atg.svc.repository.service.TopicServiceImpl
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, atg.searchadmin.repository.service.TopicService, java.util.EventListener

public class TopicServiceImpl
extends atg.searchadmin.repository.service.TopicServiceImpl
implements atg.searchadmin.repository.service.TopicService

TopicService 2006.2 Business methods - Create, Retrieve(by id), Save and Delete for the Topic object.

Following methods are used for Topic Administration

The topic tree has one pre-defined root topic (id = 1, parent is null). This topic is called the system root topic. Directly underneath the system root topic are the taxonomy topics. Each taxonomy acts as a separate topic tree that can be included in indexing content templates. The topics directly underneath the taxonomy topics are called the root topics. These topics are the top-level visible topics in the UI.

  /Topics
      /ATG
          /ATG Products
          /ATG Supported App Servers
          /ATG Supported Browsers
      /ATG Customer Service
          /Billing
          /Technical Support
          /Sales
 
 

In the preceding example, 'Topics' is the system root topic. 'ATG' and 'ATG Customer Service' are taxonomies. They are represented as special taxonomy nodes in the ATG Search Management Console, but do not appear in the Self-Service and Workspace UIs. The children directly below the taxonomies (e.g. ATG Products) are the root topics displayed in the UI.

The topics in the topic tree can be labeled to indicate that this node is the root of a labeled topic tree. Note that there can be only one labeled node per label accross all the topic trees.

A TopicLabel rep item should be created. Use TopicLabel.setTopic(atg.searchadmin.repository.beans.Topic) to mark a topic as root of the labeled topic tree. Although it does not make sense but the API does not prevent from having a topic act as root for two labeled topic trees.

TopicLabel management is done by atg.svc.repository.service.TopicLabelService.

For example, The traversal of the topic tree is supported by the following

For example, TopicService topicService = <...>; // initialize this TopicLabelService topicLabelService = topicService.getTopicLabelService(); Collection root = getTopTopics(); // roots has the topic (id=products) Collection childrenOfRoot = topicService.getChildren(rootTopic.iter().next()); // has the Topics (id=eserver) and (id=es) ... Topic eServerTopic = topicService.getRootTopicByLabel("eServerLbl"); // topic with id=eserver Collection childrenOfEServer = topicService.getChildren(eServerTopic); // has the topic (id=iview) ... Topic esTopic = topicService.getRootTopicByLabel("esLbl"); // topic with id=eserver Collection childrenOfES = topicService.getChildren(esTopic); // empty collection ... Collection includeLabels = new ArrayList("eServerLbl"); Collection excludeLabels = new ArrayList("esLbl"); Collection childrenOfRootSet2 = topicService.getChildrenByLabelIds(rootTopic, includeLabels, excludeLabels, false); // returns topic (id=eserver)

In order to get the ancestors of a topic use the following:

If the query (only labeled tree) is made that is on a wrong tree an exception will be thrown.

For example, TopicService topicService = <...>; // initialize this TopicLabelService topicLabelService = topicService.getTopicLabelService(); Topic topicIView = topicService.findByPrimaryKey("iview"); Collection iviewAncs = topicService.getTopicAncestors(topicIView); // returns Products and eServer Collection iviewLblAncs = topicService.getTopicAncestorsByLabelId(topicIView, eServerLbl); // returns eServer Collection iviewAnyLblAncs = topicService.getTopicAncestorsByLabelId(topicIView, null); // returns eServer

There is also a need to display only the non-empty topics i.e. Topics that are used at least once in a solution. This is achieved by setting a flag in most of the methods. Please note that the use count feature is yet to be fully implemented.

For example, Let us say there are two solution classes - FAQ and Fix 'Product' has 3 FAQ solutions directly associated with it. 'eServer' has 2 FAQ and 10 Fix solutions directly associated with it 'Enterprise Search' has no FAQ and Fix solutions directly associated with it 'iView' has 1 FAQ solutions directly associated with it The total use count would look like this 'Product' - 6 FAQ and 10 Fix solutions 'eServer' - 3 FAQ and 10 Fix solutions 'Enterprise Search' - 0 FAQ and 0 Fix solutions 'iView' - 1 FAQ and 0 Fix solutions TopicService topicService = <...>; // initialize this TopicLabelService topicLabelService = topicService.getTopicLabelService(); ... Topic rootTopic = getRootTopic(); // roots has the topic (id=products) ;;;// returns Topics (id=eserver) as topic (id=es) has no solutions Collection childrenOfRoot = topicService.getChildrenFilteredByUseCount(rootTopic); ... Topic eServerTopic = topicService.getRootTopicByLabel("eServerLbl"); // topic with id=eserver Collection solnsSet1 = new ArrayList("Fix"); Collection solnsSet2 = new ArrayList("FAQ"); ;;;// returns empty collection, as iView has no Fix solutions Collection eServerChildrenSet1 = topicService.getChildrenBySolutionClassUseCount(eServerTopic, solnsSet1, solnsSet2); ;;;// returns collection with topic (id=iview) Collection eServerChildrenSet2 = topicService.getChildrenBySolutionClassUseCount(eServerTopic, solnsSet2, solnsSet1); ... Collection includeLabels = new ArrayList("esLbl"); Collection excludeLabels = new ArrayList("eServerLbl"); ;;;// returns empty collection as ES has no solutions underneath it and eServer tree is excluded Collection childrenOfRootSet2 = topicService.getChildrenByLabelIds(rootTopic, includeLabels, excludeLabels, true); TopicService topicService = <...>; // initialize this TopicLabelService topicLabelService = topicService.getTopicLabelService(); ... Topic eServerTopic = topicService.getRootTopicByLabel("eServerLbl"); // topic with id=eserver Collection solnsSetEmpty = new ArrayList(); Collection solnsSet1 = new ArrayList("Fix"); Collection solnsSet2 = new ArrayList("FAQ"); ;;;// returns 13 int eServerUsecount = topicService.getTotalUseCount(eServerTopic); ;;;// returns 13 (is the same as the previous call) int eServerUsecount = topicService.getTotalUseCount(eServerTopic, solnsSetEmpty, solnsSetEmpty); ;;;// returns 10 int eServerFixUsecount1 = topicService.getTotalUseCount(eServerTopic, solnsSet1, solnsSet2); ;;;// returns 3 int eServerFaqUsecount1 = topicService.getTotalUseCount(eServerTopic, solnsSet2, solnsSet1);

See Also:
Topic, TopicLabel

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String OTHER_TOPICS
           
 
Fields inherited from class atg.searchadmin.repository.service.TopicServiceImpl
sITEM_DESCRIPTOR, SLASH_SYMBOL
 
Fields inherited from class atg.searchadmin.repository.service.TopicRepositoryService
mBeanHomes, mBeanHomesName, mRepositoryHomes, mRepositoryHomesName
 
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
TopicServiceImpl()
           
 
Method Summary
protected  void filterOutSolutionListTopicSet(java.util.Collection pTopicSets)
          The solution list topic set holds special hot solutions and top solutions topics that are used to build the hot solutions and top solutions lists.
 java.util.Collection findTopicSetsByLanguage(atg.search.routing.utils.Language pLanguage)
          Lookup a topic set by language.
 java.util.Collection findTopicSetsByLocale(java.util.Locale pLocale)
          Lookup a topic set by locale using getLocaleTopicSetMap() Does not include the getSolutionListsTopicSetName() topic set.
 java.util.Collection findTopicSetsByLocale(java.lang.String pLocaleCode)
          Lookup a topic set by locale using getLocaleTopicSetMap() Does not include the getSolutionListsTopicSetName() topic set.
 java.util.Collection getAllTopicSets()
          Returns the list of all TopicSet repository items EXCEPT the getSolutionListsTopicSetName() topic set.
 java.lang.String[] getBrowseTaxonomyNames()
           
 java.util.Map getLocaleTopicSetMap()
           
 java.lang.String getLocaleTopicSetMapDelimiter()
           
 atg.svc.search.SearchLanguageService getSearchLanguageService()
           
 java.lang.String getSolutionListsTopicSetName()
          The solution lists topic set holds special hot solutions and top solutions topics that are used to build the hot solutions and top solutions lists.
 void setBrowseTaxonomyNames(java.lang.String[] pBrowseTaxonomyNames)
           
 void setLocaleTopicSetMap(java.util.Map pLocaleTopicSetMap)
           
 void setLocaleTopicSetMapDelimiter(java.lang.String pLocaleTopicSetMapDelimiter)
           
 void setSearchLanguageService(atg.svc.search.SearchLanguageService pSearchLanguageService)
           
 void setSolutionListsTopicSetName(java.lang.String pSolutionListsTopicSetName)
           
 
Methods inherited from class atg.searchadmin.repository.service.TopicServiceImpl
createGlobalMacro, createTopic, createTopic, createTopicLabel, createTopicMacro, createTopicPattern, createTopicSet, deleteGlobalMacro, deletePattern, deleteTopic, deleteTopicAndChildren, deleteTopicLabel, deleteTopicMacro, deleteTopicSet, editGlobalMacro, editTopic, editTopicMacro, editTopicPattern, exportEmptyTopicSetToFile, exportEmptyTopicSetToXmlString, exportTopics, exportTopicSetToFile, exportTopicSetToXmlString, findGlobalMacroById, findPatternById, findTopicById, findTopicByMacroId, findTopicLabelById, findTopicLabelByName, findTopicLabelsById, findTopicLabelsByNames, findTopicMacroById, findTopicsByName, findTopicSetById, findTopicSetByName, findTopicsWithPattern, getAllGlobalMacros, getAllLabelledTopics, getAllTopicLabels, getChildren, getLabelledChildren, getLabelledTopics, getNoLanguageOnTopicSetMeansAllLanguages, getTopicAncestorsByLabelId, getTopicLabelIdsByNames, getTopTopics, importTopicSet, isChild, pasteTopic, reorderPatterns, saveGlobalMacro, saveTopic, saveTopic, saveTopicLabel, saveTopicMacro, saveTopicPattern, saveTopics, saveTopicSet, setNoLanguageOnTopicSetMeansAllLanguages, topicExists, writeGlobalMacro, writeTopicHeader, writeTopicMacro, writeTopicPattern, writeTopicWithChildren
 
Methods inherited from class atg.searchadmin.repository.service.TopicRepositoryService
getBaseBeanHomes, getBaseRepositoryHomes, getBeanHomes, getBeanHomesName, getRepositoryHomes, getRepositoryHomesName, getToday, getTransactionManager, lookup, lookup, setBeanHomesName, setRepositoryHomesName, setTransactionManager
 
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
 
Methods inherited from interface atg.searchadmin.repository.service.TopicService
createGlobalMacro, createTopic, createTopic, createTopicLabel, createTopicMacro, createTopicPattern, createTopicSet, deleteGlobalMacro, deletePattern, deleteTopic, deleteTopicAndChildren, deleteTopicLabel, deleteTopicMacro, deleteTopicSet, editGlobalMacro, editTopic, editTopicMacro, editTopicPattern, exportEmptyTopicSetToFile, exportEmptyTopicSetToXmlString, exportTopics, exportTopicSetToFile, exportTopicSetToXmlString, findGlobalMacroById, findPatternById, findTopicById, findTopicByMacroId, findTopicLabelById, findTopicLabelByName, findTopicLabelsById, findTopicLabelsByNames, findTopicMacroById, findTopicsByName, findTopicSetById, findTopicSetByName, findTopicsWithPattern, getAllGlobalMacros, getAllLabelledTopics, getAllTopicLabels, getChildren, getLabelledChildren, getLabelledTopics, getTopicAncestorsByLabelId, getTopicLabelIdsByNames, getTopTopics, getTransactionManager, importTopicSet, isChild, pasteTopic, reorderPatterns, saveGlobalMacro, saveTopic, saveTopic, saveTopicLabel, saveTopicMacro, saveTopicPattern, saveTopics, saveTopicSet, topicExists, writeGlobalMacro, writeTopicHeader, writeTopicMacro, writeTopicPattern
 
Methods inherited from interface atg.nucleus.Service
getNucleus, getServiceConfiguration, isRunning
 
Methods inherited from interface atg.nucleus.ServiceListener
startService, stopService
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

OTHER_TOPICS

public static final java.lang.String OTHER_TOPICS
See Also:
Constant Field Values
Constructor Detail

TopicServiceImpl

public TopicServiceImpl()
Method Detail

getSearchLanguageService

public atg.svc.search.SearchLanguageService getSearchLanguageService()

setSearchLanguageService

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

getBrowseTaxonomyNames

public java.lang.String[] getBrowseTaxonomyNames()

setBrowseTaxonomyNames

public void setBrowseTaxonomyNames(java.lang.String[] pBrowseTaxonomyNames)

getLocaleTopicSetMap

public java.util.Map getLocaleTopicSetMap()

setLocaleTopicSetMap

public void setLocaleTopicSetMap(java.util.Map pLocaleTopicSetMap)

getLocaleTopicSetMapDelimiter

public java.lang.String getLocaleTopicSetMapDelimiter()

setLocaleTopicSetMapDelimiter

public void setLocaleTopicSetMapDelimiter(java.lang.String pLocaleTopicSetMapDelimiter)

getSolutionListsTopicSetName

public java.lang.String getSolutionListsTopicSetName()
The solution lists topic set holds special hot solutions and top solutions topics that are used to build the hot solutions and top solutions lists. These special topics should not be displayed in the normal topic browse tree. By excluding the "Solution Lists" topic set we exclude the hot solutions, top solutions and any other special topics that are defined in this is this topic set. NOTE: If the topic set name changes, it needs to be changed here also.


setSolutionListsTopicSetName

public void setSolutionListsTopicSetName(java.lang.String pSolutionListsTopicSetName)

findTopicSetsByLanguage

public java.util.Collection findTopicSetsByLanguage(atg.search.routing.utils.Language pLanguage)
Lookup a topic set by language. topic sets with a null language will not be returned. If getLocaleTopicSetMap() is not empty, uses the localeTopicSetMap property to determine which topic sets are defined per locale. If the localeTopicSetMap property is not set (the default behavior), then we determine the available topic sets using the language property associated with the topic set (assigned thru the Search Workbench). For most installations, it will be preferable to use the langauge associated with the topic set rather than using the lcoaleTopicSetMap property. However, if you need the ability to define topic sets per country (not just per language), then you will need to continue using localTopicSetMap. NOTE: Prior to ATG Search 2007.0, there wasn't a language property associated with topic sets - thus the need for localeTopicSetMap. However, in 2007.0 this mapping can now be defined on the topic sets via the Search Workbench. Does not include the getSolutionListsTopicSetName() topic set.

Specified by:
findTopicSetsByLanguage in interface atg.searchadmin.repository.service.TopicService
Overrides:
findTopicSetsByLanguage in class atg.searchadmin.repository.service.TopicServiceImpl
Parameters:
pLangauge - Language
Returns:
A collection of TopicSet
See Also:
atg.searchadmin.repository.service.SearchProjectService#findTopicSetsByLanguage(Language)

findTopicSetsByLocale

public java.util.Collection findTopicSetsByLocale(java.util.Locale pLocale)
Lookup a topic set by locale using getLocaleTopicSetMap() Does not include the getSolutionListsTopicSetName() topic set.

Specified by:
findTopicSetsByLocale in interface atg.searchadmin.repository.service.TopicService
Overrides:
findTopicSetsByLocale in class atg.searchadmin.repository.service.TopicServiceImpl
Parameters:
pLocale - Either a locale with language, language + country or language + country + variant code
Returns:
A collection of TopicSet
See Also:
getLocaleTopicSetMap()

findTopicSetsByLocale

public java.util.Collection findTopicSetsByLocale(java.lang.String pLocaleCode)
Lookup a topic set by locale using getLocaleTopicSetMap() Does not include the getSolutionListsTopicSetName() topic set.

Specified by:
findTopicSetsByLocale in interface atg.searchadmin.repository.service.TopicService
Overrides:
findTopicSetsByLocale in class atg.searchadmin.repository.service.TopicServiceImpl
Parameters:
pLocale - Either a locale with language, language + country or language + country + variant code
Returns:
A collection of TopicSet
See Also:
findTopicSetsByLocale(Locale)

getAllTopicSets

public java.util.Collection getAllTopicSets()
Returns the list of all TopicSet repository items EXCEPT the getSolutionListsTopicSetName() topic set.

Specified by:
getAllTopicSets in interface atg.searchadmin.repository.service.TopicService
Overrides:
getAllTopicSets in class atg.searchadmin.repository.service.TopicServiceImpl
Returns:
An TopicSet representing the topic set
Throws:
atg.searchadmin.repository.service.exception.TopicSetNotFoundException - If the topic set cannot be found ISSUE: Should the collection of TopicSet be ordered?

filterOutSolutionListTopicSet

protected void filterOutSolutionListTopicSet(java.util.Collection pTopicSets)
The solution list topic set holds special hot solutions and top solutions topics that are used to build the hot solutions and top solutions lists. These special topics should not be displayed in the normal topic browse tree. By excluding the "Solution Lists" topic set we exclude the hot solutions, top solutions and any other special topics that are defined in this is this topic set. NOTE: If the topic set name changes, it needs to be changed here also.