SAP NetWeaver '04

com.sapportals.wcm.service.indexmanagement
Interface IIndexService

[contained in: com.sap.km.cm.service.par - km.shared.service.indexmanagement_api.jar]
All Superinterfaces:
IEventReceiver, IResourceEventReceiver, IService

public interface IIndexService
extends IResourceEventReceiver, 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);
 

See Also:
IIndex, IWcmIndexConst

Field Summary
static boolean ACTIVATE_SIEMENS
           
static java.lang.String CM_INDEXSERVICE_NS
           
static boolean NEW_CRAWLER_FLAG
           
static boolean NEW_CRAWLER_FLAG_TODO_1
           
static java.lang.String SERVICE_CLASS
          Class property of an index implementation.
static java.lang.String SERVICE_NAME
          Display name property of an index implementation.
static boolean TEST_NIRVANA_FLAG
           
 
Method Summary
 void attachIndexFolder(IIndex index, IIndexFolder indexfolder)
          Attaches an index folder to an index.
 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 imdexmanagement API.
 ISchedulerTask createDeltaIndexSchedulerTask()
          Returns a task for a delta index schedule.
 java.lang.String createEmptySchedulerEntryId(java.lang.String indexId)
          Returns an identifier for a delta index schedule for the index.
 IIndex createIndex(java.lang.String indexId, java.lang.String indexName, java.lang.String indexGroup, java.lang.String serviceId)
          Creates an index object.
 java.lang.String createIndexSchedulerEntryId(java.lang.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.
 java.lang.String createSchedulerEntryId(java.lang.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 imdexmanagement API.
 void deleteCrawlers(java.util.List crawlers)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement 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 detachIndexFromRepository(IIndex index, IResource folder)
          Detaches an index from a folder in a repository.
 void enqueueDeltaIndexCrawler(IIndexFolder indexFolder)
          Puts a delta index crawl into the index management crawler queue.
 void enqueueIndexCrawler(IIndexFolder indexFolder)
          Deprecated. as of NW04. Does not work with the new crawlers
 java.util.List getActiveIndexes()
          Returns all existing indexes in the system which are active.
 java.util.List getActiveIndexmanagementCrawlers(IIndex index)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 java.util.List getAllIndexmanagementCrawlers(IIndex index)
          Returns an ID list of all crawler for an index.
 com.sapportals.portal.security.usermanagement.IUser getConfigServiceUser()
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 java.lang.String getCrawlerType()
          Returns the default crawler type of the index management service.
 java.util.List getFailedCrawlers(IIndex index)
          Returns an ID list with the failed crawler.
 IIndex getIndex(java.lang.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(java.util.List indexes)
          Determines all properties indexed in at least one of the indexes.
 IPropertyMap getIndexedProperties(java.util.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.
 java.util.List getIndexes()
          Returns all existing indexes in the system.
 java.util.List getIndexes(IRepositoryManager repositoryManager)
          Returns all indexes into which documents of a repository are indexed.
 java.util.List getIndexes(RID topFolderRid)
          Indexes that contain documents of the folder specified by topFolderRid or any subfolder
 java.util.List getIndexes(URI topFolderURI)
          Deprecated. as of NW04. Use getIndexes(RID)
 java.util.List getIndexesForResource(IResource resource)
          TReturns the indexes into which a document is indexed.
 java.util.List getIndexesForResource(RID rid)
          Returns the indexes into which a document is indexed.
 java.util.List getIndexesForResource(URI uri)
          Deprecated. as of NW04. Use getIndexesForResource(RID)
 IIndex getIndexForResource(IResource resource, java.lang.String serviceType)
          Returns the index in which the document is indexed depending on the specified service type.
 IIndex getIndexForResource(RID rid, java.lang.String serviceType)
          Returns the index into which the document is indexed depending on the specified service type.
 IIndex getIndexForResource(URI uri, java.lang.String serviceType)
          Deprecated. as of NW04. Use getIndexForResource(RID,String)
 java.util.List getIndexGroups()
          Returns the index groups defined.
 RID getIndexmanagementRepositoryPrefixRID()
          Gets the resource ID of the root folder of the indexmanagement repository.
 IResourceContext getIndexServiceUserContext()
           
 java.util.Set getLanguagesOfIndexedDocuments(java.util.List indexes)
          The methods get as parameter a list of index IDs.
 int getMaxTransferSize()
          Returns the defined size in byte, up to which content is send directly to the index server, when indexing documents.
 java.lang.Object getObjectInstance(java.lang.String objectInstanceName)
          Gets an instance of an object specified by an IWcmIndexConst constant.
 ISchedulerTimeTable getSchedulerTimeTable(java.lang.String indexId)
          Returns the timetable of a schedule for delta index crawling for the index.
 java.util.List getServiceIds()
          Returns the available service IDs.
 java.util.Properties getServiceProperties(java.lang.String serviceId)
          Gets the properties of an index implementation.
 java.lang.String getServiceUserId()
          Returns the ID of the index management service user.
 ITaskQueueHandler getTaskQueueHandler()
          Returns the task queue handler of the index management service.
 java.util.Map groupIndexesByService(java.util.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.
 boolean isDeleteAllowed(IResourceContext context, IIndex index)
          Checks the delete permission of a user for an index.
 java.util.List isDeleteAllowed(IResourceContext context, java.util.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.
 java.util.List isReadAllowed(IResourceContext context, java.util.List indexes)
          Checks the read access permission of a user for a list of indexes.
 boolean isWriteAllowed(IResourceContext context, IIndex index)
          Checks the write access permission of a user for an index.
 java.util.List isWriteAllowed(IResourceContext context, java.util.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(java.util.List crawlers)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 void runQueuedCrawlers()
          Deprecated. as of NW04. Does not work with the new crawlers
 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 setSchedulerTimeTable(java.lang.String indexId, ISchedulerTimeTable schedulerTimeTable)
          Registers a schedule for delta index crawling for the index with the ISchedulerTimeTable.
 void startDeltaIndexCrawler(IIndexFolder indexFolder)
          Deprecated. as of NW04. Crawlers can only be queued - use queueDeltaIndexCrawler
 void startIndexCrawler(IIndexFolder indexFolder)
          Deprecated. as of NW04. Crawlers can only be queued - use queueIndexCrawler
 void startResourceIndexer(IResource document, AbstractClassificationIndex index)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 void startXIndexCrawler(IIndex index, IResource startResource)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 void startXTaxRetrainCrawler(IIndex index, java.lang.String taxonomyName, ICollection taxonomyCollection, boolean isSearchRelevant)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 void stopCrawlers(java.util.List crawlers)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 void suspendCrawlers(java.util.List crawlers)
          This method is only used by internal methods and should not be used programmers using the imdexmanagement API.
 void updateIndex(IIndex index)
          Saves all changes that have been made to the index object.
 
Methods inherited from interface com.sapportals.wcm.util.events.IEventReceiver
received
 
Methods inherited from interface com.sapportals.wcm.service.IService
getDescription, getDescription, getID
 

Field Detail

ACTIVATE_SIEMENS

public static final boolean ACTIVATE_SIEMENS

TEST_NIRVANA_FLAG

public static final boolean TEST_NIRVANA_FLAG

NEW_CRAWLER_FLAG

public static final boolean NEW_CRAWLER_FLAG

NEW_CRAWLER_FLAG_TODO_1

public static final boolean NEW_CRAWLER_FLAG_TODO_1

CM_INDEXSERVICE_NS

public static final java.lang.String CM_INDEXSERVICE_NS

SERVICE_CLASS

public static final java.lang.String SERVICE_CLASS
Class property of an index implementation.
The index service can manage different index implementations.
For each implementation, the class and the displayname 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);
 

SERVICE_NAME

public static final java.lang.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 displayname 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 displayname property of the index implementation.

Example:

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

deleteIndex

public 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 superordinate index in the hierarchy. Then the index itself is deleted.

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

createIndex

public IIndex createIndex(java.lang.String indexId,
                          java.lang.String indexName,
                          java.lang.String indexGroup,
                          java.lang.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

public 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 superordinate 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

public void attachIndexToRepository(IIndex index,
                                    IResource folder)
                             throws WcmException
Attaches an index to a folder in a repository. All subdocuments are deindexed from the directly superordinate 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

public void attachIndexFolder(IIndex index,
                              IIndexFolder indexfolder)
                       throws WcmException
Attaches an index folder to an index.
All subdocuments are deindexed from the directly superordinate 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

detachIndexFromRepository

public void detachIndexFromRepository(IIndex index,
                                      IResource folder)
                               throws WcmException
Detaches an index from a folder in a repository.
All subdocuments are deindexed from the index and reindexed into the directly superordinate 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

public void detachIndexFolder(IIndex index,
                              IIndexFolder indexFolder)
                       throws WcmException
Detaches an index folder from an index. All subdocuments are deindexed from the index and reindexed into the directly superordinate 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

getIndexes

public java.util.List getIndexes()
Returns all existing indexes in the system.
Returns:
list of all indexes (type IIndex)

getIndexes

public java.util.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

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

Returns the list of all indexes of the subhierarchy beginning with this folder.
Parameters:
topFolderUri - URI of the top folder of a subhierarchy
Returns:
list of all indexes of the subhierarchy beginning with this folder (type IIndex)

getIndexedProperties

public 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 (defind by its name) one representator.
Returns:
map of properties
Throws:
WcmException - exception raised in failure situation

getIndexedProperties

public 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 (defind by its name) one representator.
Parameters:
resourceContext -  
Returns:
map of properties
Throws:
WcmException - exception raised in failure situation

getIndexedProperties

public IPropertyMap getIndexedProperties(java.util.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 (defind by its name) one representator.
Returns:
list of indexes
Throws:
WcmException - exception raised in failure situation

getIndexedProperties

public IPropertyMap getIndexedProperties(java.util.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 (defind by its name) one representator.
Parameters:
indexes -  
resourceContext -  
Returns:
map of properties
Throws:
WcmException - exception raised in failure situation

getIndexes

public java.util.List getIndexes(RID topFolderRid)
Indexes that contain documents of the folder specified by topFolderRid or any subfolder
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 subfolder is attached

getIndex

public IIndex getIndex(java.lang.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 specialized 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

public IIndex getIndexForResource(IResource resource,
                                  java.lang.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

public IIndex getIndexForResource(URI uri,
                                  java.lang.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

public IIndex getIndexForResource(RID rid,
                                  java.lang.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

public java.util.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

public java.util.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

public java.util.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

public java.util.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

public java.util.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

public java.util.Properties getServiceProperties(java.lang.String serviceId)
                                          throws WcmException
Gets the properties of an index implementation.
The displayname 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

public java.util.Set getLanguagesOfIndexedDocuments(java.util.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

public 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

public 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

groupIndexesByService

public java.util.Map groupIndexesByService(java.util.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

public java.lang.Object getObjectInstance(java.lang.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

getCrawlerType

public java.lang.String getCrawlerType()
Returns the default crawler type of the index management service.
If no crawler profile exists for an index folder, the default crawler type is used to create a crawler.
Returns:
default crawler type of the index management service

getServiceUserId

public java.lang.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().getServiceContext(serviceUserId);
 
Note: The user must be configured in user management as a service user.
Returns:
user ID of the index management service user

getIndexServiceUserContext

public IResourceContext getIndexServiceUserContext()
                                            throws WcmException

startDeltaIndexCrawler

public void startDeltaIndexCrawler(IIndexFolder indexFolder)
                            throws WcmException
Deprecated. as of NW04. Crawlers can only be queued - use queueDeltaIndexCrawler

Runs a delta index crawl as a separate thread.
A delta index crawl indexes only new and changed documents and deindexes deleted documents.

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.startDeltaIndexCrawler(indexFolder);
 
Parameters:
indexFolder - index folder that has to be crawled
Throws:
WcmException - exception raised in failure situation

startIndexCrawler

public void startIndexCrawler(IIndexFolder indexFolder)
                       throws WcmException
Deprecated. as of NW04. Crawlers can only be queued - use queueIndexCrawler

Runs an index crawl as a separate thread.
An index crawl indexes all documents that are crawled.

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.startIndexCrawler(indexFolder);
 
Parameters:
indexFolder - index folder that has to be crawled
Throws:
WcmException - exception raised in failure situation

enqueueDeltaIndexCrawler

public void enqueueDeltaIndexCrawler(IIndexFolder indexFolder)
                              throws WcmException
Puts a delta index crawl into the index management crawler queue.
To start processing the queued crawlers, runQueuedCrawlers must be executed. 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
See Also:
runQueuedCrawlers()

queueDeltaIndexCrawler

public void queueDeltaIndexCrawler(IIndexFolder indexFolder)
                            throws WcmException
Puts a delta index crawl into the index management crawler queue.
To start processing the queued crawlers, runQueuedCrawlers must be executed. 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
See Also:
runQueuedCrawlers()

queueIndexCrawler

public void queueIndexCrawler(IIndexFolder indexFolder)
                       throws WcmException
Puts an index crawl into the index management crawler queue.
To start processing the queued crawlers, runQueuedCrawlers must be executed. 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
See Also:
runQueuedCrawlers()

enqueueIndexCrawler

public void enqueueIndexCrawler(IIndexFolder indexFolder)
                         throws WcmException
Deprecated. as of NW04. Does not work with the new crawlers

Puts an index crawl into the index management crawler queue.
To start processing the queued crawlers, runQueuedCrawlers must be executed. 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 be crawled
reindexMode - true, if the documents are indexed using the reindex call
Throws:
WcmException - exception raised in failure situation
See Also:
runQueuedCrawlers()

runQueuedCrawlers

public void runQueuedCrawlers()
                       throws WcmException
Deprecated. as of NW04. Does not work with the new crawlers

Runs all index and delta index crawlers that have been queued previously.
Crawlers can be queued by calling the queueIndexCrawler and queueDeltaIndexCrawler methods of this interface.

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();
 
Throws:
WcmException - exception raised in failure situation
See Also:
queueIndexCrawler(IIndexFolder), queueDeltaIndexCrawler(IIndexFolder)

getTaskQueueHandler

public 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

setSchedulerTimeTable

public void setSchedulerTimeTable(java.lang.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 fo index.
schedulerTimeTable - ISchedulerTimeTable
Throws:
WcmException - in case of an error.

getSchedulerTimeTable

public ISchedulerTimeTable getSchedulerTimeTable(java.lang.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

public java.lang.String createIndexSchedulerEntryId(java.lang.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

public java.lang.String createSchedulerEntryId(java.lang.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

public java.lang.String createEmptySchedulerEntryId(java.lang.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

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

getIndexmanagementRepositoryPrefixRID

public RID getIndexmanagementRepositoryPrefixRID()
                                          throws WcmException
Gets the resource ID of the root folder of the indexmanagement repository.
Returns:
resource ID of the root folder of the indexmanagement repository
Throws:
WcmException - in case of an error

getActiveIndexes

public java.util.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

public 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

isReadAllowed

public java.util.List isReadAllowed(IResourceContext context,
                                    java.util.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

public 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

public java.util.List isWriteAllowed(IResourceContext context,
                                     java.util.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

public 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

public java.util.List isDeleteAllowed(IResourceContext context,
                                      java.util.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

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

setMaxTransferSize

public 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

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

startXTaxRetrainCrawler

public void startXTaxRetrainCrawler(IIndex index,
                                    java.lang.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 imdexmanagement API.

getConfigServiceUser

public com.sapportals.portal.security.usermanagement.IUser getConfigServiceUser()
                                                                         throws java.lang.Exception
This method is only used by internal methods and should not be used programmers using the imdexmanagement API.

startResourceIndexer

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

getActiveIndexmanagementCrawlers

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

deleteCrawlers

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

stopCrawlers

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

suspendCrawlers

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

resumeCrawlers

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

createTaxonomyTransport

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

createCompareTaxonomies

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

getAllIndexmanagementCrawlers

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

getFailedCrawlers

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

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.