Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Fetching all documents of a workspace
System
We are experiencing performance issue while trying to fetch all the documents available within a workspace. We are using workspace. getAllChildren() method and the iterating over the folders and getting all the documents. For a workspace having more that 100 documents this call becomes very slow.
CODE:
items = workspace.getAllChildren(Folder.class).iterator();
while (items.hasNext()) {
Folder folder = (Folder) items.next();
getAllDocuments(folder);
}
Is there any alternative way to achieve the same with less performance overhead?
Find more posts tagged with
Comments
Migrateduser
you should probably use Workspace search. SearchArgument with a generic profile condition(search condition).
Migrateduser
I have tried using Workspace search but this doesn't give any significant gain.
I was reading the WOM developers guid and there I could see usage of Bundle object.
Is there any example available?
original_report_as_on_BIRTVIEWER.jpg
pdf_version_when_exported.jpg
Palchalam
What is the action that u want to carry out after u r retrieve all the documents from the workspace?
If u r trying to retrieve names of all the documents in the workspace then you can also fire a database query to retrieve the names. This would be much faster.
Migrateduser
i actually want to find out the list of documents which are accessible by a given user (input parameter) for a particular workspace.
Palchalam
select p_name from doc_document
where
owner_trustee_rsid = (user id)
and workspace_rsid = (workspace id)
and p_datasource = 'document'
The above query would give name of all the documents owned by a particular user in a workspace.
Check the results manually by executing the above query from database client, if fine use them in the java code...