4A Server -
2.0
|
Class representing annotation. More...
Private Member Functions | |
boolean | canBeDisplayedInKBRefMode () |
StringBuilder | attributesToKBRefString (ArrayList< String > attFilter, int langNum) |
String | EscapeCharsToSend (String source) |
Private Attributes | |
Integer | id |
Integer | type |
Date | created |
String | authorIdStr |
String | authorName |
String | authorAddress |
String | authorId |
String | source |
Integer | sourceDocumentId |
String | content |
String | nestedIn |
AnnotType | annotType |
AnnotDocument | sourceDocument |
List< BaseAttribute > | attributes |
List< Fragment > | fragments |
User | user |
Annotation | nestedInAnnot |
String | tmpId |
List< Integer > | linkedByBeforeRemove |
Static Private Attributes | |
static final long | serialVersionUID = 1L |
Class representing annotation.
Class representing annotation
Definition at line 80 of file Annotation.java.
cz.vutbr.fit.knot.annotations.entity.Annotation.Annotation | ( | ) |
Constructor
Definition at line 170 of file Annotation.java.
cz.vutbr.fit.knot.annotations.entity.Annotation.Annotation | ( | Integer | id | ) |
Constructor of reference objects for searching purposes - no initialization needed
id | Id of annotation |
Definition at line 179 of file Annotation.java.
cz.vutbr.fit.knot.annotations.entity.Annotation.Annotation | ( | Integer | id, |
Date | created, | ||
String | authorIdStr, | ||
String | authorName, | ||
String | authorAddress, | ||
AnnotDocument | sourceDocument, | ||
String | content, | ||
String | nestedIn | ||
) |
Constructor
id | Id of annotation |
created | Date of creation |
authorIdStr | URI of annotation author (user) |
authorName | Name of annotation author (user) |
authorAddress | E-mail of annotation author (user) |
sourceDocument | Annotated copy of document to which this annotation belongs |
content | Textual content of annotation |
nestedIn | If this annotation is nested, then parent annotation, null otherwise |
Definition at line 195 of file Annotation.java.
cz.vutbr.fit.knot.annotations.entity.Annotation.Annotation | ( | AnnotType | annotType, |
Date | created, | ||
String | authorIdStr, | ||
String | authorName, | ||
String | authorAddress, | ||
AnnotDocument | sourceDocument, | ||
String | content | ||
) |
Constructor
annotType | Type of annotation |
created | Date of creation |
authorIdStr | URI of annotation author (user) |
authorName | Name of annotation author (user) |
authorAddress | E-mail of annotation author (user) |
sourceDocument | Annotated copy of document to which this annotation belongs |
content | Textual content of annotation |
Definition at line 223 of file Annotation.java.
cz.vutbr.fit.knot.annotations.entity.Annotation.Annotation | ( | AnnotType | annotType, |
Date | created, | ||
String | authorIdStr, | ||
String | authorName, | ||
String | authorAddress, | ||
AnnotDocument | sourceDocument, | ||
String | content, | ||
Annotation | nestedInAnnot | ||
) |
Constructor
annotType | Type of annotation |
created | Date of creation |
authorIdStr | URI of annotation author (user) |
authorName | Name of annotation author (user) |
authorAddress | E-mail of annotation author (user) |
sourceDocument | Annotated copy of document to which this annotation belongs |
content | Textual content of annotation |
nestedInAnnot | If this annotation is nested, then parent annotation, null otherwise |
Definition at line 251 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.addAllLinkedByBeforeRemove | ( | List< Integer > | IDs | ) |
Adds all IDs of linking annotations.
IDs | list of IDs of annotations that contain attribute linking this particular annotation |
Definition at line 1598 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.addAttribute | ( | BaseAttribute | attribute | ) |
Adds attribute to the annotation
attribute | Annotation attribute to add |
Definition at line 593 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.addFragment | ( | Fragment | fragment | ) |
Adds fragment to the list of annotated fragments
fragment | Annotated fragment |
Definition at line 530 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.addLinkedByBeforeRemove | ( | Integer | id | ) |
Inserts ID of annotation that links this particular annotation to the list
id | ID of annotation that links this particular annotation |
Definition at line 1574 of file Annotation.java.
|
private |
Returns serialized attributes in KB Ref mode
attFilter | Filter for attributes |
langNum | Number of language |
Definition at line 1211 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.attributesToXMLString | ( | boolean | proto11, |
boolean | tmpIdForNested | ||
) |
Returns serialized informations about annotation attributes in XML
proto11 | If true, protocol version is greather then 1.0 |
tmpIdForNested | If true, nested annotations will have attribute tmpId |
Definition at line 1416 of file Annotation.java.
|
private |
If this annotation can be displayed in KB Ref mode (KB_Ref attribute is not presented and updatable_annotation is presented and true), returns true, false otherwise
Definition at line 1189 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.clearLinkedByBeforeRemove | ( | ) |
Clears the list containing ID. It should be used after the remove message for this particular annotation has been created.
Definition at line 1589 of file Annotation.java.
boolean cz.vutbr.fit.knot.annotations.entity.Annotation.contentEquals | ( | Object | obj | ) |
Compares this with other object and returns, whether objects are same type and have same content (id is irelevant). Contents of fragments and attributes are also compared.
obj | Object to compare with |
Definition at line 787 of file Annotation.java.
boolean cz.vutbr.fit.knot.annotations.entity.Annotation.contentEquals | ( | Object | obj, |
boolean | withCreated, | ||
boolean | noLinked | ||
) |
Compares this with other object and returns, whether objects are same type and have same content (id is irrelevant). Contents of fragments and attributes are also compared.
obj | Object to compare with |
withCreated | If true, dates of creation will be compared, if false, dates will be omitted |
noLinked | If true, linked attributes will be ignored, if false, links will be compared. |
Definition at line 801 of file Annotation.java.
boolean cz.vutbr.fit.knot.annotations.entity.Annotation.equals | ( | Object | object | ) |
Compares this with other object and returns, whether objects are same type and have same id.
object | Object to compare with |
Definition at line 735 of file Annotation.java.
boolean cz.vutbr.fit.knot.annotations.entity.Annotation.equals | ( | Object | object, |
boolean | noLinked | ||
) |
Compares this with other object and returns, whether objects are same type and have same id, but not go to deeper comparation if noLinek is set to true.
object | Object to compare with |
noLinked | No trace links and compare them if is set to true |
Definition at line 761 of file Annotation.java.
|
private |
Creates escaped version of the provided textual data. It is used when text to be sent to the SEC Store server contains special characters like quotes and backslash. Method expects SEC Store server to store strings enclosed in double quote. That's why double quote character needs to be escaped and single quote not.
Definition at line 1435 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.fragmentsToXMLString | ( | ) |
Returns serialized informations about annotated fragments in XML
Definition at line 1398 of file Annotation.java.
AnnotType cz.vutbr.fit.knot.annotations.entity.Annotation.getAnnotType | ( | ) |
Gets type of annotation
Definition at line 367 of file Annotation.java.
List<BaseAttribute> cz.vutbr.fit.knot.annotations.entity.Annotation.getAttributes | ( | ) |
Gets list of annotation attributes
Definition at line 575 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getAuthorAddress | ( | ) |
Gets e-mail of author of annotation (user)
Definition at line 467 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getAuthorId | ( | ) |
Gets id of annotation author (user)
Definition at line 678 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getAuthorIdStr | ( | ) |
Gets URI of author of annotation (user)
Definition at line 431 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getAuthorName | ( | ) |
Gets name of author of annotation (user)
Definition at line 449 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getContent | ( | ) |
Gets textual content of annotation
Definition at line 539 of file Annotation.java.
Date cz.vutbr.fit.knot.annotations.entity.Annotation.getCreated | ( | ) |
Gets date of creation
Definition at line 413 of file Annotation.java.
List<Fragment> cz.vutbr.fit.knot.annotations.entity.Annotation.getFragments | ( | ) |
Gets list of annotated fragments
Definition at line 503 of file Annotation.java.
ArrayList<Fragment> cz.vutbr.fit.knot.annotations.entity.Annotation.getFragmentsAL | ( | ) |
Gets list of annotated fragments as ArrayList
Definition at line 512 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getFragmentXpointersV2 | ( | ) |
Returns xpointers of all annotations fragments
Definition at line 1315 of file Annotation.java.
Integer cz.vutbr.fit.knot.annotations.entity.Annotation.getId | ( | ) |
Gets id of annotation
Definition at line 349 of file Annotation.java.
List<Integer> cz.vutbr.fit.knot.annotations.entity.Annotation.getLinkedByBeforeRemove | ( | ) |
Returns a list containing IDs of annotations that links this annotation
Definition at line 1565 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getNestedIn | ( | ) |
Gets id of parent annotation of nested annotation
Definition at line 557 of file Annotation.java.
Annotation cz.vutbr.fit.knot.annotations.entity.Annotation.getNestedInAnnot | ( | ) |
Gets parent annotation of nested annotation
Definition at line 602 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getNewAnnotMsg | ( | ) |
Definition at line 1529 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getSource | ( | ) |
Gets annotated copy of document to which this annotation belongs
Definition at line 485 of file Annotation.java.
AnnotDocument cz.vutbr.fit.knot.annotations.entity.Annotation.getSourceDocument | ( | ) |
Gets annotated copy of document to which this annotation belongs
Definition at line 656 of file Annotation.java.
Integer cz.vutbr.fit.knot.annotations.entity.Annotation.getSourceDocumentId | ( | ) |
Gets id of annotated copy of document to which this annotation belongs
Definition at line 620 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getTmpId | ( | ) |
Gets tmpId of annotation
Definition at line 1548 of file Annotation.java.
Integer cz.vutbr.fit.knot.annotations.entity.Annotation.getType | ( | ) |
Gets id of type of annotation
Definition at line 638 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.getURI | ( | ) |
String cz.vutbr.fit.knot.annotations.entity.Annotation.getURIV2 | ( | ) |
Gets URI of annotation for protocol V2
Definition at line 708 of file Annotation.java.
User cz.vutbr.fit.knot.annotations.entity.Annotation.getUser | ( | ) |
Gets author of annotation (user)
Definition at line 385 of file Annotation.java.
int cz.vutbr.fit.knot.annotations.entity.Annotation.hashCode | ( | ) |
Definition at line 721 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setAnnotType | ( | AnnotType | annotType | ) |
Sets type of annotation
annotType | Type of annotation |
Definition at line 376 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setAttributes | ( | ArrayList< BaseAttribute > | attributes | ) |
Sets list of annotation attributes
attributes | List of annotation attributes |
Definition at line 584 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setAuthorAddress | ( | String | authorAddress | ) |
Sets e-mail of author of annotation (user)
authorAddress | E-mail of author of annotation (user) |
Definition at line 476 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setAuthorId | ( | String | authorId | ) |
Sets id of annotation author (user)
authorId | id of annotation author (user) |
Definition at line 687 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setAuthorIdStr | ( | String | authorIdStr | ) |
Sets URI of author of annotation (user)
authorIdStr | URI of author of annotation (user) |
Definition at line 440 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setAuthorName | ( | String | authorName | ) |
Sets name of author of annotation (user)
authorName | Name of author of annotation (user) |
Definition at line 458 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setContent | ( | String | content | ) |
Sets textual content of annotation
content | Textual content of annotation |
Definition at line 548 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setCreated | ( | Date | created | ) |
Sets date of creation
created | Date of creation |
Definition at line 422 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setFragments | ( | ArrayList< Fragment > | fragments | ) |
Sets list of annotated fragments
fragments | List of annotated fragments |
Definition at line 521 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setId | ( | Integer | id | ) |
void cz.vutbr.fit.knot.annotations.entity.Annotation.setNestedIn | ( | String | nestedIn | ) |
Sets id of parent annotation of nested annotation
nestedIn | Id of parent annotation of nested annotation |
Definition at line 566 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setNestedInAnnot | ( | Annotation | nestedInAnnot | ) |
Sets parent annotation of nested annotation
nestedInAnnot | If this annotation is nested, then parent annotation, null otherwise |
Definition at line 611 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setSource | ( | String | source | ) |
Sets annotated copy of document to which this annotation belongs
source | Annotated copy of document to which this annotation belongs |
Definition at line 494 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setSourceDocument | ( | AnnotDocument | sourceDocument | ) |
Sets annotated copy of document to which this annotation belongs (if document is not null, his URI is also set)
sourceDocument | Annotated copy of document to which this annotation belongs |
Definition at line 666 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setSourceDocumentId | ( | Integer | sourceDocumentId | ) |
Sets id of annotated copy of document to which this annotation belongs
sourceDocumentId | id of annotated copy of document to which this annotation belongs |
Definition at line 629 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setTmpId | ( | String | tmpId | ) |
void cz.vutbr.fit.knot.annotations.entity.Annotation.setType | ( | Integer | type | ) |
Sets id of type of annotation
type | id of type of annotation |
Definition at line 647 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.setUser | ( | User | user | ) |
Sets author of annotation (user) URI is also set and if available, full name and e-mail too
user | Author of annotation (user) |
Definition at line 395 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.toJsonString | ( | Integer | sOffset, |
Integer | eOffset | ||
) |
Stores annotation data into the JSON string representation. String could be processed on the SEC Store API server. Method stores IDs of referenced structures, so when creating an object from this representation, one must look up for structures by IDs.
Definition at line 1453 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.toString | ( | ) |
Definition at line 912 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.toSXMLString | ( | boolean | addSpaces | ) |
Returns serialized informations about annotation in SXML
addSpaces | If true, it will add space after each node during linearization (offset will be incremented by 1) |
Definition at line 923 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.toSXMLString | ( | boolean | addSpaces, |
boolean | addCreated | ||
) |
Returns serialized informations about annotation in SXML
addSpaces | If true, it will add space after each node during linearization (offset will be incremented by 1) |
addCreated | If true, date and time of creation will be added |
Definition at line 935 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.toXMLString | ( | boolean | proto11 | ) |
Returns serialized informations about annotation in XML
proto11 | If true, protocol version is greather then 1.0 |
Definition at line 1332 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.toXMLString | ( | boolean | annotTag, |
String | annotTagAttrs, | ||
boolean | proto11, | ||
boolean | tmpIdForNested | ||
) |
Returns serialized informations about annotation in XML
annotTag | Denotes whether wrapping tag annotation should be included |
annotTagAttrs | Attributes of created annotation tag |
proto11 | If true, protocol version is greather then 1.0 |
tmpIdForNested | If true, nested annotations will have attribute tmpId |
Definition at line 1345 of file Annotation.java.
String cz.vutbr.fit.knot.annotations.entity.Annotation.toXMLStringV2 | ( | ArrayList< String > | attFilter, |
int | langNum, | ||
Boolean | KBRefMode | ||
) |
Returns serialized informations about annotation in XML for protocol V2
attFilter | Filter for attributes |
langNum | Number of language |
KBRefMode | Is KB_Ref mode on? |
Definition at line 1016 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.updateWithAnnotation | ( | Annotation | newData | ) |
Updates data in this annotation with data from another annotation
newData | Annotation with new data |
Definition at line 272 of file Annotation.java.
void cz.vutbr.fit.knot.annotations.entity.Annotation.updateWithSuggestion | ( | Suggestion | newData | ) |
Updates data in this annotation with data from some suggestion
newData | Suggestion with new data |
Definition at line 297 of file Annotation.java.
|
private |
Type of annotation
Definition at line 133 of file Annotation.java.
|
private |
List of attributes of annotation
Definition at line 141 of file Annotation.java.
|
private |
E-mail of annotation author (user)
Definition at line 108 of file Annotation.java.
|
private |
Id of annotation author (user)
Definition at line 112 of file Annotation.java.
|
private |
URI of annotation author (user)
Definition at line 100 of file Annotation.java.
|
private |
Name of annotation author (user)
Definition at line 104 of file Annotation.java.
|
private |
Textual content of annotation
Definition at line 125 of file Annotation.java.
|
private |
Date of creation
Definition at line 96 of file Annotation.java.
|
private |
List of annotated fragments
Definition at line 145 of file Annotation.java.
|
private |
Id of annotation
Definition at line 87 of file Annotation.java.
|
private |
Holds IDs of annotations that have a linkedAnnotation attribute with value pointing to this annotation. It is necessary to store these IDs before the annotation is removed from the database (before persist). The list is used during flier processing when user has annotations that he is not subscribed to and they need to be removed from the client.
Definition at line 165 of file Annotation.java.
|
private |
If this annotation is nested, here is id of parent annotation
Definition at line 128 of file Annotation.java.
|
private |
If this annotation is nested, here is parent annotation
Definition at line 153 of file Annotation.java.
|
staticprivate |
Definition at line 81 of file Annotation.java.
|
private |
URI of annotated copy of document to which this annotation belongs
Definition at line 116 of file Annotation.java.
|
private |
Annotated copy of document to which this annotation belongs
Definition at line 137 of file Annotation.java.
|
private |
Id of annotated copy of document to which this annotation belongs
Definition at line 120 of file Annotation.java.
|
private |
Temporary id for links between annotations which are not saved yet
Definition at line 157 of file Annotation.java.
|
private |
Id of type of annotation
Definition at line 91 of file Annotation.java.
|
private |
Author of annotation (user)
Definition at line 149 of file Annotation.java.