Environment: TS 6.5 SP3 on a Win2K server
I'm trying to build a custom portlet for the CC Standard UI that will list all of the DCRs in a user's workarea(s). I'm able to successfully enumerate a user's workareas no problem. However, when I try to get the list of DCRs it's not returning what I would expect. Here is the JSP that I'm using to build the list of DCRs:[html]<%--
/**
* List of files in /data dirs of workarea.
* List all files in the /templatedata/site/ template dirs.
*/
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="com.interwoven.cssdk.access.CSUser" %>
<%@ page import="com.interwoven.cssdk.common.CSClient" %>
<%@ page import="com.interwoven.cssdk.filesys.*" %>
<%
String filePath = "/default/main/Internal/Intranet";
// get the cs client
CSClient client = (CSClient)request.getAttribute( "iw.csclient");
CSBranch branch = client.getBranch(new CSVPath(filePath), false);
%>
<% // get the current user and then get their workareas CSUser user = client.getCurrentUser(); CSWorkarea[] workareas = branch.getWorkareasForUser(user, true); // loop through the user's workareas for(int x=0; x {%>
<%= workareas.getName()%> <% // build the workarea specific vpath String workareaVpath = "/default/main/Internal/Intranet/" + workareas.getName() + "/WORKAREA/" + workareas.getName(); CSWorkarea workarea = client.getWorkarea(new CSVPath(workareaVpath), false); // create the array of area relative paths to the various data directories CSAreaRelativePath[] filepaths = new CSAreaRelativePath[16]; filepaths[0] = new CSAreaRelativePath("templatedata/site/about us/data/"); filepaths[1] = new CSAreaRelativePath("templatedata/site/blank/data/"); filepaths[2] = new CSAreaRelativePath("templatedata/site/bookmark/data/"); filepaths[3] = new CSAreaRelativePath("templatedata/site/calendar of events/data/"); filepaths[4] = new CSAreaRelativePath("templatedata/site/contact us (by name)/data/"); filepaths[5] = new CSAreaRelativePath("templatedata/site/contact us (by topic)/data/"); filepaths[6] = new CSAreaRelativePath("templatedata/site/faq/data/"); filepaths[7] = new CSAreaRelativePath("templatedata/site/feedback/data/"); filepaths[8] = new CSAreaRelativePath("templatedata/site/filenet/data/"); filepaths[9] = new CSAreaRelativePath("templatedata/site/glossary/data/"); filepaths[10] = new CSAreaRelativePath("templatedata/site/home/data/"); filepaths[11] = new CSAreaRelativePath("templatedata/site/navigation/data/"); filepaths[12] = new CSAreaRelativePath("templatedata/site/related sites/data/"); filepaths[13] = new CSAreaRelativePath("templatedata/site/related sites (custom)/data/"); filepaths[14] = new CSAreaRelativePath("templatedata/site/site administration/data/"); filepaths[15] = new CSAreaRelativePath("templatedata/site/what's new/data/"); // get the files from all of the above workareas CSFile[] files = workarea.getFiles(filepaths); // loop through the files and output them in the table for(int y=0; y {%>
<%= files.getName() %> <% } }%>
[/html]
What I get back is the following (the test user account I'm working with has access to "Web Delivery" and "HR"):
Web Deliverydata
data
data
[...]
HRdata
data
data
[...]
Essentially I just get "data" 16 times for each workarea. It's just picking up the last directory from the area relative vpath that I provide. Why is it not listing the files in these directories (there are indeed files in many, but not all, of them)? Thanks.