info.magnolia.cms.gui.controlx.search
Class RepositorySearchListModel

java.lang.Object
  extended by info.magnolia.cms.gui.controlx.list.AbstractListModel
      extended by info.magnolia.cms.gui.controlx.search.AbstractSearchableListModel
          extended by info.magnolia.cms.gui.controlx.search.RepositorySearchListModel
All Implemented Interfaces:
ListModel, SearchableListModel

public class RepositorySearchListModel
extends AbstractSearchableListModel

Author:
Sameer Charles $Id:RepositorySearchListModel.java 2544 2006-04-04 12:47:32Z philipp $

Nested Class Summary
 
Nested classes/interfaces inherited from class info.magnolia.cms.gui.controlx.list.AbstractListModel
AbstractListModel.ListComparator
 
Field Summary
protected  SearchQuery query
          search query to be used by sub implementation
 
Fields inherited from class info.magnolia.cms.gui.controlx.list.AbstractListModel
ASCENDING, DESCENDING, groupBy, groupByOrder, sortBy, sortByOrder
 
Constructor Summary
RepositorySearchListModel(String repositoryId)
          default constructor
 
Method Summary
protected  String buildQuery()
          Returns the jcr query statement used by the model.
 String getNodeType()
          get select node type, query will be executed only on these if set
 SearchQuery getQuery()
          get query
protected  QueryBuilder getQueryBuilder()
           
 String getRepositoryId()
          get repository Id
protected  Collection getResult()
          Creates the jcr query and executes it.
protected  Collection getResult(QueryResult result)
          Gets the items from the query (possibility to post filter)
protected  QueryResult getResult(String statement)
          Executes the query statement and returns the QueryResult.
 String getResultNodeType()
           
 String getSearchPath()
          get jcr path, under which search will be executed
 String getWorkspaceId()
          get workspace Id
protected  String resolveId(int index, Object value)
          Returns the uuid of the node
 void setNodeType(String selectNodeType)
          set select node type value, query will be executed only on these if set
 void setQuery(SearchQuery query)
          set Query
 void setRepositoryId(String repositoryId)
          set repository id
 void setResultNodeType(String resultNodeType)
           
 void setSearchPath(String searchPath)
          set jcr path, under which search will be executed
 void setWorkspaceId(String workspaceId)
          set workspace Id
 
Methods inherited from class info.magnolia.cms.gui.controlx.list.AbstractListModel
createIterator, doSort, getGroupBy, getGroupByOrder, getListModelIterator, getSortBy, getSortByOrder, getValueProvider, iterator, newComparator, setGroupBy, setGroupBy, setSortBy, setSortBy, setValueProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.cms.gui.controlx.list.ListModel
getGroupBy, getGroupByOrder, getListModelIterator, getSortBy, getSortByOrder, iterator, setGroupBy, setGroupBy, setSortBy, setSortBy
 

Field Detail

query

protected SearchQuery query
search query to be used by sub implementation

Constructor Detail

RepositorySearchListModel

public RepositorySearchListModel(String repositoryId)
default constructor

Method Detail

buildQuery

protected String buildQuery()
Returns the jcr query statement used by the model.


getQueryBuilder

protected QueryBuilder getQueryBuilder()

getResult

protected QueryResult getResult(String statement)
                         throws javax.jcr.query.InvalidQueryException,
                                javax.jcr.RepositoryException
Executes the query statement and returns the QueryResult.

Throws:
javax.jcr.query.InvalidQueryException
javax.jcr.RepositoryException

getResult

protected Collection getResult()
                        throws Exception
Creates the jcr query and executes it.

Specified by:
getResult in class AbstractListModel
Returns:
the collection of the items passed to the iterator
Throws:
Exception

getResult

protected Collection getResult(QueryResult result)
Gets the items from the query (possibility to post filter)


resolveId

protected String resolveId(int index,
                           Object value)
Returns the uuid of the node

Overrides:
resolveId in class AbstractListModel

getRepositoryId

public String getRepositoryId()
get repository Id

Returns:
repository id

setRepositoryId

public void setRepositoryId(String repositoryId)
set repository id

Parameters:
repositoryId -

getWorkspaceId

public String getWorkspaceId()
get workspace Id

Returns:
workspace id

setWorkspaceId

public void setWorkspaceId(String workspaceId)
set workspace Id

Parameters:
workspaceId -

getNodeType

public String getNodeType()
get select node type, query will be executed only on these if set

Returns:
nodeType name

setNodeType

public void setNodeType(String selectNodeType)
set select node type value, query will be executed only on these if set

Parameters:
nodeType -

getSearchPath

public String getSearchPath()
get jcr path, under which search will be executed

Returns:
path

setSearchPath

public void setSearchPath(String searchPath)
set jcr path, under which search will be executed

Parameters:
searchPath -

setQuery

public void setQuery(SearchQuery query)
set Query

Specified by:
setQuery in interface SearchableListModel
Overrides:
setQuery in class AbstractSearchableListModel
Parameters:
query -

getQuery

public SearchQuery getQuery()
get query

Specified by:
getQuery in interface SearchableListModel
Overrides:
getQuery in class AbstractSearchableListModel
Returns:
query

setResultNodeType

public void setResultNodeType(String resultNodeType)

getResultNodeType

public String getResultNodeType()


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.