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

Class provides offerining of suggestions with usage of local knowledge repository. More...

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

Classes

class  ConfidenceComparator
 The object implements comparator of Alternative objects that are compared by confidence (from highest to lowest confidence). More...
 
class  SuggestionFragmentComp
 Class which implements Comparator to sort arrayList of SuggestionFragment alphabetically. More...
 
enum  SuggestionSource
 Source of suggestions. More...
 

Public Member Functions

 SuggestionManager (RequestInfo request)
 
void run ()
 
String printSuggestionsDiff (EditorSession session, ArrayList< Suggestion > modifiedSuggestions, ArrayList< AnnotType > newTypes)
 
String getSuggestionsFromSECAPI (RequestInfo parRequestInfo, String doc, String uri, boolean useAlternatives, ArrayList< Suggestion > validSuggestions)
 
String getSuggestionsFromRemoteSECAPI (RequestInfo parRequestInfo, String doc, String uri, boolean useAlternatives, ArrayList< Suggestion > validSuggestions)
 
void lockDocForChange (Integer documentId)
 
void unlockDocForChange (Integer documentId)
 

Static Public Member Functions

static void sendToOthers (RequestInfo requestInfo, String message)
 
static String printTypes (RequestInfo requestInfo, EditorSession session, ArrayList< AnnotType > newTypes)
 
static boolean isTypeInGroups (AnnotType annotType, RequestInfo requestInfo)
 
static void initReqTypes ()
 
static void initReqTypesFromRemote (SECAPIConn conn, RequestInfo requestInfo)
 
static Suggestion updateSuggNegativeFeedback (RequestInfo request, Integer groupId, int refusedSuggID, boolean processAlternatives)
 
static SuggestionSource sourceOfSuggestions (String document)
 
static Suggestion getSuggestionFromList (Integer suggestionId, List< Suggestion > list)
 
static ArrayList< SuggestiongetNestedSuggFromToDelete (ArrayList< Suggestion > inputSuggs, ArrayList< Suggestion > suggsToDelete)
 
static void filtrateSuggestions (RequestInfo requestInfo, EditorSession session, ArrayList< Suggestion > userSuggestions)
 
static ArrayList< SuggestionaddAllDependencies (ArrayList< Suggestion > filteredSuggestions, ArrayList< Suggestion > nonFilteredSuggestion)
 
static String changeGroupInUri (String uri, Integer groupId)
 
static void checkTypes (EditorSession session, ArrayList< Suggestion > suggestions, ArrayList< AnnotType > newTypes, boolean solveAtribute)
 
static boolean updateSuggestion (Suggestion suggestion, RequestInfo request)
 
static ArrayList
< SuggestionFragment
getLinearized (Document doc, ArrayList< SuggestionFragment > fragments)
 
static ArrayList< AnnotTypebreakdownType (AnnotType type, RequestInfo requestInfo, ArrayList< AnnotType > newTypes)
 
static boolean persistTypes (ArrayList< AnnotType > types)
 
static AnnotType queryType (String uri, EntityManager em) throws RuntimeException
 
static ArrayList< SuggestiongetSuggestionsFromDB (Integer documentId)
 
static void processSugAttributes (List< Suggestion > suggestionList, ArrayList< Suggestion > result)
 
static AnnotType getAnnotTypeFromDB (String uri)
 
static ArrayList
< SuggestionFeedback
getFeedbackFromDB (Integer documentId, Integer groupId)
 
static SuggestionFeedback getFeedbackByAnnot (Integer annotId)
 
static Suggestion getSuggestionFromDB (Integer id)
 

Public Attributes

UserGroup userGroup
 

Static Public Attributes

static final int NOT_USABLE_CONFIDENCE = 4
 
static final int MINIMAL_CONFIDENCE = 5
 
static final int INITIAL_CONFIDENCE = 50
 
static final int REFUSED_CONFIDENCE = 40
 
static final int CONFIRMED_CONFIDENCE = 90
 
static final int MINIMAL_FILTER_CONFIDENCE = 5
 
static final String MODULE_NAME = "SuggestionManager"
 

Package Functions

void startModule ()
 

Package Attributes

RequestInfo requestInfo = null
 

Private Member Functions

void annotationsAddChange (RequestInfo request)
 
String annotationsDelete (RequestInfo request)
 
String getSuggestions (RequestInfo request)
 
void updateDocument (RequestInfo request)
 
void rejectSuggestions (RequestInfo request, ArrayList< SuggestionLogEntry > skipSugs, ArrayList< SuggestionLogEntry > noAlternatives)
 
boolean haveLinkOn (Suggestion suggestion, Suggestion linkedSuggestion)
 
ArrayList< SuggestionupdateNegativeFeedback (RequestInfo request, ArrayList< SuggestionLogEntry > skipSugs, ArrayList< SuggestionLogEntry > noAlternatives)
 
ArrayList< SuggestionLogEntryrefuseOtherSugFromFragments (RequestInfo request)
 
void updateDocument (RequestInfo request, ArrayList< Suggestion > oldSuggestions, ArrayList< Suggestion > addedSuggestions, ArrayList< Suggestion > changedSuggestions, ArrayList< AnnotType > newTypes)
 
String getAddMessagesString (ArrayList< Suggestion > suggestions)
 
String getDeleteMessagesString (ArrayList< Integer > suggestions)
 
String makeClientMessage (String suggestionToAddM, String suggestionToRemoveM)
 
void getNewClientCache (ArrayList< Suggestion > addedSugg, ArrayList< Integer > deletedSugg, ArrayList< Integer > actualCache)
 
String filterByClientCache (EditorSession session, ArrayList< Suggestion > shouldHave, ArrayList< Suggestion > changedSuggestions)
 
ArrayList< SuggestionfiltrateRefusedSugg (RequestInfo request, ArrayList< Suggestion > docSuggestions)
 
ArrayList< SuggestiongetSuggestionWithoutFeedback (ArrayList< Suggestion > list, ArrayList< Suggestion > modified)
 
void feedbackChangeRef (ArrayList< Suggestion > list, Suggestion sgFromList, ArrayList< Suggestion > modified, SuggestionFeedback fb, ArrayList< Suggestion > removedSuggestions)
 
boolean isSuggestionInFeedback (ArrayList< SuggestionFeedback > feedbackList, Suggestion searchedSugg)
 
ArrayList< SuggestioncutRefusedSuggLinks (ArrayList< Suggestion > userSuggestions, ArrayList< Suggestion > refusedSuggestions)
 
AnnotSugPair getPairByAnnot (ArrayList< AnnotSugPair > pairs, Annotation annot)
 
ArrayList< SuggestiongetAffectedForDelete (ArrayList< Annotation > removedAnnot)
 
void compareFragments (ArrayList< Suggestion > suggestions, ArrayList< Suggestion > changedSuggestions)
 
void setConfidenceToAllNested (Suggestion sg, Integer confidence, ArrayList< Suggestion > changedSuggestions)
 
ArrayList< SuggestionupdateSuggestionsFragments (ArrayList< Suggestion > suggestions, RequestInfo request, ArrayList< Suggestion > changedSugg)
 
void insertNewSuggestions (ArrayList< Suggestion > newSuggestions, ArrayList< Suggestion > oldSuggestions, ArrayList< Suggestion > addedSugg, ArrayList< Suggestion > changedSugg)
 
Suggestion findSuggInArray (Integer id, ArrayList< Suggestion > list)
 
Suggestion findSuggestion (ArrayList< Suggestion > suggestions, Suggestion suggestion)
 
ArrayList< SuggestionfindSuggestions (ArrayList< Suggestion > suggestions, Suggestion suggestion)
 
ArrayList< SuggestiongetAllLinkedSugg (Suggestion suggestion)
 
ArrayList< SuggestiongetSuggestionsForAlternatives (Integer documentId, int minimalConfidence)
 
ArrayList< SugLinkedAttributegetLinkedSugAttrsByLink (Integer suggId)
 
ArrayList< SugNestedAttributegetNestedSugAttrsByNested (Integer suggId)
 
ArrayList< SuggestionFeedbackgetNegFeedbackFromDB (Integer documentId, Integer groupId)
 
boolean isDocUpdate (RequestInfo request)
 
boolean isSuggestionsRequest (RequestInfo request)
 
boolean isPositiveFeedback (RequestInfo request)
 
boolean isNegativeFeedback (RequestInfo request)
 
boolean isAnnotChange (RequestInfo request)
 
boolean isAnnotDelete (RequestInfo request)
 
boolean isAnnotAdded (RequestInfo request)
 

Static Private Member Functions

static ArrayList< SuggestiongetAllDependencies (Suggestion suggestion)
 
static void loadTypeDefsFromDB ()
 
static String getSuggestionsXMLFromJSON (String responseData)
 
static boolean checkException (JSONObject jsonData)
 
static String createSecApiSuggestionsRequest (String doc, String uri, boolean useAlternatives)
 
static String createSecApiTypesRequest ()
 
static ArrayList< Integer > findSeparators (String doc)
 
static void filtrateByConfidence (Integer minimalConfidence, ArrayList< Suggestion > userSuggestions)
 
static AnnotType getTypeWithSameURI (List< AnnotType > list, String uri)
 
static ArrayList
< SuggestionFragment
fragToSuggFrag (ArrayList< Fragment > fragments, Suggestion reference)
 
static void filtrateByFragments (EditorSession session, ArrayList< Suggestion > userSuggestions)
 
static void filtrateByType (EditorSession session, ArrayList< Suggestion > userSuggestions)
 
static boolean isInFragment (Document doc, Suggestion sugg, SuggestionFragment linFragment)
 
static AnnotType cloneType (AnnotType referenceType)
 
static void cloneTypeAttributes (AnnotType referenceType, AnnotType newType)
 
static boolean isAnnotTypeInArray (ArrayList< AnnotType > types, String uri)
 
static AnnotType cloneTypesTree (AnnotType currentType, UserGroup currentGroup, ArrayList< AnnotType > clonedTypes)
 
static AnnotType getAnnotTypeFromDB (Integer groupId, String uri)
 
static void persistFeedback (SuggestionFeedback feedback)
 
static void updateFeedback (SuggestionFeedback feedback)
 
static SuggestionFeedback getFeedbackSFromDB (Integer suggestionId, Integer groupId)
 
static String EscapeForSecApi (String source)
 

Static Private Attributes

static String disambiguate = "1"
 

Detailed Description

Class provides offerining of suggestions with usage of local knowledge repository.

Class provides offerining of suggestion with usage of local knowledge repository.

Author
Martin Petr (xpetrm05) Class provides offerining of suggestions.
Martin Petr (xpetrm05)

Definition at line 79 of file SuggestionManager.java.

Constructor & Destructor Documentation

cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.SuggestionManager ( RequestInfo  request)

Constructor

Parameters
requestInformations about client request

Definition at line 112 of file SuggestionManager.java.

Member Function Documentation

static ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.addAllDependencies ( ArrayList< Suggestion filteredSuggestions,
ArrayList< Suggestion nonFilteredSuggestion 
)
static

Method go through filtered suggestions list and searches dependencies ( linked and nested suggestions and parents) that are in non filtered suggestion list and add them to filtered suggestion list.

Parameters
filteredSuggestionsFiltered suggestion list
nonFilteredSuggestionNon-filtered suggestions list
Returns
Returns resulting list with suggestions

Definition at line 1966 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.annotationsAddChange ( RequestInfo  request)
private

Top level method thats handle situation when there is positive feedback, added annotations or changed annotations

Parameters
requestinformations about client request

Definition at line 238 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.annotationsDelete ( RequestInfo  request)
private

Top level method thats handle situation when annotations are deleted.

Parameters
requestinformations about client request
Returns
string with message for client

Definition at line 325 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<AnnotType> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.breakdownType ( AnnotType  type,
RequestInfo  requestInfo,
ArrayList< AnnotType newTypes 
)
static

If ancestor of type of annotation is not exists, but should and name is probably composed of path in type tree, this method breakdowns path, sets name properly and generate ancestors. New names are generated from URI. Ancestors are stored into informations about client request.

Parameters
typeType of annotation to check and breakdown
requestInfoInformations about client request
newTypesList of newly added types

Definition at line 2970 of file SuggestionManager.java.

Here is the call graph for this function:

static String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.changeGroupInUri ( String  uri,
Integer  groupId 
)
static

Method changes group id in annotation attribute uri.

Parameters
uriold annotation type uri
groupIdnew group id

Definition at line 2017 of file SuggestionManager.java.

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.checkException ( JSONObject  jsonData)
staticprivate

Checks if JSON from SEC API contains exception and if yes, logs it

Parameters
jsonDataJSON data from SEC API
Returns
If exception was presented, returns true, false otherwise

Definition at line 864 of file SuggestionManager.java.

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.checkTypes ( EditorSession  session,
ArrayList< Suggestion suggestions,
ArrayList< AnnotType newTypes,
boolean  solveAtribute 
)
static

Method check types of given suggestions, if finds unknown type create it, if finds known type change it and if type is ok (for current user group) leave type alone.

Parameters
sessionsession of user
suggestionslist of suggestions which types will be checked
newTypeslist of types, that was/will be created by this function
solveAtributeFalse - this function don't clone attribute type (although it is necessary)

Definition at line 2058 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static AnnotType cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.cloneType ( AnnotType  referenceType)
staticprivate

Method clone attributes annot type without group, id, uri and attributes.

Parameters
referenceTypeannotation type that will be clone
Returns
new annotation type cloned from referenced type

Definition at line 2836 of file SuggestionManager.java.

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.cloneTypeAttributes ( AnnotType  referenceType,
AnnotType  newType 
)
staticprivate

Method clone attributes reference annot type and copy them to new type.

Parameters
referenceTypeattributes of this annotation type will be clone
newTypecloned atributes will be copied to this annotation type

Definition at line 2852 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static AnnotType cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.cloneTypesTree ( AnnotType  currentType,
UserGroup  currentGroup,
ArrayList< AnnotType clonedTypes 
)
staticprivate

Method clone given type and all his ancestors tree if they aren't stored in DB under given user group.

Parameters
currentTypetype of otrer group for clone
currentGroupcurrent group of clonned type
clonedTypeslist of cloned types, this list is filled in this function, out of this function is this list processed
Returns
cloned currentType

Definition at line 2896 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.compareFragments ( ArrayList< Suggestion suggestions,
ArrayList< Suggestion changedSuggestions 
)
private

Set low confidence to suggestions with same fragments. Some suggestions may be devastated be updateSuggestionsFragments, fragments of more suggestions may be same, only one of this suggestions should have high confidence.

Parameters
suggestionsList of suggestions
changedSuggestionsList of changed suggestions

Definition at line 2204 of file SuggestionManager.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.suggestionManager.SuggestionManager.createSecApiSuggestionsRequest ( String  doc,
String  uri,
boolean  useAlternatives 
)
staticprivate

Creates SEC API request for suggestions

Parameters
docLinearized document
uriURI of original document
useAlternativesTrue for work with alternatives, false otherwise
Returns
Returns SEC API request for suggestions

Definition at line 888 of file SuggestionManager.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.suggestionManager.SuggestionManager.createSecApiTypesRequest ( )
staticprivate

Creates SEC API request for types and attributes

Returns
Returns SEC API request for types and attributes

Definition at line 925 of file SuggestionManager.java.

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.cutRefusedSuggLinks ( ArrayList< Suggestion userSuggestions,
ArrayList< Suggestion refusedSuggestions 
)
private

Method sets the rejected references to null and return changed suggestions.

Parameters
userSuggestionslist of filtered suggestions
refusedSuggestionslist of refused suggestions by users
Returns
changed suggestions

Definition at line 1873 of file SuggestionManager.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.suggestionManager.SuggestionManager.EscapeForSecApi ( String  source)
staticprivate

Creates escaped version of the provided textual data for use in JSON format for SEC API. Method expects SEC API to store strings enclosed in double quote. That's why double quote character needs to be escaped and single quote not.

Parameters
sourcestring with characters to be escaped
Returns
Returns escaped veersion of string

Definition at line 3594 of file SuggestionManager.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.feedbackChangeRef ( ArrayList< Suggestion list,
Suggestion  sgFromList,
ArrayList< Suggestion modified,
SuggestionFeedback  fb,
ArrayList< Suggestion removedSuggestions 
)
private

Adds links in suggestion to modified suggs

Parameters
listList of suggestions
sgFromListSuggestion to check for links
modifiedList to which modified suggestions will be added
fbfeedback for this suggestion
removedSuggestionsRemoved suggestions from list.

Definition at line 1765 of file SuggestionManager.java.

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.filterByClientCache ( EditorSession  session,
ArrayList< Suggestion shouldHave,
ArrayList< Suggestion changedSuggestions 
)
private

Method filter list with suggestions which client should have and leave only suggestions that are interested for client (new or changed). Client's session is updated and message for client generated.

Parameters
sessionInformations about client session
shouldHaveList with suggestions which client should have
changedSuggestionsList with changed suggestions
Returns
String with messages for client

Definition at line 1553 of file SuggestionManager.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.suggestionManager.SuggestionManager.filtrateByConfidence ( Integer  minimalConfidence,
ArrayList< Suggestion userSuggestions 
)
staticprivate

Method filter list of suggestions by confidence.

Parameters
minimalConfidencesuggestions lower than this confidence will be removed from list
userSuggestionssuggestions that will be filtered

Definition at line 1945 of file SuggestionManager.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.suggestionManager.SuggestionManager.filtrateByFragments ( EditorSession  session,
ArrayList< Suggestion userSuggestions 
)
staticprivate

Method filter list of suggestions by fragments.

Parameters
sessionsession where are stored fragments specified by user
userSuggestionssuggestions that will be filtered

Definition at line 2615 of file SuggestionManager.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.suggestionManager.SuggestionManager.filtrateByType ( EditorSession  session,
ArrayList< Suggestion userSuggestions 
)
staticprivate

Method filter list of suggestions by their type.

Parameters
sessionsession from user where is stored type that specifies suggestions
userSuggestionssuggestions that will be filtered

Definition at line 2668 of file SuggestionManager.java.

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.filtrateRefusedSugg ( RequestInfo  request,
ArrayList< Suggestion docSuggestions 
)
private

Method filter document suggestions by user group feedback, method builds suggestion list without suggestions with negative references.

Parameters
requestrequest from user
docSuggestionsall document suggestions

Definition at line 1636 of file SuggestionManager.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.filtrateSuggestions ( RequestInfo  requestInfo,
EditorSession  session,
ArrayList< Suggestion userSuggestions 
)
static

Method filter list of suggestions by attributes in request.

Parameters
requestInfoInformations about client request
sessionsession where are stored attributes specified by user
userSuggestionssuggestions that will be filtered

Definition at line 1930 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<Integer> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.findSeparators ( String  doc)
staticprivate

Finds offsets of all ocurrences of refuse border separator in linearized document (separators are defined in Constants)

Parameters
docLinearized document
Returns
Returns offsets of separators

Definition at line 936 of file SuggestionManager.java.

Here is the caller graph for this function:

Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.findSuggestion ( ArrayList< Suggestion suggestions,
Suggestion  suggestion 
)
private

Method finds suggestion in the suggestion list by its content.

Parameters
suggestionssuggestion list where method will search
suggestionsuggestion which will be seek
Returns
founded suggestion

Definition at line 2547 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.findSuggestions ( ArrayList< Suggestion suggestions,
Suggestion  suggestion 
)
private

Method finds suggestions in the suggestion list by its content. Suggestions, not suggestion.

Parameters
suggestionssuggestion list where method will search
suggestionsuggestion which will be seek
Returns
founded suggestions in list.

Definition at line 2567 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.findSuggInArray ( Integer  id,
ArrayList< Suggestion list 
)
private

Method finds suggestion by id in suggestions array.

Parameters
idid of searched suggestion
listArray to search in

Definition at line 2385 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<SuggestionFragment> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.fragToSuggFrag ( ArrayList< Fragment fragments,
Suggestion  reference 
)
staticprivate

Method converts list of fragments to list of SuggestionFragments.

Parameters
fragmentslist of fragments
referenceSuggestion to which new fragment should belong
Returns
list of converted fragments

Definition at line 2587 of file SuggestionManager.java.

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getAddMessagesString ( ArrayList< Suggestion suggestions)
private

Method make message with suggestions from given array.

Parameters
suggestionslist of suggestions
Returns
string with added suggestions

Definition at line 1388 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getAffectedForDelete ( ArrayList< Annotation removedAnnot)
private

Method searches suggestions that will be affectedy by removing annotations.

Parameters
removedAnnotlist of removed annotations
Returns
list of changed suggestions

Definition at line 2159 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getAllDependencies ( Suggestion  suggestion)
staticprivate

Method finds all linked and nested suggestions of suggestions and return them as an ArrayList.

Parameters
suggestionsuggestion with possible dependencies
Returns
list of found linked and nested suggestions

Definition at line 279 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getAllLinkedSugg ( Suggestion  suggestion)
private

Method finds all linked suggestions of suggestions and return them as ArrayList.

Parameters
suggestionsuggestion for which will be linked suggestions searched
Returns
list of founded linked suggestions

Definition at line 2803 of file SuggestionManager.java.

Here is the call graph for this function:

static AnnotType cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getAnnotTypeFromDB ( Integer  groupId,
String  uri 
)
staticprivate

Method loads annotation type specified by group and uri from the database.

Parameters
groupIdid of group of querried annotation type
uriuri of querried annotation type
Returns
annotation type that fits by groupId and uri

Definition at line 3266 of file SuggestionManager.java.

Here is the caller graph for this function:

static AnnotType cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getAnnotTypeFromDB ( String  uri)
static

Method loads annotation type specified by uri from the database.

Parameters
uriUri of queried annotation type
Returns
Returns annotation type that fits by uri

Definition at line 3283 of file SuggestionManager.java.

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getDeleteMessagesString ( ArrayList< Integer >  suggestions)
private

Method make message with suggestions to delete from given array.

Parameters
suggestionslist of suggestions to delete
Returns
string with suggestions to delete

Definition at line 1434 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static SuggestionFeedback cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getFeedbackByAnnot ( Integer  annotId)
static

Method loads suggestion positive feedback specified by annotation.

Parameters
annotIdannotation id that specify suggestion feedback
Returns
array list with founded negative suggestions feedback

Definition at line 3390 of file SuggestionManager.java.

Here is the caller graph for this function:

static ArrayList<SuggestionFeedback> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getFeedbackFromDB ( Integer  documentId,
Integer  groupId 
)
static

Method loads suggestion feedback specified by group and document from the database.

Parameters
documentIddocument id that specify suggestion feedback
groupIdgroup id that specify suggestion feedback

Definition at line 3371 of file SuggestionManager.java.

Here is the caller graph for this function:

static SuggestionFeedback cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getFeedbackSFromDB ( Integer  suggestionId,
Integer  groupId 
)
staticprivate

Method loads suggestion feedback specified by suggestion ID and group ID.

Parameters
suggestionIdId of suggestion for which we are searching suggestion feedback
groupIdID of group to which feedback belongs
Returns
Returns querried suggestion feedback or null if feedback isn't found

Definition at line 3429 of file SuggestionManager.java.

Here is the caller graph for this function:

static ArrayList<SuggestionFragment> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getLinearized ( Document  doc,
ArrayList< SuggestionFragment fragments 
)
static

Method make from list of structured fragments list of linearized fragments.

Parameters
docdocument that fragments belongs
fragmentslist of structured fragments
Returns
list of linearized fragments

Definition at line 2723 of file SuggestionManager.java.

Here is the caller graph for this function:

ArrayList<SugLinkedAttribute> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getLinkedSugAttrsByLink ( Integer  suggId)
private

Method loads suggestion attributes specified by suggestion link.

Parameters
suggIdid of suggestion
Returns
list of founded linked suggestion attributes

Definition at line 3300 of file SuggestionManager.java.

Here is the caller graph for this function:

ArrayList<SuggestionFeedback> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getNegFeedbackFromDB ( Integer  documentId,
Integer  groupId 
)
private

Method loads negative suggestion feedback specified by group and document from the database.

Parameters
documentIddocument id that specify suggestion feedback
groupIdgroup id that specify suggestion feedback
Returns
array list with founded negative suggestions feedback

Definition at line 3409 of file SuggestionManager.java.

Here is the caller graph for this function:

ArrayList<SugNestedAttribute> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getNestedSugAttrsByNested ( Integer  suggId)
private

Method loads suggestion attributes specified by nested suggestion.

Parameters
suggIdid of nested suggestion
Returns
list of founded linked suggestion attributes

Definition at line 3318 of file SuggestionManager.java.

Here is the caller graph for this function:

static ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getNestedSuggFromToDelete ( ArrayList< Suggestion inputSuggs,
ArrayList< Suggestion suggsToDelete 
)
static

Method searches for those suggestions from the input array that are nested in ones included in the second array.

Parameters
inputSuggsAll current suggestions
suggsToDeleteSuggestions that are going removed
Returns
Suggestions that are nested in removed suggestions

Definition at line 1833 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getNewClientCache ( ArrayList< Suggestion addedSugg,
ArrayList< Integer >  deletedSugg,
ArrayList< Integer >  actualCache 
)
private

Definition at line 1519 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

AnnotSugPair cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getPairByAnnot ( ArrayList< AnnotSugPair pairs,
Annotation  annot 
)
private

Method searches in pair of suggestions and annots for pair that is specified by annotation.

Parameters
pairslist where will be pair searched
annotannotation that specify pair

Definition at line 1997 of file SuggestionManager.java.

Here is the call graph for this function:

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestionFromDB ( Integer  id)
static

Method loads suggestion specified by id from the database.

Parameters
idid that specify suggestions
Returns
querried suggestion or null if suggestion isn't found

Definition at line 3445 of file SuggestionManager.java.

Here is the caller graph for this function:

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestionFromList ( Integer  suggestionId,
List< Suggestion list 
)
static

Return suggestion from list by id. Return null if not found.

Parameters
suggestionIdId of suggestion
listList of suggestion
Returns
Founded suggestion

Definition at line 1672 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestions ( RequestInfo  request)
private

Top level method thats handle situation when user want suggestions.

Parameters
requestinformations about client request
Returns
string with message for client

Definition at line 338 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestionsForAlternatives ( Integer  documentId,
int  minimalConfidence 
)
private

Method loads suggestions specified by document and confidence from the database.

Parameters
documentIddocument id that specify suggestions
minimalConfidenceminimal confidence of suggestions
Returns
list of querried suggestions

Definition at line 3199 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestionsFromDB ( Integer  documentId)
static

Method loads suggestions specified by document from the database.

Parameters
documentIddocument id that specify suggestions
Returns
list of querried suggestions

Definition at line 3217 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestionsFromRemoteSECAPI ( RequestInfo  parRequestInfo,
String  doc,
String  uri,
boolean  useAlternatives,
ArrayList< Suggestion validSuggestions 
)

Gets suggestions from remote SEC API and translates them to the Suggestion objects.

Parameters
parRequestInfoInformations about client request
docLinearized document
uriURI of original document
useAlternativesTrue for work with alternatives, false otherwise
validSuggestionsList of valid suggestions
Returns
Returns suggestions (ArrayList<Suggestion>) or alternatives of suggestions (ArrayList<Alternative>) for the document

Definition at line 787 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestionsFromSECAPI ( RequestInfo  parRequestInfo,
String  doc,
String  uri,
boolean  useAlternatives,
ArrayList< Suggestion validSuggestions 
)

Gets suggestions from SEC API and translates them to the Suugestion objects.

Parameters
parRequestInfoInformations about client request
docLinearized document
uriURI of original document
useAlternativesTrue for work with alternatives, false otherwise
validSuggestionsList of valid suggestions
Returns
Returns suggestions (ArrayList<Suggestion>) or alternatives of suggestions (ArrayList<Alternative>) for the document

Definition at line 724 of file SuggestionManager.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.suggestionManager.SuggestionManager.getSuggestionsXMLFromJSON ( String  responseData)
staticprivate

Gets XML with suggestions from JSON response data from SEC API

Parameters
responseDataResponse data from SEC API
Returns
Returns XML with suggestions in String

Definition at line 831 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getSuggestionWithoutFeedback ( ArrayList< Suggestion list,
ArrayList< Suggestion modified 
)
private

Removes suggestions with feedback from the list and replaces all references to them by annotations from feedback (for negative feedback by null).

Parameters
listList of suggestions
modifiedList to which modified suggestions will be added
Returns
Removed suggestions from list.

Definition at line 1696 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static AnnotType cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.getTypeWithSameURI ( List< AnnotType list,
String  uri 
)
staticprivate

Get annotType from list with specific URI.

Parameters
listList of annotType
uriURI of AnnotType
Returns
If found - type, else null.

Definition at line 2035 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.haveLinkOn ( Suggestion  suggestion,
Suggestion  linkedSuggestion 
)
private

Gets true value if one suggestion have link to other.

Parameters
suggestionsuggestion where will be link searched
linkedSuggestionsuggestion to which is link searched
Returns
Returns true value if one suggestion have link to other, false otherwise.

Definition at line 551 of file SuggestionManager.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.initReqTypes ( )
static

Initializes Requested types definitions in AppBean

Definition at line 585 of file SuggestionManager.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.suggestionManager.SuggestionManager.initReqTypesFromRemote ( SECAPIConn  conn,
RequestInfo  requestInfo 
)
static

Initializes Requested types definitions in AppBean from remote SEC API

Parameters
connConnection to SEC API server
requestInfoInfo about clients request

Definition at line 616 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.insertNewSuggestions ( ArrayList< Suggestion newSuggestions,
ArrayList< Suggestion oldSuggestions,
ArrayList< Suggestion addedSugg,
ArrayList< Suggestion changedSugg 
)
private

Method adds a new suggestions to the old suggestions. Method uses these rules:

  • If the new suggestion is found in the old suggestions then is increased its confidence
  • If the new suggestion isn't found in the old suggestions then is added to old suggestions
  • If there is suggestion in old suggestion that isn't in new suggestion then is decreased its confidence
Parameters
newSuggestionsnew suggestions from ner
oldSuggestionsexisting suggestions for document that are in DB
addedSuggthere will be new annotations saved
changedSuggthere will be changed annotations saved

Definition at line 2319 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isAnnotAdded ( RequestInfo  request)
private

Method test if is there request with added annotations.

Parameters
requestinformations about client request
Returns
true if is ther request with added annotations

Definition at line 3576 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isAnnotChange ( RequestInfo  request)
private

Method test if is there request with changed annotations.

Parameters
requestinformations about client request
Returns
true if is ther request with changed annotations

Definition at line 3546 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isAnnotDelete ( RequestInfo  request)
private

Method test if is there request with removed annotations.

Parameters
requestinformations about client request
Returns
true if is ther request with removed annotations

Definition at line 3561 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isAnnotTypeInArray ( ArrayList< AnnotType types,
String  uri 
)
staticprivate

Method tests if array of annotation types contains type with specific uri.

Parameters
typesarray of types
urisearched type uri
Returns
true if type is found

Definition at line 2874 of file SuggestionManager.java.

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isDocUpdate ( RequestInfo  request)
private

Method test if is there request for document update.

Parameters
requestinformations about client request
Returns
true if is ther request for document update

Definition at line 3488 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isInFragment ( Document  doc,
Suggestion  sugg,
SuggestionFragment  linFragment 
)
staticprivate

Method check if suggestion is in linear document fragment.

Parameters
docdocument that suggestion and fragment belongs
suggsuggestion that will be tested
linFragmentlinearized document fragment that will be tested

Definition at line 2757 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isNegativeFeedback ( RequestInfo  request)
private

Method test if is there request with negative feedback.

Parameters
requestinformations about client request
Returns
true if is ther request with negative feedback

Definition at line 3532 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isPositiveFeedback ( RequestInfo  request)
private

Method test if is there request with positive feedback.

Parameters
requestinformations about client request
Returns
true if is ther request with positive feedback

Definition at line 3518 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isSuggestionInFeedback ( ArrayList< SuggestionFeedback feedbackList,
Suggestion  searchedSugg 
)
private

Finds suggestion in feedback

Parameters
feedbackListList with feedback
searchedSuggSearched suggestion
Returns
If suggestion is in feedback, returns true, false otherwise.

Definition at line 1811 of file SuggestionManager.java.

Here is the call graph for this function:

boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isSuggestionsRequest ( RequestInfo  request)
private

Method test if is there request for suggestions.

Parameters
requestinformations about client request
Returns
true if is ther request for suggestions

Definition at line 3505 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.isTypeInGroups ( AnnotType  annotType,
RequestInfo  requestInfo 
)
static

Checks whether type come under user groups of logged in user

Parameters
annotTypeChecked type of annotation
requestInfoInformations about client request
Returns
If type come under user groups of logged in user, returns true, false otherwise

Definition at line 496 of file SuggestionManager.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.suggestionManager.SuggestionManager.loadTypeDefsFromDB ( )
staticprivate

Loads desired and unnecessary type definitions from database

Definition at line 644 of file SuggestionManager.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.lockDocForChange ( Integer  documentId)

Method locks the document suggestions for change.

Parameters
documentIdid of document

Definition at line 3465 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.makeClientMessage ( String  suggestionToAddM,
String  suggestionToRemoveM 
)
private

Method make from added suggestions string and added suggestion strings message for client.

Parameters
suggestionToAddMstring with added suggestions
suggestionToRemoveMstring with removed suggestions

Definition at line 1495 of file SuggestionManager.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.suggestionManager.SuggestionManager.persistFeedback ( SuggestionFeedback  feedback)
staticprivate

Method store new suggestion feedback to DB.

Parameters
feedbacksuggestion feedback that will be stored

Definition at line 3335 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.persistTypes ( ArrayList< AnnotType types)
static

Persist types of annotations to DB

Parameters
typesTypes of annotations to persist
Returns
In case of success returns false, true otherwise

Definition at line 3043 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.printSuggestionsDiff ( EditorSession  session,
ArrayList< Suggestion modifiedSuggestions,
ArrayList< AnnotType newTypes 
)

Method which prepares messages for the client and updates client's session based on now modified suggestions and previous client's session.

Parameters
sessionInformations about client session
modifiedSuggestionsSuggestions which was modified in this request
newTypesList of new annotation types to send along with suggestions
Returns
Returns string with message for client

Definition at line 523 of file SuggestionManager.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.suggestionManager.SuggestionManager.printTypes ( RequestInfo  requestInfo,
EditorSession  session,
ArrayList< AnnotType newTypes 
)
static

Creates message with added annotation types for the client

Parameters
sessionInformations about client session
newTypesArray with new types of annotations
requestInfoInformations about client request
Returns
Returns message for the client

Definition at line 456 of file SuggestionManager.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.suggestionManager.SuggestionManager.processSugAttributes ( List< Suggestion suggestionList,
ArrayList< Suggestion result 
)
static

Process suggestion attributes

Parameters
suggestionListOriginal list of suggestions
resultNew list of suggestions

Definition at line 3235 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static AnnotType cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.queryType ( String  uri,
EntityManager  em 
) throws RuntimeException
static

Query database for type of annotation

Parameters
uriURI of type of annotation
emEntity manager
Returns
Returns type of annotation with given URI
Exceptions
RuntimeExceptionIf type of annotation was not found, throws exception

Definition at line 3170 of file SuggestionManager.java.

Here is the caller graph for this function:

ArrayList<SuggestionLogEntry> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.refuseOtherSugFromFragments ( RequestInfo  request)
private

Refuses other suggestions for fragments for which is some suggestion confirmed

Parameters
requestInformations about client request
Returns
Returns list of refused suggestions

Definition at line 1118 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.rejectSuggestions ( RequestInfo  request,
ArrayList< SuggestionLogEntry skipSugs,
ArrayList< SuggestionLogEntry noAlternatives 
)
private

Top level method thats handle situation when user rejected some suggestions.

Parameters
requestInformations about client request
skipSugsSuggestions for which update of negative feedback should be skipped
noAlternativesList of suggestions for which alternatives should not be activated

Definition at line 422 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.run ( )

Method start the thread code execution.

Definition at line 121 of file SuggestionManager.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.sendToOthers ( RequestInfo  requestInfo,
String  message 
)
static

Send message to other clients

Parameters
requestInfoInformations about client request
messageString with message

Definition at line 401 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.setConfidenceToAllNested ( Suggestion  sg,
Integer  confidence,
ArrayList< Suggestion changedSuggestions 
)
private

Set confidence to suggestion and to its all nested suggestions.

Parameters
sgSuggestion
confidenceConfidence
changedSuggestionsList of changed suggestions

Definition at line 2242 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static SuggestionSource cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.sourceOfSuggestions ( String  document)
static

Return source of suggestions.

Parameters
documentDocument.
Returns
Source of suggestions.

Definition at line 1373 of file SuggestionManager.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.startModule ( )
package

Method start module

Definition at line 162 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.unlockDocForChange ( Integer  documentId)

Method unlocks the document suggestions for change.

Parameters
documentIdid of document

Definition at line 3478 of file SuggestionManager.java.

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.updateDocument ( RequestInfo  request)
private

Top level method thats handle situation when synchronized document was updated.

Parameters
requestinformations about client request

Definition at line 361 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.updateDocument ( RequestInfo  request,
ArrayList< Suggestion oldSuggestions,
ArrayList< Suggestion addedSuggestions,
ArrayList< Suggestion changedSuggestions,
ArrayList< AnnotType newTypes 
)
private

Main method to update suggestion database after document change. Method retrieves the new suggestions and compares them with existing old suggestions and save changes and new suggestions.

Parameters
requestinformations about client request
oldSuggestionsexisting suggestions for document that are in DB
addedSuggestionsthere will be new annotations saved
changedSuggestionsthere will be changed annotations saved
newTypesArray for adding new types of annotations

Definition at line 1292 of file SuggestionManager.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.updateFeedback ( SuggestionFeedback  feedback)
staticprivate

Method updates suggestion feedback in DB.

Parameters
feedbacksuggestion feedback that will be update

Definition at line 3352 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.updateNegativeFeedback ( RequestInfo  request,
ArrayList< SuggestionLogEntry skipSugs,
ArrayList< SuggestionLogEntry noAlternatives 
)
private

Method for updating negative feedback

Parameters
requestInformations about client request
skipSugsSuggestions for which update should be skipped
noAlternativesList of suggestions for which alternatives should not be activated
Returns
Refused suggestions

Definition at line 960 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.updateSuggestion ( Suggestion  suggestion,
RequestInfo  request 
)
static

Updates fragments in suggestion. (Method copied from CoreFuncMOdule)

Parameters
suggestionSuggestion to update
requestInformations about client request
Returns
If suggestion was updated, returns true, if no update needed or error occurred, returns false

Definition at line 2406 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.updateSuggestionsFragments ( ArrayList< Suggestion suggestions,
RequestInfo  request,
ArrayList< Suggestion changedSugg 
)
private

Method goes through all suggestions and their fragments and try to update them. If some suggestion have bad fragment sets that suggestions minimal confidence.

Parameters
suggestionsold suggestions to update
requestinformations about client request
changedSuggArray for changed suggestions

Definition at line 2270 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.updateSuggNegativeFeedback ( RequestInfo  request,
Integer  groupId,
int  refusedSuggID,
boolean  processAlternatives 
)
static

Method for updating negative feedback for one suggestion

Parameters
requestInformations about client request
groupIdGroup ID of the current user
refusedSuggIDID of the refused Suggestion
processAlternativesFlag to processing alternatives
Returns
Reference to the updated suggestion

Definition at line 1231 of file SuggestionManager.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

final int cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.CONFIRMED_CONFIDENCE = 90
static

Definition at line 88 of file SuggestionManager.java.

String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.disambiguate = "1"
staticprivate

Definition at line 918 of file SuggestionManager.java.

final int cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.INITIAL_CONFIDENCE = 50
static

Definition at line 86 of file SuggestionManager.java.

final int cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.MINIMAL_CONFIDENCE = 5
static

Definition at line 85 of file SuggestionManager.java.

final int cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.MINIMAL_FILTER_CONFIDENCE = 5
static

Definition at line 89 of file SuggestionManager.java.

final String cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.MODULE_NAME = "SuggestionManager"
static

Name of this module

Definition at line 91 of file SuggestionManager.java.

final int cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.NOT_USABLE_CONFIDENCE = 4
static

Definition at line 84 of file SuggestionManager.java.

final int cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.REFUSED_CONFIDENCE = 40
static

Definition at line 87 of file SuggestionManager.java.

RequestInfo cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.requestInfo = null
package

Informations about request from client

Definition at line 82 of file SuggestionManager.java.

UserGroup cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.userGroup

Default user group

Definition at line 94 of file SuggestionManager.java.


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