Metatagger.pm functions

Hi,
I have some FormAPI code that calls a script on the server.
The script looks as follows:

my $mtagger = Metatagger -> new();
$mtagger->setServerHost("hostname", 9095);

$mtagger->loadDocumentByExt($DCRPath, "");
$mtagger->suggestCategory("category name");
my $test = $mtagger->getMetadata();
$mtagger->setMetadata($test);
print $test;

when executing the script from the cmd prompt I can see that $test does hold tbe metadata in canonical XML format. As I figure setMetadata() should add the metadata to the DCR's extended attributes, but it does not. Is there any problems with doing this, considering that it is a DCR I am doing this on ? any help would be appreciated.

Comments

  • getMetadata returns an XML metadata record created by the Metatagger. That metadata record can be saved to EAs by giving it as a file to the command line tool iwmetadata (ships with MT):
    iwmetadata -set metadata.xml <vpath>

    The setMetadata() loads a pre-existing metadata record along with loadDocument...use this if you want Metatagger to augment an already existing metadata record for a document as opposed to creating a new one from scratch. setMetadata does not save metadata to EAs or to DCRs.

    The current Metatagger/Teamsite integration was designed to be called from metadata capture and saved into EAs not called by templating and saved into DCRs. I think upcoming future release will address the later use case. If you need to populate a DCR using MetaTagger you need to include custom code in your script to copy the MetaTagger generated XML format into the DCR format. It is possible that XSLT would help...
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs