|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.searchadmin.repository.service.TopicRepositoryService
atg.searchadmin.repository.service.TopicServiceImpl
atg.svc.repository.service.TopicServiceImpl
public class TopicServiceImpl
TopicService 2006.2
Business methods - Create, Retrieve(by id), Save and Delete for the
Topic
object.
Following methods are used for Topic Administration
TopicServiceImpl.createTopic()
#findByPrimaryKey(String)
TopicServiceImpl.saveTopic(Topic)
#deleteSolution(String)
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 /SalesIn 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. UseTopicLabel.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
#getSystemRootTopic()
TopicServiceImpl.getTopTopics()
#getRootTopicByLabel(String))
#getChildren(Topic)
.
getChildrenByLabelIds
where a flag may be set to true to exclude the one that have no solution associated with them.
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:
#getTopicAncestors(Topic))
or Topic.getAncestors()
#getTopicAncestorsByLabelId(Topic, String))
use a non-null label to get the ancestors upto the particular labeled root or
use a null label to get the ancestors upto the any labeled root.
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.
getChildren
getChildrenBySolutionClassUseCount
getChildrenByLabelIds
where a flag may be set to true to exclude the one that have no solution associated with them.
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);
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 |
---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String OTHER_TOPICS
Constructor Detail |
---|
public TopicServiceImpl()
Method Detail |
---|
public atg.svc.search.SearchLanguageService getSearchLanguageService()
public void setSearchLanguageService(atg.svc.search.SearchLanguageService pSearchLanguageService)
public java.lang.String[] getBrowseTaxonomyNames()
public void setBrowseTaxonomyNames(java.lang.String[] pBrowseTaxonomyNames)
public java.util.Map getLocaleTopicSetMap()
public void setLocaleTopicSetMap(java.util.Map pLocaleTopicSetMap)
public java.lang.String getLocaleTopicSetMapDelimiter()
public void setLocaleTopicSetMapDelimiter(java.lang.String pLocaleTopicSetMapDelimiter)
public java.lang.String getSolutionListsTopicSetName()
public void setSolutionListsTopicSetName(java.lang.String pSolutionListsTopicSetName)
public java.util.Collection findTopicSetsByLanguage(atg.search.routing.utils.Language pLanguage)
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.
findTopicSetsByLanguage
in interface atg.searchadmin.repository.service.TopicService
findTopicSetsByLanguage
in class atg.searchadmin.repository.service.TopicServiceImpl
pLangauge
- Language
TopicSet
atg.searchadmin.repository.service.SearchProjectService#findTopicSetsByLanguage(Language)
public java.util.Collection findTopicSetsByLocale(java.util.Locale pLocale)
getLocaleTopicSetMap()
Does not include the getSolutionListsTopicSetName()
topic set.
findTopicSetsByLocale
in interface atg.searchadmin.repository.service.TopicService
findTopicSetsByLocale
in class atg.searchadmin.repository.service.TopicServiceImpl
pLocale
- Either a locale with language, language + country or language + country + variant code
TopicSet
getLocaleTopicSetMap()
public java.util.Collection findTopicSetsByLocale(java.lang.String pLocaleCode)
getLocaleTopicSetMap()
Does not include the getSolutionListsTopicSetName()
topic set.
findTopicSetsByLocale
in interface atg.searchadmin.repository.service.TopicService
findTopicSetsByLocale
in class atg.searchadmin.repository.service.TopicServiceImpl
pLocale
- Either a locale with language, language + country or language + country + variant code
TopicSet
findTopicSetsByLocale(Locale)
public java.util.Collection getAllTopicSets()
getSolutionListsTopicSetName()
topic set.
getAllTopicSets
in interface atg.searchadmin.repository.service.TopicService
getAllTopicSets
in class atg.searchadmin.repository.service.TopicServiceImpl
TopicSet
representing the topic set
atg.searchadmin.repository.service.exception.TopicSetNotFoundException
- If the topic set cannot be found
ISSUE: Should the collection of TopicSet be ordered?protected void filterOutSolutionListTopicSet(java.util.Collection pTopicSets)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |