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)
file lock status from tpl
amigo
Can we determine the file status(locked/unlocked) from the tpl and display a link for triggering a delete workflow based on that?
Find more posts tagged with
Comments
reddyl
You can use iwattrib CLT to determine if the file is locked or not. If its locked then invoke the delete workflow using iwjobc CLT.
awizardly
I use iwfilestate to determine if a file is locked and other information.
Then you can also use iwlockinfo to determine more information about the lock.
I've built functions in perl that invoke iwfilestate and iwlockinfo to return the state of a vpath as a hash, and I include things like the lock comment.
I've put these in a perl module because I use them in email templates and in external tasks.
for iwfilestate I use:
iwfilestate -f script -i <vpath>
This returns the file state output in a script parseable format.
Take a look at the CLT's and you can get alot of info.
Lee
Organic Inc
http://www.organic.com
Nellai123
HI,
istagged attribute of iwattrib CLT will give you the desired result.
Usage : iwattrib <objectvpath> istagged
Thanks,
Nellai...
Herman
yes, i try iwfilestate -f script -i <vpath>
then I get :
conflict=no
current=yes
modified=yes
editable=yes
user=temp2\Administrator
role=master
locked=no
assigned=no
If in perl how can i just check the "locked" variable is "no" or "self"?
Adam Stoller
If in perl how can i just check the "locked" variable is "no" or "self"?
By parsing the returned data:
...
my %hash;
map {
chomp;
my($k, $v) = split(/=/, $_, 2);
$hash{$k} = $v;
} qx($iwhome/bin/iwfilestate -f script -i $vpath);
...
if ($hash{locked} eq "no"){
...
}
Depending on what you want to do - the code can be simpler or more complex - the above takes the results for a given file and sticks it into a hash so that each part of the results is accessible. You could do this in such a way that multiple files are processed and provide a key for each file that then leads to a per-file-hash, or you could do this in such a way that all you retrieve is the value of 'locked' for a given file and don't store anything in a hash, etc.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Herman
Thanks fish,
your response is very helpful!