Home
TeamSite
Auto Populating Metadata Entries on Set Metadata
sunil_j
Hi,
TeamSite Users are using Templating to add new content and once finished entering the content, they Just save and close the DCT and Submit for Approval. The Workflow has an external task "GenerateFile" which generates the corresponding HTML file and then the user is sent an email notification and task to "Set Metadata" and he is presented with the Metadata Capture Form. On this form we have several fields like Title, Contributor Name, Date Created etc. I am interested in knowing is it possible to populate these fields automatically specially the Contributor, Title and Date Created Fields ?
We are on TeamSite 5.5.2 SP5 on Windows 2000 SP4 Server and NO Metatagger.
Regards
Sunil
Technical Consultant
Sydney (Australia)
Find more posts tagged with
Comments
Adam Stoller
You can use an externaltask script to run iwextattr to "pre-populate" metadata on the file before the set metadata CGI is run (EA's beginning with TeamSite/Metadata/)
You just need to make sure that the externaltask script can access the correct information to set it correctly.
(note: iwextattr unfortunately adds a bunch of overhead [performance-wise] as you have to invoke it once for each EA you want to set)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
sunil_j
Thanks for the input. How do I get the correct values ? I am interested in knowing what kind of lines of code should I write so that I get the current date, the contributor name, the title which is there in the Title tag of HTML, or the title Properties of the PDF/Word document ?
Regards
Sunil
Technical Consultant
Sydney (Australia)
Adam Stoller
current date - trivial (
return(scalar(localtime));
)
last modified date of file - trivial (
my @st = stat($file); return(scalar(localtime($st[9]));
)
contributor name - if they're the owner of the file - you can extract the UID from the file with
stat()
and then use another routine to lookup the uid to retrive a user name. If the information is contained within the file - then you have to parse the file to find it - same goes for the title tag information. For being able to parse a wide variety of document types for that kind of information - MetaTagger is probably the way to go.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
gzevin
apart from what fish has said - what you enter as metadata will likely depend on the business rules - if you have unqualified metadata (say, DC.Date instead of DC.Date.modified, etc), it's interpretation is pretty open..
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
bturns
Also, Metatagger already has a preprocessor (I believe that's what it's called) that will grab the Title for certain types of documents. Primarly MS Office docs and html docs. If the out of the box one doesn't work then a custom preprocessors can be written to grab that info.
bturns
You could also probably assume that the workflow creator was the contributor. In that case within the external task you would want to include the following code:
use TeamSite::WFworkflow;
.......
my $workflow = new TeamSite::WFworkflow($ARGV[0]);
my $user = $workflow->GetOwner();
use the $user variable to set as an extended attribute.