Set an asset attribute

RAMAsset.getAssetAttributes() and RAMAsset.getAssetAttribute(String) can be used to get the available attribute on an asset based on the asset type constraints. After fetching an attribute from an asset, use RAMAsset.setValues(String[]) to set the values of the attribute.

                AssetAttribute attribute = newAsset.getAssetAttribute("Custom Attribute");
                attribute.setValues(new String[]{"value 1", "value 2", "value 3"});

                session.put(newAsset, new NullProgressMonitor());
If you are setting a custom attribute, use the following data formats:
  • Boolean: "true" or "false" (lower case; you can use the Boolean.toString() method)
  • Date: Long.toString(myDate.getTime())
  • Link: "<a href=\"myURL\">myLabel</a>" (note that the quotation marks are escaped with backslashes)
  • Number: the number in string format (you can use the Number.toString() method)
  • User: the user's unique ID.

Feedback