public class FilenetConnector extends BaseRepositoryConnector
| Modifier and Type | Class and Description |
|---|---|
protected class |
FilenetConnector.CheckConnectionThread |
protected class |
FilenetConnector.DestroySessionThread |
protected class |
FilenetConnector.GetChildFoldersThread |
protected class |
FilenetConnector.GetDocumentClassesInfoThread |
protected class |
FilenetConnector.GetDocumentClassesMetadataFieldsInfoThread |
protected class |
FilenetConnector.GetDocumentContentCountThread |
protected class |
FilenetConnector.GetDocumentContentsThread |
protected class |
FilenetConnector.GetDocumentInformationThread |
protected class |
FilenetConnector.GetMatchingObjectIdsThread |
protected class |
FilenetConnector.GetSessionThread |
protected static class |
FilenetConnector.SpecInfo |
currentContext, paramsGLOBAL_DENY_TOKEN, JOBMODE_CONTINUOUS, JOBMODE_ONCEONLY, MODEL_ADD, MODEL_ADD_CHANGE, MODEL_ADD_CHANGE_DELETE, MODEL_ALL, MODEL_CHAINED_ADD, MODEL_CHAINED_ADD_CHANGE, MODEL_CHAINED_ADD_CHANGE_DELETE, MODEL_PARTIAL| Constructor and Description |
|---|
FilenetConnector()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
addSeedDocuments(ISeedingActivity activities,
Specification spec,
String lastSeedVersion,
long seedTime,
int jobMode)
Queue "seed" documents.
|
protected static String |
buildTime(Calendar c,
long timeValue) |
String |
check()
Test the connection.
|
protected void |
checkConnection()
Check connection, with appropriate retries
|
void |
connect(ConfigParams configParams)
Connect to filenet.
|
protected static String |
convertToURI(String urlBase,
String documentIdentifier,
int elementNumber,
String documentClass)
Convert a document identifier to a URI.
|
void |
disconnect()
Disconnect from Filenet.
|
protected String[] |
doGetChildFolders(String[] folderPath)
Get child folder names
|
protected Integer |
doGetDocumentContentCount(String documentIdentifier) |
protected void |
doGetDocumentContents(String docId,
int elementNumber,
String tempFileName)
Get document contents
|
protected FileInfo |
doGetDocumentInformation(String docId,
Map<String,Object> metadataFields)
Get document info
|
protected String[] |
doGetMatchingObjectIds(String sql)
Get matching object id's for a given query
|
String[] |
getActivitiesList()
Return the list of activities that this connector supports (i.e.
|
String[] |
getBinNames(String documentIdentifier)
Get the bin name string for a document identifier.
|
String[] |
getChildFolders(String folderName)
Get child folder names, given a starting folder name.
|
int |
getConnectorModel()
Let the crawler know the completeness of the information we are giving it.
|
DocumentClassDefinition[] |
getDocumentClassesDetails()
Get the set of available document classes, with details
|
protected DocumentClassDefinition[] |
getDocumentClassesInfo()
Get document class details, with appropriate retries
|
MetadataFieldDefinition[] |
getDocumentClassMetadataFieldsDetails(String documentClassName)
Get the set of available metadata fields per document class
|
protected MetadataFieldDefinition[] |
getDocumentClassMetadataFieldsInfo(String documentClassName)
Get document class metadata fields details, with appropriate retries
|
String |
getFormCheckJavascriptMethodName(int connectionSequenceNumber)
Obtain the name of the form check javascript method to call.
|
String |
getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
Obtain the name of the form presave check javascript method to call.
|
int |
getMaxDocumentRequest() |
String[] |
getMimeTypes()
Get the set of available mime types
|
protected void |
getSession()
Get a DFC session.
|
protected static void |
handleIOException(IOException e,
String documentIdentifier,
String context) |
boolean |
isConnected()
This method is called to assess whether to count this connector instance should
actually be counted as being connected.
|
protected static boolean |
likeMatch(String matchDocValue,
int matchDocPos,
String matchValue,
int matchPos)
Match a portion of a string with SQL wildcards (%)
|
void |
outputConfigurationBody(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
String tabName)
Output the configuration body section.
|
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
List<String> tabsArray)
Output the configuration header section.
|
void |
outputSpecificationBody(IHTTPOutput out,
Locale locale,
Specification ds,
int connectionSequenceNumber,
int actualSequenceNumber,
String tabName)
Output the specification body section.
|
void |
outputSpecificationHeader(IHTTPOutput out,
Locale locale,
Specification ds,
int connectionSequenceNumber,
List<String> tabsArray)
Output the specification header section.
|
protected static boolean |
performMatch(String matchType,
String matchDocValue,
String matchValue)
Emulate the query matching for filenet sql expressions.
|
void |
poll()
This method is periodically called for all connectors that are connected but not
in active use.
|
protected static int |
print_digit(StringBuilder sb,
int value,
int divisor) |
protected static void |
print_int(StringBuilder sb,
int value,
int digits) |
String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
Locale locale,
ConfigParams parameters)
Process a configuration post.
|
void |
processDocuments(String[] documentIdentifiers,
IExistingVersions statuses,
Specification spec,
IProcessActivity activities,
int jobMode,
boolean usesDefaultAuthority)
Process a set of documents.
|
String |
processSpecificationPost(IPostParameters variableContext,
Locale locale,
Specification ds,
int connectionSequenceNumber)
Process a specification post.
|
protected static String |
quoteSQLString(String value) |
protected void |
releaseCheck()
Release the session, if it's time.
|
boolean |
requestInfo(Configuration output,
String command)
Request arbitrary connector information.
|
void |
viewConfiguration(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters)
View configuration.
|
void |
viewSpecification(IHTTPOutput out,
Locale locale,
Specification ds,
int connectionSequenceNumber)
View specification.
|
addSeedDocuments, addSeedDocuments, addSeedDocuments, getDocumentIdentifiers, getDocumentIdentifiers, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getRelationshipTypes, getRemainingDocumentIdentifiers, outputSpecificationBody, outputSpecificationBody, outputSpecificationHeader, outputSpecificationHeader, outputSpecificationHeader, processDocuments, processDocuments, processDocuments, processDocuments, processSpecificationPost, processSpecificationPost, releaseDocumentVersions, releaseDocumentVersions, viewSpecification, viewSpecificationclearThreadContext, deinstall, getConfiguration, install, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, unpack, unpackFixedList, unpackList, viewConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearThreadContext, deinstall, getConfiguration, install, setThreadContextpublic static final String _rcsid
public static final String CONFIG_PARAM_USERID
public static final String CONFIG_PARAM_PASSWORD
public static final String CONFIG_PARAM_FILENETDOMAIN_OLD
public static final String CONFIG_PARAM_FILENETDOMAIN
public static final String CONFIG_PARAM_OBJECTSTORE
public static final String CONFIG_PARAM_SERVERPROTOCOL
public static final String CONFIG_PARAM_SERVERHOSTNAME
public static final String CONFIG_PARAM_SERVERPORT
public static final String CONFIG_PARAM_SERVERWSILOCATION
public static final String CONFIG_PARAM_URLPROTOCOL
public static final String CONFIG_PARAM_URLHOSTNAME
public static final String CONFIG_PARAM_URLPORT
public static final String CONFIG_PARAM_URLLOCATION
public static final String SPEC_NODE_FOLDER
public static final String SPEC_NODE_MIMETYPE
public static final String SPEC_NODE_DOCUMENTCLASS
public static final String SPEC_NODE_METADATAFIELD
public static final String SPEC_NODE_MATCH
public static final String SPEC_ATTRIBUTE_VALUE
public static final String SPEC_ATTRIBUTE_ALLMETADATA
public static final String SPEC_ATTRIBUTE_MATCHTYPE
public static final String SPEC_ATTRIBUTE_FIELDNAME
public static final String ACTIVITY_FETCH
protected static final long timeToRelease
protected IFilenet session
protected long lastSessionFetch
protected String userID
protected String password
protected String filenetDomain
protected String objectStore
protected String serverProtocol
protected String serverHostname
protected String serverPort
protected String serverLocation
protected String serverWSIURI
protected String docUrlServerProtocol
protected String docUrlServerName
protected String docUrlPort
protected String docUrlLocation
protected String docURIPrefix
protected void getSession()
throws ManifoldCFException,
ServiceInterruption
protected void releaseCheck()
throws ManifoldCFException
ManifoldCFExceptionpublic int getConnectorModel()
getConnectorModel in interface IRepositoryConnectorgetConnectorModel in class BaseRepositoryConnectorpublic String[] getBinNames(String documentIdentifier)
getBinNames in interface IRepositoryConnectorgetBinNames in class BaseRepositoryConnectordocumentIdentifier - is the document identifier.public String[] getActivitiesList()
getActivitiesList in interface IRepositoryConnectorgetActivitiesList in class BaseRepositoryConnectorpublic void connect(ConfigParams configParams)
connect in interface IConnectorconnect in class BaseConnectorpublic String check() throws ManifoldCFException
check in interface IConnectorcheck in class BaseConnectorManifoldCFExceptionpublic void poll()
throws ManifoldCFException
poll in interface IConnectorpoll in class BaseConnectorManifoldCFExceptionpublic boolean isConnected()
isConnected in interface IConnectorisConnected in class BaseConnectorpublic void disconnect()
throws ManifoldCFException
disconnect in interface IConnectordisconnect in class BaseConnectorManifoldCFExceptionpublic boolean requestInfo(Configuration output, String command) throws ManifoldCFException
requestInfo in interface IRepositoryConnectorrequestInfo in class BaseRepositoryConnectoroutput - is the response object, to be filled in by this method.command - is the command, which is taken directly from the API request.ManifoldCFExceptionpublic String[] getChildFolders(String folderName) throws ManifoldCFException, ServiceInterruption
folderName - is the starting folder name.ManifoldCFExceptionServiceInterruptionpublic String addSeedDocuments(ISeedingActivity activities, Specification spec, String lastSeedVersion, long seedTime, int jobMode) throws ManifoldCFException, ServiceInterruption
addSeedDocuments in interface IRepositoryConnectoraddSeedDocuments in class BaseRepositoryConnectoractivities - is the interface this method should use to perform whatever framework actions are desired.spec - is a document specification (that comes from the job).seedTime - is the end of the time range of documents to consider, exclusive.lastSeedVersionString - is the last seeding version string for this job, or null if the job has no previous seeding version string.jobMode - is an integer describing how the job is being run, whether continuous or once-only.ManifoldCFExceptionServiceInterruptionprotected static void print_int(StringBuilder sb, int value, int digits)
protected static int print_digit(StringBuilder sb, int value, int divisor)
public void processDocuments(String[] documentIdentifiers, IExistingVersions statuses, Specification spec, IProcessActivity activities, int jobMode, boolean usesDefaultAuthority) throws ManifoldCFException, ServiceInterruption
processDocuments in interface IRepositoryConnectorprocessDocuments in class BaseRepositoryConnectordocumentIdentifiers - is the set of document identifiers to process.statuses - are the currently-stored document versions for each document in the set of document identifiers
passed in above.activities - is the interface this method should use to queue up new document references
and ingest documents.jobMode - is an integer describing how the job is being run, whether continuous or once-only.usesDefaultAuthority - will be true only if the authority in use for these documents is the default one.ManifoldCFExceptionServiceInterruptionprotected static void handleIOException(IOException e, String documentIdentifier, String context) throws ManifoldCFException, ServiceInterruption
protected static boolean performMatch(String matchType, String matchDocValue, String matchValue)
protected static boolean likeMatch(String matchDocValue, int matchDocPos, String matchValue, int matchPos)
public int getMaxDocumentRequest()
getMaxDocumentRequest in interface IRepositoryConnectorgetMaxDocumentRequest in class BaseRepositoryConnectorpublic void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray) throws ManifoldCFException, IOException
outputConfigurationHeader in interface IConnectoroutputConfigurationHeader in class BaseConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.parameters - are the configuration parameters, as they currently exist, for this connection being configured.tabsArray - is an array of tab names. Add to this array any tab names that are specific to the connector.ManifoldCFExceptionIOExceptionpublic void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName) throws ManifoldCFException, IOException
outputConfigurationBody in interface IConnectoroutputConfigurationBody in class BaseConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.parameters - are the configuration parameters, as they currently exist, for this connection being configured.tabName - is the current tab name.ManifoldCFExceptionIOExceptionpublic String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, Locale locale, ConfigParams parameters) throws ManifoldCFException
processConfigurationPost in interface IConnectorprocessConfigurationPost in class BaseConnectorthreadContext - is the local thread context.variableContext - is the set of variables available from the post, including binary file post information.parameters - are the configuration parameters, as they currently exist, for this connection being configured.ManifoldCFExceptionpublic void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException
viewConfiguration in interface IConnectorviewConfiguration in class BaseConnectorthreadContext - is the local thread context.out - is the output to which any HTML should be sent.parameters - are the configuration parameters, as they currently exist, for this connection being configured.ManifoldCFExceptionIOExceptionpublic String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
getFormCheckJavascriptMethodName in interface IRepositoryConnectorgetFormCheckJavascriptMethodName in class BaseRepositoryConnectorconnectionSequenceNumber - is the unique number of this connection within the job.public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
getFormPresaveCheckJavascriptMethodName in interface IRepositoryConnectorgetFormPresaveCheckJavascriptMethodName in class BaseRepositoryConnectorconnectionSequenceNumber - is the unique number of this connection within the job.public void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber, List<String> tabsArray) throws ManifoldCFException, IOException
outputSpecificationHeader in interface IRepositoryConnectoroutputSpecificationHeader in class BaseRepositoryConnectorout - is the output to which any HTML should be sent.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.tabsArray - is an array of tab names. Add to this array any tab names that are specific to the connector.ManifoldCFExceptionIOExceptionpublic void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber, int actualSequenceNumber, String tabName) throws ManifoldCFException, IOException
outputSpecificationBody in interface IRepositoryConnectoroutputSpecificationBody in class BaseRepositoryConnectorout - is the output to which any HTML should be sent.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.actualSequenceNumber - is the connection within the job that has currently been selected.tabName - is the current tab name. (actualSequenceNumber, tabName) form a unique tuple within
the job.ManifoldCFExceptionIOExceptionpublic String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification ds, int connectionSequenceNumber) throws ManifoldCFException
processSpecificationPost in interface IRepositoryConnectorprocessSpecificationPost in class BaseRepositoryConnectorvariableContext - contains the post data, including binary file-upload information.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.ManifoldCFExceptionpublic void viewSpecification(IHTTPOutput out, Locale locale, Specification ds, int connectionSequenceNumber) throws ManifoldCFException, IOException
viewSpecification in interface IRepositoryConnectorviewSpecification in class BaseRepositoryConnectorout - is the output to which any HTML should be sent.locale - is the locale the output is preferred to be in.ds - is the current document specification for this job.connectionSequenceNumber - is the unique number of this connection within the job.ManifoldCFExceptionIOExceptionpublic DocumentClassDefinition[] getDocumentClassesDetails() throws ManifoldCFException, ServiceInterruption
public MetadataFieldDefinition[] getDocumentClassMetadataFieldsDetails(String documentClassName) throws ServiceInterruption, ManifoldCFException
public String[] getMimeTypes() throws ManifoldCFException, ServiceInterruption
protected static String convertToURI(String urlBase, String documentIdentifier, int elementNumber, String documentClass)
documentIdentifier - is the document identifier.protected void checkConnection()
throws FilenetException,
ManifoldCFException,
ServiceInterruption
protected DocumentClassDefinition[] getDocumentClassesInfo() throws FilenetException, ManifoldCFException, ServiceInterruption
protected MetadataFieldDefinition[] getDocumentClassMetadataFieldsInfo(String documentClassName) throws FilenetException, ManifoldCFException, ServiceInterruption
protected String[] doGetChildFolders(String[] folderPath) throws FilenetException, ManifoldCFException, ServiceInterruption
protected String[] doGetMatchingObjectIds(String sql) throws FilenetException, ManifoldCFException, ServiceInterruption
protected Integer doGetDocumentContentCount(String documentIdentifier) throws FilenetException, ManifoldCFException, ServiceInterruption
protected FileInfo doGetDocumentInformation(String docId, Map<String,Object> metadataFields) throws FilenetException, ManifoldCFException, ServiceInterruption
protected void doGetDocumentContents(String docId, int elementNumber, String tempFileName) throws FilenetException, ManifoldCFException, ServiceInterruption