com.sapportals.wcm.service.indexmanagement

Class AbstractIndex

java.lang.Object
  extended bycom.sapportals.wcm.service.indexmanagement.AbstractIndex
All Implemented Interfaces:
IIndex
Direct Known Subclasses:
AbstractClassificationIndex

public abstract class AbstractIndex
extends Object
implements IIndex

Generic index class, which must be extended by a specialized index implementation.

See Also:
IIndex

Nested Class Summary
static class AbstractIndex.ErrorState
           
static class AbstractIndex.IndexingState
           
 class AbstractIndex.Reindexer
          This class handles the reindex process in a separate thread.
static class AbstractIndex.RunningState
           
static class AbstractIndex.WhatToIndex
           
 
Field Summary
static String CFG_PLUGIN_CM_INDEXES
           
static String CFG_PLUGIN_CM_INDEXES_INDEX_FOLDERS
           
static String INDEX_STRING_AS_STRING
           
protected  String m_crawlerProfileId
          ID of the default crawler profile for all index folders of the index.
protected  List m_crawlerQueue
          Queue of crawlers.
protected  IIndexFolderList m_indexFolders
          list of index folders that are assigned to the index
protected  String m_indexGroup
          group of the index
protected  String m_indexId
          id of the index
protected  String m_indexName
          display name of the index
protected  boolean m_isActive
          Indicates if an index is available or has be deactivated.
protected  String m_serviceId
          the id of the implementing index service
protected static String m_serviceUserId
          ID of the service user.
static String PROPERTIES
           
static String SYSTEM_FOLDER
           
 
Constructor Summary
AbstractIndex(String indexId, String indexName, String indexGroup, IIndexFolderList indexFolders, String serviceId, String serviceUserId, Properties indexServiceProperties)
          Deprecated. as of NW04. Use constructor with crawler profile ID
AbstractIndex(String indexId, String indexName, String indexGroup, IIndexFolderList indexFolders, String serviceId, String crawlerProfileId, String serviceUserId, Properties indexServiceProperties)
          Constructor.
 
Method Summary
 void addFolderUri(URI folderUri)
          Deprecated. as of NW04. Use add(IIndexFolder) at the IIndexFolderList interface
 void checkIndexIsActive()
           
 void checkProperties(Properties customProperties)
          With this method the properties that should be set could be checked.
 int compareTo(Object o)
           
static Date convertDateToIndexTime(Date dateInput)
          Converts the input date into a date used for indexing time attributeand returns this value.
 void createIndexOnServer()
          Creates the index on the index server connected with the CM system.
 void deindexDocument(IResource resource)
          Deindexes a document
 void deindexDocument(RID resourceRid)
          Deindexes a document
 void deindexDocument(URI resourceUri)
          Deprecated. as of NW04. Use deindexDocument(RID)
 void deindexDocuments(IResourceList resources)
          Deindexes a document
 void deindexDocuments(IRidList resourceRids)
          Deindexes a document
 void deindexDocuments(IUriList resourceUris)
          Deprecated. as of NW04. Use deindexDocuments(IRidList)
 void deleteOnServer()
          Deletes the index on the index server connected with the CM system.
static void deleteOnServer(String indexId)
           
 void deltaReindex()
          Performs indexing of the documents that are not indexed yet or have been changed since the last crawl.
 boolean equals(Object o)
           
static StringBuffer escape(String s)
           
 void flush()
          Flushes the queue
 boolean flush(RID rid, int counter)
          Tries about counter of times to bring the documents decribed by the rid in a state such that the document can be found in the index.
 void flushAsync()
          Asynchronous flush.
 void flushAsync(RID rid, int counter)
          Asynchronous flush.
 long getActiveTime()
          Gives a rough estimation for the time duration needed for indexing the actual available documents.
static com.sapportals.portal.security.usermanagement.IUser getConfigServiceUser()
          AccessController.doPrivileged stops the security check on this level of the call stack.
 IContent getContent(RID rid)
          Returns the content for the specified ridList.
 String getCrawlerProfileId()
          ID of the default crawler profile for all index folders of the index.
 String getDetailsMonitorPageText(Locale locale)
          Get Display Text for details monitor portal page
 String getDetailsMonitorPageURL()
          Get details monitor portal page
 String getDetailsMonitorURL1()
          Get first details monitor
 String getDetailsMonitorURL2()
          Get second details monitor
 String getDetailsMonitorURL3()
          Get third details monitor
static PropertyName getDisplayNameAsStringPropName()
           
 AbstractIndex.ErrorState getErrorState(double errorThreshold, double warningThreshold, Locale locale)
          Returns an error state indicating the overall indexing status.
 IUriList getFolderUris()
          Deprecated. as of NW04. Use getFolderRids()
 String[] getFrameSizes()
          Get frame sizes of detailed monitors (and implicit number of detailed monitors)
 RID getHiddenIndexAreaStartRid()
          Returns the start rid of an hidden index
static Map getHiddenIndexIds()
           
 IPropertyMap getIndexedProperties()
          Returns the properties, indexed with the documents in the index.
 IIndexFolder getIndexFolderForDocument(RID documentRid)
          Gets the next upper indexFolder for the document
static PropertyName getIndexFolderRidPropName()
           
 IIndexFolderList getIndexFolders()
          Folders or start pages that are assigned to the index for indexing.
 String getIndexGroup()
          Returns the group of indexes to which the index logically belongs.
 String getIndexId()
          Identifies the index within the system.
 AbstractIndex.IndexingState getIndexingState()
           
 String getIndexName()
          Non-technical identifier of an index.
 List getLanguagesOfIndexedDocuments()
          Returns the languages of an index, for which documents exist in.
static byte getModeledPropertyIndexType(IMetaName metaName)
          Returns the property type for a modelled property which is used for indexing.
 int getNumberOfCrawler(RID indexRid)
           
 int getNumberOfDocumentsInQueue()
          Returns the numbers of documents currently in work for indexing, but not in an error state.
 int getNumberOfErrors()
          Returns the numbers of documents failed during indexing.
 int getNumberOfIndexedDocuments(IIndexFolder indexFolder, IResourceContext context)
          Returns the number of documents of the datasource of the index which are already in the index
 int getNumberOfSuccessfullyIndexedDocs()
          Returns the numbers of documents successfully indexed and searchable.
 Collection getOriginalContent(IRidList ridList)
          Returns the content for the specified ridList.
 Properties getProperties()
          Gets index implementation specific data
 IPropertyMap getPropertiesForHiddenResource(RID rid)
          Returns the properties for the resource specified by the rid.
 String getResourceInfo(RID documentRid)
           
 RID getRID()
          Gets the resource ID of the resource representation of this index.
 AbstractIndex.RunningState getRunningState()
          Returns a state indicating what is actually happening with respect to indexing.
 ISchedulerTimeTable getSchedulerTimeTable()
          Returns the timetable of a schedule for delta index crawling for the index.
 DefaultIMSecurityManager getSecManager()
           
 String getServiceId()
          Specifies the index implementation that is used for the index.
 List getServiceTypes(Locale locale)
          Displays representations of the indexes service types in the locale's language.
abstract  ISupportedOptionSet getSupportedOptions()
          The actions of the additional interfaces of an index are supported actions for the index in question (for example, ISearchIndex, IClassificationIndex) that are supported by the index implementation.
static ISystemList getSystemList()
           
 AbstractIndex.WhatToIndex getWhatToIndex()
           
 String getWhatToIndexString()
           
 boolean indexContentOfExternalLinks()
           
 void indexDocument(IResource resource)
          Indexes a document
 void indexDocument(IResource resource, IResourceEvent resourceEvent)
          Indexes a document
 void indexDocuments(IResourceList resources)
          Indexes a list of documents
 void indexDocuments(IResourceList resources, IResourceEvent resourceEvent)
          Indexes a list of documents
 boolean indexInternalLinks()
           
static boolean indexStringAttributeAsString(IMetaName metaName)
          Returns true if the attribute is indexed as a string and false if indexed as text.
abstract  void init(Properties properties)
          Initializes the index with index implementation specific data
 void internalAddQueuedCrawler(IIndexServiceCrawler crawler)
          For internal use only!
protected abstract  void internalDeindexDocuments(IRidList rids)
          Deindexes documents
protected abstract  void internalIndexDocuments(IResourceList resources, IResourceEvent resourceEvent)
          Indexes a list of documents
 void internalRunQueuedIfNoActive()
           
 void internalSetIndexFolders(IIndexFolderList indexFolders)
          For internal use only!
 boolean isActive()
          Returns the information if an index is available or has be set inactive.
 int reduceNumberOfCrawler()
           
 void reindex()
          Reindexes the index
 void reindex(boolean disablePostClearTasks)
          Reindexes the index
 void reindexNotTrainingDocs()
           
protected  void reindexPostClear(IIndexFolderList preClearIndexFolders)
          Deprecated. as of NW04. Does not work with the new crawlers
protected  boolean reindexXPostClear(IIndexFolderList preClearIndexFolders)
           
 void removeAllFolderUris()
          Deprecated. as of NW04. Use clear() at the IIndexFolderList interface
 void removeFolderUri(URI folderUri)
          Deprecated. as of NW04. Use remove(IIndexFolder) at the IIndexFolderList interface
 void repaireConfigurable()
           
 void restartAll()
          Stops all stopped and suspended tasks for indexing.
 void resumeAll()
          Resumes all suspended tasks for indexing.
 boolean setActive(boolean isActive)
          Sets an index inactive or activates it.
 void setActiveDuringStartup(boolean isActive)
           
 void setCrawlerProfileId(String crawlerProfileId)
          Sets the ID of the default crawler profile for all index folders of the index.
 void setInactiveIndexHasChanged()
          Sets a property on true, if index documents have changed during index was inactive.
 void setIndexGroup(String indexGroup)
          for internal use
 void setIndexingState(AbstractIndex.IndexingState state)
           
 void setIndexName(String indexName)
          For internal use only.
 void setNumberOfCrawler(int numOfCrawler)
           
 void setProperties(Properties properties)
          Sets index implementation specific data
 void setSchedulerTimeTable(ISchedulerTimeTable schedulerTimeTablePar)
          Registers a schedule for delta index crawling for the index with the ISchedulerTimeTable.
 void setStateAndNumberOfCrawler(AbstractIndex.IndexingState state, int numOfCrawler)
           
 void setWhatToIndex(String s)
           
 void startReindexer(boolean disablePostClearTasks)
           
 void stopAll()
          Stops all running tasks for indexing.
 void suspendAll()
          Suspends all running tasks for indexing.
 boolean typeShouldBeIndexed(IResource res)
           
static String unescape(String s)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sapportals.wcm.service.indexmanagement.IIndex
clear, delete, delete, generate, generate, getResourceInfo, getServiceTypes
 

Field Detail

CFG_PLUGIN_CM_INDEXES

public static final String CFG_PLUGIN_CM_INDEXES
See Also:
Constant Field Values

CFG_PLUGIN_CM_INDEXES_INDEX_FOLDERS

public static final String CFG_PLUGIN_CM_INDEXES_INDEX_FOLDERS
See Also:
Constant Field Values

PROPERTIES

public static final String PROPERTIES
See Also:
Constant Field Values

INDEX_STRING_AS_STRING

public static final String INDEX_STRING_AS_STRING
See Also:
Constant Field Values

SYSTEM_FOLDER

public static final String SYSTEM_FOLDER
See Also:
Constant Field Values

m_indexId

protected String m_indexId
id of the index


m_indexFolders

protected IIndexFolderList m_indexFolders
list of index folders that are assigned to the index


m_serviceId

protected String m_serviceId
the id of the implementing index service


m_indexName

protected String m_indexName
display name of the index


m_indexGroup

protected String m_indexGroup
group of the index


m_isActive

protected boolean m_isActive
Indicates if an index is available or has be deactivated.


m_crawlerProfileId

protected String m_crawlerProfileId
ID of the default crawler profile for all index folders of the index.


m_serviceUserId

protected static String m_serviceUserId
ID of the service user.


m_crawlerQueue

protected List m_crawlerQueue
Queue of crawlers.

Constructor Detail

AbstractIndex

public AbstractIndex(String indexId,
                     String indexName,
                     String indexGroup,
                     IIndexFolderList indexFolders,
                     String serviceId,
                     String serviceUserId,
                     Properties indexServiceProperties)
              throws WcmException
Deprecated. as of NW04. Use constructor with crawler profile ID

Constructor.

Parameters:
indexId - - index identifier
indexName - - display name of the index
indexGroup - - the group the index has been assigned to
serviceId - - the identifier of the index service
serviceUserId - - id of the index management service user, to set the service context
indexServiceProperties - - config properties of the index management service
Throws:
WcmException - Exception raised in failure situation

AbstractIndex

public AbstractIndex(String indexId,
                     String indexName,
                     String indexGroup,
                     IIndexFolderList indexFolders,
                     String serviceId,
                     String crawlerProfileId,
                     String serviceUserId,
                     Properties indexServiceProperties)
              throws WcmException
Constructor.

Parameters:
indexId - - index identifier
indexName - - display name of the index
indexGroup - - the group the index has been assigned to
serviceId - - the identifier of the index service
crawlerProfileId - - ID of the default crawler profile for all index folders of the index
serviceUserId - - id of the index management service user, to set the service context
indexServiceProperties - - config properties of the index management service
Throws:
WcmException - Exception raised in failure situation
Method Detail

escape

public static StringBuffer escape(String s)

unescape

public static String unescape(String s)

convertDateToIndexTime

public static Date convertDateToIndexTime(Date dateInput)
Converts the input date into a date used for indexing time attributeand returns this value. The year, month and day is set to 2000-Jan-01.

Parameters:
dateInput -
Returns:

getModeledPropertyIndexType

public static byte getModeledPropertyIndexType(IMetaName metaName)
                                        throws WcmException
Returns the property type for a modelled property which is used for indexing. The porperty types are defined in IQueryEntry.

Parameters:
metaName -
Returns:
Throws:
WcmException

getConfigServiceUser

public static com.sapportals.portal.security.usermanagement.IUser getConfigServiceUser()
                                                                                throws Exception
AccessController.doPrivileged stops the security check on this level of the call stack. This allows customer code to call this method. Otherwise the execution of foreign code would be forbidden.

Throws:
Exception

getIndexedProperties

public IPropertyMap getIndexedProperties()
                                  throws WcmException
Returns the properties, indexed with the documents in the index. Only the information about the properties not all their values are returned, i.e. each property appearch only one time in the return map.

Specified by:
getIndexedProperties in interface IIndex
Returns:
Map with the properties
Throws:
WcmException - Exception raised in failure situation

setIndexName

public void setIndexName(String indexName)
For internal use only. Sets the name of the index.

Specified by:
setIndexName in interface IIndex
Parameters:
indexName - The new IndexName value

setIndexGroup

public void setIndexGroup(String indexGroup)
for internal use

Specified by:
setIndexGroup in interface IIndex
Parameters:
indexGroup - The new IndexGroup value

setCrawlerProfileId

public void setCrawlerProfileId(String crawlerProfileId)
                         throws WcmException
Sets the ID of the default crawler profile for all index folders of the index.

Specified by:
setCrawlerProfileId in interface IIndex
Throws:
WcmException

setProperties

public void setProperties(Properties properties)
Sets index implementation specific data

Specified by:
setProperties in interface IIndex
Parameters:
properties - The new Properties value

getIndexId

public String getIndexId()
Description copied from interface: IIndex
Identifies the index within the system.
The ID of an index is needed to get the IIndex object from the IIndexService.
Forbidden characters for an index ID are dot('.'), space(' ') and plus('+').

Specified by:
getIndexId in interface IIndex
Returns:
index identifier

getIndexName

public String getIndexName()
Description copied from interface: IIndex
Non-technical identifier of an index.
The index name should be used for display purposes only.
All characters are allowed for an index name. If no index name is available, the index ID is returned.

Specified by:
getIndexName in interface IIndex
Returns:
display name of the index

getFolderUris

public IUriList getFolderUris()
Deprecated. as of NW04. Use getFolderRids()

Specified by:
getFolderUris in interface IIndex
Returns:
list of URI objects that are representing the attached folders of the index

getIndexFolders

public IIndexFolderList getIndexFolders()
Description copied from interface: IIndex
Folders or start pages that are assigned to the index for indexing.
A document is added to a particular index, if a superior folder (or startpage) is contained in IIndexFolderList. If more than one superior folder is attached to different indexes, the lower folder determines the index, in which the document is stored.

Specified by:
getIndexFolders in interface IIndex
Returns:
list of IIndexFolder objects that are representing the attached folders of the index

getServiceId

public String getServiceId()
Description copied from interface: IIndex
Specifies the index implementation that is used for the index.
Every service ID is linked to a java class from which the index object is instantiated.
The index implementation determines the interfaces that can be used for the index.
Additionally, the service types of the index are determined by the implementation.
Example:
Service ID: trexSearchAndClassification
Java Class: com.sapportals.wcm.service.indexmanagement.retrieval.trex.TrexSearchAndClassificationIndex
Additional interfaces: ISearchIndex, IClassificationIndex
Service types: search, classification

Specified by:
getServiceId in interface IIndex
Returns:
the identifier of the index service (e.g. trexSearchAndClassification).

It is configured in the wcm configuration file and links to the impementing class.


getIndexGroup

public String getIndexGroup()
Description copied from interface: IIndex
Returns the group of indexes to which the index logically belongs.
Grouping indexes makes it possible to perform operations on more than one index by selecting an index group and performing the action on all indexes in that group.
These cumulative functions must be implemented on UI level. Currently this is implemented in the CM search dialog box for the selection of indexes. Selection is carried out by selecting an index group to search in all indexes that belong to that group. group can be null.

Specified by:
getIndexGroup in interface IIndex
Returns:
the group the index has been assigned to

As an example indexes can be grouped to display them separated in groups.


getCrawlerProfileId

public String getCrawlerProfileId()
ID of the default crawler profile for all index folders of the index.

Specified by:
getCrawlerProfileId in interface IIndex
Returns:
crawler profile ID

getServiceTypes

public List getServiceTypes(Locale locale)
Description copied from interface: IIndex
Displays representations of the indexes service types in the locale's language.
The returned types should only be used for display purposes.

Specified by:
getServiceTypes in interface IIndex
Parameters:
locale - - locale of user context to return service types in locale language of user context
Returns:
(String)list of service types the index is belonging to. because of the locale the service types are returned in the locales language

getProperties

public Properties getProperties()
Gets index implementation specific data

Specified by:
getProperties in interface IIndex
Returns:
The Properties value

checkProperties

public void checkProperties(Properties customProperties)
                     throws WcmException
Description copied from interface: IIndex
With this method the properties that should be set could be checked. In case of a wrong property (range error, format error, etc.) a WcmException is thrown, with a localized error message, describing the problem. If the parameter is null, no exception is thrown.

Specified by:
checkProperties in interface IIndex
Parameters:
customProperties -
Throws:
WcmException
See Also:
IIndex

getSupportedOptions

public abstract ISupportedOptionSet getSupportedOptions()
Description copied from interface: IIndex
The actions of the additional interfaces of an index are supported actions for the index in question (for example, ISearchIndex, IClassificationIndex) that are supported by the index implementation.

Example:

  String indexId = "abc";
  IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
  IIndex index = indexService.getIndex(indexId);
  ISupportedOptionSet supportedOptions = index.getSupportedOptions();
  if (supportedOptions.isSupported(SupportedOption.SEARCH)) {
    //do search; it is supported by the index
  }
 

Specified by:
getSupportedOptions in interface IIndex
Returns:
a collection of supported operations

getLanguagesOfIndexedDocuments

public List getLanguagesOfIndexedDocuments()
                                    throws WcmException
Returns the languages of an index, for which documents exist in.

Specified by:
getLanguagesOfIndexedDocuments in interface IIndex
Returns:
List of strings each describing one language.
Throws:
WcmException

addFolderUri

public void addFolderUri(URI folderUri)
Deprecated. as of NW04. Use add(IIndexFolder) at the IIndexFolderList interface

for internal use

Specified by:
addFolderUri in interface IIndex
Parameters:
folderUri - FolderUri to be added

removeAllFolderUris

public void removeAllFolderUris()
Deprecated. as of NW04. Use clear() at the IIndexFolderList interface

for internal use

Specified by:
removeAllFolderUris in interface IIndex

removeFolderUri

public void removeFolderUri(URI folderUri)
Deprecated. as of NW04. Use remove(IIndexFolder) at the IIndexFolderList interface

for internal use

Specified by:
removeFolderUri in interface IIndex
Parameters:
folderUri - uri of folder to remove from index

indexDocuments

public void indexDocuments(IResourceList resources,
                           IResourceEvent resourceEvent)
                    throws ResourceException,
                           WcmException,
                           IOException
Indexes a list of documents

Specified by:
indexDocuments in interface IIndex
Parameters:
resources - resources to index
resourceEvent - event that caused the index request
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation
IOException - Exception raised in failure situation

indexDocuments

public void indexDocuments(IResourceList resources)
                    throws ResourceException,
                           WcmException,
                           IOException
Indexes a list of documents

Specified by:
indexDocuments in interface IIndex
Parameters:
resources - resources to index
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation
IOException - Exception raised in failure situation

indexDocument

public void indexDocument(IResource resource)
                   throws ResourceException,
                          WcmException,
                          IOException
Indexes a document

Specified by:
indexDocument in interface IIndex
Parameters:
resource - resource to index
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation
IOException - Exception raised in failure situation

indexDocument

public void indexDocument(IResource resource,
                          IResourceEvent resourceEvent)
                   throws ResourceException,
                          WcmException,
                          IOException
Indexes a document

Specified by:
indexDocument in interface IIndex
Parameters:
resource - resource to index
resourceEvent - event that caused the index request
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation
IOException - Exception raised in failure situation

deindexDocuments

public void deindexDocuments(IResourceList resources)
                      throws ResourceException,
                             WcmException
Deindexes a document

Specified by:
deindexDocuments in interface IIndex
Parameters:
resources - resources to deindex
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation

deindexDocuments

public void deindexDocuments(IUriList resourceUris)
                      throws ResourceException,
                             WcmException
Deprecated. as of NW04. Use deindexDocuments(IRidList)

Deindexes a document

Specified by:
deindexDocuments in interface IIndex
Parameters:
resourceUris - list of uris to deindex
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation

deindexDocuments

public void deindexDocuments(IRidList resourceRids)
                      throws ResourceException,
                             WcmException
Deindexes a document

Specified by:
deindexDocuments in interface IIndex
Parameters:
resourceRids - list of rids to deindex
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation

deindexDocument

public void deindexDocument(IResource resource)
                     throws ResourceException,
                            WcmException
Deindexes a document

Specified by:
deindexDocument in interface IIndex
Parameters:
resource - resource to deindex
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation

deindexDocument

public void deindexDocument(URI resourceUri)
                     throws ResourceException,
                            WcmException
Deprecated. as of NW04. Use deindexDocument(RID)

Deindexes a document

Specified by:
deindexDocument in interface IIndex
Parameters:
resourceUri - uri to deindex
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation

deindexDocument

public void deindexDocument(RID resourceRid)
                     throws ResourceException,
                            WcmException
Deindexes a document

Specified by:
deindexDocument in interface IIndex
Parameters:
resourceRid - rid to deindex
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation

reindex

public void reindex()
             throws WcmException
Reindexes the index

Specified by:
reindex in interface IIndex
Throws:
WcmException - Exception raised in failure situation

reindex

public void reindex(boolean disablePostClearTasks)
             throws WcmException
Reindexes the index

Specified by:
reindex in interface IIndex
Parameters:
disablePostClearTasks - - if true the tasks that can be performed by the index implementation after the index has been cleared are skipped. Example: Don't train the classification index before reindex all documents.
Throws:
WcmException - Exception raised in failure situation

deleteOnServer

public void deleteOnServer()
                    throws WcmException
Description copied from interface: IIndex
Deletes the index on the index server connected with the CM system.

Specified by:
deleteOnServer in interface IIndex
Throws:
WcmException

deleteOnServer

public static void deleteOnServer(String indexId)
                           throws WcmException
Throws:
WcmException

createIndexOnServer

public void createIndexOnServer()
                         throws WcmException
Description copied from interface: IIndex
Creates the index on the index server connected with the CM system.

Specified by:
createIndexOnServer in interface IIndex
Throws:
WcmException

startReindexer

public void startReindexer(boolean disablePostClearTasks)
                    throws WcmException
Throws:
WcmException

deltaReindex

public void deltaReindex()
                  throws WcmException
Performs indexing of the documents that are not indexed yet or have been changed since the last crawl. Additionally it deindexes documents from the index that have been indexed but now have been deleted. In contrast to the reindex calls this call doesn't clear the index.

Specified by:
deltaReindex in interface IIndex
Throws:
WcmException - exception raised in failure situation

init

public abstract void init(Properties properties)
Initializes the index with index implementation specific data

Specified by:
init in interface IIndex
Parameters:
properties - specific properties of the index implemenation

internalIndexDocuments

protected abstract void internalIndexDocuments(IResourceList resources,
                                               IResourceEvent resourceEvent)
                                        throws ResourceException,
                                               WcmException,
                                               IOException
Indexes a list of documents

Parameters:
resources - resources to index
resourceEvent - event that caused the index request
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation
IOException - Exception raised in failure situation

internalDeindexDocuments

protected abstract void internalDeindexDocuments(IRidList rids)
                                          throws ResourceException,
                                                 WcmException
Deindexes documents

Parameters:
rids - list of rids to deindex
Throws:
ResourceException - Exception raised in failure situation
WcmException - Exception raised in failure situation

reindexPostClear

protected void reindexPostClear(IIndexFolderList preClearIndexFolders)
                         throws WcmException
Deprecated. as of NW04. Does not work with the new crawlers

Lets index implementations perform tasks after the index has been cleared within a reindex call. After this post clear tasks the attached folders of the index are indexed. Example task: train the taxonomies of an classification index before indexing the documents.

Parameters:
preClearIndexFolders - index folders that have been attached befor the clear
Throws:
WcmException - Exception raised in failure situation

reindexXPostClear

protected boolean reindexXPostClear(IIndexFolderList preClearIndexFolders)
                             throws WcmException
Throws:
WcmException

getIndexFolderForDocument

public IIndexFolder getIndexFolderForDocument(RID documentRid)
Gets the next upper indexFolder for the document

Specified by:
getIndexFolderForDocument in interface IIndex
Parameters:
documentRid - rid of the document to get the index folder for
Returns:
index folder for document

reindexNotTrainingDocs

public void reindexNotTrainingDocs()
                            throws WcmException
Throws:
WcmException

compareTo

public int compareTo(Object o)

equals

public boolean equals(Object o)

internalSetIndexFolders

public void internalSetIndexFolders(IIndexFolderList indexFolders)
For internal use only!

Parameters:
indexFolders -

internalAddQueuedCrawler

public void internalAddQueuedCrawler(IIndexServiceCrawler crawler)
                              throws WcmException
For internal use only!

Parameters:
crawler -
Throws:
WcmException

internalRunQueuedIfNoActive

public void internalRunQueuedIfNoActive()
                                 throws WcmException
Throws:
WcmException

getResourceInfo

public String getResourceInfo(RID documentRid)
                       throws WcmException
Throws:
WcmException

getSystemList

public static ISystemList getSystemList()
                                 throws WcmException
Returns:
Throws:
WcmException

setSchedulerTimeTable

public void setSchedulerTimeTable(ISchedulerTimeTable schedulerTimeTablePar)
                           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. Remark: It is recommended to use the similar method of the IIndexService instead of this method.

Specified by:
setSchedulerTimeTable in interface IIndex
Parameters:
schedulerTimeTablePar - ISchedulerTimeTable
Throws:
WcmException - in case of an error.

getSchedulerTimeTable

public ISchedulerTimeTable getSchedulerTimeTable()
                                          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. Remark: It is recommended to use the similar method of the IIndexService instead of this method.

Specified by:
getSchedulerTimeTable in interface IIndex
Returns:
ISchedulerTimeTable
Throws:
WcmException - in case of an error.

isActive

public boolean isActive()
Returns the information if an index is available or has be set inactive.

Specified by:
isActive in interface IIndex
Returns:
true if index is active, false if index is inactive

setActive

public boolean setActive(boolean isActive)
                  throws WcmException
Sets an index inactive or activates it.

Specified by:
setActive in interface IIndex
Returns:
true, if index has to be actualized after activating it, otherwise false
Throws:
WcmException

setActiveDuringStartup

public void setActiveDuringStartup(boolean isActive)
                            throws WcmException
Specified by:
setActiveDuringStartup in interface IIndex
Throws:
WcmException

setInactiveIndexHasChanged

public void setInactiveIndexHasChanged()
                                throws WcmException,
                                       ResourceException
Sets a property on true, if index documents have changed during index was inactive. The property is automatically deleted, if the index is reactivated, but the method for index reactivation returns true in that case, indicating that the index should be updated.

Specified by:
setInactiveIndexHasChanged in interface IIndex
Throws:
WcmException - in case of an error
ResourceException - in case of an error

getRID

public RID getRID()
           throws WcmException
Gets the resource ID of the resource representation of this index. Can return null if no indexmanagement repository prefix is configured.

Specified by:
getRID in interface IIndex
Returns:
resource ID of this index
Throws:
WcmException - in case of an error.

checkIndexIsActive

public void checkIndexIsActive()
                        throws WcmException
Throws:
WcmException

setStateAndNumberOfCrawler

public void setStateAndNumberOfCrawler(AbstractIndex.IndexingState state,
                                       int numOfCrawler)
                                throws WcmException
Specified by:
setStateAndNumberOfCrawler in interface IIndex
Throws:
WcmException

setNumberOfCrawler

public void setNumberOfCrawler(int numOfCrawler)
                        throws ResourceException,
                               WcmException
Throws:
ResourceException
WcmException

setIndexingState

public void setIndexingState(AbstractIndex.IndexingState state)
                      throws ResourceException,
                             WcmException
Specified by:
setIndexingState in interface IIndex
Throws:
ResourceException
WcmException

repaireConfigurable

public void repaireConfigurable()
                         throws Exception
Throws:
Exception

getNumberOfCrawler

public int getNumberOfCrawler(RID indexRid)
                       throws WcmException
Returns:
Throws:
WcmException

reduceNumberOfCrawler

public int reduceNumberOfCrawler()
                          throws WcmException
Specified by:
reduceNumberOfCrawler in interface IIndex
Returns:
Throws:
WcmException

getIndexingState

public AbstractIndex.IndexingState getIndexingState()
                                             throws ResourceException,
                                                    WcmException
Specified by:
getIndexingState in interface IIndex
Returns:
Throws:
ResourceException
WcmException

getDetailsMonitorURL1

public String getDetailsMonitorURL1()
                             throws NotSupportedException
Get first details monitor

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getDetailsMonitorURL2

public String getDetailsMonitorURL2()
                             throws NotSupportedException
Get second details monitor

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getDetailsMonitorURL3

public String getDetailsMonitorURL3()
                             throws NotSupportedException
Get third details monitor

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getDetailsMonitorPageURL

public String getDetailsMonitorPageURL()
                                throws NotSupportedException
Get details monitor portal page

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getDetailsMonitorPageText

public String getDetailsMonitorPageText(Locale locale)
                                 throws NotSupportedException
Get Display Text for details monitor portal page

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getFrameSizes

public String[] getFrameSizes()
                       throws NotSupportedException
Get frame sizes of detailed monitors (and implicit number of detailed monitors)

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getErrorState

public AbstractIndex.ErrorState getErrorState(double errorThreshold,
                                              double warningThreshold,
                                              Locale locale)
                                       throws NotSupportedException
Returns an error state indicating the overall indexing status. The parameters decribes two borders. If the percentage of errors is over the first parameter an error status is returned. If it is over the second a warning status is returned.

Parameters:
errorThreshold -
warningThreshold -
locale -
Returns:
Throws:
NotSupportedException - if the method is not implemented for an index

getRunningState

public AbstractIndex.RunningState getRunningState()
                                           throws WcmException
Returns a state indicating what is actually happening with respect to indexing.

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getNumberOfSuccessfullyIndexedDocs

public int getNumberOfSuccessfullyIndexedDocs()
                                       throws WcmException
Returns the numbers of documents successfully indexed and searchable.

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getNumberOfDocumentsInQueue

public int getNumberOfDocumentsInQueue()
                                throws WcmException
Returns the numbers of documents currently in work for indexing, but not in an error state.

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getNumberOfErrors

public int getNumberOfErrors()
                      throws WcmException
Returns the numbers of documents failed during indexing.

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getActiveTime

public long getActiveTime()
                   throws WcmException
Gives a rough estimation for the time duration needed for indexing the actual available documents.

Returns:
Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

getWhatToIndex

public AbstractIndex.WhatToIndex getWhatToIndex()
Returns:

setWhatToIndex

public void setWhatToIndex(String s)
Specified by:
setWhatToIndex in interface IIndex
Parameters:
s -

getWhatToIndexString

public String getWhatToIndexString()
Specified by:
getWhatToIndexString in interface IIndex
Returns:

typeShouldBeIndexed

public boolean typeShouldBeIndexed(IResource res)
Specified by:
typeShouldBeIndexed in interface IIndex
Parameters:
res -
Returns:

getDisplayNameAsStringPropName

public static PropertyName getDisplayNameAsStringPropName()
                                                   throws ResourceException
Returns:
Throws:
ResourceException

getIndexFolderRidPropName

public static PropertyName getIndexFolderRidPropName()
                                              throws ResourceException
Returns:
Throws:
ResourceException

suspendAll

public void suspendAll()
                throws WcmException
Suspends all running tasks for indexing.

Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

resumeAll

public void resumeAll()
               throws WcmException
Resumes all suspended tasks for indexing.

Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

stopAll

public void stopAll()
             throws WcmException
Stops all running tasks for indexing.

Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

restartAll

public void restartAll()
                throws WcmException
Stops all stopped and suspended tasks for indexing.

Throws:
NotSupportedException - if the method is not implemented for an index
WcmException

indexStringAttributeAsString

public static boolean indexStringAttributeAsString(IMetaName metaName)
Returns true if the attribute is indexed as a string and false if indexed as text. The property has to be modelled otherwise false is returned.

Parameters:
metaName -
Returns:

indexInternalLinks

public boolean indexInternalLinks()
Specified by:
indexInternalLinks in interface IIndex

flush

public boolean flush(RID rid,
                     int counter)
              throws WcmException
Tries about counter of times to bring the documents decribed by the rid in a state such that the document can be found in the index. If this is possible, true is returned otherwise false.

Parameters:
rid -
counter -
Returns:
Throws:
WcmException

flushAsync

public void flushAsync(RID rid,
                       int counter)
                throws WcmException
Asynchronous flush.

Parameters:
rid -
counter -
Throws:
WcmException

flush

public void flush()
           throws WcmException
Flushes the queue

Throws:
WcmException

flushAsync

public void flushAsync()
                throws WcmException
Asynchronous flush.

Throws:
WcmException

getHiddenIndexIds

public static Map getHiddenIndexIds()
                             throws ResourceException
Returns:
Throws:
ResourceException

indexContentOfExternalLinks

public boolean indexContentOfExternalLinks()

getPropertiesForHiddenResource

public IPropertyMap getPropertiesForHiddenResource(RID rid)
                                            throws WcmException
Returns the properties for the resource specified by the rid.

Parameters:
rid -
Returns:
Throws:
WcmException

getContent

public IContent getContent(RID rid)
                    throws WcmException
Returns the content for the specified ridList.

Returns:
Throws:
WcmException

getOriginalContent

public Collection getOriginalContent(IRidList ridList)
                              throws WcmException
Returns the content for the specified ridList.

Parameters:
ridList -
Returns:
Throws:
WcmException

getNumberOfIndexedDocuments

public int getNumberOfIndexedDocuments(IIndexFolder indexFolder,
                                       IResourceContext context)
                                throws NotSupportedException
Returns the number of documents of the datasource of the index which are already in the index. -1 is returned if the number cannot be returned.

Parameters:
indexFolder -
context -
Returns:
Throws:
NotSupportedException - if the method is not implemented by the index type.

getHiddenIndexAreaStartRid

public RID getHiddenIndexAreaStartRid()
Returns the start rid of an hidden index

Returns:

getSecManager

public DefaultIMSecurityManager getSecManager()
                                       throws ResourceException
Returns:
Throws:
ResourceException


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.