com.ibm.ecm.json

Class JSONResultSetRow

  1. java.lang.Object
  2. extended byjava.util.AbstractMap<K,V>
  3. extended byjava.util.HashMap
  4. extended bycom.ibm.json.java.JSONObject
  5. extended bycom.ibm.ecm.json.JSONResultSetRow
All implemented interfaces:
JSONArtifact, java.io.Serializable, java.lang.Cloneable, java.util.Map

  1. public class JSONResultSetRow
  2. extends JSONObject
This class represents a single row in a result set. A row typically represents a "hit" for a search or item within a folder or work list.
Since:
2.0.2
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>

Field Summary

Modifier and Type Field and Description
  1. static
  2. long
PRIV_ADD_LINK
Privilege constant on an item indicating that links can be added to the item
  1. static
  2. long
PRIV_ADD_TO_FOLDER
Privilege constant on folders indicating that the folder can have items added to it
  1. static
  2. long
PRIV_ADDDOC
Privilege constant indicating that documents can be added
  1. static
  2. long
PRIV_ADDITEM
Privilege constant indicating non-document items can be added
  1. static
  2. long
PRIV_ADDNOTES
Privilege constant indicating indicating that notes can be added to an item
  1. static
  2. long
PRIV_CANCELCHECKOUTDOC
Privilege constant indicating that the document checkout can be cancelled.
  1. static
  2. long
PRIV_CHANGE_CLASS
Privilege constant indicating that the content class of the item can be changed.
  1. static
  2. long
PRIV_CHECKINDOC
Privilege constant indicating that the document can be checked in.
  1. static
  2. long
PRIV_CHECKINOUTDOC
Privilege constant indicating that the document supports checkin and checkout.
  1. static
  2. long
PRIV_CHECKOUTDOC
Privilege constant indicating that the document can be checked out.
  1. static
  2. long
PRIV_DECLARE
Privilege constant indicating that the document can be declared in a record.
  1. static
  2. long
PRIV_DELETE
Privilege constant indicating that the document can be deleted.
  1. static
  2. long
PRIV_EDITANNOTATIONS
Privilege constant indicating that annotations can be edited on the document.
  1. static
  2. long
PRIV_EDITDOC
Privilege constant indicating the item's content can be edited
  1. static
  2. long
PRIV_EDITPROPERTIES
Privilege constant indicating properties of the item can be edited
  1. static
  2. long
PRIV_EMAILDOC
Privilege constant indicating the document can be emailed.
  1. static
  2. long
PRIV_EXPORT
Privilege constant indicating the document can be exported (downloaded)
  1. static
  2. long
PRIV_HOLD
Privilege constant indicating that the document can be put on hold.
  1. static
  2. long
PRIV_MAJOR_VERSION
Privilege constant indicating that the document can be major versioned.
  1. static
  2. long
PRIV_MINOR_VERSION
Privilege constant indicating that the document can be minor versioned
  1. static
  2. long
PRIV_MODIFYNOTES
Privilege constant indicating that notes can be modified on the document.
  1. static
  2. long
PRIV_MOVE_TO_FOLDER
Privilege constant indicating that the item can be moved from one folder to another.
  1. static
  2. long
PRIV_PRINTDOC
Privilege constant indicating that the document can be printed
  1. static
  2. long
PRIV_PRINTNOTES
Privilege constant indicating that notes can be printed
  1. static
  2. long
PRIV_REMOVE_FROM_FOLDER
Privilege constant on a folder indicating that items can be removed from it
  1. static
  2. long
PRIV_REMOVE_LINK
Privilege constant on an item indicating that links can be removed from the item
  1. static
  2. long
PRIV_STARTWORKFLOW
Privilege constant indicating that the document can be started on workflow.
  1. static
  2. long
PRIV_VIEWANNOTATIONS
Privilege constant indicating that annotations can be viewed on the document.
  1. static
  2. long
PRIV_VIEWDOC
Privilege constant indicating that the document can be viewed.
  1. static
  2. long
PRIV_VIEWNOTES
Privilege constant indicating notes on the item can be viewed
  1. static
  2. java.lang.String
TYPE_BINARY
Data type constant for binary data
  1. static
  2. java.lang.String
TYPE_BOOLEAN
Data type constant for boolean
  1. static
  2. java.lang.String
TYPE_DOUBLE
Data type constant for floating point
  1. static
  2. java.lang.String
TYPE_GUID
Data type constant for an GUID
  1. static
  2. java.lang.String
TYPE_INTEGER
Data type constant for integer
  1. static
  2. java.lang.String
TYPE_OBJECT
Data type constant for a complex object
  1. static
  2. java.lang.String
TYPE_STRING
Data type constant for string
  1. static
  2. java.lang.String
TYPE_TIMESTAMP
Data type constant for date, time, timestamp

Constructor Summary

Constructor and Description
JSONResultSetRow()
Default constructor.
JSONResultSetRow(java.lang.String id,java.lang.String name,java.lang.String mimetype,long privileges)
Constructor
JSONResultSetRow(java.lang.String template,java.lang.String id,java.lang.String name,java.lang.String mimetype,long privileges)
Constructor

Method Summary

Modifier and Type Method and Description
  1. void
addAttribute(java.lang.String id,java.lang.Object value,java.lang.String type,java.lang.String format,java.lang.String displayValue)
Adds an attribute to the row.
  1. int
getAttributeCount()
Returns the number of attributes on the row.
  1. java.lang.String
getAttributeDisplayValue(java.lang.String id)
Returns the display value of an attribute given the attribute id.
  1. java.lang.String
getAttributeFormat(java.lang.String id)
Returns the format of an attribute given the attribute id.
  1. java.lang.String
getAttributeType(java.lang.String id)
Returns the type of an attribute given the attribute id.
  1. java.lang.Object
getAttributeValue(java.lang.String id)
Returns the value of an attribute given the attribute id.
  1. java.lang.String
getId()
Returns the internal identifier for the item represented by this row.
  1. void
getId(java.lang.String id)
Sets the internal identifier for the item represented by this row.
  1. java.lang.String
getMimetype()
Returns the MIME content type of the item represented by the row.
  1. java.lang.String
getName()
Returns the name of the item represented by this row.
  1. long
getPrivileges()
Returns a bitmapped integer containing the privileges the user has on this item.
  1. void
setAttributeDisplayValue(java.lang.String id,java.lang.String displayValue)
Sets the display value of an attribute.
  1. void
setAttributeFormat(java.lang.String id,java.lang.String format)
Sets the format of an attribute.
  1. void
setAttributeType(java.lang.String id,java.lang.String type)
Sets the type of an attribute.
  1. void
setAttributeValue(java.lang.String id,java.lang.Object value)
Sets the value of an attribute.
  1. void
setMimetype(java.lang.String mimetype)
Sets the MIME content type of the item represented by this row.
  1. void
setName(java.lang.String name)
Sets the name of the item represented by this row.
  1. void
setPrivileges(long privileges)
Sets the bitmapped integer containing the privileges the user has on this item.
  1. static
  2. JSONResultSetRow
toJSONResultSetRow(JSONObject jsonObject)
This is for compatibility with earlier JSON that did not use this class.
Methods inherited from class com.ibm.json.java.JSONObject
isValidObject, isValidType, parse, parse, parse, put, serialize, serialize, serialize, serialize, serialize, serialize, toString
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
equals, hashCode

Field Detail

PRIV_EDITPROPERTIES

  1. public static final long PRIV_EDITPROPERTIES
Privilege constant indicating properties of the item can be edited
See Also:

PRIV_EDITDOC

  1. public static final long PRIV_EDITDOC
Privilege constant indicating the item's content can be edited
See Also:

PRIV_VIEWNOTES

  1. public static final long PRIV_VIEWNOTES
Privilege constant indicating notes on the item can be viewed
See Also:

PRIV_ADDDOC

  1. public static final long PRIV_ADDDOC
Privilege constant indicating that documents can be added
See Also:

PRIV_ADDITEM

  1. public static final long PRIV_ADDITEM
Privilege constant indicating non-document items can be added
See Also:

PRIV_EMAILDOC

  1. public static final long PRIV_EMAILDOC
Privilege constant indicating the document can be emailed.
See Also:

PRIV_EXPORT

  1. public static final long PRIV_EXPORT
Privilege constant indicating the document can be exported (downloaded)
See Also:

PRIV_ADD_TO_FOLDER

  1. public static final long PRIV_ADD_TO_FOLDER
Privilege constant on folders indicating that the folder can have items added to it
See Also:

PRIV_REMOVE_FROM_FOLDER

  1. public static final long PRIV_REMOVE_FROM_FOLDER
Privilege constant on a folder indicating that items can be removed from it
See Also:

  1. public static final long PRIV_ADD_LINK
Privilege constant on an item indicating that links can be added to the item
See Also:

  1. public static final long PRIV_REMOVE_LINK
Privilege constant on an item indicating that links can be removed from the item
See Also:

PRIV_ADDNOTES

  1. public static final long PRIV_ADDNOTES
Privilege constant indicating indicating that notes can be added to an item
See Also:

PRIV_PRINTNOTES

  1. public static final long PRIV_PRINTNOTES
Privilege constant indicating that notes can be printed
See Also:

PRIV_PRINTDOC

  1. public static final long PRIV_PRINTDOC
Privilege constant indicating that the document can be printed
See Also:

PRIV_CHECKINOUTDOC

  1. public static final long PRIV_CHECKINOUTDOC
Privilege constant indicating that the document supports checkin and checkout.
See Also:

PRIV_CHECKINDOC

  1. public static final long PRIV_CHECKINDOC
Privilege constant indicating that the document can be checked in.
See Also:

PRIV_CHECKOUTDOC

  1. public static final long PRIV_CHECKOUTDOC
Privilege constant indicating that the document can be checked out.
See Also:

PRIV_CANCELCHECKOUTDOC

  1. public static final long PRIV_CANCELCHECKOUTDOC
Privilege constant indicating that the document checkout can be cancelled.
See Also:

PRIV_VIEWANNOTATIONS

  1. public static final long PRIV_VIEWANNOTATIONS
Privilege constant indicating that annotations can be viewed on the document.
See Also:

PRIV_EDITANNOTATIONS

  1. public static final long PRIV_EDITANNOTATIONS
Privilege constant indicating that annotations can be edited on the document.
See Also:

PRIV_VIEWDOC

  1. public static final long PRIV_VIEWDOC
Privilege constant indicating that the document can be viewed.
See Also:

PRIV_DELETE

  1. public static final long PRIV_DELETE
Privilege constant indicating that the document can be deleted.
See Also:

PRIV_STARTWORKFLOW

  1. public static final long PRIV_STARTWORKFLOW
Privilege constant indicating that the document can be started on workflow.
See Also:

PRIV_HOLD

  1. public static final long PRIV_HOLD
Privilege constant indicating that the document can be put on hold.
See Also:

PRIV_MOVE_TO_FOLDER

  1. public static final long PRIV_MOVE_TO_FOLDER
Privilege constant indicating that the item can be moved from one folder to another.
See Also:

PRIV_CHANGE_CLASS

  1. public static final long PRIV_CHANGE_CLASS
Privilege constant indicating that the content class of the item can be changed.
See Also:

PRIV_MAJOR_VERSION

  1. public static final long PRIV_MAJOR_VERSION
Privilege constant indicating that the document can be major versioned.
See Also:

PRIV_MINOR_VERSION

  1. public static final long PRIV_MINOR_VERSION
Privilege constant indicating that the document can be minor versioned
See Also:

PRIV_DECLARE

  1. public static final long PRIV_DECLARE
Privilege constant indicating that the document can be declared in a record.
See Also:

PRIV_MODIFYNOTES

  1. public static final long PRIV_MODIFYNOTES
Privilege constant indicating that notes can be modified on the document.
See Also:

TYPE_STRING

  1. public static final java.lang.String TYPE_STRING
Data type constant for string
See Also:

TYPE_BOOLEAN

  1. public static final java.lang.String TYPE_BOOLEAN
Data type constant for boolean
See Also:

TYPE_TIMESTAMP

  1. public static final java.lang.String TYPE_TIMESTAMP
Data type constant for date, time, timestamp
See Also:

TYPE_DOUBLE

  1. public static final java.lang.String TYPE_DOUBLE
Data type constant for floating point
See Also:

TYPE_INTEGER

  1. public static final java.lang.String TYPE_INTEGER
Data type constant for integer
See Also:

TYPE_OBJECT

  1. public static final java.lang.String TYPE_OBJECT
Data type constant for a complex object
See Also:

TYPE_BINARY

  1. public static final java.lang.String TYPE_BINARY
Data type constant for binary data
See Also:

TYPE_GUID

  1. public static final java.lang.String TYPE_GUID
Data type constant for an GUID
See Also:

Constructor Detail

JSONResultSetRow

  1. public JSONResultSetRow()
Default constructor. This constructor in public to be available internally and should not normally be used by plug-ins.

JSONResultSetRow

  1. public JSONResultSetRow(java.lang.String id,
  2. java.lang.String name,
  3. java.lang.String mimetype,
  4. long privileges)
Constructor
Parameters:
id - the id of the row. This is an internal identifier used on other requests for the item represented by this row.
name - the name of the item represented by this row. The name is displayed in tree views and other locations to name the item.
mimetype - the MIME content type of the item represented by the row. For non-content items, special values are used for mimetype to indicate the type of the item.
privileges - a bitmapped integer containing the privileges the user has on this item. See the PRIV_ statics for the definition of the different bits.

JSONResultSetRow

  1. public JSONResultSetRow(java.lang.String template,
  2. java.lang.String id,
  3. java.lang.String name,
  4. java.lang.String mimetype,
  5. long privileges)
Constructor
Parameters:
template - the name of the class type for this item.
id - the id of the row. This is an internal identifier used on other requests for the item represented by this row.
name - the name of the item represented by this row. The name is displayed in tree views and other locations to name the item.
mimetype - the MIME content type of the item represented by the row. For non-content items, special values are used for mimetype to indicate the type of the item.
privileges - a bitmapped integer containing the privileges the user has on this item. See the PRIV_ statics for the definition of the different bits.

Method Detail

toJSONResultSetRow

  1. public static final JSONResultSetRow toJSONResultSetRow( JSONObject jsonObject)
This is for compatibility with earlier JSON that did not use this class. It will either return an instance of the argument if it is already a JSONResultSetRow or will construct a JSONResultSetColum from the given JSONObject.
Parameters:
jsonObject -
Returns:

getId

  1. public java.lang.String getId()
Returns the internal identifier for the item represented by this row.

getId

  1. public void getId(java.lang.String id)
Sets the internal identifier for the item represented by this row.

getName

  1. public java.lang.String getName( )
Returns the name of the item represented by this row. This is the name that will be displayed on tree views and other locations to name the item.

setName

  1. public void setName(java.lang.String name)
Sets the name of the item represented by this row.

getMimetype

  1. public java.lang.String getMimetype( )
Returns the MIME content type of the item represented by the row. For non-content items, special values are used for mimetype to indicate the type of the item.

setMimetype

  1. public void setMimetype(java.lang.String mimetype)
Sets the MIME content type of the item represented by this row.

getPrivileges

  1. public long getPrivileges()
Returns a bitmapped integer containing the privileges the user has on this item. See the PRIV_ statics for the definition of the different bits.

setPrivileges

  1. public void setPrivileges(long privileges)
Sets the bitmapped integer containing the privileges the user has on this item.

addAttribute

  1. public void addAttribute(java.lang.String id,
  2. java.lang.Object value,
  3. java.lang.String type,
  4. java.lang.String format,
  5. java.lang.String displayValue)
Adds an attribute to the row. An attribute corresponds to a cell in the details view of the content list.
Parameters:
id - the identifier of the attribute. This should match the identifier of a result set column to appear in the content list details view.
value - the value of the attribute. This is usually a String but Integer and Boolean are also used for appropriate data types.
type - the type of the attribute. Use the TYPE_ static strings defined in this class for the proper syntax of the type for different data types. These strings are based on XML data type descriptors.
format - the format of the attribute. This is interpreted differently depending on the type. For timestamp types this is an dojo date formatter. Look at the implementation of ecm.model.ValueFormatter for how the format is interpreted. If no format is needed specify null.
displayValue - a string describing how the value should be displayed. This overrides any formatting that would normally occur for the value and it will be displayed using this string. If no overriding display value is needed specify null.

getAttributeCount

  1. public int getAttributeCount()
Returns the number of attributes on the row.

getAttributeValue

  1. public java.lang.Object getAttributeValue( java.lang.String id)
Returns the value of an attribute given the attribute id.
Parameters:
id - the identifier of the attribute.
Returns:
an object, typically a String but may be a Boolean or Integer, containing the value, or null if no value is defined for the attribute or the attribute does not exist.

setAttributeValue

  1. public void setAttributeValue(java.lang.String id,
  2. java.lang.Object value)
Sets the value of an attribute. This will add the attribute if it does not exist on the row.
Parameters:
id - the attribute id
value - an object containing the value of the attribute. This is typically a String but may be Boolean or Integer for boolean and integer data types.

getAttributeType

  1. public java.lang.String getAttributeType( java.lang.String id)
Returns the type of an attribute given the attribute id.
Parameters:
id - the identifier of the attribute.
Returns:
the type of the attribute, one of the TYPE_ constants, or null if the attribute does not have a defined type.

setAttributeType

  1. public void setAttributeType(java.lang.String id,
  2. java.lang.String type)
Sets the type of an attribute. This will add the attribute if it does not exist on the row.
Parameters:
id - the attribute id
type - an string, one of the TYPE_ constants, containing the type of the attribute.

getAttributeFormat

  1. public java.lang.String getAttributeFormat( java.lang.String id)
Returns the format of an attribute given the attribute id.
Parameters:
id - the identifier of the attribute.
Returns:
the format of the attribute or null if the attribute uses default formatting.

setAttributeFormat

  1. public void setAttributeFormat( java.lang.String id,
  2. java.lang.String format)
Sets the format of an attribute. This will add the attribute if it does not exist on the row.
Parameters:
id - the attribute id
format - a format string or null for default formatting.

getAttributeDisplayValue

  1. public java.lang.String getAttributeDisplayValue( java.lang.String id)
Returns the display value of an attribute given the attribute id.
Parameters:
id - the identifier of the attribute.
Returns:
the display value of the attribute or null if the attribute does not have a defined display value, in which case the display value will be determined from formatting the value (which is normally the case).

setAttributeDisplayValue

  1. public void setAttributeDisplayValue( java.lang.String id,
  2. java.lang.String displayValue)
Sets the display value of an attribute. This will add the attribute if it does not exist on the row.
Parameters:
id - the attribute id