You can also download document content in bulk using JavaScript. Following are the steps:
- Logon to http://servername:9080/acce/
- Go to the Search tab.
- Select New object Store Search.
- Select SQL View and mention your query to execute
SELECT TOP 100 This FROM Document;
- Make sure bulk action is enabled.
- Run Script must be selected.
Please change the output directory according to your environment. Make sure directory should be existing on the server.
importClass(Packages.com.filenet.api.collection.ContentElementList); importClass(Packages.com.filenet.api.core.ContentTransfer); importClass(java.io.FileOutputStream); importClass(java.io.InputStream); importClass(java.lang.Byte); function OnCustomProcess (CEObject)
{
CEObject.refresh();
var ce = CEObject.get_ContentElements();
if(ce.size() > 0)
{
var ct = ce.get(0);
var folderName = "/media/temp/content/"; // output directory this._downloadContent(folderName, ct);
}
}
function _downloadContent(folderName, ct)
{
var out = new FileOutputStream(folderName + ct.get_RetrievalName());
var docLen = ct.get_ContentSize().intValue();
var buf = java.lang.reflect.Array.newInstance(Byte.TYPE, docLen)
var stream = ct.accessContentStream();
stream.read(buf, 0, docLen);
out.write(buf);
out.flush();
stream.close();
out.close();
}
Here is the screenshot:
- Run this search and its output will be like:
- Close this dialogue box.
- Go to the output directory and you will see the download document content there as below:
For further details please visit knowledge center https://www.ibm.com/support/knowledgecenter/en/SSNW2F_5.2.1/com.ibm.p8.ce.admin.tasks.doc/p8pcc439.htm