com.sapportals.wcm.service.indexmanagement

Interface IIndexService

All Superinterfaces:
IService

public interface IIndexService
extends IService

Manages the indexes of the content management system.
There is always one central instance for the documents of all repositories.

To get an index service follow this example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
 

Changes between major releases 7.0 and 7.X

See Also:
IIndex, IWcmIndexConst

Field Summary
static boolean ACTIVATE_SIEMENS
           
static String CM_INDEXSERVICE_NS
           
static boolean NEW_CRAWLER_FLAG
           
static boolean NEW_CRAWLER_FLAG_TODO_1
           
static String SERVICE_CLASS
          Class property of an index implementation.
static String SERVICE_NAME
          Display name property of an index implementation.
static boolean TEST_NIRVANA_FLAG
           
static boolean VIRTUAL_TAXONOMIES
           
 
Method Summary
 void attachIndexFolder(IIndex index, IIndexFolder indexfolder)
          Attaches an index folder to an index.
 void attachIndexFolderWithoutIndexing(IIndex index, IIndexFolder indexFolder)
          Attaches an index folder to an index but does not start indexing the resources below.
 void attachIndexToRepository(IIndex index, IResource folder)
          Attaches an index to a folder in a repository.
 ICompareTaxonomies createCompareTaxonomies()
          This method is only used by internal methods and should not be used programmers using the index management API.
 ISchedulerTask createDeltaIndexSchedulerTask()
          Returns a task for a delta index schedule.
 String createEmptySchedulerEntryId(String indexId)
          Returns an identifier for a delta index schedule for the index.
 IIndex createIndex(String indexId, String indexName, String indexGroup, String serviceId)
          Creates an index object.
 String createIndexSchedulerEntryId(String indexId, RID indexFolderRid)
          Returns an identifier for a delta index schedule for an folder, which if defined by the according schedule of the index.
 IPropertyDistributionList createPropertyDistributionList()
          Creates an empty IPropertyDistributionList
 String createSchedulerEntryId(String indexId, RID indexFolderRid)
          Returns an identifier for a delta index schedule for an folder, which if not defined by the according schedule of the index.
 ITaxonomyTransport createTaxonomyTransport()
          This method is only used by internal methods and should not be used programmers using the index management API.
 String createVirtualTaxonomy(String dataString, IResourceContext context)
          Create a virtual taxonomy according to the XML specification of the parameter dataString.
 void deleteCrawlers(List crawlers)
          This method is only used by internal methods and should not be used programmers using the index management API.
 void deleteIndex(IIndex index)
          Deprecated. as of NW04. Use deleteIndex(IIndex,IResourceContext)
ATTENTION: Using this signature instead of the one with a resource context for a classification index can lead to problems. If ACLs are used for the taxonomy repository, no folder can be deleted by this method because the service user context that is used only has read permission.
 void deleteIndex(IIndex index, IResourceContext context)
          Deletes an index.
 void detachIndexFolder(IIndex index, IIndexFolder indexFolder)
          Detaches an index folder from an index.
 void detachIndexFolder(IIndex index, IIndexFolder indexFolder, boolean removeDocuments)
          Only for internal usage
 void detachIndexFromRepository(IIndex index, IResource folder)
          Detaches an index from a folder in a repository.
 List getActiveIndexes()
          Returns all existing indexes in the system which are active.
 List getActiveIndexmanagementCrawlers(IIndex index)
          This method is only used by internal methods and should not be used programmers using the index management API.
 List getAllIndexmanagementCrawlers(IIndex index)
           
 Class getClass(String className)
          only for internal usage
 IUser getConfigServiceUserUME()
          This method is only used by internal methods and should not be used programmers using the index management API.
 List getFailedCrawlers(IIndex index)
           
 IIndex getIndex(String indexId)
          Returns the specified index.
 IPropertyMap getIndexedProperties()
          Determines all properties indexed in at least one of the indexes maintained by the index service.
 IPropertyMap getIndexedProperties(IResourceContext resourceContext)
          Determines all properties indexed in at least one of the indexes maintained by the index service and for which read access for the resource context is allowed.
 IPropertyMap getIndexedProperties(List indexes)
          Determines all properties indexed in at least one of the indexes.
 IPropertyMap getIndexedProperties(List indexes, IResourceContext resourceContext)
          Determines all properties indexed in at least one of the indexes and for which read access for the resource context is allowed.
 List getIndexes()
          Returns all existing indexes in the system.
 List getIndexes(IRepositoryManager repositoryManager)
          Returns all indexes into which documents of a repository are indexed.
 List getIndexes(RID topFolderRid)
          Indexes that contain documents of the folder specified by topFolderRid or any sub-folder
 List getIndexes(URI topFolderURI)
          Deprecated. as of NW04. Use getIndexes(RID)
 List getIndexesForResource(IResource resource)
          TReturns the indexes into which a document is indexed.
 List getIndexesForResource(RID rid)
          Returns the indexes into which a document is indexed.
 List getIndexesForResource(URI uri)
          Deprecated. as of NW04. Use getIndexesForResource(RID)
 IIndex getIndexForResource(IResource resource, String serviceType)
          Returns the index in which the document is indexed depending on the specified service type.
 IIndex getIndexForResource(RID rid, String serviceType)
          Returns the index into which the document is indexed depending on the specified service type.
 IIndex getIndexForResource(URI uri, String serviceType)
          Deprecated. as of NW04. Use getIndexForResource(RID,String)
 List getIndexGroups()
          Returns the index groups defined.
 RID getIndexmanagementRepositoryPrefixRID()
          Gets the resource ID of the root folder of the index management repository.
 IResourceContext getIndexServiceUserContext()
           
 Set getLanguagesOfIndexedDocuments(List indexes)
          The methods get as parameter a list of index IDs.
 int getMaxTransferSize()
           
 Object getObjectInstance(String objectInstanceName)
          Gets an instance of an object specified by an IWcmIndexConst constant.
 Properties getProperties(IIndex index)
          only for internal usage
 ISchedulerTimeTable getSchedulerTimeTable(String indexId)
          Returns the timetable of a schedule for delta index crawling for the index.
 List getServiceIds()
          Returns the available service IDs.
 Properties getServiceProperties(String serviceId)
          Gets the properties of an index implementation.
 String getServiceUserId()
          Returns the ID of the index management service user.
 ITaskQueueHandler getTaskQueueHandler()
          Returns the task queue handler of the index management service.
 IVirtualTaxImporter getVirtualTaxImporter()
          Only for internal usage.
 Map groupIndexesByService(List indexes)
          When given a list of index objects, it returns a map that contains the service IDs as keys and a list of indexes for each service as values.
 void internalSaveIndex(IIndex index)
          Saves a newly created index object inside the index service.
 void invalidateIndexesCache()
          only for internal usage
 boolean isDeleteAllowed(IResourceContext context, IIndex index)
          Checks the delete permission of a user for an index.
 List isDeleteAllowed(IResourceContext context, List indexes)
          Checks the delete permission of a user for a list of indexes.
 boolean isReadAllowed(IResourceContext context, IIndex index)
          Checks the read access permission of a user for an index.
 List isReadAllowed(IResourceContext context, List indexes)
          Checks the read access permission of a user for a list of indexes.
 boolean isReadAllowedFast(IResourceContext context, IIndex index)
          Checks the read access permission of a user for an index but does not if the index is currently deleted.
 boolean isVirtualTaxRid(RID rid)
          Checks if the rid start with the path for the dynamic taxonomies (/taxonomies/Virtual_Taxonomies)
 boolean isWriteAllowed(IResourceContext context, IIndex index)
          Checks the write access permission of a user for an index.
 List isWriteAllowed(IResourceContext context, List indexes)
          Checks the write access permission of a user for a list of indexes.
 void queueDeltaIndexCrawler(IIndexFolder indexFolder)
          Puts a delta index crawl into the index management crawler queue.
 void queueIndexCrawler(IIndexFolder indexFolder)
          Puts an index crawl into the index management crawler queue.
 void resumeCrawlers(List crawlers)
          This method is only used by internal methods and should not be used programmers using the index management API.
 void setMaxTransferSize(int i)
          Sets the defined size in byte, up to which content is send directly to the index server, when indexing documents.
 void setProperties(IIndex index, Properties indexProperties)
          only for internal usage
 void setSchedulerTimeTable(String indexId, ISchedulerTimeTable schedulerTimeTable)
          Registers a schedule for delta index crawling for the index with the ISchedulerTimeTable.
 void startResourceIndexer(IResource document, AbstractClassificationIndex index)
          This method is only used by internal methods and should not be used programmers using the index management API.
 void startXIndexCrawler(IIndex index, IResource startResource, String[] parameter)
          This method is only used by internal methods and should not be used programmers using the index management API.
 void startXTaxRetrainCrawler(IIndex index, String taxonomyName, ICollection taxonomyCollection, boolean isSearchRelevant)
          This method is only used by internal methods and should not be used programmers using the index management API.
 void stopCrawlers(List crawlers)
          This method is only used by internal methods and should not be used programmers using the index management API.
 void suspendCrawlers(List crawlers)
          This method is only used by internal methods and should not be used programmers using the index management API.
 void updateIndex(IIndex index)
          Saves all changes that have been made to the index object.
 
Methods inherited from interface com.sapportals.wcm.service.IService
getDescription, getDescription, getID
 

Field Detail

ACTIVATE_SIEMENS

static final boolean ACTIVATE_SIEMENS
See Also:
Constant Field Values

VIRTUAL_TAXONOMIES

static final boolean VIRTUAL_TAXONOMIES
See Also:
Constant Field Values

TEST_NIRVANA_FLAG

static final boolean TEST_NIRVANA_FLAG
See Also:
Constant Field Values

NEW_CRAWLER_FLAG

static final boolean NEW_CRAWLER_FLAG
See Also:
Constant Field Values

NEW_CRAWLER_FLAG_TODO_1

static final boolean NEW_CRAWLER_FLAG_TODO_1
See Also:
Constant Field Values

CM_INDEXSERVICE_NS

static final String CM_INDEXSERVICE_NS

SERVICE_CLASS

static final String SERVICE_CLASS
Class property of an index implementation.
The index service can manage different index implementations.
For each implementation, the class and the display name can be requested by calling the getServiceProperties(String serviceId) method of this interface. It returns a property bag with the two properties.
This constant can be used as a key for getting the class property of the index implementation.

Example:

   Properties properties = indexService.getServiceProperties("trexSearch");
   String class = properties.getProperty(IIndexService.SERVICE_CLASS);
 

See Also:
Constant Field Values

SERVICE_NAME

static final String SERVICE_NAME
Display name property of an index implementation.
The index service can manage different index implementations.
For each implementation, the class and the display name can be requested by calling the getServiceProperties(String serviceId) method of this interface. It returns a property bag with the two properties.
This constant can be used as a key for getting the display name property of the index implementation.

Example:

   Properties properties = indexService.getServiceProperties("trexSearch");
   String class = properties.getProperty(IIndexService.SERVICE_NAME);
 

See Also:
Constant Field Values
Method Detail

deleteIndex

void deleteIndex(IIndex index)
                 throws WcmException
Deprecated. as of NW04. Use deleteIndex(IIndex,IResourceContext)
ATTENTION: Using this signature instead of the one with a resource context for a classification index can lead to problems. If ACLs are used for the taxonomy repository, no folder can be deleted by this method because the service user context that is used only has read permission.

Deletes an index.
Firstly, it detaches the index from all folders of all repositories to which the index has been attached. The documents are indexed in the directly super ordinate index in the hierarchy. Then the index itself is deleted.

Parameters:
index - object of type IIndex
Throws:
WcmException - exception raised in failure situation

createIndex

IIndex createIndex(String indexId,
                   String indexName,
                   String indexGroup,
                   String serviceId)
                   throws WcmException
Creates an index object.
To create the index on the index server, generate(IResourceContext context) must be performed on the index object.
If an index implementation has special properties, they have to be set by calling the init method of the IIndex interface.

Example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.createIndex("abc","abc index","abc group","trexSearch");
  Properties properties = new Properties();
  properties.setProperty("fuzziness","0.8");
  index.init(properties);
  index.generate(context);
 

Parameters:
indexId - identifier/name of the index
indexName - display name of the index
indexGroup - group name to group indexes, examples: Internal Sources, Internet Sources
serviceId - ID that has been specified for the index implementation in cm configuration
Returns:
index object of type IIndex
Throws:
WcmException - exception raised in failure situation

deleteIndex

void deleteIndex(IIndex index,
                 IResourceContext context)
                 throws WcmException
Deletes an index.
Firstly, it detaches the index from all folders of all repositories to which the index has been attached. The documents are indexed in the directly super ordinate index in the hierarchy. Then the index itself is deleted.

Example:

  String indexId = "abc";
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex(indexId);
  indexService.deleteIndex(index,context);
 

Parameters:
index - object of type IIndex
context - user context
Throws:
WcmException - exception raised in failure situation

attachIndexToRepository

void attachIndexToRepository(IIndex index,
                             IResource folder)
                             throws WcmException
Attaches an index to a folder in a repository. All sub documents are deindexed from the directly super ordinate index and indexed in the new attached index.

Parameters:
index - index that has to be attached
folder - folder to which the index should be attached
Throws:
WcmException - exception raised in failure situation

attachIndexFolder

void attachIndexFolder(IIndex index,
                       IIndexFolder indexfolder)
                       throws WcmException
Attaches an index folder to an index.
All sub documents are deindexed from the directly super ordinate index and indexed in the new index.

Example:

  String indexId = "abc";
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex(indexId);
  IIndexFolder indexFolder = new IndexFolder(indexId,RID.getRID("/abcRm/subfolder"));
  indexService.attachIndexFolder(index,indexFolder);
 

Parameters:
index - index to that the index folder has to be attached
indexfolder - index folder to attach to the index
Throws:
WcmException - exception raised in failure situation

attachIndexFolderWithoutIndexing

void attachIndexFolderWithoutIndexing(IIndex index,
                                      IIndexFolder indexFolder)
                                      throws WcmException
Attaches an index folder to an index but does not start indexing the resources below.

Example:

  String indexId = "abc";
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex(indexId);
  IIndexFolder indexFolder = new IndexFolder(indexId,RID.getRID("/abcRm/subfolder"));
  indexService.attachIndexFolderWithoutIndexing(index,indexFolder);
 

Parameters:
index - index to that the index folder has to be attached
indexFolder - index folder to attach to the index
Throws:
WcmException - exception raised in failure situation

detachIndexFromRepository

void detachIndexFromRepository(IIndex index,
                               IResource folder)
                               throws WcmException
Detaches an index from a folder in a repository.
All sub documents are deindexed from the index and reindexed into the directly super ordinate index. Only folders to which the index has been attached can be used for detaching the index.

Parameters:
index - index that has to be detached from the folder
folder - folder from which the index is to be detached
Throws:
WcmException - exception raised in failure situation

detachIndexFolder

void detachIndexFolder(IIndex index,
                       IIndexFolder indexFolder)
                       throws WcmException
Detaches an index folder from an index. All sub documents are deindexed from the index and reindexed into the directly super ordinate index.

Example:

  String indexId = "abc";
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex(indexId);
  IIndexFolder indexFolder = index.getIndexFolders().get(RID.getRID("/abcRm/subfolder"));
  indexService.detachIndexFolder(index,indexFolder);
 

Parameters:
index - index from which the index folder has to be detached
indexFolder - index folder to detach from the index
Throws:
WcmException - exception raised in failure situation

detachIndexFolder

void detachIndexFolder(IIndex index,
                       IIndexFolder indexFolder,
                       boolean removeDocuments)
                       throws WcmException
Only for internal usage

Parameters:
index -
indexFolder -
removeDocuments -
Throws:
WcmException

getIndexes

List getIndexes()
Returns all existing indexes in the system.

Returns:
list of all indexes (type IIndex)

getIndexes

List getIndexes(IRepositoryManager repositoryManager)
Returns all indexes into which documents of a repository are indexed.

Parameters:
repositoryManager - repository for which the indexes have to be returned
Returns:
list of all indexes (IIndex) containing documents of the repository

getIndexes

List getIndexes(URI topFolderURI)
Deprecated. as of NW04. Use getIndexes(RID)

Returns the list of all indexes of the sub hierarchy beginning with this folder.

Parameters:
topFolderURI - URI of the top folder of a sub hierarchy
Returns:
list of all indexes of the sub hierarchy beginning with this folder (type IIndex)

getIndexedProperties

IPropertyMap getIndexedProperties()
                                  throws WcmException
Determines all properties indexed in at least one of the indexes maintained by the index service. Not every different property value is returned, but for each property (defined by its name) one representator.

Returns:
map of properties
Throws:
WcmException - exception raised in failure situation

getIndexedProperties

IPropertyMap getIndexedProperties(IResourceContext resourceContext)
                                  throws WcmException
Determines all properties indexed in at least one of the indexes maintained by the index service and for which read access for the resource context is allowed. Not every different property value is returned, but for each property (defined by its name) one representator.

Parameters:
resourceContext -
Returns:
map of properties
Throws:
WcmException - exception raised in failure situation

getIndexedProperties

IPropertyMap getIndexedProperties(List indexes)
                                  throws WcmException
Determines all properties indexed in at least one of the indexes. Not every different property value is returned, but for each property (defined by its name) one representator.

Parameters:
indexes -
Returns:
list of indexes
Throws:
WcmException - exception raised in failure situation

getIndexedProperties

IPropertyMap getIndexedProperties(List indexes,
                                  IResourceContext resourceContext)
                                  throws WcmException
Determines all properties indexed in at least one of the indexes and for which read access for the resource context is allowed. Not every different property value is returned, but for each property (defined by its name) one representator.

Parameters:
indexes -
resourceContext -
Returns:
map of properties
Throws:
WcmException - exception raised in failure situation

getIndexes

List getIndexes(RID topFolderRid)
Indexes that contain documents of the folder specified by topFolderRid or any sub-folder

Parameters:
topFolderRid - resource ID of the top folder in a folder hierarchy
Returns:
list of all indexes (IIndex) to which the specified folder or a sub-folder is attached

getIndex

IIndex getIndex(String indexId)
                throws WcmException
Returns the specified index. The index object is needed to perform any index-related action, such as classification. Therefore the generic index object needs to be casted to the specialised interface that is supported by the index implementation (for example, IClassificationIndex).

Example:

  String indexId = "abcclassification";
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex(indexId);
  IClassificationIndex classificationIndex = null;
  if (index instanceof IClassificationIndex)
  classificationIndex = (IClassificationIndex)index;
 

Parameters:
indexId - ID of the index
Returns:
requested index object
Throws:
WcmException - exception raised in failure situation
If no index exists for an index ID, an WcmException is thrown.

getIndexForResource

IIndex getIndexForResource(IResource resource,
                           String serviceType)
                           throws ResourceException
Returns the index in which the document is indexed depending on the specified service type.
The service type defines the kind of index, for example, search or classification.
IWcmIndexConst contains constants for existing service types

Example:
To get the search index for document "a.txt" that is in folder "/documents/mydocs" the following example can be used:

  IResource resource = ResourceFactory.getInstance().getResource(RID.getRID("/documents/mydocs/a.txt"),context);
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndexForResource(resource,IWcmIndexConst.SERVICE_TYPE_SEARCH);
 

If no index of the specified service type contains the resource, null is returned.

Parameters:
resource - folder or document for which the index has to be determined
serviceType - use com.sapportals.wcm.service.indexmanagement.IWcmIndexConst service types
Returns:
index into which the document is indexed depending on the specified service type
Throws:
ResourceException - exception raised in failure situation

getIndexForResource

IIndex getIndexForResource(URI uri,
                           String serviceType)
Deprecated. as of NW04. Use getIndexForResource(RID,String)

Returns the index into which the document is indexed depending on the specified service type.

Parameters:
serviceType - use com.sapportals.wcm.service.indexmanagement.IWcmIndexConst service types
uri - URI of the resource for which the index has to be determined
Returns:
index into which the document is indexed depending on the specified service type

getIndexForResource

IIndex getIndexForResource(RID rid,
                           String serviceType)
Returns the index into which the document is indexed depending on the specified service type.
The service type defines the kind of index, for example, search or classification.
IWcmIndexConst contains constants for existing service types

Example:
To get the search index for document "a.txt" that is in folder "/documents/mydocs" the following example can be used:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndexForResource(RID.getRID("/documents/mydocs/a.txt"),IWcmIndexConst.SERVICE_TYPE_SEARCH);
 

If no index of the specified service type contains the resource, null is returned.

Parameters:
serviceType - use com.sapportals.wcm.service.indexmanagement.IWcmIndexConst service types
rid - resource ID of the resource for which the index has to be determined
Returns:
index into which the document is indexed depending on the specified service type

getIndexesForResource

List getIndexesForResource(IResource resource)
                           throws ResourceException
TReturns the indexes into which a document is indexed.

Example:
To get the indexes for document "a.txt" that is in folder "/documents/mydocs" the following example can be used:

  IResource resource = ResourceFactory.getInstance().getResource(RID.getRID("/documents/mydocs/a.txt"),context);
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  List indexes = indexService.getIndexesForResource(resource);
 

If no index contains the resource, an empty List is returned.

Parameters:
resource - folder or the document for which the indexes have to be determined
Returns:
list of all indexes (IIndex) into which the document is indexed
Throws:
ResourceException - exception raised in failure situation

getIndexesForResource

List getIndexesForResource(URI uri)
Deprecated. as of NW04. Use getIndexesForResource(RID)

Returns the indexes into which the document is indexed.

Parameters:
uri - the URI of the folder or the document for which the indexes have to be determined
Returns:
list of all indexes into which the document is indexed (type IIndex).

getIndexesForResource

List getIndexesForResource(RID rid)
Returns the indexes into which a document is indexed.

Example:
To get the indexes for document "a.txt" that is in folder "/documents/mydocs" the following example can be used:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  List indexes = indexService.getIndexesForResource(RID.getRID("/documents/mydocs/a.txt"));
 

If no index contains the resource, an empty List is returned.

Parameters:
rid - resource ID of the folder or the document for which the indexes have to be determined
Returns:
list of all indexes (IIndex) into which the document is indexed

getIndexGroups

List getIndexGroups()
Returns the index groups defined. Grouping indexes enables operations to be carried out on more than one index by selecting an index group in order to perform the action on all indexes in the group in question.
This method goes through all indexes and builds a list of index groups that are currently defined for indexes.

Returns:
list of index groups of type String used in the existing indexes

getServiceIds

List getServiceIds()
Returns the available service IDs. The index service can manage different index implementations.
For each implementation, the serviceId is an identifier.
This method returns the IDs of all index implementations that are available in the system.

Returns:
list of the IDs (String) of all index services

getServiceProperties

Properties getServiceProperties(String serviceId)
                                throws WcmException
Gets the properties of an index implementation.
The display name and the class are returned for each implementation. The constants SERVICE_NAME and SERVICE_CLASS can be used as keys for getting a property from the returned property map.

Example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  Properties properties = indexService.getServiceProperties("trexSearch");
  //returns "Trex Search"
  String displayName = properties.getProperty(IIndexService.SERVICE_NAME);
  //returns "com.sapportals.wcm.service.indexmanagement.retrieval.trex.TrexSearch"
  String class = properties.getProperty(IIndexService.SERVICE_CLASS);
 

Parameters:
serviceId - ID of the index implementation, for example, "trexSearch"
Returns:
properties of the implementation, for example IIndexService.SERVICE_CLASS, IIndexService.SERVICE_NAME, ...
Throws:
WcmException - exception raised in failure situation

getLanguagesOfIndexedDocuments

Set getLanguagesOfIndexedDocuments(List indexes)
                                   throws WcmException
The methods get as parameter a list of index IDs. It returns the set of languages of the documents in the specified indexes.

Parameters:
indexes - List of indexes
Returns:
Set of Strings, each specifying a language.
Throws:
WcmException - Exception raised in failure situation

updateIndex

void updateIndex(IIndex index)
                 throws ResourceException
Saves all changes that have been made to the index object.
The method must be called after the index object has been modified. It saves all changes to the object permanently.

Example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex("abc");
  index.setIndexName("abc index");
  indexService.updateIndex(index);
 

Parameters:
index - index that has to be updated persistently
Throws:
ResourceException - exception raised in failure situation

internalSaveIndex

void internalSaveIndex(IIndex index)
                       throws WcmException
Saves a newly created index object inside the index service. After saving the index it is persistent in the CM configuration. This call must be called by index implementations at the end of their .generate() method. In that way the configuration is only made persistent when the index could be created by the index implementation successfully. Don't use this method for other purposes.

Parameters:
index - index to save
Throws:
WcmException

groupIndexesByService

Map groupIndexesByService(List indexes)
When given a list of index objects, it returns a map that contains the service IDs as keys and a list of indexes for each service as values.
Service IDs are the identifiers of index implementations.

Parameters:
indexes - list of indexes (IIndex) that have to be grouped
Returns:
Map with serviceIds as keys (String) and their corresponding indexes in a list as values (IIndex)

getObjectInstance

Object getObjectInstance(String objectInstanceName)
                         throws WcmException
Gets an instance of an object specified by an IWcmIndexConst constant.
The returned object must be casted with its interface.

Example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IFederatedSearch federatedSearch = (IFederatedSearch)indexService.getObjectInstance(IWcmIndexConst.FEDERATED_SEARCH_INSTANCE);
 

Parameters:
objectInstanceName - ID for the kind of object
Returns:
requested object
Throws:
WcmException - exception raised in failure situation

getServiceUserId

String getServiceUserId()
Returns the ID of the index management service user.
The index management service user is used to access documents in background jobs such as crawling. It has read permission for all documents in the system.

To get the resource context of the index management service user, follow this example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  String serviceUserId = indexService.getServiceUserId();
  IResourceContext serviceContext = ResourceFactory.getInstance().getServiceContextUME(serviceUserId);
 
Note: The user must be configured in user management as a service user.

Returns:
user ID of the index management service user

getIndexServiceUserContext

IResourceContext getIndexServiceUserContext()
                                            throws WcmException
Returns:
a resource context for the index_service user.
Throws:
WcmException

queueDeltaIndexCrawler

void queueDeltaIndexCrawler(IIndexFolder indexFolder)
                            throws WcmException
Puts a delta index crawl into the index management crawler queue.
The number of crawlers of the queue that are active in parallel is defined in the index management service configuration property maxrunningcrawlers.

Example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex("abc");
  //"/documents" must be an index folder of the index "abc".
  IIndexFolder indexFolder = index.getIndexFolders().get(RID.getRID("/documents"));
  indexService.queueDeltaIndexCrawler(indexFolder);
  indexService.runQueuedCrawlers();
 

Parameters:
indexFolder - index folder that has to be crawled
Throws:
WcmException - exception raised in failure situation

queueIndexCrawler

void queueIndexCrawler(IIndexFolder indexFolder)
                       throws WcmException
Puts an index crawl into the index management crawler queue.
The number of crawlers of the queue that are active in parallel is defined in the index management service configuration property maxrunningcrawlers.

Example:

  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex("abc");
  //"/documents" must be an index folder of the index "abc".
  IIndexFolder indexFolder = index.getIndexFolders().get(RID.getRID("/documents"));
  indexService.queueIndexCrawler(indexFolder);
  indexService.runQueuedCrawlers();
 

Parameters:
indexFolder - index folder that has to be crawled
Throws:
WcmException - exception raised in failure situation

getTaskQueueHandler

ITaskQueueHandler getTaskQueueHandler()
                                      throws WcmException
Returns the task queue handler of the index management service.
The handler writes index tasks such as starting of crawlers into the task queue and periodically checks the queue if new index tasks are available to execute.

Returns:
index management task queue handler
Throws:
WcmException

setSchedulerTimeTable

void setSchedulerTimeTable(String indexId,
                           ISchedulerTimeTable schedulerTimeTable)
                           throws WcmException
Registers a schedule for delta index crawling for the index with the ISchedulerTimeTable. Thereby it sets this schedule for all data sources with no own schedule.

Parameters:
indexId - String ID for index.
schedulerTimeTable - ISchedulerTimeTable
Throws:
WcmException - in case of an error.

getSchedulerTimeTable

ISchedulerTimeTable getSchedulerTimeTable(String indexId)
                                          throws WcmException
Returns the timetable of a schedule for delta index crawling for the index. Returns null in case that no schedule is defined for the index.

Parameters:
indexId - String ID of the index.
Returns:
schedule for delta index crawling
Throws:
WcmException - in case of an error.

createIndexSchedulerEntryId

String createIndexSchedulerEntryId(String indexId,
                                   RID indexFolderRid)
                                   throws WcmException
Returns an identifier for a delta index schedule for an folder, which if defined by the according schedule of the index.

Parameters:
indexId - String ID of the index.
indexFolderRid - RID
Returns:
identifier for a delta index schedule
Throws:
WcmException - in case of an error.

createSchedulerEntryId

String createSchedulerEntryId(String indexId,
                              RID indexFolderRid)
                              throws WcmException
Returns an identifier for a delta index schedule for an folder, which if not defined by the according schedule of the index.

Parameters:
indexId - String ID of the index.
indexFolderRid - RID
Returns:
identifier for a delta index schedule
Throws:
WcmException - in case of an error.

createEmptySchedulerEntryId

String createEmptySchedulerEntryId(String indexId)
                                   throws WcmException
Returns an identifier for a delta index schedule for the index.

Parameters:
indexId - String ID of the index.
Returns:
identifier for a delta index schedule
Throws:
WcmException - in case of an error.

createDeltaIndexSchedulerTask

ISchedulerTask createDeltaIndexSchedulerTask()
Returns a task for a delta index schedule.

Returns:
task for a delta index schedule

getIndexmanagementRepositoryPrefixRID

RID getIndexmanagementRepositoryPrefixRID()
                                          throws WcmException
Gets the resource ID of the root folder of the index management repository.

Returns:
resource ID of the root folder of the index management repository
Throws:
WcmException - in case of an error

getActiveIndexes

List getActiveIndexes()
                      throws WcmException
Returns all existing indexes in the system which are active.

Returns:
list of all active indexes (type IIndex)
Throws:
WcmException - in case of an error

isReadAllowed

boolean isReadAllowed(IResourceContext context,
                      IIndex index)
                      throws WcmException
Checks the read access permission of a user for an index.

Parameters:
context - user context
index - index that is checked
Returns:
true if the user has read access for the index
Throws:
WcmException - in case of an error

isReadAllowedFast

boolean isReadAllowedFast(IResourceContext context,
                          IIndex index)
                          throws WcmException
Checks the read access permission of a user for an index but does not if the index is currently deleted.

Parameters:
context - user context
index - index that is checked
Returns:
true if the user has read access for the index
Throws:
WcmException - in case of an error

isReadAllowed

List isReadAllowed(IResourceContext context,
                   List indexes)
                   throws WcmException
Checks the read access permission of a user for a list of indexes.

Parameters:
context - user context
indexes - indexes that are checked
Returns:
list of indexes where the user has read access
Throws:
WcmException - in case of an error

isWriteAllowed

boolean isWriteAllowed(IResourceContext context,
                       IIndex index)
                       throws WcmException
Checks the write access permission of a user for an index.

Parameters:
context - user context
index - index that is checked
Returns:
true if the user has write access for the index
Throws:
WcmException - in case of an error

isWriteAllowed

List isWriteAllowed(IResourceContext context,
                    List indexes)
                    throws WcmException
Checks the write access permission of a user for a list of indexes.

Parameters:
context - user context
indexes - indexes that are checked
Returns:
list of indexes where the user has write access
Throws:
WcmException - in case of an error

isDeleteAllowed

boolean isDeleteAllowed(IResourceContext context,
                        IIndex index)
                        throws WcmException
Checks the delete permission of a user for an index.

Parameters:
context - user context
index - index that is checked
Returns:
true if the user has read access for the index
Throws:
WcmException - in case of an error

isDeleteAllowed

List isDeleteAllowed(IResourceContext context,
                     List indexes)
                     throws WcmException
Checks the delete permission of a user for a list of indexes.

Parameters:
context - user context
indexes - indexes that are checked
Returns:
list of indexes where the user has read access
Throws:
WcmException - in case of an error

getMaxTransferSize

int getMaxTransferSize()
Returns:
he defined size in byte, up to which content is send directly to the index server, when indexing documents.

setMaxTransferSize

void setMaxTransferSize(int i)
Sets the defined size in byte, up to which content is send directly to the index server, when indexing documents.

Parameters:
i -

startXIndexCrawler

void startXIndexCrawler(IIndex index,
                        IResource startResource,
                        String[] parameter)
                        throws WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
index -
startResource -
parameter -
Throws:
WcmException

startXTaxRetrainCrawler

void startXTaxRetrainCrawler(IIndex index,
                             String taxonomyName,
                             ICollection taxonomyCollection,
                             boolean isSearchRelevant)
                             throws ResourceException,
                                    WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
index -
taxonomyName -
taxonomyCollection -
isSearchRelevant -
Throws:
ResourceException
WcmException

getConfigServiceUserUME

IUser getConfigServiceUserUME()
                              throws Exception
This method is only used by internal methods and should not be used programmers using the index management API.

Throws:
Exception
Since:
NetWeaver 7.1

startResourceIndexer

void startResourceIndexer(IResource document,
                          AbstractClassificationIndex index)
                          throws WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
document -
index -
Throws:
WcmException

getActiveIndexmanagementCrawlers

List getActiveIndexmanagementCrawlers(IIndex index)
                                      throws WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
index -
Returns:
Active Indexmanagement Crawlers
Throws:
WcmException

deleteCrawlers

void deleteCrawlers(List crawlers)
                    throws WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
crawlers -
Throws:
WcmException

stopCrawlers

void stopCrawlers(List crawlers)
                  throws WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
crawlers -
Throws:
WcmException

suspendCrawlers

void suspendCrawlers(List crawlers)
                     throws WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
crawlers -
Throws:
WcmException

resumeCrawlers

void resumeCrawlers(List crawlers)
                    throws WcmException
This method is only used by internal methods and should not be used programmers using the index management API.

Parameters:
crawlers -
Throws:
WcmException

createTaxonomyTransport

ITaxonomyTransport createTaxonomyTransport()
                                           throws ResourceException,
                                                  PropertyConfigurationServiceException
This method is only used by internal methods and should not be used programmers using the index management API.

Throws:
ResourceException
PropertyConfigurationServiceException

createCompareTaxonomies

ICompareTaxonomies createCompareTaxonomies()
This method is only used by internal methods and should not be used programmers using the index management API.

Returns:
compare taxonomies

getAllIndexmanagementCrawlers

List getAllIndexmanagementCrawlers(IIndex index)
                                   throws ResourceException,
                                          XCrawlerException
Parameters:
index -
Returns:
an ID list of all crawler for an index.
Throws:
ResourceException
XCrawlerException

getFailedCrawlers

List getFailedCrawlers(IIndex index)
                       throws ResourceException,
                              XCrawlerException
Parameters:
index -
Returns:
an ID list with the failed crawler.
Throws:
ResourceException
XCrawlerException

createVirtualTaxonomy

String createVirtualTaxonomy(String dataString,
                             IResourceContext context)
                             throws WcmException
Create a virtual taxonomy according to the XML specification of the parameter dataString.

Parameters:
dataString -
context -
Returns:
virtual taxonomy
Throws:
WcmException

isVirtualTaxRid

boolean isVirtualTaxRid(RID rid)
Checks if the rid start with the path for the dynamic taxonomies (/taxonomies/Virtual_Taxonomies)

Parameters:
rid -
Returns:
boolean type

createPropertyDistributionList

IPropertyDistributionList createPropertyDistributionList()
Creates an empty IPropertyDistributionList

Returns:
Property Distribution List

getVirtualTaxImporter

IVirtualTaxImporter getVirtualTaxImporter()
Only for internal usage.

Returns:
Virtual Tax Importer

setProperties

void setProperties(IIndex index,
                   Properties indexProperties)
only for internal usage

Parameters:
index -
indexProperties -

getProperties

Properties getProperties(IIndex index)
only for internal usage

Parameters:
index -
Returns:
properties

getClass

Class getClass(String className)
only for internal usage

Parameters:
className -
Returns:
class

invalidateIndexesCache

void invalidateIndexesCache()
only for internal usage

Access Rights

This class can be accessed from:


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 2014 SAP AG Complete Copyright Notice