I was thinking about this and will most likely need to do this in the future as we also have groups of non-participants resources who need assess to project documents.
So my idea is to create an HTML portlet (one / two pages) that:
1. Validates that a user (via their session) as the rights to review any project document.
2. Pulls a list (via NSQL query web services) of projects along with each of their documents.
3. Push the list into a tree and display the resulting tree to the user.
4. The user would open the project node branch (under a parent node based on the first letter of the project) to see which documents are available.
5. When the user clicks on a document node, the page opens another window, sets the response content mine-type (returned in the web service results) and dumps the a byte array of the file into the response stream.
There is a static method inside the dms.jar that will pull a document into a byte array base on its file version id which gives us the output byte array that we need for the response output stream.
6. At this point the browser takes over and asks the user if they want to save the document or open it (assuming that the mine-type is known to the browser).
I built a simple test html to check out the user UI. ( the query api refused to sort the results which I didn't understand -- it sorted based on the dim UniqueId).
based on the following NSQL (not validate that it is correct but returns results -- also not all records had mine_types so I supplied a few if they were null):
SELECT @SELECT:DIM:USER_DEF:IMPLIED:X:X.UniqueId:UniqueId@
, @SELECT:DIM_PROP:USER_DEF:IMPLIED:X:X.TreeNode:TreeNode@
, @SELECT:DIM_PROP:USER_DEF:IMPLIED:X:X.ProjectName:ProjectName@
, @SELECT:DIM_PROP:USER_DEF:IMPLIED:X:X.ProjectCode:ProjectCode@
, @SELECT:DIM_PROP:USER_DEF:IMPLIED:X:X.FileName:FileName@
, @SELECT:DIM_PROP:USER_DEF:IMPLIED:X:X.MimeType:MimeType@
, @SELECT:DIM_PROP:USER_DEF:IMPLIED:X:X.FileId:FileId@
FROM (
SELECT
v.id as UniqueId,
UPPER(SUBSTR(iv.name, 1, 1)) as TreeNode,
iv.name as ProjectName, p2.NAME as ProjectCode, f.name as FileName,
nvl(case
when f.mime_type is null and Lower(SUBSTR(f.name, INSTR(f.name, '.',-1))) = '.docx' then 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
when f.mime_type is null and Lower(SUBSTR(f.name, INSTR(f.name, '.',-1))) = '.xlsx' then 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
when f.mime_type is null and Lower(SUBSTR(f.name, INSTR(f.name, '.',-1))) = '.pptx' then 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
else
f.mime_type
end ,'application/octet-stream') as MimeType,
v.file_id as FileId
FROM clb_dms_folders p2
inner join inv_investments iv on iv.code = p2.name
inner join clb_dms_folders p1 on p2.ID = p1.parent_folder_id
inner join clb_dms_files f on p1.ID = f.parent_folder_id
inner join clb_dms_versions v on f.ID = v.file_id
where v.IS_LATEST = 1
and iv.IS_ACTIVE = 1
order by iv.name, f.name
) X WHERE @FILTER@
Just thinking out loud,
Gene