|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.northwestern.at.wordhoard.swing.calculator.modelutils.QueryUtils
public class QueryUtils
Query utilities.
| Constructor Summary | |
|---|---|
protected |
QueryUtils()
Don't allow instantiation but do allow overrides. |
| Method Summary | |
|---|---|
static WHQuery |
addQuery(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
int queryType,
java.lang.String queryText)
Add a new query. |
static boolean |
deleteQueries(WHQuery[] queries)
Delete multiple queries. |
static boolean |
deleteQuery(java.lang.String title,
int queryType)
Delete a query by title. |
static boolean |
deleteQuery(WHQuery query)
Delete a query. |
static WHQuery[] |
getQueries(int queryType)
Get all available public queries as an array. |
static WHQuery[] |
getQueries(java.lang.String owner,
int queryType)
Get all available queries for a specified owner as an array. |
static int |
getQueriesCount(java.lang.String owner,
int queryType)
Get count of queries for a user. |
static WHQuery[] |
getQueriesForLoggedInUser(int queryType)
Get all available queries for the logged-in user. |
static WHQuery |
getQuery(java.lang.String title,
int queryType)
Get a query by title. |
static WHQuery |
getQuery(java.lang.String title,
java.lang.String owner)
Get a query by title. |
static WHQuery |
getQuery(java.lang.String title,
java.lang.String owner,
int queryType)
Get a query by title. |
static WHQuery |
getQuery(WHQuery query)
Get a query, loading it to current persistence manager if needed. |
static WHQuery |
importFromDOMDocument(org.w3c.dom.Node queryNode)
Import a specified query by name from a DOM document. |
static WHQuery[] |
importQueries(org.w3c.dom.Document importDocument,
int queryType)
Import one or more queries from XML file. |
static boolean |
isDuplicate(int queryType,
java.lang.String title,
java.lang.String owner,
java.lang.Long id)
Check for a duplicate query. |
protected static WHQuery[] |
udosToQueries(UserDataObject[] udos)
Copy UserDataObject array to WHQuery array. |
static boolean |
updateQuery(WHQuery query,
java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
int queryType,
java.lang.String queryText)
Update a query. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected QueryUtils()
| Method Detail |
|---|
protected static WHQuery[] udosToQueries(UserDataObject[] udos)
udos - Array of user data objects, all actually
WHQuery objects.
public static WHQuery addQuery(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
int queryType,
java.lang.String queryText)
throws DuplicateQueryException,
BadOwnerException
title - Title for the new query.description - Description for the new query.webPageURL - Web page URL for the new query.isPublic - True if query to be public.queryType - The type of query.queryText - The text of the query.
DuplicateQueryException - if
(title,owner,queryType)
combination already exists.
BadOwnerException - if the owner null or empty. public static boolean deleteQuery(WHQuery query)
query - The query to delete.
A query may only be deleted by its owner.
public static boolean deleteQuery(java.lang.String title,
int queryType)
title - The title of the query to delete.queryType - Query type to retrieve.
public static boolean deleteQueries(WHQuery[] queries)
queries - The queries to delete.
public static WHQuery getQuery(java.lang.String title,
java.lang.String owner,
int queryType)
title - The title of the query to fetch.owner - The owner of the query to fetch.queryType - Query type to retrieve.
public static WHQuery getQuery(java.lang.String title,
java.lang.String owner)
title - The title of the query to fetch.owner - The owner of the query to fetch.
public static WHQuery getQuery(java.lang.String title,
int queryType)
title - The title of the query to fetch.queryType - Query type to retrieve.
public static WHQuery getQuery(WHQuery query)
query - The query.
public static WHQuery[] getQueries(int queryType)
queryType - Query type to retrieve.
public static WHQuery[] getQueries(java.lang.String owner,
int queryType)
owner - Owner of queries to retrieve.queryType - Query type to retrieve.
public static WHQuery[] getQueriesForLoggedInUser(int queryType)
queryType - Query type to retrieve.
public static int getQueriesCount(java.lang.String owner,
int queryType)
owner - The owner.
public static boolean isDuplicate(int queryType,
java.lang.String title,
java.lang.String owner,
java.lang.Long id)
queryType - The query type.title - The query title.owner - The query owner.id - The query ID.
public static boolean updateQuery(WHQuery query,
java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
int queryType,
java.lang.String queryText)
throws DuplicateQueryException,
BadOwnerException
query - The query to update.title - Title for the query.description - Description for the query.webPageURL - Web page URL for the query.isPublic - True if query is public.queryType - The type of query.queryText - The text of the query.
DuplicateQueryException
BadOwnerException
public static WHQuery[] importQueries(org.w3c.dom.Document importDocument,
int queryType)
importDocument - The DOM document containing the queries
to import.
Note: The queries are not persisted here. That is the responsibility of the caller.
public static WHQuery importFromDOMDocument(org.w3c.dom.Node queryNode)
throws BadOwnerException
queryNode - The DOM node which is the root of the
query to import.
BadOwnerException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||