[opencms-dev] Get file path for files with a specific value.
Thomas Fabbricante
tom_fabbricante at wunderman.com
Tue Mar 9 22:38:01 CET 2004
I would like to pull all the files in the system that have a property that
is set to a specific value.
The results have the /default/vfs/ prepended to path(
/default/vfs/myserver/mydirectory/mypage.html). I've looked through the
api for a method that just returns the file path
/myserver/mydirectory/mypage.html but have been unsuccessful.
The code looks like this...
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);
CmsObject cmsObj = cms.getCmsObject();
Vector vecFiles = cmsObj.getFilesWithProperty("Office","testoffice");
StringBuffer stringOut = new StringBuffer("");
Iterator i = vecFiles.iterator();
while (i.hasNext()){
String path = (String)i.next();
stringOut.append(path);
stringOut.append("<p/>");
}
out.println(stringOut.toString());
Thanks
-tom
===============================================
This transmission is confidential and intended
solely for the person or organization to whom
it is addressed. It may contain privileged and
confidential information. If you are not the
intended recipient, you should not copy,
distribute or take any action in reliance on it.
If you have received this transmission in error,
please notify the sender at the e-mail address above.
================================================
More information about the opencms-dev
mailing list