Interface QueryDao
-
- All Known Implementing Classes:
JcrQueryDao
public interface QueryDao
Provider for connections and queries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,String>
addQuery(String siteName, Map<String,Object> parameters)
Adds a query.String
addQuery(String siteName, Query query)
Add a query and set its id.Map<String,String>
deleteQuery(String siteName, String id)
Deletes a query.Map<String,Query>
getDataSourceQueries(String siteName, String dataSourceId)
Get all the queries of a site.Map<String,Query>
getDataSourceQueries(String siteName, String dataSourceId, DataSourceClientInteraction.DataSourceType dataSourceType, Query.ResultType resultType)
Get all the queries of a site of a specific result typeMap<String,Query>
getDataSourceQueries(String siteName, String dataSourceId, Query.ResultType resultType)
Get all the queries of a site of a specific result typeMap<String,Query>
getQueries(String siteName)
Get all the queries of a site.Map<String,Query>
getQueries(String siteName, DataSourceClientInteraction.DataSourceType type)
Get all the queries of a site.Query
getQuery(String siteName, String id)
Get a query from its id.Map<String,Object>
getQueryProperties(String id, String siteName)
Get the query properties.void
removeQuery(String siteName, String id)
Remove a query.Map<String,String>
updateQuery(String siteName, Map<String,Object> parameters)
Updates a query.void
updateQuery(String siteName, Query query)
Update a query.
-
-
-
Method Detail
-
getQueries
Map<String,Query> getQueries(String siteName) throws DataInclusionException
Get all the queries of a site.- Parameters:
siteName
- the site name.- Returns:
- the queries as a Map.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
getQueries
Map<String,Query> getQueries(String siteName, DataSourceClientInteraction.DataSourceType type) throws DataInclusionException
Get all the queries of a site.- Parameters:
siteName
- the site name.type
- the query type- Returns:
- the queries as a Map.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
getDataSourceQueries
Map<String,Query> getDataSourceQueries(String siteName, String dataSourceId) throws DataInclusionException
Get all the queries of a site.- Parameters:
siteName
- the site name.dataSourceId
- the id of the data source- Returns:
- the queries as a Map.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
getDataSourceQueries
Map<String,Query> getDataSourceQueries(String siteName, String dataSourceId, Query.ResultType resultType) throws DataInclusionException
Get all the queries of a site of a specific result type- Parameters:
siteName
- the site name.dataSourceId
- the id of the data sourceresultType
- Filter on result type- Returns:
- the queries as a Map.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
getDataSourceQueries
Map<String,Query> getDataSourceQueries(String siteName, String dataSourceId, DataSourceClientInteraction.DataSourceType dataSourceType, Query.ResultType resultType) throws DataInclusionException
Get all the queries of a site of a specific result type- Parameters:
siteName
- the site name.dataSourceId
- the id of the data sourcedataSourceType
- the query typeresultType
- Filter on result type- Returns:
- the queries as a Map.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
getQuery
Query getQuery(String siteName, String id) throws DataInclusionException
Get a query from its id.- Parameters:
siteName
- the site name.id
- the query id.- Returns:
- the Query.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
getQueryProperties
Map<String,Object> getQueryProperties(String id, String siteName) throws DataInclusionException
Get the query properties.- Parameters:
id
- The query idsiteName
- The site name- Returns:
- The properties of the query in a result map.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
addQuery
Map<String,String> addQuery(String siteName, Map<String,Object> parameters) throws Exception
Adds a query.- Parameters:
siteName
- The site nameparameters
- The params needed to create the query- Returns:
- The id of the created query,its parent id and its type, or an error
- Throws:
Exception
- if an error occurs when adding the query
-
updateQuery
Map<String,String> updateQuery(String siteName, Map<String,Object> parameters) throws Exception
Updates a query.- Parameters:
siteName
- The site nameparameters
- The params needed to update the query- Returns:
- The id of the updated query and its type, or an error
- Throws:
Exception
- if an error occurs when updating the query
-
deleteQuery
Map<String,String> deleteQuery(String siteName, String id) throws Exception
Deletes a query.- Parameters:
siteName
- the site nameid
- The id of the query to delete- Returns:
- The id of the deleted query, or an error
- Throws:
Exception
- if an error occurs when deleting the query
-
addQuery
String addQuery(String siteName, Query query) throws DataInclusionException
Add a query and set its id.- Parameters:
siteName
- the site namequery
- the query to add. The id member doesn't need to be specified.- Returns:
- id of the newly created data source.
- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
updateQuery
void updateQuery(String siteName, Query query) throws DataInclusionException
Update a query. Update the query specified by its id member with all the data.- Parameters:
siteName
- the site namequery
- the query to update.- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
removeQuery
void removeQuery(String siteName, String id) throws DataInclusionException
Remove a query.- Parameters:
siteName
- the site nameid
- the query id.- Throws:
DataInclusionException
- if an error occurs while manipulating the data sources
-
-