4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.modules.CoreFuncModule Class Reference

Document, annotations and types manipulation functionality. More...

Inheritance diagram for cz.vutbr.fit.knot.annotations.modules.CoreFuncModule:
Inheritance graph
Collaboration diagram for cz.vutbr.fit.knot.annotations.modules.CoreFuncModule:
Collaboration graph

Public Member Functions

 CoreFuncModule ()
 
String processRequestBeforePersist (RequestInfo requestInfo)
 
String processRequestAfterPersist (RequestInfo requestInfo, boolean persistFailed)
 
String messagesFromFlier (Flier flier, EditorSession session)
 
MatcherProvider getMatcherProvider ()
 
synchronized void lockDocumentUsage () throws InterruptedException
 
synchronized void unlockDocumentUsage ()
 
String getModuleName (int lang)
 
String getModuleDescription (int lang)
 

Static Public Member Functions

static String cleanUpURI (String uri) throws URISyntaxException
 
static ArrayList< String > getUserSources (User user)
 
static ArrayList< AnnotationgetLinkedAnnotationsDB (Annotation annot)
 
static ArrayList< AnnotationgetDifference (ArrayList< Annotation > annotListA, ArrayList< Annotation > annotListB)
 
static ArrayList< AnnotationgetRelatedAnnotations (ArrayList< Annotation > approvedAnnot, ArrayList< Annotation > unapprovedAnnot, EditorSession session)
 

Private Member Functions

void findLinkingAnnotationsIds (Annotation remAnnot, List< Integer > closed)
 
boolean typeInClientCache (AnnotType type, ArrayList< String > queries)
 
boolean containsMoreThanTwoAsterisks (String pattern, String wildcard)
 
String makeAddedAnnotMsg (ArrayList< Annotation > addedAnnotations, EditorSession session, Flier flier, boolean proto11)
 
String makeDeletedAnnotMsg (ArrayList< Annotation > deletedAnnotations, ArrayList< Annotation > deletedNestedAnnotations, EditorSession session, boolean proto11)
 
boolean isSubscribedToLinkingAnnot (EditorSession session, Annotation remAnnot, ArrayList< Annotation > deletedAnnotations)
 
String makeChangedAnnotMsg (ArrayList< Annotation > changedAnnotations, EditorSession session, boolean proto11)
 
ArrayList< AnnotationaddWithoutDuplicity (ArrayList< Annotation > listOfOld, ArrayList< Annotation > listOfNew)
 
void addNestedToRemoved (Annotation annot, List< Annotation > removedNested)
 
String getAttrOnto (RequestInfo requestInfo)
 
boolean isTypeInGroups (AnnotType annotType, EditorSession session)
 
String getQueriedSubscriptions (RequestInfo requestInfo)
 
String getQueSubsLike (ArrayList< String > qString)
 
String getQueriedTypes (RequestInfo requestInfo)
 
String getQueriedTypeExact (String qString, RequestInfo requestInfo)
 
String getQueriedTypeLike (String qString, RequestInfo requestInfo)
 
String getAllInterestingAnnotations (RequestInfo requestInfo)
 
void updateAllExisting (RequestInfo requestInfo)
 
boolean updateAnnotation (Annotation annotation, RequestInfo requestInfo)
 
void checkAddedAndEdited (RequestInfo requestInfo)
 
boolean checkReqAttrsInAnnot (Annotation annot, RequestInfo requestInfo)
 
int checkAnnotationFragments (Annotation annotation, AnnotDocument annotDoc, RequestInfo requestInfo, Boolean cmpErr, Integer updFr)
 
double isAnnotationsAffected (AnnotDocument doc, AnnotDocument newDoc, RequestInfo requestInfo)
 
double isAnnotationAffected (Annotation annotation, AnnotDocument newDoc, RequestInfo requestInfo)
 
double fragmentTreshold (Fragment origFragment, UpdatableFragment foundFragment)
 
void synchronizeDocument (RequestInfo requestInfo)
 
void synchronizeStructuredDocument (AnnotDocument doc, AnnotDocument newDoc, RequestInfo requestInfo)
 
void reSynchronizeDocument (RequestInfo requestInfo)
 
void reSynchronizeStructuredDocument (AnnotDocument doc, AnnotDocument newDoc, RequestInfo requestInfo)
 
void synchronizeLinearizedDocument (AnnotDocument doc, AnnotDocument newDoc, RequestInfo requestInfo)
 
void reSynchronizeLinearizedDocument (AnnotDocument doc, AnnotDocument newDoc, RequestInfo requestInfo)
 
void generateTextModificationsToFlier (String oldVersion, String newVersion, boolean linearized, RequestInfo requestInfo)
 
String updateDocument (RequestInfo requestInfo)
 
ArrayList< AnnotationgetRelatedAnnotations (ArrayList< Annotation > annotations)
 
ArrayList< AnnotationgetAnnotsForUpdate (ArrayList< Annotation > annotations, ArrayList< Annotation > updatedAnnots)
 
ArrayList< String > getAllNestedIdentificators (Annotation annot)
 
ArrayList< AnnotationgetLinkedAnnotations (ArrayList< Annotation > approvedAnnotations)
 
void updateAnnotationLinks (Annotation annot, RequestInfo requestInfo)
 
boolean canBeDocumentModified (RequestInfo requestInfo)
 

Static Private Member Functions

static int getLowestProtocolFromSessionList (RequestInfo requestInfo)
 
static void updateTmpIdRefInNested (Annotation nestedAnn, RequestInfo requestInfo)
 

Private Attributes

MatcherProvider matcherProvider
 
MatcherProvider exactMatcherProvider
 
MatcherProvider nearestMatcherProvider
 
MatcherProvider sequenceMatcherProvider
 

Static Private Attributes

static boolean documentUsageLocked = false
 

Detailed Description

Document, annotations and types manipulation functionality.

This module implements core document, annotations and types manipulation functionality.

Author
idytrych

Definition at line 60 of file CoreFuncModule.java.

Constructor & Destructor Documentation

cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.CoreFuncModule ( )

Constructor

Definition at line 87 of file CoreFuncModule.java.

Member Function Documentation

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.addNestedToRemoved ( Annotation  annot,
List< Annotation removedNested 
)
private

Adds nested annotations of the given annotation to list of removed nested annotations

Parameters
annotcurrent annotation thats nested annotation will be added to list
removedNestedlist of removed nested annotations

Definition at line 1022 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.addWithoutDuplicity ( ArrayList< Annotation listOfOld,
ArrayList< Annotation listOfNew 
)
private

Method merges the two arrays of annotations into a array list without duplicates.

Parameters
listOfOldfirst array of annotations
listOfNewsecond array of annotations
Returns
array of merged input arrays

Definition at line 991 of file CoreFuncModule.java.

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.canBeDocumentModified ( RequestInfo  requestInfo)
private

If document can be modified by this request, returns true, false otherwise

Parameters
requestInfoInformations about client request
Returns
If document can be modified by this request, returns true, false otherwise

Definition at line 3386 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.checkAddedAndEdited ( RequestInfo  requestInfo)
private

Checks whether added and changed annotations have good fragments and required attributes

Parameters
requestInfoInformations about client request

Definition at line 1600 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

int cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.checkAnnotationFragments ( Annotation  annotation,
AnnotDocument  annotDoc,
RequestInfo  requestInfo,
Boolean  cmpErr,
Integer  updFr 
)
private

Check whether annotated fragments in given annotation are good (can be found in synchronized document)

Parameters
annotationAnnotation to check
annotDocSynchronized document
requestInfoInformations about client request
cmpErrIn this object this method returns, whether there are errors of searching fragments (maybe synchronization error)
updFrIn this object this method returns count of updated fragments
Returns
Returns number of bad fragments

Definition at line 1831 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.checkReqAttrsInAnnot ( Annotation  annot,
RequestInfo  requestInfo 
)
private

Checks whether annotation have all required attributes filled

Parameters
annotAnnotation to check
requestInfoInformations about client request
Returns
If annotation have all required attributes filled, returns true, false otherwise

Definition at line 1760 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.cleanUpURI ( String  uri) throws URISyntaxException
static

Normalizes URI and removes id of session and other mess.

Parameters
uriURI to clean up
Returns
Cleaned URI

Definition at line 2568 of file CoreFuncModule.java.

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.containsMoreThanTwoAsterisks ( String  pattern,
String  wildcard 
)
private

Checks whether wildcard contains more than one asterisk

Parameters
patternPattern string
wildcardWildcard string
Returns
True if wildcard contains more than one asterisk, false otherwise

Definition at line 772 of file CoreFuncModule.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.findLinkingAnnotationsIds ( Annotation  remAnnot,
List< Integer >  closed 
)
private

Finds all annotations linking this patricular annotation using database query. Result of the search is stored to list "closed" and is later added to the removed annotation. The method is nescessery for removing annotations that user client have but is not subscribed to, e.g. target of the annotation link.

Parameters
remAnnotInitial removed annotation that is possible target of the annotation link
closedlist of unique IDs of all found linking annotations

Definition at line 686 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

double cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.fragmentTreshold ( Fragment  origFragment,
UpdatableFragment  foundFragment 
)
private

Treshold method which tells you how much is the fragment changed.

Parameters
origFragment
foundFragment
Returns
fragment affection percentage

Definition at line 2209 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.generateTextModificationsToFlier ( String  oldVersion,
String  newVersion,
boolean  linearized,
RequestInfo  requestInfo 
)
private

Generates text modifications and saves them into flier.

Parameters
oldVersionOld version of document against which to generate text modifications.
newVersionNew version of document.
linearizedSpecifies whether should be generated linearized text modifications or structured.
requestInfoInformations about client request
Returns
True on success, false on fail.

Definition at line 2673 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getAllInterestingAnnotations ( RequestInfo  requestInfo)
private

Creates message with annotations interesting for client Annotations are returned in element add of annotations message.

Parameters
requestInfoInformations about client request
Returns
Returns message with annotations interesting for client or empty string if there are no such annotations.

Definition at line 1353 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<String> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getAllNestedIdentificators ( Annotation  annot)
private

Definition at line 3100 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getAnnotsForUpdate ( ArrayList< Annotation annotations,
ArrayList< Annotation updatedAnnots 
)
private

Gets annotations for update

Parameters
annotationsList of Annotations
updatedAnnotsList of updated Annotations
Returns
empty arraylist

Definition at line 3050 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getAttrOnto ( RequestInfo  requestInfo)
private

Returns serialized attributes of unknown types of annotation from ontology

Parameters
requestInfoInformations about client request
Returns
Returns serialized attributes from ontology

Definition at line 1038 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getDifference ( ArrayList< Annotation annotListA,
ArrayList< Annotation annotListB 
)
static

Returns difference of the annotation lists ( A / B ).

Parameters
annotListAList A
annotListBList B
Returns
Difference

Definition at line 3179 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getLinkedAnnotations ( ArrayList< Annotation approvedAnnotations)
private

Update all annotations with relationships to given approved annotations in list.

Parameters
approvedAnnotationslist of approved annotations
Returns
list of related annotations and given annotations

Definition at line 3122 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getLinkedAnnotationsDB ( Annotation  annot)
static

Gets linked annotation attributes from db which links input annotation

Parameters
annotinput annotations
Returns
arraylist of linked annotations

Definition at line 3153 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static int cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getLowestProtocolFromSessionList ( RequestInfo  requestInfo)
staticprivate

Gets the lowest version of the protocol used in the clients where is the actual session document used.

Parameters
requestInfoactual requestInfo
Returns
Lowest version of the protocol

Definition at line 2700 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

MatcherProvider cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getMatcherProvider ( )

Gets provider of matchers for finding fragments

Returns
Returns provider of matchers for finding fragments

Definition at line 1414 of file CoreFuncModule.java.

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getModuleDescription ( int  lang)

Returns description of this module. It will be part of information about server functions.

Parameters
langRequested language of description
Returns
Description of this module

Implements cz.vutbr.fit.knot.annotations.comet.AnnotServerModule.

Definition at line 2558 of file CoreFuncModule.java.

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getModuleName ( int  lang)

Returns name of this module. Name will be included in XML element attribute so usable characters are restricted.

Parameters
langRequested language of name
Returns
Name of this module

Implements cz.vutbr.fit.knot.annotations.comet.AnnotServerModule.

Definition at line 2546 of file CoreFuncModule.java.

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getQueriedSubscriptions ( RequestInfo  requestInfo)
private

Creates message with types of subscriptions requested (queried) by client

Parameters
requestInfoInformations about client request
Returns
Returns subscriptions message with requested types in subscriptions element. If there wasn't found any match, element subscriptions will be empty. If user is not logged in, method returns empty string

Definition at line 1116 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getQueriedTypeExact ( String  qString,
RequestInfo  requestInfo 
)
private

Gets type of annotations with given URI serialized in XML

Parameters
qStringURI of requested type of annotations
requestInfoInformations about client request
Returns
Returns type of annotations with given URI serialized in XML or empty string if there are no matching type

Definition at line 1277 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getQueriedTypeLike ( String  qString,
RequestInfo  requestInfo 
)
private

Gets type of annotations with URI matching given pattern serialized in XML Character % is used as wildcard.

Parameters
qStringPattern of URI of requested type of annotations
requestInfoInformations about client request
Returns
Returns type of annotations with URI matching given pattern serialized in XML or empty string if there are no matching type

Definition at line 1308 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getQueriedTypes ( RequestInfo  requestInfo)
private

Creates message with types of annotations requested (queried) by client

Parameters
requestInfoInformations about client request
Returns
Returns types message with requested types in add element. If no types matching supplied filter, element add will be empty. If user is not logged in or no types requested, it returns empty string.

Definition at line 1200 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getQueSubsLike ( ArrayList< String >  qString)
private

Gets subscriptions from dababase based upon terms in arrayList Character % is used as wildcard.

Parameters
qStringArrayList of strings filled with patterns
Returns
Returns either subscriptions serialized in XML if there was a pattern match or empty string otherwise

Definition at line 1158 of file CoreFuncModule.java.

Here is the caller graph for this function:

ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getRelatedAnnotations ( ArrayList< Annotation annotations)
private

Return all annotations that are related with annotations in list

Parameters
annotationslist of annotations to search
Returns
list of related annotations and given annotations

Definition at line 3016 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<Annotation> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getRelatedAnnotations ( ArrayList< Annotation approvedAnnot,
ArrayList< Annotation unapprovedAnnot,
EditorSession  session 
)
static

Return all annotations that are related with annotations in lists for session in parameter (not related only to approvedAnnot list but also to something to which is user subscribed)

Parameters
approvedAnnotapproved annotation list
unapprovedAnnotunapproved annotation list
sessionsession
Returns
list of related annotations and given annotations

Definition at line 3208 of file CoreFuncModule.java.

Here is the call graph for this function:

static ArrayList<String> cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.getUserSources ( User  user)
static

Gets the user sources

Parameters
useruser
Returns
arraylist of strings with sources

Definition at line 2992 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

double cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.isAnnotationAffected ( Annotation  annotation,
AnnotDocument  newDoc,
RequestInfo  requestInfo 
)
private

Checks whether annotation will be affected by updating annotated copy of document to new version If annotation can be automatically updated (all fragments found), it's not treated as affection.

Parameters
annotationChecked annotation
newDocNew version of annotated document
requestInfoInformations about client request
Returns
If annotations are affected, returns true, false otherwise

Definition at line 2098 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

double cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.isAnnotationsAffected ( AnnotDocument  doc,
AnnotDocument  newDoc,
RequestInfo  requestInfo 
)
private

Checks whether annotations of document will be affected by updating annotated copy of document to new version If annotation can be automatically updated (all fragments found), it's not treated as affection.

Parameters
docOld version of annotated document
newDocNew version of annotated document
requestInfoInformations about client request
Returns
If annotations are affected, returns true, false otherwise

Definition at line 2068 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.isSubscribedToLinkingAnnot ( EditorSession  session,
Annotation  remAnnot,
ArrayList< Annotation deletedAnnotations 
)
private

Checks if removed annotation is linked by annotation that user client is subscribed to. The client can display annotations that the user is not subscribed to in case that the annotation is a target of the annotation link.

Parameters
sessionUser session
remAnnotRemoved annotation which is inspected for linking annotations and their subscribtion status
deletedAnnotationsList of all removed annotations obtained from a flier
Returns
True if the user is subscribed to any of the removed annotations linking annotation

Definition at line 895 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.isTypeInGroups ( AnnotType  annotType,
EditorSession  session 
)
private

Checks whether type come under user groups of logged in user

Parameters
annotTypeChecked type of annotation
sessionClient session
Returns
If type come under user groups of logged in user, returns true, false otherwise

Definition at line 1090 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

synchronized void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.lockDocumentUsage ( ) throws InterruptedException

Locks document usage

Exceptions
InterruptedException

Definition at line 2303 of file CoreFuncModule.java.

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.makeAddedAnnotMsg ( ArrayList< Annotation addedAnnotations,
EditorSession  session,
Flier  flier,
boolean  proto11 
)
private

Method takes all added annotations and detects whether client require these annotations. Then method make message from required annotations.

Parameters
addedAnnotationsarray of added annotations
sessioninformations about client session
flierFlier, which has been sent to all comet handlers.
proto11minimal protocol version
Returns
message for client

Definition at line 786 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.makeChangedAnnotMsg ( ArrayList< Annotation changedAnnotations,
EditorSession  session,
boolean  proto11 
)
private

Method takes all changed annotations and detects whether client require these annotations. Then method make message from required annotations.

Parameters
changedAnnotationsarray of changed annotations
sessioninformations about client session
proto11minimal protocol version
Returns
message for client

Definition at line 939 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.makeDeletedAnnotMsg ( ArrayList< Annotation deletedAnnotations,
ArrayList< Annotation deletedNestedAnnotations,
EditorSession  session,
boolean  proto11 
)
private

Method takes all deleted annotations and detects whether client require these annotations. Then method make message from required annotations.

Parameters
deletedAnnotationsarray of deleted annotations
deletedNestedAnnotationsarray of deleted nested annotations
sessioninformations about client session
proto11minimal protocol version
Returns
message for client

Definition at line 845 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.messagesFromFlier ( Flier  flier,
EditorSession  session 
)

This method is called for each sleeping comet handler when he receives flier (part of informations about this or another client request).

Parameters
flierFlier, which has been sent to all comet handlers.
sessionSession associated with comet handler.
Returns
If this handler hasn't react to this flier (not interested) return null, else return messages for client in single string.

Implements cz.vutbr.fit.knot.annotations.comet.AnnotServerModule.

Definition at line 464 of file CoreFuncModule.java.

Here is the call graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.processRequestAfterPersist ( RequestInfo  requestInfo,
boolean  persistFailed 
)

This method is called when client sent message, these message has been processed and changes in entities are persisted. Composed response is sent to client after calling this method from all modules. It performs:

  • actualization of language in session (set language according to database)
  • creating of synchronized message - creating message with queried types
  • sending annotations to client after synchronizing or request
  • sending just added types to client
Parameters
requestInfoInformations about client request
persistFailedTrue if changes not persisted, false otherwise.
Returns
String with messages for client or empty string

Implements cz.vutbr.fit.knot.annotations.comet.AnnotServerModule.

Definition at line 204 of file CoreFuncModule.java.

Here is the call graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.processRequestBeforePersist ( RequestInfo  requestInfo)

This method is called when client sent message and these message has been processed. Changes in types, annotations and in other entities are persisted after calling this method from all modules. It performs:

  • checking of synchronized document and synchronization
  • applying document modifications
  • checking of fragments in added and edited annotations
Parameters
requestInfoInformations about client request
Returns
String with messages for client or empty string

Implements cz.vutbr.fit.knot.annotations.comet.AnnotServerModule.

Definition at line 132 of file CoreFuncModule.java.

Here is the call graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.reSynchronizeDocument ( RequestInfo  requestInfo)
private

Resynchronizes document

Parameters
requestInfoInformations about client request

Definition at line 2468 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.reSynchronizeLinearizedDocument ( AnnotDocument  doc,
AnnotDocument  newDoc,
RequestInfo  requestInfo 
)
private

Definition at line 2652 of file CoreFuncModule.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.reSynchronizeStructuredDocument ( AnnotDocument  doc,
AnnotDocument  newDoc,
RequestInfo  requestInfo 
)
private

Resynchronizes document

Parameters
docOld version of document
newDocNew version of document
requestInfoInformations about client request

Definition at line 2506 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.synchronizeDocument ( RequestInfo  requestInfo)
private

Synchronizes document

Parameters
requestInfoInformations about client request

Definition at line 2235 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.synchronizeLinearizedDocument ( AnnotDocument  doc,
AnnotDocument  newDoc,
RequestInfo  requestInfo 
)
private

Definition at line 2633 of file CoreFuncModule.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.synchronizeStructuredDocument ( AnnotDocument  doc,
AnnotDocument  newDoc,
RequestInfo  requestInfo 
)
private

Synchronizes structured document

Parameters
docpersisted annotated document whether exists, otherwise null
newDocNew version of annotated document
requestInfoInformations about client request

Definition at line 2325 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.typeInClientCache ( AnnotType  type,
ArrayList< String >  queries 
)
private

Client has a cache containing a history of type tree queries. It can request for the whole types tree or any subtree. Flier contains added and modified types. Method decides if the user will receive type from the flier for cache update. Type is send only when user previously asked for the subtree that the new/modified type is a part of.

Parameters
typeNew modified or added type obtained from a flier
queriesHistory of type query request strings, may contain wildcard char
Returns
True if the user has the modified type or subtree containing new type in cache, false otherwise

Definition at line 714 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

synchronized void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.unlockDocumentUsage ( )

Unlocks document usage

Definition at line 2313 of file CoreFuncModule.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.updateAllExisting ( RequestInfo  requestInfo)
private

Updates all annotations for synchronized document (eg. after modification of document)

Parameters
requestInfoInformations about client request

Definition at line 1424 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.updateAnnotation ( Annotation  annotation,
RequestInfo  requestInfo 
)
private

Updates fragments in annotation

Parameters
annotationAnnotation to update
requestInfoInformations about client request
Returns
If annotation was updated, returns true, if no update needed or error occurred, returns false

Definition at line 1456 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.updateAnnotationLinks ( Annotation  annot,
RequestInfo  requestInfo 
)
private

Checks all AnnotationLink attributes for values and updates refferences if attribute value is null and tmpId value of attribute != null.

Parameters
annotAnnotation for check.
requestInfoInformations about client request

Definition at line 3270 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.updateDocument ( RequestInfo  requestInfo)
private

Updates document with text modifications from request. If update finishes with success, stores text modifications into flier. If update fails, generates reverse text modifications.

Parameters
requestInfoInformations about client request
Returns
String with messages for client or empty string

Definition at line 2725 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.updateTmpIdRefInNested ( Annotation  nestedAnn,
RequestInfo  requestInfo 
)
staticprivate

Recursively Checks all AnnotationLink attributes in NestedAnnotations for values and updates refferences if attribute value is null and tmpId value of attribute != null.

Parameters
nestedAnnNested Annotation link
requestInfoInformations about client request

Definition at line 3329 of file CoreFuncModule.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

boolean cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.documentUsageLocked = false
staticprivate

Specifies whether is document usage locked

Definition at line 82 of file CoreFuncModule.java.

MatcherProvider cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.exactMatcherProvider
private

Provider of matchers for finding fragments (exact matches only)

Definition at line 69 of file CoreFuncModule.java.

MatcherProvider cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.matcherProvider
private

Provider of matchers for finding fragments

Definition at line 65 of file CoreFuncModule.java.

MatcherProvider cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.nearestMatcherProvider
private

Provider of matchers for finding fragments (nearest matches only)

Definition at line 73 of file CoreFuncModule.java.

MatcherProvider cz.vutbr.fit.knot.annotations.modules.CoreFuncModule.sequenceMatcherProvider
private

Provider of matchers for finding fragments (sequence iterator)

Definition at line 77 of file CoreFuncModule.java.


The documentation for this class was generated from the following file: