How to update asset autoKeywords?

Hi,

when I change a category of an asset (whether through the GUI or via script), the autoKeywords are not updated. In the GUI I can do this by opening the metadata editor, make any change (e.g. description) and accepting, but how can I force this in a script.

Thanks for any idea.

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,747

    autoKeywords are created automatically, they are not meant to be manually editable. Beyond that, as a general remark on those fields that are updatable:

    an asset is a snapshot of the data at the moment of retrieval... the portions of the public API that provide read/write access likely update those specific rows of data in the database as you call/assign to them (in order to provide a simpler API - individual transactions for each row of data is not as efficient as a single transaction for multiple rows at the same time, but the more efficient method requires an understanding of the underling implementation - which could change as needs change)... the portions of the public API that provided access to generated and/or read-only data may require you to call updateFromMetadata() after making modifications in order to cause said snapshot to be representative of the new/modified state

  • kabexefkabexef Posts: 75

    Richard Haseltine said:

    autoKeywords are created automatically, they are not meant to be manually editable. Beyond that, as a general remark on those fields that are updatable:

    That was probably a misunderstanding. I don't want to change the autoKeywords, I want them to change themselves when I add userCategories for example.

    I tried the following (sorry for the non-compliant formatting)

    print("asset.userCategories 1 =", asset.userCategories); // asset has user categories
    print("asset.autoKeywords =", asset.autoKeywords); // user categories found in autoKeywords
    var ucs = asset.userCategories;
    asset.removeFromCategories(ucs, true);
    product.pushMetadata();
    asset.updateFromMetadata();
    print("asset.userCategories 2 =", asset.userCategories); // asset has no user categories
    product.update();
    product.updateAssets();
    product.updateChildren();
    product.pushMetadata();
    print("asset.autoKeywords =", asset.autoKeywords); // autoKeywords not refreshed; user categories still found in autoKeywords;

Sign In or Register to comment.