public interface IClassificationIndex extends IIndex
To get a classification index, follow this example:
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IClassificationIndex classificationIndex = (IClassificationIndex)indexService.getIndex("abc");Note that the index that is requested must support the
IClassificationIndex
interface.
Otherwise a ClassCastException
is thrown.
classifyDocuments(IResourceList, String, float, int, boolean)
getBestClasses(IResourceList, String, int)
Modifier and Type | Field and Description |
---|---|
static String |
AINBOX_CATEGORY_TO_CLASSIFY
Deprecated.
as of NW04.
|
static String |
DEFAULT_THRESHOLD_LEVEL1
Default threshold 1 property.
|
static String |
DEFAULT_THRESHOLD_LEVEL2
Default threshold 2 property.
|
static String |
PROP_NAME_BEST_CLASSES_SENSITIVITY
Property name of the "BestClassesSensitivity"-property of a taxonomy folder
The best classes sensitivity is defined for each taxonomy. |
static String |
PROP_NAME_THRESHOLD_LEVEL1
Property name of the "threshold 1"-property of a taxonomy folder
The taxonomy name space is used. |
static String |
PROP_NAME_THRESHOLD_LEVEL2
Property name of the "threshold 2"-property of a taxonomy folder
The taxonomy name space is used. |
static String |
PROP_NAME_TRAINING_URI
Property name of the "training URI"-property of a taxonomy folder
The training URI is saved as a property of a taxonomy folder if the taxonomy has been built by copying an existing hierarchy. |
static String |
TAX_THRESHOLD_DEFAULT_VALUE
Default value of the threshold properties if no threshold value is set for a taxonomy.
|
static String |
TAXONOMY_NAMESPACE
The name space suffix of resource properties related to taxonomies and classification
To get the complete name space of a taxonomy property, this suffix has to be
appended to the cm name space.
|
static String |
WORKLIST_FOLDER_NAME
Deprecated.
as of NW04.
|
Modifier and Type | Method and Description |
---|---|
void |
addTaxonomy(String taxonomyName)
Deprecated.
as of NW04. Use
addTaxonomy(String,IResourceContext) |
void |
addTaxonomy(String taxonomyName,
IResourceContext context)
Adds a new taxonomy to the index
By adding the taxonomy name, a folder is created for the taxonomy in the taxonomy repository and the taxonomy is saved with the index. |
void |
autoClassifyDocs(String taxonomyName,
IResourceContext context)
Requests proposals for the best categories for documents that have no classification
and sets these categories automatically as document classification.
|
void |
autoClassifyDocs(String taxonomyName,
IResourceList docList,
IResourceContext context)
Requests proposals for the best categories for the documents and sets these categories
automatically as document classification.
|
void |
autoClassifyDocs(String taxonomyName,
IRidList docRidList,
IResourceContext context)
Requests proposals for the best categories for the documents and sets these categories
automatically as document classification.
|
Collection |
classifyDocuments(IResourceList resourceDocuments,
String taxonomyName)
Classifies documents into existing categories of a taxonomy
The returned results are only proposals. |
Collection |
classifyDocuments(IResourceList resourceDocuments,
String taxonomyName,
float threshold,
int maxResults)
Classifies documents into existing categories of a taxonomy
The returned results are only proposals. |
Collection |
classifyDocuments(IResourceList resourceDocuments,
String taxonomyName,
float threshold,
int maxResults,
boolean checkIfInIndex)
Classifies documents (which taxonomy class folders do the documents fit best).
|
Collection |
classifyDocuments(IResourceList resourceDocuments,
String taxonomyName,
int maxResults)
Classifies documents into existing categories of a taxonomy
The returned results are only proposals. |
Collection |
clusterDocuments(IResourceList resourceDocuments,
int maxResults)
Divides documents into clusters of documents
The clustering is done on the basis of content similarity. |
void |
createTaxonomyHierarchyByCopiing(String taxonomyName,
ICollection existingHierarchy)
The taxonomy hierarchy is created by copying an existing hierarchy.
|
Map |
doGeneric(String function,
Map parameters)
Enables an index service to perform classification actions that are not reflected by the interface
|
Collection |
getBestClasses(IResourceList resourceDocuments,
String taxonomyName) |
Collection |
getBestClasses(IResourceList resourceDocuments,
String taxonomyName,
int maxNumberOfDocs) |
IResourceList |
getClassDocuments(ICollection taxonomyClass)
Gets all documents of a taxonomy class
The taxonomy class is a folder in the taxonomy repository To get the resource ID of a taxonomy class, first the resource ID of the taxonomy root must be determined by using the getSpecialFolderRID(taxonomyName,SpecialFolder.TAXONOMY) method. |
Collection |
getClassFeatures(Collection taxonomyClassUris,
String taxonomyName,
int maxResults)
Deprecated.
as of NW04. Use getClassFeatures(IRidList taxonomyClassRids,String taxonomyName, int maxResults)
|
Collection |
getClassFeatures(IRidList taxonomyClassRids,
String taxonomyName,
int maxResults)
Gets the features of taxonomy categories
The most characteristic key words of a category are returned for each category. |
IDocClassificationMap |
getDocClassification(IResource document)
Gets the categories to which the document is assigned
To get proposals of categories that a document might match, use classifyDocuments . |
IDocClassificationMapList |
getDocListClassification(IResourceList documents)
Gets the categories to which the documents are assigned
To get proposals of categories into which documents might fit, use classifyDocuments . |
Map |
getDocumentClassification(IResource document)
Deprecated.
as of NW04. Use getDocClassification(IResource)
|
ClassificationStatus |
getDocumentClassificationStatusNewEnum(IResource document,
String taxonomyName)
Gets the classification status of a document for a taxonomy
|
IRidList |
getDocumentRidsNeverToClassify(String taxonomyName,
IResourceContext context)
Gets all RIDs of documents for an index that have the status "never to classify" in a taxonomy
|
IRidList |
getDocumentRidsToClassify(String taxonomyName,
IResourceContext context)
Gets all RIDs of documents of an index that have the status "to classify" in a taxonomy
|
IResourceList |
getDocumentsNeverToClassify(String taxonomyName)
Deprecated.
as of NW04. Use getDocumentsNeverToClassify(String,IResourceContext)
|
IResourceList |
getDocumentsNeverToClassify(String taxonomyName,
IResourceContext context)
Gets all documents of an index that have the status "never to classify" in a taxonomy
|
IResourceList |
getDocumentsToClassify(String taxonomyName)
Deprecated.
as of NW04. Use getDocumentsToClassify(String,IResourceContext)
|
IResourceList |
getDocumentsToClassify(String taxonomyName,
IResourceContext context)
Gets all documents of an index that have the status "to classify" in a taxonomy
|
IRidList |
getDocumentTrainingClasses(IResource document)
Gets all taxonomy classes for which the document is a training document
|
IRidList |
getManuallyDeclassifiedClasses(IResource document) |
IClassificationIndexCollection |
getNewClassificationIndexCollection()
Returns an index collection where classification operations for multiple
indexes can be performed
|
RID |
getSpecialFolderRID(String taxonomyName,
SpecialFolder specialFolderType) |
List |
getTaxonomies()
Names of all taxonomies of an index
The name of a taxonomy is also the name of the taxonomy folder in the taxonomy repository. |
BestClassesSensitivity |
getTaxonomyBestClassesSensitivity(String taxonomyName)
Gets the sensitivity level of the best classes algorithm
|
float |
getTaxonomyBestClassesSensitivityValue(String taxonomyName) |
float |
getTaxonomyClassificationThreshold(String taxonomyName,
String thresholdId)
Gets the threshold of a taxonomy
|
String |
getTaxonomyRmPrefix() |
RID |
getTaxonomyTrainingRid(String taxonomyName)
Gets the URI of the root folder of the hierarchy that has been used to train/create the given taxonomy.
|
URI |
getTaxonomyTrainingUri(String taxonomyName)
Deprecated.
as of NW04. Use getTaxonomyTrainingRid(String)
|
TaxonomyType |
getTaxonomyTypeNewEnum(String taxonomyName) |
UpdateTaxonomyState |
getUpdateTaxonomyState(String taxonomyName) |
UpdateTaxonomyState |
getUpdateTaxonomyState(String taxonomyName,
Locale locale) |
boolean |
hasTaxonomy(String name) |
void |
indexDocument(IResource resource,
String taxonomyName,
IRidList taxonomyClasses,
boolean isSearchRelevant)
Puts a document into the index
It is recommended that you do not index a document manually using this method. |
void |
indexDocument(IResource resource,
String taxonomyName,
IUriList taxonomyClasses,
boolean isSearchRelevant)
Deprecated.
as of NW04. Use indexDocument(IResource, String, IRidList, boolean)
|
void |
indexDocuments(IResourceList resources,
String taxonomyName,
IRidList taxonomyClasses,
boolean isSearchRelevant)
Indexes a list of documents
It is recommended that you do not index documents manually using this method.
|
void |
indexDocuments(IResourceList resources,
String taxonomyName,
IUriList taxonomyClasses,
boolean isSearchRelevant)
Deprecated.
as of NW04. Use indexDocuments(IResourceList, String, IRidList, boolean)
|
void |
initTaxonomies(List taxonomies)
Sets the index taxonomies initially before generating the index
After the index has been created, the taxonomy folders are created automatically. |
boolean |
isTrainingDocument(IResource document,
RID taxonomyClassRid) |
void |
queueTaxonomyTrainingCrawler(String taxonomyName,
ICollection taxonomyCollection,
boolean isSearchRelevant)
Adds a taxonomy training crawler to the index management crawler queue.
|
void |
removeCategoryAssignments(ICollection deletedCategoryFolder)
Removes the assignment to a deleted category for all documents in the index
|
void |
removeTaxonomy(String taxonomyName)
Deprecated.
as of NW04. Use
removeTaxonomy(String,IResourceContext) |
void |
removeTaxonomy(String taxonomyName,
IResourceContext context)
Removes a taxonomy form the index
By removing a taxonomy, the folder for the taxonomy in the taxonomy repository is deleted and the taxonomy itself is removed from the index. |
void |
setDocClassification(IDocClassificationMap documentClassificationMap)
Stores the document classification that has been chosen by manual or automatic classification
|
void |
setDocClassification(IDocClassificationMap documentClassificationMap,
boolean indexDocumentClassification)
Stores the document classification that has been chosen by manual or automatic classification
|
void |
setDocClassification(IDocClassificationMap documentClassificationMap,
boolean indexDocumentClassification,
boolean isTrainingDocument)
Stores the document classification that has been chosen by manual or automatic classification
|
void |
setDocClassification(IDocClassificationMap documentClassificationMap,
String notToSend) |
void |
setDocListClassification(IDocClassificationMapList documentClassificationMapList)
Stores the documents classification that has been chosen by manual or automatic classification
|
void |
setDocumentClassification(IResource document,
Map classification)
Deprecated.
as of NW04. Use setDocClassification(IResource,Map)
|
void |
setDocumentClassification(IResource document,
Map classification,
boolean indexDocumentClassification)
Deprecated.
as of NW04. Use setDocClassification(IResource,Map,boolean)
|
void |
setDocumentClassification(IResource document,
Map classification,
boolean indexDocumentClassification,
boolean isTrainingDocument)
Deprecated.
as of NW04. Use setDocClassification(IResource,Map,boolean, boolean)
|
void |
setDocumentClassificationStatus(IResourceList documents,
String taxonomyName,
ClassificationStatus status)
Sets the classification status for a list of documents for a taxonomy
|
void |
setDocumentClassificationStatus(IResource document,
String taxonomyName,
ClassificationStatus status)
Sets the classification status of a document for a taxonomy
|
void |
setDocumentClassificationStatus(IResource document,
String taxonomyName,
ClassificationStatus status,
boolean sendEvents,
String notToSend)
This method is for internal usage only
|
void |
setDocumentClassificationStatus(IResource document,
String taxonomyName,
ClassificationStatus status,
String notToSend)
This method is for internal usage only
|
void |
setTaxonomyBestClassesSensitivity(String taxonomyName,
BestClassesSensitivity sensitivity)
Sets the threshold of a taxonomy
|
void |
setTaxonomyClassificationThreshold(String taxonomyName,
String thresholdId,
float threshold)
Sets the threshold of a taxonomy
|
void |
setTaxonomyTrainingRid(String taxonomyName,
RID trainingRid)
Sets the RID of the root folder of the hierarchy that has been used to train/create the given taxonomy.
|
void |
setTaxonomyTrainingUri(String taxonomyName,
URI trainingUri)
Deprecated.
as of NW04. Use setTaxonomyTrainingRid(String, RID)
|
void |
setTaxonomyType(String taxonomyName,
TaxonomyType taxonomyType)
Sets the type for the taxonomy
|
void |
synchronizeTaxonomyMetaData(String taxonomyName)
Rebuilds the taxonomy meta data on the classification engine.
|
void |
updateSearchCategoryAttributes(IResourceList oldResourceListe,
IResourceList newResourceListe,
String taxonomyName,
RID categoryRid)
The attributes necessary for searching in taxonomies are modified on the index server only.
|
boolean |
useBestClasses() |
addFolderUri, changeIndexedDocumentProperties, changeIndexedDocumentProperties, changeIndexedDocumentProperties, checkProperties, clear, createIndexOnServer, deindex, deindexDocument, deindexDocument, deindexDocument, deindexDocuments, deindexDocuments, deindexDocuments, delete, delete, deleteOnServer, deltaReindex, generate, generate, getCrawlerProfileId, getFolderUris, getIndexedProperties, getIndexFolderForDocument, getIndexFolders, getIndexGroup, getIndexId, getIndexingState, getIndexName, getLanguagesOfIndexedDocuments, getProperties, getResourceInfo, getRID, getSchedulerTimeTable, getServiceId, getServiceTypes, getServiceTypes, getSimilarClasses, getSupportedOptions, getWhatToIndexString, indexDocument, indexDocument, indexDocuments, indexDocuments, indexInternalLinks, init, isActive, reduceNumberOfCrawler, reindex, reindex, removeAllFolderUris, removeFolderUri, setActive, setActiveDuringStartup, setCrawlerProfileId, setInactiveIndexHasChanged, setIndexGroup, setIndexingState, setIndexName, setProperties, setSchedulerTimeTable, setStateAndNumberOfCrawler, setWhatToIndex, typeShouldBeIndexed
static final String TAXONOMY_NAMESPACE
Example:
String name space = new StringBuffer(IWcmConst.SAP_WCM_NAMESPACE).append(IClassificationIndex.TAXONOMY_NAMESPACE).toString();
static final String PROP_NAME_THRESHOLD_LEVEL1
getTaxonomyClassificationThreshold
should be used instead.static final String PROP_NAME_THRESHOLD_LEVEL2
getTaxonomyClassificationThreshold
should be used instead.static final String PROP_NAME_BEST_CLASSES_SENSITIVITY
getTaxonomyBestClassesSensitivity
should be used instead.static final String PROP_NAME_TRAINING_URI
getTaxonomyTrainingRid
should be used instead.static final String DEFAULT_THRESHOLD_LEVEL1
static final String DEFAULT_THRESHOLD_LEVEL2
static final String TAX_THRESHOLD_DEFAULT_VALUE
static final String WORKLIST_FOLDER_NAME
static final String AINBOX_CATEGORY_TO_CLASSIFY
List getTaxonomies()
String
) of the classification indexvoid addTaxonomy(String taxonomyName) throws WcmException
addTaxonomy(String,IResourceContext)
taxonomyName
- name of the taxonomy to be added to the indexWcmException
- exception raised in failure situationvoid addTaxonomy(String taxonomyName, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomy to be added to the indexcontext
- user contextWcmException
- exception raised in failure situationvoid removeTaxonomy(String taxonomyName)
removeTaxonomy(String,IResourceContext)
taxonomyName
- name of the taxonomy to removevoid removeTaxonomy(String taxonomyName, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomy to removecontext
- user contextWcmException
- WcmExceptionvoid indexDocument(IResource resource, String taxonomyName, IUriList taxonomyClasses, boolean isSearchRelevant) throws ResourceException, WcmException, IOException
resource
- resourcetaxonomyName
- taxonomyNametaxonomyClasses
- taxonomyClassesisSearchRelevant
- isSearchRelevantResourceException
- ResourceExceptionWcmException
- WcmExceptionIOException
- IOExceptionvoid indexDocument(IResource resource, String taxonomyName, IRidList taxonomyClasses, boolean isSearchRelevant) throws ResourceException, WcmException, IOException
resource
- resource to indextaxonomyName
- name of the taxonomy where the taxonomy classes have to be indexed with the documenttaxonomyClasses
- taxonomy classes to index with the documentisSearchRelevant
- if true, the document can be found in a search if false the document is only for training the taxonomy classesResourceException
- exception raised in failure situationWcmException
- exception raised in failure situationIOException
- exception raised in failure situationvoid indexDocuments(IResourceList resources, String taxonomyName, IUriList taxonomyClasses, boolean isSearchRelevant) throws ResourceException, WcmException, IOException
resources
- resourcestaxonomyName
- taxonomyNametaxonomyClasses
- taxonomyClassesisSearchRelevant
- isSearchRelevantResourceException
- ResourceExceptionWcmException
- WcmExceptionIOException
- IOExceptionvoid indexDocuments(IResourceList resources, String taxonomyName, IRidList taxonomyClasses, boolean isSearchRelevant) throws ResourceException, WcmException, IOException
resources
- resources to indextaxonomyName
- name of the taxonomy where the taxonomy classes have to be indexed with the documenttaxonomyClasses
- taxonomy classes to index with the documentsisSearchRelevant
- if true, the documents can be found in a search; if false the document is only for training the taxonomy classesResourceException
- exception raised in failure situationWcmException
- exception raised in failure situationIOException
- exception raised in failure situationCollection getClassFeatures(Collection taxonomyClassUris, String taxonomyName, int maxResults) throws WcmException
taxonomyClassUris
- collection of URI that represent taxonomy class folderstaxonomyName
- name of the taxonomy you want to have class features formaxResults
- maximum number of class features returnedWcmException
- exception raised in failure situationCollection getClassFeatures(IRidList taxonomyClassRids, String taxonomyName, int maxResults) throws WcmException
Example:
IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IClassificationIndex classificationIndex = (IClassificationIndex)indexService.getIndex("abc"); IRidList categoryRids = new RidList(); categoryRids.add(RID.getRID("/taxonomies/abc/taxonomyXY/catXY")); Collection classificationResults = classificationIndex.getClassFeatures(categoryRids,"taxonomyXY",5); IClassificationResult classificationResult = (IClassificationResult)classificationResults.get(0); Collection featuresList = classificationResult.getResults(); Iterator featureIterator = featuresList.iterator(); String feature = null; while(featureIterator.hasNext()){ feature = (String)featureIterator.next(); }
taxonomyClassRids
- list of RIDs that represent taxonomy class folderstaxonomyName
- name of the taxonomy you want to have class features formaxResults
- maximum number of class features returnedIClassificationResult
WcmException
- exception raised in failure situationIClassificationResult
Collection classifyDocuments(IResourceList resourceDocuments, String taxonomyName, int maxResults) throws WcmException
setDocClassification
. To get the categories that have
been assigned to a document, use getDocClassification
.
Example:
IResource document = ResourceFactory.getInstance().getResource(RID.getRID("/documents/abc.doc"),context); IResourceList documents = new ResourceList(); documents.add(document); IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IClassificationIndex classificationIndex = (IClassificationIndex)indexService.getIndex("abc"); Collection classificationResults = classificationIndex.classifyDocuments(documents,"taxonomyXY",5); IClassificationResult classificationResult = (IClassificationResult)classificationResults.get(0); Collection resultClasses = classificationResult.getResults(); Iterator resultClassesIterator = resultClasses.iterator(); IClassificationClass resultClass = null; RID resultClassRID = null; float rankValue = 0.0F; while(resultClassesIterator.hasNext()){ resultClass = (IClassificationClass)resultClassesIterator.next(); resultClassRID = resultClass.getResultClassRid(); rankValue = resultClass.getRankValue(); }
resourceDocuments
- list of documents you want to classifytaxonomyName
- name of the taxonomy for which classification proposals have to be foundmaxResults
- maximum number of returned proposals for each documentIClassificationResult
WcmException
- exception raised in failure situationIClassificationResult
,
getDocClassification(IResource)
,
setDocClassification(IDocClassificationMap)
Collection classifyDocuments(IResourceList resourceDocuments, String taxonomyName) throws WcmException
setDocClassification
. To get the categories that have
been assigned to a document, use getDocClassification
.
Example:
IResource document = ResourceFactory.getInstance().getResource(RID.getRID("/documents/abc.doc"),context); IResourceList documents = new ResourceList(); documents.add(document); IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IClassificationIndex classificationIndex = (IClassificationIndex)indexService.getIndex("abc"); Collection classificationResults = classificationIndex.classifyDocuments(documents,"taxonomyXY"); IClassificationResult classificationResult = (IClassificationResult)classificationResults.get(0); Collection resultClasses = classificationResult.getResults(); Iterator resultClassesIterator = resultClasses.iterator(); IClassificationClass resultClass = null; RID resultClassRID = null; float rankValue = 0.0F; while(resultClassesIterator.hasNext()){ resultClass = (IClassificationClass)resultClassesIterator.next(); resultClassRID = resultClass.getResultClassRid(); rankValue = resultClass.getRankValue(); }
resourceDocuments
- list of documents you want to classifytaxonomyName
- name of the taxonomy for which classification proposals have to be foundIClassificationResult
WcmException
- exception raised in failure situationIClassificationResult
,
getDocClassification(IResource)
,
setDocClassification(IDocClassificationMap)
Collection classifyDocuments(IResourceList resourceDocuments, String taxonomyName, float threshold, int maxResults) throws WcmException
setDocClassification
. To get the categories that have
been assigned to a document, use getDocClassification
.
Example:
IResource document = ResourceFactory.getInstance().getResource(RID.getRID("/documents/abc.doc"),context); IResourceList documents = new ResourceList(); documents.add(document); IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE); IClassificationIndex classificationIndex = (IClassificationIndex)indexService.getIndex("abc"); //returns a maximum of 5 classes for each document that have rank values higher than 0.7 Collection classificationResults = classificationIndex.classifyDocuments(documents,"taxonomyXY",0.7F,5); IClassificationResult classificationResult = (IClassificationResult)classificationResults.get(0); Collection resultClasses = classificationResult.getResults(); Iterator resultClassesIterator = resultClasses.iterator(); IClassificationClass resultClass = null; RID resultClassRID = null; float rankValue = 0.0F; while(resultClassesIterator.hasNext()){ resultClass = (IClassificationClass)resultClassesIterator.next(); resultClassRID = resultClass.getResultClassRid(); rankValue = resultClass.getRankValue(); }
resourceDocuments
- resource list of documents you want to classifytaxonomyName
- name of the taxonomy for which classification proposals have to be foundthreshold
- lowest rank value of a returned taxonomy classmaxResults
- maximum number of proposals returned for each documentIClassificationResult
WcmException
- exception raised in failure situationIClassificationResult
,
getDocClassification(IResource)
,
setDocClassification(IDocClassificationMap)
Collection classifyDocuments(IResourceList resourceDocuments, String taxonomyName, float threshold, int maxResults, boolean checkIfInIndex) throws WcmException
resourceDocuments
- Resource list of documents you want to classifythreshold
- lowest rank value of a returned taxonomy classmaxResults
- maximum number of returned taxonomy classestaxonomyName
- name of the taxonomy for that classification proposals have to be foundcheckIfInIndex
- if true it is checked if the current version of the document is already in the index; then the document has not to be preprocessed againWcmException
- Exception raised in failure situationCollection clusterDocuments(IResourceList resourceDocuments, int maxResults) throws WcmException
Note: This method is not yet supported by the implementing classes.
resourceDocuments
- list of documents you want to clustermaxResults
- maximum number of returned clustersICluster
)WcmException
- exception raised in failure situationICluster
IClassificationIndexCollection getNewClassificationIndexCollection() throws ResourceException
ResourceException
- exception raised in failure situationIResourceList getClassDocuments(ICollection taxonomyClass) throws WcmException, ResourceException
getSpecialFolderRID(taxonomyName,SpecialFolder.TAXONOMY)
method.
Then the path from the taxonomy root to the category must be appended to this resource ID.
Example:
RID taxonomyRid = classificationIndex.getSpecialFolderRID("taxonomyXY",SpecialFolder.TAXONOMY); RID categoryRid = taxonomyRid.add(RID.getRID("/categoryXY"));Result: "/taxonomies/indexXY/taxonomyXY/categoryXY"
ICollection category = (ICollection)ResourceFactory.getInstance().getResource(categoryRid,context);
taxonomyClass
- taxonomy class folder you want to have documents forWcmException
- exception raised in failure situationResourceException
- exception raised in failure situationgetSpecialFolderRID(String,SpecialFolder)
void initTaxonomies(List taxonomies)
taxonomies
- list of taxonomy names (String
)Map doGeneric(String function, Map parameters) throws WcmException
function
- name of the function that has to be performedparameters
- parameters for the function that has to be performedWcmException
- exception raised in failure situationMap getDocumentClassification(IResource document) throws WcmException
setDocumentClassification()
.document
- document for which the classification has to be returnedString
) taxonomy name. Value is IRidList
of
taxonomy class rids.WcmException
- exception raised in failure situationIDocClassificationMap getDocClassification(IResource document) throws WcmException
classifyDocuments
.
Example:
IDocClassificationMap docClassification = classificationIndex.getDocClassification(document); String taxonomyName = "taxonomyXY"; IRidList taxonomyCategories = docClassification.getClasses(taxonomyName);The example returns a list of resource IDs for category folders in the taxonomy repository to which the document is assigned as regards taxonomy "taxonomyXY".
document
- document for which the classification has to be returnedIDocClassificationMap
with classifications for each taxonomy nameWcmException
- exception raised in failure situationIDocClassificationMapList getDocListClassification(IResourceList documents) throws WcmException
classifyDocuments
.
Example:
IDocClassificationMapList docClassificationList = classificationIndex.getDocListClassification(documents); IDocClassificationMap docClassification = docClassificationList.get(0); String taxonomyName = "taxonomyXY"; IRidList taxonomyCategories = docClassification.getClasses(taxonomyName);The example returns a list of resource IDs for category folders in the taxonomy repository to which the first document in the list is assigned as regards taxonomy "taxonomyXY".
documents
- list of documents for which the classification has to be returnedIDocClassificationMapList
that contains
an IDocClassificationMap
for every documentWcmException
- exception raised in failure situationvoid setDocClassification(IDocClassificationMap documentClassificationMap) throws WcmException
documentClassificationMap
- container with the document and its classification for all taxonomiesWcmException
- exception raised in failure situationvoid setDocClassification(IDocClassificationMap documentClassificationMap, String notToSend) throws WcmException
documentClassificationMap
- documentClassificationMapnotToSend
- notToSendWcmException
- WcmExceptionvoid setDocClassification(IDocClassificationMap documentClassificationMap, boolean indexDocumentClassification) throws WcmException
documentClassificationMap
- container with the document and its classification for all taxonomiesindexDocumentClassification
- if true, the document classification is indexed. If false, the document
classification is only stored as an application property with the document and is not indexed. Warning: Should
only be "false" if the document is indexed immediately before or after the call by another routine.WcmException
- exception raised in failure situationvoid setDocClassification(IDocClassificationMap documentClassificationMap, boolean indexDocumentClassification, boolean isTrainingDocument) throws WcmException
documentClassificationMap
- container with the document and its classification for all taxonomiesindexDocumentClassification
- if true, the document classification is indexed. If false, the document
classification is only stored as an application property with the document and is not indexed. Warning: Should
only be "false" if the document is indexed immediately before or after the call by another routine.isTrainingDocument
- if true, the classification is indexed to train the indexWcmException
- exception raised in failure situationvoid setDocListClassification(IDocClassificationMapList documentClassificationMapList) throws WcmException
documentClassificationMapList
- list of containers with the document and its classification for all taxonomiesWcmException
- exception raised in failure situationvoid setDocumentClassification(IResource document, Map classification) throws WcmException
document
- document for which the classification has to be setclassification
- map with document classification. Key is (String) taxonomy name. Value is IRidList of
taxonomy class RIDs.WcmException
- exception raised in failure situationvoid setDocumentClassification(IResource document, Map classification, boolean indexDocumentClassification) throws WcmException
document
- document for which the classification has to be setclassification
- map with document classification. Key is (String) taxonomy name. Value is
IRidList of taxonomy class RIDs.indexDocumentClassification
- if true, the document classification is indexed. If false, the document
classification is only stored as an application property with the document and is not indexed. Warning: Should
only be "false" if the document is indexed immediately before or after the call by another routine.WcmException
- exception raised in failure situationvoid setDocumentClassification(IResource document, Map classification, boolean indexDocumentClassification, boolean isTrainingDocument) throws WcmException
document
- document for which the classification has to be setclassification
- map with document classification. Key is (String) taxonomy name. Value is
IRidList of taxonomy class RIDs.indexDocumentClassification
- if true, the document classification is indexed. If false, the document
classification is only stored as an application property with the document and is not indexed. Warning: Should
only be "false" if document is indexed immediately before or after the call by another routine.isTrainingDocument
- if true, the classification is indexed to train the indexWcmException
- exception raised in failure situationvoid queueTaxonomyTrainingCrawler(String taxonomyName, ICollection taxonomyCollection, boolean isSearchRelevant) throws WcmException
taxonomyName
- name of the taxonomytaxonomyCollection
- start collection of the hierarchy that is used to build up the taxonomyisSearchRelevant
- indicates whether the documents are to become part of the index or should only be used to
train the indexWcmException
- exception raised in failure situationvoid createTaxonomyHierarchyByCopiing(String taxonomyName, ICollection existingHierarchy) throws WcmException
taxonomyName
- name of the taxonomyexistingHierarchy
- root folder of the hierarchy to copyWcmException
- WcmExceptionfloat getTaxonomyClassificationThreshold(String taxonomyName, String thresholdId) throws WcmException
taxonomyName
- name of the taxonomy (must exist for index)thresholdId
- Constant IClassificationIndex.PROP_NAME_THRESHOLD_LEVEL1 or
IClassificationIndex.PROP_NAME_THRESHOLD_LEVEL2WcmException
- exception raised in failure situationvoid setTaxonomyClassificationThreshold(String taxonomyName, String thresholdId, float threshold) throws WcmException
taxonomyName
- name of the taxonomy (must exist for index)thresholdId
- Constant IClassificationIndex.PROP_NAME_THRESHOLD_LEVEL1 or
IClassificationIndex.PROP_NAME_THRESHOLD_LEVEL2threshold
- the threshold value for the specified taxonomy that has to be setWcmException
- exception raised in failure situationURI getTaxonomyTrainingUri(String taxonomyName) throws WcmException
taxonomyName
- taxonomyNameWcmException
- WcmExceptionRID getTaxonomyTrainingRid(String taxonomyName) throws WcmException
taxonomyName
- name of the taxonomy (must exist for index)WcmException
- exception raised in failure situationvoid setTaxonomyTrainingUri(String taxonomyName, URI trainingUri) throws WcmException
taxonomyName
- name of the taxonomy (must exist for index)trainingUri
- the training URI for the specified taxonomyWcmException
- exception raised in failure situationvoid setTaxonomyTrainingRid(String taxonomyName, RID trainingRid) throws WcmException
taxonomyName
- name of the taxonomy (must exist for index)trainingRid
- the training RID for the specified taxonomyWcmException
- exception raised in failure situationString getTaxonomyRmPrefix()
boolean useBestClasses()
Collection getBestClasses(IResourceList resourceDocuments, String taxonomyName) throws WcmException
resourceDocuments
- resource list of documents you want to classifytaxonomyName
- taxonomy for which the best classes have to be proposedWcmException
- exception raised in failure situationCollection getBestClasses(IResourceList resourceDocuments, String taxonomyName, int maxNumberOfDocs) throws WcmException
resourceDocuments
- Resource list of documents you want to classifytaxonomyName
- taxonomy for that the best classes have to be proposed formaxNumberOfDocs
- max number of results per documentWcmException
- Exception raised in failure situationBestClassesSensitivity getTaxonomyBestClassesSensitivity(String taxonomyName) throws WcmException
taxonomyName
- name of the taxonomy (must exist for index)WcmException
- exception raised in failure situationfloat getTaxonomyBestClassesSensitivityValue(String taxonomyName) throws WcmException
taxonomyName
- taxonomyNameWcmException
- WcmExceptionvoid setTaxonomyBestClassesSensitivity(String taxonomyName, BestClassesSensitivity sensitivity) throws WcmException
taxonomyName
- name of the taxonomy (must exist for index)sensitivity
- the new TaxonomyBestClassesSensitivity valueWcmException
- exception raised in failure situationboolean isTrainingDocument(IResource document, RID taxonomyClassRid) throws WcmException
document
- the document to checktaxonomyClassRid
- the RID of the taxonomy class that has to be checked
if the document is a training documentWcmException
- WcmExceptionClassificationStatus getDocumentClassificationStatusNewEnum(IResource document, String taxonomyName) throws WcmException
document
- document to get the classification status fortaxonomyName
- name of the taxonomyWcmException
- WcmExceptionvoid setDocumentClassificationStatus(IResource document, String taxonomyName, ClassificationStatus status) throws WcmException
document
- document to get the classification status fortaxonomyName
- name of the taxonomystatus
- the documents classification status in the taxonomyWcmException
- WcmExceptionvoid setDocumentClassificationStatus(IResource document, String taxonomyName, ClassificationStatus status, String notToSend) throws WcmException
document
- documenttaxonomyName
- taxonomyNamestatus
- statusnotToSend
- notToSendWcmException
- WcmExceptionvoid setDocumentClassificationStatus(IResource document, String taxonomyName, ClassificationStatus status, boolean sendEvents, String notToSend) throws WcmException
document
- documenttaxonomyName
- taxonomyNamestatus
- statussendEvents
- sendEventsnotToSend
- notToSendWcmException
- WcmExceptionvoid setDocumentClassificationStatus(IResourceList documents, String taxonomyName, ClassificationStatus status) throws WcmException
documents
- documents to set the classification status fortaxonomyName
- name of the taxonomystatus
- the documents classification status in the taxonomyWcmException
- WcmExceptionIResourceList getDocumentsToClassify(String taxonomyName) throws WcmException
taxonomyName
- name of the taxonomy for which the documents that are to classify should be returnedWcmException
- WcmExceptionIResourceList getDocumentsNeverToClassify(String taxonomyName) throws WcmException
taxonomyName
- name of the taxonomy for which the documents that are never to be classified should be returnedWcmException
- WcmExceptionIResourceList getDocumentsToClassify(String taxonomyName, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomy for which the documents that are to classify should be returnedcontext
- user contextWcmException
- WcmExceptionIResourceList getDocumentsNeverToClassify(String taxonomyName, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomy for which the documents that are never to be classified should be returnedcontext
- user contextWcmException
- WcmExceptionIRidList getDocumentRidsToClassify(String taxonomyName, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomy for which the documents that are to be classified should be returnedcontext
- user contextWcmException
- WcmExceptionIRidList getDocumentRidsNeverToClassify(String taxonomyName, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomy for which the documents that are never to be classified should be returnedcontext
- user contextWcmException
- WcmExceptionRID getSpecialFolderRID(String taxonomyName, SpecialFolder specialFolderType) throws WcmException
taxonomyName
- name of the taxonomyspecialFolderType
- type of special folderWcmException
- WcmExceptionTaxonomyType getTaxonomyTypeNewEnum(String taxonomyName) throws WcmException
taxonomyName
- the name of the taxonomyWcmException
- WcmExceptionvoid setTaxonomyType(String taxonomyName, TaxonomyType taxonomyType) throws WcmException
taxonomyName
- name of the taxonomytaxonomyType
- new taxonomy typeWcmException
- WcmExceptionIRidList getDocumentTrainingClasses(IResource document) throws WcmException
document
- document for which the training classes have to be returnedWcmException
- WcmExceptionIRidList getManuallyDeclassifiedClasses(IResource document) throws WcmException
document
- document for that the manually declassified classes have to be returnedWcmException
- WcmExceptionvoid removeCategoryAssignments(ICollection deletedCategoryFolder) throws WcmException
deletedCategoryFolder
- category that has been deletedWcmException
- WcmExceptionvoid autoClassifyDocs(String taxonomyName, IRidList docRidList, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomydocRidList
- list IDs of documents of a taxonomy to be reclassifiedcontext
- user contextWcmException
- WcmExceptionvoid autoClassifyDocs(String taxonomyName, IResourceList docList, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomydocList
- list documents of a taxonomy to be reclassifiedcontext
- user contextWcmException
- WcmExceptionvoid autoClassifyDocs(String taxonomyName, IResourceContext context) throws WcmException
taxonomyName
- name of the taxonomycontext
- user contextWcmException
- WcmExceptionvoid synchronizeTaxonomyMetaData(String taxonomyName) throws WcmException
taxonomyName
- taxonomy that has to be redefinedWcmException
- WcmExceptionvoid updateSearchCategoryAttributes(IResourceList oldResourceListe, IResourceList newResourceListe, String taxonomyName, RID categoryRid) throws WcmException
categoryRid
for the specified taxonomy is removed from
the index server for all resources in oldResourceListe
and added to
all resources in newResourceListe
.oldResourceListe
- resources for which category attribute is deleted.newResourceListe
- resources for which category attribute is deleted.taxonomyName
- taxonomyNamecategoryRid
- categoryRidWcmException
- in case of an errorboolean hasTaxonomy(String name)
name
- nameUpdateTaxonomyState getUpdateTaxonomyState(String taxonomyName) throws WcmException
taxonomyName
- taxonomyNameWcmException
- WcmExceptionUpdateTaxonomyState getUpdateTaxonomyState(String taxonomyName, Locale locale) throws WcmException
taxonomyName
- taxonomyNamelocale
- localeWcmException
- WcmExceptionAccess Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2018 SAP AG Complete Copyright Notice