get the list and delete the extended attributes of each page according to the list

Hi.
I'd like to create the following shell script.

1)get the page list including the pages which have specific extended attributes.
Target pages could have 3 extended attributes.

TeamSite/LiveSite/Id
TeamSite/Metadata/CreationDate
TeamSite/Metadata/Locale

and then

2) I'd like to delete all of the extended attributes for each pages.

Could you give me any advices for it?( ex) which iw command with option i should utilize...)

Thank you very much in Advance.

Naoki

Answers

  • Depending on the size of your branch, brute force may be the best approach.

    iwextattr will perform the changes, you will need to get the list of EAs and then process.

    I would use the -x option (get/set all EAs in an XML structure)

    iwextattr -h
    Usage: iwextattr [-c | -s attr=value | -g attr | -d attr | -e | -l] [-f] [-r ] [u] [x] vpath
    Set, get, or delete extended attributes of the file, directory,
    branch, edition or WORKAREA specified in the vpath.
    The vpath is in the form:
    [//server]/archive{[/branch]+}/{EDITION,WORKAREA}/dirpath
    -h Print this message.
    -v Print version string.
    -s attr=value Set to .
    -s attr Set reading value from stdin.
    -g attr Get the value of .
    -d attr Delete attribute .
    -c Clear (delete) all EAs for this file.
    -e Enumerate attribute names.
    -f Input value for attribute via stdin.
    -l List attributes and values.
    -r Use to filter attribute names (requires -l or -e)
    -u Encode/decode EA values to/from UTF8 on input/output.
    -x Read and write XML with -s and -l options.
    If no option is specified, attributes are listed as with -l.

  • Hi Andy,

    Can you help me in providing the complete script for getting and setting the attribute as per the following steps:

    1. create a .ipl file (just the extension is ipl)

    2. Let the ipl file take a command line argument of a folder

    3. read all files in the folder (including child folders) and keep in an array

    4. for each file in an array get the attribute of the file (ise iwextattr - g command) , store the output to $contents variable

    5. write the $contents to some txt file (output.txt)

    6. each line in output file has filename, Extended attribute name, extended attribute value

    7. then create a new file setattributes.ipl , that read the output file(output.txt)

    8. reads each line in the output file

    9. use iwextattr - s to ser name and value for the given filename

  • I do not have a copy handy. You can write one yourself, you know the steps.

    You can also do this in Java if you prefer or use OpenDeploy.

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