@Name(value="smartNXQLQueryActions") @Scope(value=CONVERSATION) public class SmartNXQLQueryActions extends Object implements Serializable
IncrementalSmartNXQLQuery
instance created
for a given existing query string.
Also handles undo/redo actions and all ajax interactions for an incremental query build page.
Modifier and Type | Field and Description |
---|---|
static int |
HISTORY_CAPACITY |
Constructor and Description |
---|
SmartNXQLQueryActions() |
Modifier and Type | Method and Description |
---|---|
void |
buildQueryPart(ActionEvent event)
Updates the query part, asking the
currentSmartQuery to build
the new resulting query. |
void |
clearQueryPart(ActionEvent event)
Sets the query part to an empty value.
|
boolean |
getCanRedoQueryPartChanges() |
boolean |
getCanUndoQueryPartChanges() |
SmartQuery |
getCurrentSmartQuery() |
String |
getQueryPart() |
List<SortInfo> |
getSearchSortInfos() |
List<String> |
getSelectedLayoutColumns() |
void |
initCurrentSmartQuery(String existingQueryPart)
Creates a new
currentSmartQuery instance. |
void |
initCurrentSmartQuery(String existingQueryPart,
boolean resetHistory) |
boolean |
isAjaxRequest()
Returns true if current request is an ajax request.
|
void |
queryPartChanged(ActionEvent event)
Updates the current
currentSmartQuery instance according to
changes on the existing query part. |
void |
redoQueryPartChanges(ActionEvent event) |
void |
resetSelectedLayoutColumns() |
void |
setQueryPart(String queryPart) |
void |
setSearchSortInfos(List<SortInfo> searchSortInfos) |
void |
setSelectedLayoutColumns(List<String> selectedLayoutColumns) |
void |
undoHistoryChanges(ActionEvent event,
HistoryList<String> history,
HistoryList<String> redoHistory) |
void |
undoQueryPartChanges(ActionEvent event) |
void |
validateQueryPart(FacesContext context,
UIComponent component,
Object value)
Validates the query part: throws a
ValidatorException if query
is not a String, or if IncrementalSmartNXQLQuery.isValid(String)
returns false. |
public static final int HISTORY_CAPACITY
public String getQueryPart()
public void setQueryPart(String queryPart)
public void resetSelectedLayoutColumns()
public void initCurrentSmartQuery(String existingQueryPart, boolean resetHistory)
public void initCurrentSmartQuery(String existingQueryPart)
currentSmartQuery
instance.
This method is supposed to be called once when loading a new page: it will initialize the smart query object according to the current existing qury part.
It should not be called when there are validation errors happening on the page, otherwise the new query part may be discarded.
public SmartQuery getCurrentSmartQuery()
public void queryPartChanged(ActionEvent event) throws ClientException
currentSmartQuery
instance according to
changes on the existing query part.
if request parameters updateQueryPart
is true, the field
queryPart
will also be edited.
ClientException
public void buildQueryPart(ActionEvent event) throws ClientException
currentSmartQuery
to build
the new resulting query.ClientException
#setQueryPart(ActionEvent, String)
public void clearQueryPart(ActionEvent event) throws ClientException
ClientException
#setQueryPart(ActionEvent, String)
public boolean getCanUndoQueryPartChanges()
public boolean getCanRedoQueryPartChanges()
public void undoHistoryChanges(ActionEvent event, HistoryList<String> history, HistoryList<String> redoHistory) throws ClientException
ClientException
public void undoQueryPartChanges(ActionEvent event) throws ClientException
ClientException
public void redoQueryPartChanges(ActionEvent event) throws ClientException
ClientException
public void validateQueryPart(FacesContext context, UIComponent component, Object value)
ValidatorException
if query
is not a String, or if IncrementalSmartNXQLQuery.isValid(String)
returns false.public boolean isAjaxRequest()
Useful when some component should be required only when the global form is submitted, and not when ajax calls are performed.
Copyright © 2011 Nuxeo SA. All Rights Reserved.