How to get extended attribute to a perl variable

I'm able to set extened attribute as below

$cmd = "$IWHOME/bin/iwextattr -s TeamSite/Metadata/SEO/Description=$metaDescription \"$file\"";
$log->debug("cmd = $cmd");
$out = `$cmd`;
$log->debug("out = $out");


If I want to get, and see what value is present previously and want to manipulate based on value... So, If I can store in perl variable, I can play with it. But How to get the value into a perl variable.

Thanks, Aneel

Comments

  • What??
    When you able to set using -s flag cant you get using -g flag??
    my $value = "$IWHOME/bin/iwextattr -g TeamSite/Metadata/SEO/Description \"$file\"";
  • I knew using -g option. Actually I wanted to how to trigger this command, even for -s....
    In a perl file, the command is stored in a variable $cmd and assigned $out..
    So,, when they assign $out = $cmd means command is executed.

    Yeah, its a silly Q.
  • 1) include the below line in your script and it will execute the command $cmd directly

    `$cmd`;

    2) to capture the output to a variable use the below

    my $cmd = qx ( );
  • Yeah Got it. thanks,
  • Hi,

    You can try the below one

    I:/iw-home/bin/iwextattr -s adminPath=Y:/Need to have path till admin/admin/ Y:/Need to put path of where your datacapture is present/datacapture.cfg
    I:/iw-home/bin/iwextattr -s SetMetadata=true Y:/Need to put path of where your datacapture is present/datacapture.cfg

    run the above cmd and this will set your metadata for the template
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