com.ibm.ecm.json

Class JSONResultSetResponse

  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.JSONResponse
  6. extended bycom.ibm.ecm.json.JSONResultSetResponse
All implemented interfaces:
JSONArtifact, java.io.Serializable, java.lang.Cloneable, java.util.Map

  1. public class JSONResultSetResponse
  2. extends JSONResponse
This class structures the JSON used to represent a result set response. These responses are returned for searches, folder contents, worklists, and other requests that return a list of content or work items.

There are two ways to use this class:

  1. In plug-in response filters for search, openFolder and other responses that return a result set. This class is actually the JSONObject passed to the response filter, so it can be immediately cast, as in:
     JSONResultSetResponse jsonResultSetResponse = (JSONResultSetResponse) jsonResponse;
     
    The result set can then be manipulated in a variety of ways before being returned. See the sample plug-in's SamplePluginResponseFilter for an example of using it in this way.
  2. In a plug-in service, to format the response JSON appropriately so that it can be parsed by ecm.model.ResultSet and used within the ecm.widget.ContentList.
Note: Although JSONObject.get can be used to access columns and rows fields of the JSON, they may not be instances of JSONResultSetColumn or JSONResultSetRow, as this class acts as a facade on existing JSON structures that are not built using instances of these classes. Therefore, use getResultSetColumn and getResultSetRow to obtain instances of JSONResultSetColumn and JSONResultSetRow for columns and rows of the result set.
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>

Constructor Summary

Constructor and Description
JSONResultSetResponse()
Constructs the result set response JSON.

Method Summary

Modifier and Type Method and Description
  1. void
addColumn(JSONResultSetColumn column)
Adds a new column to the result set.
  1. void
addMagazineColumn(JSONResultSetColumn column)
Adds a column to the result set for magazine view.
  1. void
addRow(JSONResultSetRow row)
Adds a new row to the result set.
  1. JSONResultSetColumn
getColumn(int i)
Returns a specific column in the result set.
  1. int
getColumnCount()
Returns a the number of columns in the result set.
  1. java.lang.String
getContinuationData()
Returns the continuation data.
  1. JSONResultSetColumn
getMagazineColum(int i)
Returns a magazine view column.
  1. int
getMagazineColumnCount()
Returns the count of the number of magazine view columns.
  1. int
getPageSize()
Returns the page size
  1. JSONResultSetRow
getRow(int i)
Returns a specific row in the result set.
  1. int
getRowCount()
Returns the number of rows in the result set.
  1. void
setContinuationData(java.lang.String continuationData)
Sets continuation data.
  1. void
setPageSize(int pageSize)
Sets the page size.
Methods inherited from class com.ibm.ecm.json.JSONResponse
addErrorMessage, addInfoMessage, addWarningMessage, hasErrors
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

Constructor Detail

JSONResultSetResponse

  1. public JSONResultSetResponse()
Constructs the result set response JSON.

Method Detail

addColumn

  1. public void addColumn(JSONResultSetColumn column)
Adds a new column to the result set. This column will appear in the details view on the content list.
Parameters:
column - an instance of JSONResultSetColumn describing the new column.

getColumnCount

  1. public int getColumnCount()
Returns a the number of columns in the result set.

getColumn

  1. public JSONResultSetColumn getColumn( int i)
Returns a specific column in the result set.

Note: The original JSONObject for the column may be replaced (with JSONResultSetColumn) after using this method.

Parameters:
i - the index of the column.
Returns:
an instance of JSONResultSetColumn describing the column.

addMagazineColumn

  1. public void addMagazineColumn(JSONResultSetColumn column)
Adds a column to the result set for magazine view. There are typically only two columns in the magazine view: the first is for the thumbnail, the second is for the content.
Parameters:
column - an instance of JSONResultSetMagazineColumn

getMagazineColumnCount

  1. public int getMagazineColumnCount( )
Returns the count of the number of magazine view columns.

getMagazineColum

  1. public JSONResultSetColumn getMagazineColum( int i)
Returns a magazine view column. There are typically two columns: the first is for the thumbnail, the second is for the content.

Note: The original JSONObject for the column may be replaced (with JSONResultSetColumn) after using this method.

Parameters:
i - the index of the column.
Returns:
an instance of JSONResultSetColumn describing the magazine view column.

addRow

  1. public void addRow(JSONResultSetRow row)
Adds a new row to the result set. This will appear as a new row in the details view and item in other views of the content list.
Parameters:
row - and instance of JSONResultSetRow for the new row.

getRowCount

  1. public int getRowCount()
Returns the number of rows in the result set.

getRow

  1. public JSONResultSetRow getRow( int i)
Returns a specific row in the result set.

Note: The original JSONObject for the row may be replaced (with JSONResultSetRow) after using this method.

Parameters:
i - the index of the row.
Returns:
an instance of JSONResultSetRow describing the row.

setPageSize

  1. public void setPageSize(int pageSize)
Sets the page size. This size is used with continuation requests to inform the continuation request of the number of items that should be returned. A plug-in response filter should not normally change this value.
Parameters:
pageSize -

getPageSize

  1. public int getPageSize()
Returns the page size

setContinuationData

  1. public void setContinuationData( java.lang.String continuationData)
Sets continuation data. Continuation data allows for additional requests for more results of a large result set. Plug-in response filters should normally not modify this information.
Parameters:
continuationData -

getContinuationData

  1. public java.lang.String getContinuationData( )
Returns the continuation data.