com.ibm.ecm.json
Class JSONResultSetResponse
- java.lang.Object
- java.util.AbstractMap<K,V>
- java.util.HashMap
- com.ibm.json.java.JSONObject
- com.ibm.ecm.json.JSONResponse
- com.ibm.ecm.json.JSONResultSetResponse
All implemented interfaces:
JSONArtifact, java.io.Serializable, java.lang.Cloneable, java.util.Map
- public class JSONResultSetResponse
- extends JSONResponse
There are two ways to use this class:
- 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. - 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.
Since:
2.0.2
See Also:
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 |
---|---|
|
addColumn(JSONResultSetColumn column)
Adds a new column to the result set.
|
|
addMagazineColumn(JSONResultSetColumn column)
Adds a column to the result set for magazine view.
|
|
addRow(JSONResultSetRow row)
Adds a new row to the result set.
|
getColumn(int i)
Returns a specific column in the result set.
|
|
|
getColumnCount()
Returns a the number of columns in the result set.
|
|
getContinuationData()
Returns the continuation data.
|
getMagazineColum(int i)
Returns a magazine view column.
|
|
|
getMagazineColumnCount()
Returns the count of the number of magazine view columns.
|
|
getPageSize()
Returns the page size
|
getRow(int i)
Returns a specific row in the result set.
|
|
|
getRowCount()
Returns the number of rows in the result set.
|
|
setContinuationData(java.lang.String continuationData)
Sets continuation data.
|
|
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
- public JSONResultSetResponse()
Constructs the result set response JSON.
Method Detail
addColumn
- 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
- public int getColumnCount()
Returns a the number of columns in the result set.
getColumn
- 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
- 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
- public int getMagazineColumnCount( )
Returns the count of the number of magazine view columns.
getMagazineColum
- 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
- 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
- public int getRowCount()
Returns the number of rows in the result set.
getRow
- 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
- 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
- public int getPageSize()
Returns the page size
setContinuationData
- 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
- public java.lang.String getContinuationData( )
Returns the continuation data.