public class SharePointRepository extends BaseRepositoryConnector
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SharePointRepository.ExecuteMethodThread |
protected class |
SharePointRepository.FileStream |
protected class |
SharePointRepository.ListItemStream |
protected static class |
SharePointRepository.MetadataInformation
Metadata information gleaned from document paths and specification.
|
protected class |
SharePointRepository.SystemMetadataDescription
Class that tracks paths associated with id's, and the name
of the metadata attribute to use for the path.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
_rcsid |
static String |
ACTIVITY_FETCH |
protected static String[] |
attachmentDataNames |
protected static String[] |
fileStreamDataNames |
protected static String[] |
listItemStreamDataNames |
protected static long |
sessionExpirationInterval |
static String |
wsddPathProperty |
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 |
|---|
SharePointRepository()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
addSeedDocuments(ISeedingActivity activities,
Specification spec,
String lastSeedVersion,
long seedTime,
int jobMode)
Queue "seed" documents.
|
String |
check()
Test the connection.
|
protected boolean |
checkIncludeFile(String filePath,
Specification documentSpecification)
Check if a file should be included.
|
protected boolean |
checkIncludeLibrary(String libraryPath,
Specification documentSpecification)
Check if a library should be included, given a document specification.
|
protected boolean |
checkIncludeList(String listPath,
Specification documentSpecification)
Check if a list should be included, given a document specification.
|
protected boolean |
checkIncludeListItem(String itemPath,
Specification documentSpecification)
Check if a list item should be included.
|
protected boolean |
checkIncludeListItemAttachment(String attachmentPath,
Specification documentSpecification)
Check if a list item attachment should be included.
|
protected boolean |
checkIncludeSite(String sitePath,
Specification documentSpecification)
Check if a site should be included, given a document specification.
|
protected static boolean |
checkMatch(String sourceMatch,
int sourceIndex,
String match)
Check a match between two strings with wildcards.
|
protected static boolean |
checkPartialPathMatch(String sourceMatch,
int sourceIndex,
String match,
int requiredExtraPathSections)
Check for a partial path match between two strings with wildcards.
|
void |
connect(ConfigParams configParameters)
Connect.
|
static String |
decodePath(String relPath)
Given a path that is /-separated, and otherwise encoded, decode properly to convert to
unencoded form.
|
void |
disconnect()
Close the connection.
|
static String |
encodePath(String relPath)
Given a path that is /-separated, and otherwise unencoded, encode properly for an actual
URI
|
protected void |
expireSession() |
protected void |
fetchAndIndexFile(IProcessActivity activities,
String documentIdentifier,
String version,
String fileUrl,
String fetchUrl,
String[] accessTokens,
String[] denyTokens,
Date createdDate,
Date modifiedDate,
Map<String,String> metadataValues,
String guid,
SharePointRepository.SystemMetadataDescription sDesc)
Method that fetches and indexes a file fetched from a SharePoint URL, with appropriate error handling
etc.
|
protected static void |
fillInAuthorityTypeTab(Map<String,Object> velocityContext,
IHTTPOutput out,
ConfigParams parameters) |
protected static void |
fillInMetadataTab(Map<String,Object> velocityContext,
IHTTPOutput out,
Specification ds)
Fill in metadata tab
|
protected static void |
fillInPathsTab(Map<String,Object> velocityContext,
IHTTPOutput out,
Specification ds)
Fill in paths tab
|
protected static void |
fillInSecurityTab(Map<String,Object> velocityContext,
IHTTPOutput out,
Specification ds)
Fill in security tab
|
protected static void |
fillInServerTab(Map<String,Object> velocityContext,
IHTTPOutput out,
ConfigParams parameters) |
protected void |
fillInTransientMetadataInfo(Map<String,Object> velocityContext,
int connectionSequenceNumber)
Fill in transient metadata info
|
protected void |
fillInTransientPathsInfo(Map<String,Object> velocityContext,
int connectionSequenceNumber)
Fill in the transient portion of the Paths tab
|
protected static String[] |
getAcls(Specification spec)
Grab forced acl out of document specification.
|
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.
|
List<NameValue> |
getDocLibsBySite(String parentSite)
Gets a list of document libraries of the given parent site
|
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.
|
protected String[] |
getInterestingFieldSetSorted(SharePointRepository.MetadataInformation metadataInfo,
String[] allFields) |
Map<String,String> |
getLibFieldList(String parentSite,
String docLibrary)
Gets a list of field names of the given document library or list.
|
Map<String,String> |
getListFieldList(String parentSite,
String listName)
Gets a list of field names of the given document library or list.
|
List<NameValue> |
getListsBySite(String parentSite)
Gets a list of lists of the given parent site
|
int |
getMaxDocumentRequest()
Get the maximum number of documents to amalgamate together into one batch, for this connector.
|
protected SharePointRepository.MetadataInformation |
getMetadataSpecification(String filePath,
Specification documentSpecification)
Get a file or item's metadata specification, given a path and a document specification.
|
protected void |
getSession()
Set up a session
|
List<NameValue> |
getSites(String parentSite)
Gets a list of sites/subsites of the given parent site
|
protected static void |
handleIOException(IOException e,
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 String |
mapExtensionToMimeType(String fileName)
Map an extension to a mime type
|
protected static String |
mapToFileName(String fileName)
Map document identifier to file name
|
protected static int |
matchSubPath(String subPath,
String fullPath)
Match a sub-path.
|
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 void |
packDate(StringBuilder sb,
Date dateValue) |
static String |
pathItemDecode(String pathItem)
Decode a path item.
|
static String |
pathItemEncode(String pathItem)
Encode a path item.
|
void |
poll()
This method is periodically called for all connectors that are connected but not
in active use.
|
protected static boolean |
processCheck(boolean caseSensitive,
String sourceMatch,
int sourceIndex,
String match,
int matchIndex)
Recursive worker method for checkMatch.
|
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.
|
protected static boolean |
processPartialPathCheck(boolean caseSensitive,
String sourceMatch,
int sourceIndex,
String match,
int matchIndex,
int requiredExtraPathSections)
Recursive worker method for checkPartialPathMatch.
|
String |
processSpecificationPost(IPostParameters variableContext,
Locale locale,
Specification ds,
int connectionSequenceNumber)
Process a specification post.
|
boolean |
requestInfo(Configuration output,
String command)
Request arbitrary connector information.
|
protected static void |
setDataACLs(RepositoryDocument data,
String[] acls,
String[] denyAcls) |
protected static void |
setPathAttribute(RepositoryDocument data,
SharePointRepository.SystemMetadataDescription sDesc,
String documentIdentifier) |
protected static int |
unpackDate(String value,
int index,
Date theDate) |
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, getConnectorModel, 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 wsddPathProperty
public static final String ACTIVITY_FETCH
protected static final long sessionExpirationInterval
protected static final String[] attachmentDataNames
protected static final String[] fileStreamDataNames
protected static final String[] listItemStreamDataNames
protected void getSession()
throws ManifoldCFException
ManifoldCFExceptionprotected void expireSession()
throws ManifoldCFException
ManifoldCFExceptionpublic String[] getActivitiesList()
getActivitiesList in interface IRepositoryConnectorgetActivitiesList in class BaseRepositoryConnectorpublic void connect(ConfigParams configParameters)
connect in interface IConnectorconnect in class BaseConnectorconfigParameters - is the set of configuration parameters, which
in this case describe the root directory.public void disconnect()
throws ManifoldCFException
disconnect in interface IConnectordisconnect in class BaseConnectorManifoldCFExceptionpublic String[] getBinNames(String documentIdentifier)
getBinNames in interface IRepositoryConnectorgetBinNames in class BaseRepositoryConnectordocumentIdentifier - is the document identifier.public int getMaxDocumentRequest()
getMaxDocumentRequest in interface IRepositoryConnectorgetMaxDocumentRequest in class BaseRepositoryConnectorpublic 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 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 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.ManifoldCFExceptionServiceInterruptionpublic 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 packDate(StringBuilder sb, Date dateValue)
protected String[] getInterestingFieldSetSorted(SharePointRepository.MetadataInformation metadataInfo, String[] allFields)
protected void fetchAndIndexFile(IProcessActivity activities, String documentIdentifier, String version, String fileUrl, String fetchUrl, String[] accessTokens, String[] denyTokens, Date createdDate, Date modifiedDate, Map<String,String> metadataValues, String guid, SharePointRepository.SystemMetadataDescription sDesc) throws ManifoldCFException, ServiceInterruption
protected static void handleIOException(IOException e, String context) throws ManifoldCFException, ServiceInterruption
protected static String mapExtensionToMimeType(String fileName)
protected static String mapToFileName(String fileName)
protected static void setDataACLs(RepositoryDocument data, String[] acls, String[] denyAcls)
protected static void setPathAttribute(RepositoryDocument data, SharePointRepository.SystemMetadataDescription sDesc, String documentIdentifier) throws ManifoldCFException
ManifoldCFExceptionpublic 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.ManifoldCFExceptionIOExceptionprotected static void fillInAuthorityTypeTab(Map<String,Object> velocityContext, IHTTPOutput out, ConfigParams parameters) throws ManifoldCFException
ManifoldCFExceptionprotected static void fillInServerTab(Map<String,Object> velocityContext, IHTTPOutput out, ConfigParams parameters) throws ManifoldCFException
ManifoldCFExceptionpublic 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.ManifoldCFExceptionIOExceptionprotected static void fillInMetadataTab(Map<String,Object> velocityContext, IHTTPOutput out, Specification ds)
protected void fillInTransientMetadataInfo(Map<String,Object> velocityContext, int connectionSequenceNumber)
protected static void fillInPathsTab(Map<String,Object> velocityContext, IHTTPOutput out, Specification ds)
protected void fillInTransientPathsInfo(Map<String,Object> velocityContext, int connectionSequenceNumber)
protected static void fillInSecurityTab(Map<String,Object> velocityContext, IHTTPOutput out, Specification ds)
public 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 Map<String,String> getLibFieldList(String parentSite, String docLibrary) throws ServiceInterruption, ManifoldCFException
parentSite - - parent site pathdocLibrary - nameServiceInterruptionManifoldCFExceptionpublic Map<String,String> getListFieldList(String parentSite, String listName) throws ServiceInterruption, ManifoldCFException
parentSite - - parent site pathdocLibrary - nameServiceInterruptionManifoldCFExceptionpublic List<NameValue> getSites(String parentSite) throws ServiceInterruption, ManifoldCFException
parentSite - the unencoded parent site path to search for subsites, empty for root.ServiceInterruptionManifoldCFExceptionpublic List<NameValue> getDocLibsBySite(String parentSite) throws ManifoldCFException, ServiceInterruption
parentSite - the unencoded parent site to search for libraries, empty for root.ManifoldCFExceptionServiceInterruptionpublic List<NameValue> getListsBySite(String parentSite) throws ManifoldCFException, ServiceInterruption
parentSite - the unencoded parent site to search for lists, empty for root.ManifoldCFExceptionServiceInterruptionprotected boolean checkIncludeLibrary(String libraryPath, Specification documentSpecification)
libraryPath - is the unencoded canonical library name (including site path from root site), without any starting slash.documentSpecification - is the specification.protected boolean checkIncludeList(String listPath, Specification documentSpecification)
listPath - is the unencoded canonical list name (including site path from root site), without any starting slash.documentSpecification - is the specification.protected boolean checkIncludeSite(String sitePath, Specification documentSpecification)
sitePath - is the unencoded canonical site path name from the root site level, without any starting slash.documentSpecification - is the specification.protected SharePointRepository.MetadataInformation getMetadataSpecification(String filePath, Specification documentSpecification)
filePath - is the unencoded path to a file or item, including sites and library/list, beneath the root site.documentSpecification - is the document specification.protected boolean checkIncludeFile(String filePath, Specification documentSpecification)
filePath - is the path to the file, including sites and library, beneath the root site.documentSpecification - is the document specification.protected boolean checkIncludeListItemAttachment(String attachmentPath, Specification documentSpecification)
attachmentPath - is the path to the attachment, including sites and list name, beneath the root site.documentSpecification - is the document specification.protected boolean checkIncludeListItem(String itemPath, Specification documentSpecification)
itemPath - is the path to the item, including sites and list name, beneath the root site.documentSpecification - is the document specification.protected static int matchSubPath(String subPath, String fullPath)
subPath - is the sub path.fullPath - is the full path.protected static boolean checkPartialPathMatch(String sourceMatch, int sourceIndex, String match, int requiredExtraPathSections)
protected static boolean processPartialPathCheck(boolean caseSensitive,
String sourceMatch,
int sourceIndex,
String match,
int matchIndex,
int requiredExtraPathSections)
caseSensitive - is true if file names are case sensitive.sourceMatch - is the source string (w/o wildcards)sourceIndex - is the current point in the source string.match - is the match string (w/wildcards)matchIndex - is the current point in the match string.protected static boolean checkMatch(String sourceMatch, int sourceIndex, String match)
sourceMatch - is the expanded string (no wildcards)sourceIndex - is the starting point in the expanded string.match - is the wildcard-based string.protected static boolean processCheck(boolean caseSensitive,
String sourceMatch,
int sourceIndex,
String match,
int matchIndex)
caseSensitive - is true if file names are case sensitive.sourceMatch - is the source string (w/o wildcards)sourceIndex - is the current point in the source string.match - is the match string (w/wildcards)matchIndex - is the current point in the match string.protected static String[] getAcls(Specification spec)
spec - is the document specification.public static String decodePath(String relPath)