Class ecm.model.ResultSet


Extends ecm.model._ModelObject.
Represents a set of search results, folder contents, or other items that are returned by a query to the content server. A ResultSet object contains data about the items found by the query and about how these items are to be displayed.

To iterate through the items in a ResultSet object efficiently, use the getStore method with a widget that supports Dojo datastores.


Defined in: <ecm\model\ResultSet.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
ecm.model.ResultSet(properties)
Constructs a result set.

Field Summary

Field Attributes Field Name and Description
 
An array holding the column property names.
 
A string value holding the cursor information if the result set is being paged.
 
An optional create item function that if defined will be called when building items for the result set.
 
A filter type used to limit the result set based on a certain type.
 
An optional get action menu type for items function that if defined will be called when determining which context menu to use for the selected set of items.
 
A boolean value indicating whether this result set has a toolbar.
 
items 
An array of ecm.model.Item objects or derivations of Item.
 
Holds the information on the columns of the result set in a form suitable to create a magazine view in the dojo Gridx structure.
 
A boolean value indicating whether the maxiumum results have been reached.
 
An optional get next page of items function that if defined will be called when paging items in the result set.
 
An integer value holding the default paging size.
 
 
An optional refresh items function that if defined will be called when refreshing items in the result set.
 
 
An optional search items function that if defined will be called when search for items in the result set.
 
 
A string value indicating the type of objects in the result set.
 
The current column sort direction.
 
An optional sort items function that if defined will be called when sorting items in the result set.
 
An integer value holding the sort column index.
 
Holds the information on the columns of the result set in a form suitable for use in the dojo Gridx structure property.
 
A string value holding a teamspace id.
 
Total Count of the result set returned by Content Engine 5.2 or later.
 
Total Count Type: null/none: no total count data for totalCount total: real total count data for totalCount threshold: totalCount is at least data.
Fields borrowed from class ecm.model._ModelObject:
categorization, id, isRecurring, name, nameFilter, pane, status, type, userId

Method Summary

Method Attributes Method Name and Description
 
append(resultSet)
Appends the specified result set items to the current list.
 
buildItems(jsonItemsArray, templates)
Builds the list of items from JSON, will create ecm.model.Item or derivations of Item.
 
deleteItem(item)
Deletes the specified item from the items array
 
doSort(p, afterSort, store)
Sorts the list of items in the result set.
 
Returns a string value holding the context menu type for the list of items.
 
Returns an array of column property names.
 
Returns the array index of the specified item.
 
getItem(index)
Returns a specific ecm.model.Item or derivation of Item at the requested index
 
getItems(handler, itemsNeeded)
Returns an array of ecm.model.Item objects or derivation of Item.
 
Returns an ecm.model._ModelStore object for the list of result set items.
 
Returns a string value for the toolbar type to be loaded based on the parent object of this result set.
 
Returns boolean value true if continuation data has been defined on this result set.
 
isClientSortable(store, sortProperty)
 
isClientSortableAttribute(store, attribute)
 
Returns boolean true if the specified item matches the parent object of this result set.
 
 
loadContextMenu(items, callback)
Loads the context menu actions that are appropriate for the list of items.
 
loadToolbar(callback)
Loads the toolbar for the toolbar definition specified.
 
Fired after the next page of items has been returned from the server.
 
Fired after a entry template sort returns from the server.
 
onServerSort(originalResultSet, sortedResultSet)
Fired after a server sort.
 
Fired after a teamspace sort returns from the server.
 
Fired after a template sort returns from the server.
 
prepend(resultSet)
Prepends the specified result set items to the current list.
 
Reruns the search or re-retrieves the folder content.
 
Clears all items from the result list
 
retrieveNextPage(retrievedCallback, itemsNeeded)
Called to retrieve the next page of items using the continuation data for the result set.
 
search(filterCriteria, callback)
Searches the server by using the input filter criteria.
 
setAttributeMappings(attributeMappings)
Sets attribute mappings that will be used to retrieve mapped attributes in case this result set contains items from multiple repositories.
 
setColumns(columns)
Sets a new set of columns for rendering in details mode.
 
setItem(index, item)
Sets the new item at the provided index for this result set.
Methods borrowed from class ecm.model._ModelObject:
destroy, onChange, own, toString

Constructor Detail

ecm.model.ResultSet(properties)

Constructs a result set.
Parameters:
properties
The properties for the result set. The properties can be any of the public fields as defined below and on ecm.model._ModelObject.

Field Detail

columnNames

An array holding the column property names.

continuationData

A string value holding the cursor information if the result set is being paged.

createHandler

An optional create item function that if defined will be called when building items for the result set. Should be defined as createHandler: function(resultSet, itemJSON).
Since:
2.0.3.5

filterType

A filter type used to limit the result set based on a certain type. It will depend on what types of objects will utilize this filter type.
Since:
2.0.3

getActionsMenuType

An optional get action menu type for items function that if defined will be called when determining which context menu to use for the selected set of items. Should be defined as getActionsMenuType: function(resultSet, items).
Since:
2.0.3.5

hasToolbar

A boolean value indicating whether this result set has a toolbar.

items

An array of ecm.model.Item objects or derivations of Item.

magazineStructure

Holds the information on the columns of the result set in a form suitable to create a magazine view in the dojo Gridx structure.

maxResultsReached

A boolean value indicating whether the maxiumum results have been reached.

nextPageHandler

An optional get next page of items function that if defined will be called when paging items in the result set. Should be defined as nextPageHandler: function(resultSet, itemsNeeded, callback).
Since:
2.0.3.5

pageSize

An integer value holding the default paging size.

parentFolder

A ecm.model.ContentItem object.

refreshHandler

An optional refresh items function that if defined will be called when refreshing items in the result set. Should be defined as refreshHandler: function(resultSet, callback).
Since:
2.0.3.5

repository

A ecm.model.Repository object.

searchHandler

An optional search items function that if defined will be called when search for items in the result set. Should be defined as searchHandler: function(resultSet, filterCriteria, callback).
Since:
2.0.3.5

searchTemplate

A ecm.model.SearchTemplate object.

setType

A string value indicating the type of objects in the result set.

sortDirection

The current column sort direction.

sortHandler

An optional sort items function that if defined will be called when sorting items in the result set. Should be defined as sortHandler: function(resultSet, sortProperty, descending, callback).
Since:
2.0.3.5

sortIndex

An integer value holding the sort column index.

structure

Holds the information on the columns of the result set in a form suitable for use in the dojo Gridx structure property.

teamspaceId

A string value holding a teamspace id.

totalCount

Total Count of the result set returned by Content Engine 5.2 or later. For other repositories, it is invalid.

totalCountType

Total Count Type: null/none: no total count data for totalCount total: real total count data for totalCount threshold: totalCount is at least data.

Method Detail

append(resultSet)

Appends the specified result set items to the current list.
Parameters:
resultSet
A ecm.model.ResultSet object.

buildItems(jsonItemsArray, templates)

Builds the list of items from JSON, will create ecm.model.Item or derivations of Item.
Parameters:
jsonItemsArray
A JSON object holding the list of items to construct.
templates
A JSON object holding the list of templates.

deleteItem(item)

Deletes the specified item from the items array
Parameters:
item
A ecm.model.Item object or derivation of Item.

doSort(p, afterSort, store)

Sorts the list of items in the result set. If all the result set items are in hand, will sort the list on the client, otherwise go back to the server with the continuation data. If the application is configured to use locale-specific sorting (ecm.model.desktop.culturalCollation), the sorting will be done on the server-side only if a searchTemplate or parentFolder is available; otherwise, the setting is ignored and the results are sorted on the client.
Parameters:
p
The column property to sort on.
afterSort
A callback function to call after the sort is completed. A ecm.model.ResultSet is passed as a parameter.
store
A ecm.model._ModelStore object (can be null).

getActionsMenuItemsType(items)

Returns a string value holding the context menu type for the list of items.
Parameters:
items
An array of ecm.model.Item objects or derivations of Item.

getColumns()

Returns an array of column property names.

getIndexOfItem(item)

Returns the array index of the specified item.
Parameters:
item
A ecm.model.Item object or derivation of Item

getItem(index)

Returns a specific ecm.model.Item or derivation of Item at the requested index
Parameters:
index
An integer value holding the index of the item to retrieve.

getItems(handler, itemsNeeded)

Returns an array of ecm.model.Item objects or derivation of Item.
Parameters:
handler
A function to be called to process the items before returning.
itemsNeeded
An integer value holding the number of items requested.

getStore()

Returns an ecm.model._ModelStore object for the list of result set items.

getToolbarDef()

Returns a string value for the toolbar type to be loaded based on the parent object of this result set.

hasContinuation()

Returns boolean value true if continuation data has been defined on this result set.

isClientSortable(store, sortProperty)

Parameters:
store
sortProperty
Since:
2.0.3.3

isClientSortableAttribute(store, attribute)

Parameters:
store
attribute
Since:
2.0.3.3

isResultSetForItem(item)

Returns boolean true if the specified item matches the parent object of this result set.
Parameters:
item
An ecm.model.Item object or derivation of Item.

isServerSortable()

Since:
2.0.3.3

loadContextMenu(items, callback)

Loads the context menu actions that are appropriate for the list of items.
Parameters:
items
An array of ecm.model.Item objects or derivations of Item.
callback
A callback function to be called after the context menu is loaded.

loadToolbar(callback)

Loads the toolbar for the toolbar definition specified.
Parameters:
callback
A callback function called after the toolbar has been loaded.

onNextPageRetrieved(resultSet)

Fired after the next page of items has been returned from the server.
Parameters:
resultSet
Instance of this ecm.model.ResultSet.
Since:
2.0.2

onServerEntryTemplateSort(resultSet)

Fired after a entry template sort returns from the server.
Parameters:
resultSet
Since:
2.0.3

onServerSort(originalResultSet, sortedResultSet)

Fired after a server sort.
Parameters:
originalResultSet
Instance of ecm.model.ResultSet.
sortedResultSet
Instance of ecm.model.ResultSet.
Since:
2.0.3

onServerTeamspaceSort(resultSet)

Fired after a teamspace sort returns from the server.
Parameters:
resultSet
Since:
2.0.2

onServerTemplateSort(resultSet)

Fired after a template sort returns from the server.
Parameters:
resultSet
Since:
2.0.2

prepend(resultSet)

Prepends the specified result set items to the current list.
Parameters:
resultSet
A ecm.model.ResultSet object.
Since:
2.0.3

refresh()

Reruns the search or re-retrieves the folder content.

removeAllItems()

Clears all items from the result list
Since:
2.0.3.6

retrieveNextPage(retrievedCallback, itemsNeeded)

Called to retrieve the next page of items using the continuation data for the result set.
Parameters:
retrievedCallback
A callback function called after the next page of items has been retrieved. Passes an array of ecm.model.Item objects or derivations of Item as a parameter.
itemsNeeded
An integer value indicating the number of items needed.

search(filterCriteria, callback)

Searches the server by using the input filter criteria.
Parameters:
filterCriteria
Object containing the filter criteria.
callback
Optional callback function. The callback returns a ecm.model.ResultSet from the search.
Since:
2.0.3

setAttributeMappings(attributeMappings)

Sets attribute mappings that will be used to retrieve mapped attributes in case this result set contains items from multiple repositories.
Parameters:
attributeMappings
An array of ecm.model.AttributeMapping objects
Since:
2.0.2

setColumns(columns)

Sets a new set of columns for rendering in details mode.
Parameters:
columns
A JSON object holding the column structure configuration.
Since:
2.0.3

setItem(index, item)

Sets the new item at the provided index for this result set.
Parameters:
index
An integer value holding the index of the item to set.
item
A ecm.model.Item object or derivation of Item