Class Index | File Index

Classes


Class SetField

Writes a new value to a field of an asset.
Defined in: setField.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
SetField(src, fieldId, type, append)
Writes a new value to a field of an asset.
Class Detail
SetField(src, fieldId, type, append)
Writes a new value to a field of an asset. Locates assets by the list of AssetID's in 'src', overwrites the field given in the 'field' parameter with the value 'value' parameter, and returns the new metadata value. These AssetIDs are parsed into a text object keyed by AssetID from the JSON file in which they are contained, and by default are displayed to the user.
'MBurl'/wf/restapi/1/setField?src=AssetID&fieldId='schema_name/ field_name'&value='Value'
'MBurl'/wf/restapi/1/setField?src=["AssetID"]&fieldId='schema_name/ field_name'&value='Value'
'MBurl'/wf/restapi/1/setField?src=AssetID&fieldId='schema_name/ field_name'&value=["value1", "value2", ...]&type=Bag
http://127.0.0.1:55555/wf/restapi/1/setField?src=["12345"]&fieldId="http://purl.org/dc/elements/1.1/ title"&value="a new value for Dublin Core title"
post parameter: "data", value:
{
	"data" : [
				{"fieldId": "http://purl.org/dc/elements/1.1/ title", "value": "A new value for Dublin Core title", "type": "", "append": ""},
				{"fieldId": "http://purl.org/dc/elements/1.1/ description", "value": "A new value for Dublin Core description", "type": "", "append": ""}
			]
	}
Parameters:
src
AssetID/list of AssetIDs of asset/assets containing field to be overwritten.
fieldId
ex http://purl.org/dc/elements/1.1/ subject
type
optional. The type of field we are writing to. If you omit it we will try to guess. If you include it only the value 'Bag' is relevant. This parameter, when ommitted and operating on a field that is a list defaults to a sequence (an ordered list).
append
true/false. append value to the end of the field?
Returns:
( {'AssetID': "New Field Value",...} )

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Dec 15 2023 01:43:54 GMT-0600 (CST)