This object represents a node in a datastash (See SPDatastash). New SPDatastashObject objects are created using the SPDatastash.addObject method.
Method: addObject
Adds a single object to the stash as a child of this object
SPDatastashObject addObject();
SPDatastashObject addObject(name, value, ...);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
value | String | The value for the preceding field |
name | String | The field name to add |
Returns an SPDatastashObject object
Any number of name/value pairs can be passed and the values will by applied to the newly-created object. If no values are passed the object will be empty and values can be added using the SPDatastashObject methods.
Method: deleteobjects
Deletes all the child objects of this object, a single given object, or a subset matching given attribute value criteria
void deleteobjects();
void deleteobjects(object);
void deleteobjects(name, value, ...);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
value | String | The value to compare to each object |
object | SPDatastashObject | The single object to delete |
name | String | The field name to check |
None
Any number of name/value pairs can be passed. Any object matching all the values will be deleted. If a single object is passed, that one object is deleted. If no arguments are provided, all child objects of this object are deleted.
Method: getAttribute
Gets the value of an attribute field on this object
String getAttribute(fieldName);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the attribute field to get |
The value of the given field or an empty string if the value is empty or the field does not exist
Method: getObjects
Gets all the child objects of this object, or a subset matching given attribute value criteria
SPArray getObjects();
SPArray getObjects(name, value, ...);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
value | String | The value to compare to each object |
name | String | The field name to check |
Returns an SPArray object containing zero or more SPDatasatshObject objects that matched the given criteria
Any number of name/value pairs can be passed. Any object matching all the values will be added to the returned array. If no arguments are provided, all objects that are children of this object are returned.
Method: getObjectValues
Gets a string containing a list of values associated with child objects of this object
String getObjectValues(fieldName);
String getObjectValues(fieldName, separator);
String getObjectValues(fieldName, separator, name, value, ...);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
value | String | The value to match to the preceding field |
fieldName | String | The field name to extract values from |
name | String | A field name to check for a matching value |
separator | String | A string to insert between successive values in the output |
Returns an String consisting of all the values extracted from the given field of all matching objects, separated by the given separator
E.g. to get a comma-separated list of the values in the "Name" field of all the child objects of this object: getObjectValues("Name", ",");
Method: setAttribute
Sets the value of an attribute field on this object
void setAttribute(fieldName, value);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
value | String | The new value for the field |
fieldName | String | The name of the attribute field to set |
None