Reputation: 50
I am working on a project which requires extracting documents from a FileNet system. I need to extract documents identified by their Object_ID and store them in files. The system is working under Windows and is using an Oracle 11G database. The question is: is there a way to retrieve document content using direct database access and SQL? Can I write an SQL query that retrieves the binary content of document by passing its Object_ID as a parameter. Thanks
Upvotes: 1
Views: 7736
Reputation: 3250
Answering to an old question. But thought it might act as a quick help for someone. For the situation given here, IMHO, FileNet Queries are the best solution. This is how you do it:
Domain domain = Factory.Domain.fetchInstance(conn, null, null);
ObjectStore objStore = Factory.ObjectStore.fetchInstance(domain, osName, null);
SearchScope search = new SearchScope(objStore);
// your doc-class and identifier (index) goes here
String sql1 = "Select * from DocClassName where someIndex=abc456";
SearchSQL searchSQL = new SearchSQL(sql1);
DocumentSet documents = (DocumentSet) search.fetchObjects(searchSQL, Integer.valueOf("20"), null, Boolean.valueOf(true));
// go nuts on doc
Document doc;
Upvotes: 1
Reputation: 11
I could help you in this task if you like ,
Usually the content of FileNet is stored in a directory called /cestore in windows or Linux or even AIX.
Due to some restriction on the number of files in the directory especially in Unix based systems they store the files in long tree like fn01/fn03/fn04
So what you will do is
Usually the name of the file has the next format {DocumentId}
You will Scan all the files under /cestore by libraries like Apache IO commons or better by python script store them in Map Contains then you will be able get any document Path of all the documents
Upvotes: 1
Reputation: 919
maybe this will help you: There is a tool: FileNet Enterprise Manager or just FEM if you prefer, where you can export documents (binaries) and the metadata. From this tool you can make a SQL search, or build a search with the tool, in you object store. Then you can select the results and export them to a local directory. As a result from these tasks you will have a directory with binaries and some XML files. These XML files will host all the metadata from your database, like ID's and stuff. Hope this help you somehow.
Upvotes: 0
Reputation: 176
Content does not have to be stored in the database. It can be, as BLOB, but can also be stored in FileStores, as files, or in Fixed Content Areas. If they are stored in the database, technically you should be able to retrieve them with a query by GUID.
However I would suggest using the Java API to retrieve content. That will let you manage all situations (all kinds of content areas, multi content elements...). I don't know how many documents you intend to export, but it can be significantly optimized using the API (batch, multi threading...).
Upvotes: 6