edu.northwestern.at.wordhoard.swing.annotations
Class AnnotationUtils

java.lang.Object
  extended by edu.northwestern.at.wordhoard.swing.annotations.AnnotationUtils

public class AnnotationUtils
extends java.lang.Object

Work set utilities.


Constructor Summary
protected AnnotationUtils()
          Don't allow instantiation but do allow overrides.
 
Method Summary
static AuthoredTextAnnotation createAnnotation(AuthoredTextAnnotation annot)
          Create a new annotation.
static boolean deleteAnnotation(AuthoredTextAnnotation annotation)
          Delete a annotation.
static java.util.Collection getAnnotations(java.lang.String annotates)
          Get all annotations associated with a specific item if public or user logged in.
static boolean updateAnnotation(AuthoredTextAnnotation annot, java.lang.String text)
          Update annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationUtils

protected AnnotationUtils()
Don't allow instantiation but do allow overrides.

Method Detail

createAnnotation

public static AuthoredTextAnnotation createAnnotation(AuthoredTextAnnotation annot)
                                               throws BadOwnerException
Create a new annotation.

Parameters:
annot - The annotation.
Returns:
AuthoredTextAnnotation object if created, else null.
Throws:
BadOwnerException - if the owner is null or empty.

updateAnnotation

public static boolean updateAnnotation(AuthoredTextAnnotation annot,
                                       java.lang.String text)
                                throws BadOwnerException
Update annotation.

Returns:
Annotation object
Throws:
BadOwnerException - if the owner is null or empty or not admin.

deleteAnnotation

public static boolean deleteAnnotation(AuthoredTextAnnotation annotation)
Delete a annotation.

Parameters:
annotation - The annotation to delete.
Returns:
true if work set deleted, false otherwise.

The currently logged in user must be the owner to delete an annotation.


getAnnotations

public static java.util.Collection getAnnotations(java.lang.String annotates)
Get all annotations associated with a specific item if public or user logged in.

Parameters:
annotates - The tag of the annotated item.
Returns:
All available annotations for the item.