Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
readdir
Bhargav Coca
Working on Teamsite 6.5, win2k3. I wanted to know, if there is a way selecting/reading files from a directory by its permissions ( Public/ Private ). I wanna read only those files which are public, and completely ignore those which are private. Any suggestions in this regard will be appretiated.
thanks
Jessica
Find more posts tagged with
Comments
stefanmaier
Hi,
do you mean windows file system permissions?
You can get them with the command line tool "cacls".
Do you want to import the permissions into a perl script?
Stefan
Bowker
You didn't supply a lot of details on your request, but if you are using TeamSite 6.5 you probably can use the CSSDK (TeamSite API). You can get just about any piece of info about a file throught the CSFile object. The method you need to call is: isPrivateToWorkarea() - it returns a boolean, true for private, false for non-private files.
For more information on CSSDK look in the developers forum.
Dan Bowker
Northern Trust
Web Publishing Technology
Bhargav Coca
Thank you, I think i wanted this exact same one, isPrivate, i haven't tried it yet, but will keep you posted, if i run into some problems.
Jessica
Bhargav Coca
can any one please tell me which module to use for the isPrivateToWorkarea() . Its a TeamSite API in 6.5, i am using TS 6.5. Please let me know which module to "use".
Thanks
Bowker
This is a complicated question to answer. You need to use the Content Services SDK. (downloadable at the IWOV site)
THE CODE BELOW IS UNTESTED AND I DON'T SUPPORT IT NOR DO I GUARANTEE IT WILL WORK. In fact it won't as written...this is a snipit of code that will get you very close.
Below is a block of code that I've taken from part of our app. It needs a config file that looks like:
# creates a CS JNI factory
com.interwoven.cssdk.factory.CSFactory=com.interwoven.cssdk.factory.CSLocalFactory
cssdk.cfg.path=c:/apps/interwoven/teamsite/cssdk/cssdk.cfg
Here is a rough outline of the Java Code you will need (I've removed a bunch of catches logic, definitions......
import com.interwoven.cssdk.factory.*;
import com.interwoven.cssdk.common.*;
import com.interwoven.cssdk.access.*;
import com.interwoven.cssdk.filesys.*;
import com.interwoven.cssdk.workflow.*;
try {
props = new Properties();
props.load(new FileInputStream(propertiesFilename));
csFactory = CSFactory.getFactory(props);
if (csFactory == null) {
setError("Client Services Factory is Null - unable to sign on");
}
csClient = csFactory.getClient( username, role, password, Locale.getDefault(), application, null );
CSFile file = csClient(new CSVPath("//everest/products/main/catalog/fall2003/WORKAREA/developers/www/main.html"));
// there is a plethera of things you can do from here...but what you want is
if (file.isPrivateToWorkarea())
System.out.println("private file");
else
System.out.println("public file");
} catch ( FileNotFoundException fnf ) {
} catch ( IOException io ) {
} catch (CSFactoryInitializationException fie) {
other things to catch...
CSAuthorizationException - if the user is not authorized to perform this operation
CSObjectNotFoundException - if the server cannot find this file
CSExpiredSessionException - if the user's session has expired
CSRemoteException - if the ContentServices SOAP or JNI server has an error and cannot return the requested data
CSException - if the server cannot perform this operation for any other reason
}
Dan Bowker
Northern Trust
Web Publishing Technology