public abstract class QueryModel extends Object
A user can perform various operations on saved searches while interacting with a query component. These actions include creating, deleting, duplicating, selecting, resetting and updating a saved search.
The above actions result in a QueryDescriptor
object to be created, deleted, duplicated, updated, reset or retrieved. The methods that perform the above actions are typically called during the 'Invoke Application' phase of the JSF lifecycle.
Constructor and Description |
---|
QueryModel() |
Modifier and Type | Method and Description |
---|---|
abstract QueryDescriptor |
create(String name, QueryDescriptor qdBase)
Creates or retrieves a QueryDescriptor with the specified name.
|
abstract void |
delete(QueryDescriptor qd)
Removes the specified QueryDescriptor.
|
List<AttributeDescriptor> |
getAttributes()
Deprecated.
- Please use getDescriptors() API to retrieve the tree structure of Attributes and Attribute Groups.
|
List<GroupAttributeDescriptor> |
getCriteriaGroups()
Returns a list of Attribute Groups (GroupAttributeDescritpor Objects) available
|
List<? extends Descriptor> |
getDescriptors()
Returns the list of Descriptor objects that represent Attributes and Attribute Groups.
|
abstract List<QueryDescriptor> |
getSystemQueries()
Returns the list of QueryDescriptor objects that are 'system saved searches'.
|
abstract List<QueryDescriptor> |
getUserQueries()
Returns the list of QueryDescriptor objects that are 'user saved searches'.
|
abstract void |
reset(QueryDescriptor qd)
Resets the QueryDescriptor to its last saved state.
|
abstract void |
setCurrentDescriptor(QueryDescriptor qd)
Sets the current descriptor on the QueryModel.
|
abstract void |
update(QueryDescriptor qd, Map<String,Object> uiHints)
Updates the QueryDescriptor using the changed UIHint values.
|
public abstract QueryDescriptor create(String name, QueryDescriptor qdBase)
The query component registers an internal listener for the QueryOperationEvent and invokes this method. NOTE: For more information regarding the event and its contents refer to QueryOperationEvent
.
name
- unique name to use for the (about to be) cloned QueryDescriptor or the name of an existing QueryDescriptor if retrieving an existing one.qdBase
- QueryDescriptor that is used to clone the new one or null (when retrieving an existing one).public abstract void delete(QueryDescriptor qd)
This method in the 'Invoke Application' phase of the JSF lifecycle.
The query component registers an internal listener for the QueryOperationEvent and invokes this method. NOTE: For more information regarding the event and its contents refer to QueryOperationEvent
.
qd
- QueryDescriptor instance to be deletedQueryDescriptor
@Deprecated public List<AttributeDescriptor> getAttributes()
AttributeDescriptor
public List<? extends Descriptor> getDescriptors()
AttributeDescriptor
, GroupAttributeDescriptor
public List<GroupAttributeDescriptor> getCriteriaGroups()
public abstract List<QueryDescriptor> getSystemQueries()
public abstract List<QueryDescriptor> getUserQueries()
public abstract void reset(QueryDescriptor qd)
This method is invoked during the 'Invoke Application' phase of the JSF lifecyle. Subclasses can override this method to reset the QueryDescriptor to its original state.
qd
- QueryDescriptor to be restored to its last saved state.public abstract void setCurrentDescriptor(QueryDescriptor qd)
qd
- the QueryDescriptor that will be the current descriptor.public abstract void update(QueryDescriptor qd, Map<String,Object> uiHints)
This method is called when the user personalizes a saved search by changing its name or its UI hints. This method is invoked during the 'Invoke Application' phase of the JSF lifecyle. The query component registers an internal listener for the QueryOperationEvent and invokes this method. NOTE: For more information regarding the event and its contents refer to QueryOperationEvent
.
qd
- QueryDescriptor object to updateduiHints
- Map of uiHints that contain the changed values.QueryDescriptor