Example: Document Interceptor - Upload Documents to SharePoint Server on Check-In
Example: Document Interceptor - Upload Documents to SharePoint Server on Check-In
This is an example of an interceptor, which intercepts the standard Web Central document check-in operation, extracts invocation parameters, and conditionally performs another operation based on those parameters. An example of such operation would be document upload to a SharePoint server, if table name and field name parameters match specified values.
Typical use case: when a lease document (the ls.doc field) is uploaded to the Web Central document management repository, it also should be uploaded to SharePoint server, tagged with the Lease ID (ls.ls_id), inventory table name, field name, and primary keys.
Limitations
The current implementation of CopyServiceClient uses the CXF framework to implement web service client. It only works with Sun JDK, in Windows OS, and uses Windows OS user account under which WebCentral is running, to authenticate with SharePoint server.
Example Files
The implementation is located in the
/schema/ab-products/solutions/common/src/main/com/archibus/webservice/document/interceptor/
folder. The interceptor is implemented in the
DocumentInterceptor
Java class.
The
DocumentInterceptor
bean and supporting beans are defined in
/schema/ab-products/solutions/common/src/test/com/archibus/app/solution/common/webservice/document/interceptor/documentService.xml
To run this example:
-
Modify
/WEB-INF/config/context/core/core-services.xml
:
-
Enter your SharePoint server URL as
siteRoot
property value ofcopyServiceClient
bean incore-services.xml
. -
Configure
DocumentInterceptor
to interceptDocumentService
: see/schema/ab-products/solutions/common/src/test/com/archibus/webservice/document/interceptor/documentService.xml
for an example;
- Create “Table Name”, “Field Name”, “Lease ID”, “Keys” columns in the “Shared Documents” folder of the SharePoint server.
-
Use the
/schema/ab-core/views/documents-management/ab-doc-checkin.axvw
view to check in a document. You should see the following in your SharePoint server: