javarestfatwirewebcenter-sites

Webcenter Sites REST API: How to add multiple attributes on asset?


I've created an asset with a multiple attribute, like for instance, a set of images.

I would like to insert images to that asset with Webcenter Sites REST API but I don´t know how.

Single attribute is like this:

sourceAssetAttribute = new Attribute();
  sourceAssetAttributeData = new Data();
  sourceAssetAttribute.setName("FSIILongDescription");
  sourceAssetAttributeData.setStringValue("Test Long Description");
  sourceAssetAttribute.setData(sourceAssetAttributeData);
  sourceAsset.getAttributes().add(sourceAssetAttribute);

And multiple is how ?


Solution

  • I finally got it.

    https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=563491042188574&parent=DOCUMENT&sourceId=1528601.1&id=1510322.1&_afrWindowMode=0&_adf.ctrl-state=m55lxhl4z_58

    It´s like this:

    sourceAssetAttribute = new Attribute();
      sourceAssetAttributeData = new Data();
      sourceAssetAttribute.setName("attribute_name");
    
    sourceAssetAttributeData.getStringLists().add(0,"Asset_type:"+asset_id));
    sourceAssetAttributeData.getStringLists().add(1,"Asset_type:"+asset_id));
    
    sourceAssetAttribute.setData(sourceAssetAttributeData);
    sourceAsset.getAttributes().add(sourceAssetAttribute);