|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.swing.calculator.modelutils.WorkSetUtils
public class WorkSetUtils
Work set utilities.
Constructor Summary | |
---|---|
protected |
WorkSetUtils()
Don't allow instantiation but do allow overrides. |
Method Summary | |
---|---|
static WorkSet |
addWorkSet(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
java.lang.String query,
java.util.Collection workParts)
Add a new work set with specified work parts. |
static WorkSet |
addWorkSet(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
java.lang.String query,
WorkPart[] workParts)
Add a new work set with specified work parts. |
static boolean |
containsOnlyWorks(WorkSet workSet)
Determine if work set contains only works. |
static boolean |
deleteWorkSet(java.lang.String title)
Delete a work set by title. |
static boolean |
deleteWorkSet(WorkSet workSet)
Delete a work set. |
static boolean |
deleteWorkSets(WorkSet[] workSets)
Delete multiple work sets. |
static WorkPart[] |
getWorkParts(WorkSet workSet)
Get work parts in a work set as an array. |
static Work[] |
getWorks(WorkSet workSet)
Get works in a work set as an array. |
static WorkSet |
getWorkSet(java.lang.String title)
Get a work set by title. |
static WorkSet |
getWorkSet(java.lang.String title,
java.lang.String owner)
Get a work set by title. |
static WorkSet[] |
getWorkSets()
Get all available public work sets as an array. |
static WorkSet[] |
getWorkSets(java.lang.String owner)
Get all available work sets for a specified owner as an array. |
static int |
getWorkSetsCount()
Get count of all available work sets. |
static int |
getWorkSetsCount(java.lang.String owner)
Get count of work sets for specified user. |
static WorkSet[] |
getWorkSetsForLoggedInUser()
Get work sets for logged in user as an array. |
static Work[] |
getWorksOnly(WorkSet workSet)
Get work parts in work set that are works as an array. |
static WorkSet |
importFromDOMDocument(org.w3c.dom.Node workSetNode)
Import a specified work set from a DOM document. |
static WorkSet[] |
importWorkSets(org.w3c.dom.Document importDocument)
Import one or more work sets from XML file. |
static WorkSet |
saveWorkSet(javax.swing.JFrame parentWindow,
WorkPartGetter workPartGetter)
Display dialog for creating/updating a work set. |
protected static WorkSet[] |
udosToWorkSets(UserDataObject[] udos)
Copy UserDataObject array to WorkSet array. |
static boolean |
updateWorkSet(WorkSet workSet,
java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
java.util.Collection workParts)
Update a work set. |
static boolean |
updateWorkSet(WorkSet workSet,
java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
boolean isPublic,
WorkPart[] workParts)
Update a work set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected WorkSetUtils()
Method Detail |
---|
protected static WorkSet[] udosToWorkSets(UserDataObject[] udos)
udos
- Array of user data objects, all actually
WorkSet objects.
public static WorkSet addWorkSet(java.lang.String title, java.lang.String description, java.lang.String webPageURL, boolean isPublic, java.lang.String query, WorkPart[] workParts) throws DuplicateWorkSetException, BadOwnerException
title
- Title for the new work set.description
- Description for the new work set.webPageURL
- Web page URL for the new work set.isPublic
- True if work set to be public.query
- CQL query which generates work set.workParts
- Array of WorkPart entries to add to work set.
DuplicateWorkSetException
- if (title,owner)
combination already exists.
BadOwnerException
- if the owner is null or empty. public static WorkSet addWorkSet(java.lang.String title, java.lang.String description, java.lang.String webPageURL, boolean isPublic, java.lang.String query, java.util.Collection workParts) throws DuplicateWorkSetException, BadOwnerException
title
- Title for the new work set.description
- Description for the new work set.webPageURL
- Web page URL for the new work set.isPublic
- True if work set to be public.query
- CQL query which generates work set.workParts
- Collection of WorkPart entries to add to work set.
DuplicateWorkSetException
- if (title,owner)
combination already exists.
BadOwnerException
- if the owner is null or empty. public static boolean deleteWorkSet(WorkSet workSet)
workSet
- The work set to delete.
The currently logged in user must be the owner to delete a work set.
public static boolean deleteWorkSet(java.lang.String title)
title
- The title of the work set to delete.
public static boolean deleteWorkSets(WorkSet[] workSets)
workSets
- The work sets to delete.
public static WorkSet getWorkSet(java.lang.String title, java.lang.String owner)
owner
- The owner for the work set to fetch.title
- The title of the work set to fetch.
If the owner is not the same as the currently logged in user, the work set will only be returned if it is public.
public static WorkSet getWorkSet(java.lang.String title)
title
- The title of the work set to fetch.
Only public work sets are returned.
public static WorkSet[] getWorkSets()
If the user is logged in, any private work sets belonging to the logged in are also returned.
public static WorkSet[] getWorkSets(java.lang.String owner)
owner
- The owner.
public static WorkSet[] getWorkSetsForLoggedInUser()
public static int getWorkSetsCount(java.lang.String owner)
public static int getWorkSetsCount()
public static WorkPart[] getWorkParts(WorkSet workSet)
workSet
- The work set.
Returns null if work set is null.
public static Work[] getWorks(WorkSet workSet)
workSet
- The work set.
Returns null if work set is null.
public static Work[] getWorksOnly(WorkSet workSet)
workSet
- The work set.
Returns null if work set is null.
public static boolean containsOnlyWorks(WorkSet workSet)
workSet
- The work set.
Returns false if work set is null.
public static boolean updateWorkSet(WorkSet workSet, java.lang.String title, java.lang.String description, java.lang.String webPageURL, boolean isPublic, WorkPart[] workParts) throws BadOwnerException, DuplicateWorkSetException
workSet
- The work set to update.title
- Title for the work set.description
- Description for the work set.isPublic
- True if work set is public.workParts
- Array of WorkPart entries for work set.
BadOwnerException
- if user is not logged in or
is not the work set owner .
DuplicateWorkSetException
- if new (title,owner)
combination already exists. public static boolean updateWorkSet(WorkSet workSet, java.lang.String title, java.lang.String description, java.lang.String webPageURL, boolean isPublic, java.util.Collection workParts) throws BadOwnerException, DuplicateWorkSetException
workSet
- The work set to update.title
- Title for the work set.description
- Description for the work set.isPublic
- True if work set is public.workParts
- Collection of WorkPart entries for work set.
BadOwnerException
- if user is not logged in or
is not the work set owner .
DuplicateWorkSetException
- if new (title,owner)
combination already exists. public static WorkSet importFromDOMDocument(org.w3c.dom.Node workSetNode) throws BadOwnerException
workSetNode
- The DOM node which is the root of the
work set to import.
BadOwnerException
- if the user is not logged in. public static WorkSet[] importWorkSets(org.w3c.dom.Document importDocument)
importDocument
- The DOM document containing the work sets to import.
BadOwnerException
- if the user is not logged in.
Note: The work sets are not persisted here. That is the responsibility of the caller.
public static WorkSet saveWorkSet(javax.swing.JFrame parentWindow, WorkPartGetter workPartGetter) throws java.lang.Exception
parentWindow
- Parent window for dialog.workPartGetter
- WorkPartGetter to retrieve list of
work parts to add to work set.
java.lang.Exception
- if something went wrong.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |