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)
How to get workarea name of a file in STAGING?
System
TS 6.1 Win2K
Is there any way of getting original workarea name for a file residing in STAGING area?
Is it stored as an extended attribute (although I could not find any such attribute) or at some other place?
I need it to write a script to get a list of expiring files from STAGING and display the original path (with workarea) in the generated report.
I'm doing this on STAGING because I thought it will be easier to look at one place instead of having to look at all the workareas. Also, I want to generate the report only for the submitted files.
Find more posts tagged with
Comments
Migrateduser
Do you have DataDeploy installed. If so, then the easiest way would be to query the data in those tables.
Otherwise I have attached some perl code for a search program that I created. I used if from a custom menu. It searches the current directory that the user is in and displays a list of the files that it finds. It also has a link to the file that will open the file when clicked. You may be able to use some of this code.
Adam Stoller
Try this (Perl form):
use strict;
use TeamSite::Config;
my $iwhome = TeamSite::Config::iwgethome();
my $branch = "/default/main/.....";
#=# SET THIS
my $file = "/subdirs/filename.ext";
#=# SET THIS
#=====================================================================
# Get the results from iwrlog in easy-to-parse format
#----------------------------------------------------------------------
# [ 0 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ]
# [file]\t[rev]\t[date]\t[user]\t[ed.]\t[size]\t[objid]\t[sub. event]\t[comment]
#=====================================================================
my
@rlog
= split(/\t/, qx($iwhome/bin/iwrlog -m $branch/STAGING/$file));
# All we care about is the submit event objid, at position 7
# First get the area object id
chomp(my $areaobj = qx($iwhome/bin/iwattrib -o $rlog[7] area));
# Then get the area's name from the area's object id
chomp(my $area = qx($iwhome/bin/iwattrib -o $areaobj name));
print "AREA: '$area'\n";
I believe that will give you what you are looking for.
Essentially, you run
iwrlog -m
on the file in STAGING (I'm assuming you're interested in the most-recent entry, which is the first, otherwise you'll have to do more parsing of that data) - and pull out the
submit event objid
relative to the version that you are interested in. Then you are essentially running
iwattrib
on the results of the output from
iwattrib
to come up with the workarea name from which the file in question was submitted.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Using CSSDK, I think you can get the submit record from the file (file.getSubmitRecord()) and then get the source area from the record (record.getSourceArea()).
Michelle Neuringer
Interwoven Engineer
Migrateduser
Michelle, Adam ,
Thanks for the info.
I'll do it using CSSDK.
Thanks
-Ashish