4A Server -
2.0
|
Class provides offerining of suggestions with usage of local knowledge repository. More...
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< Suggestion > | getNestedSuggFromToDelete (ArrayList< Suggestion > inputSuggs, ArrayList< Suggestion > suggsToDelete) |
static void | filtrateSuggestions (RequestInfo requestInfo, EditorSession session, ArrayList< Suggestion > userSuggestions) |
static ArrayList< Suggestion > | addAllDependencies (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< AnnotType > | breakdownType (AnnotType type, RequestInfo requestInfo, ArrayList< AnnotType > newTypes) |
static boolean | persistTypes (ArrayList< AnnotType > types) |
static AnnotType | queryType (String uri, EntityManager em) throws RuntimeException |
static ArrayList< Suggestion > | getSuggestionsFromDB (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< Suggestion > | updateNegativeFeedback (RequestInfo request, ArrayList< SuggestionLogEntry > skipSugs, ArrayList< SuggestionLogEntry > noAlternatives) |
ArrayList< SuggestionLogEntry > | refuseOtherSugFromFragments (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< Suggestion > | filtrateRefusedSugg (RequestInfo request, ArrayList< Suggestion > docSuggestions) |
ArrayList< Suggestion > | getSuggestionWithoutFeedback (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< Suggestion > | cutRefusedSuggLinks (ArrayList< Suggestion > userSuggestions, ArrayList< Suggestion > refusedSuggestions) |
AnnotSugPair | getPairByAnnot (ArrayList< AnnotSugPair > pairs, Annotation annot) |
ArrayList< Suggestion > | getAffectedForDelete (ArrayList< Annotation > removedAnnot) |
void | compareFragments (ArrayList< Suggestion > suggestions, ArrayList< Suggestion > changedSuggestions) |
void | setConfidenceToAllNested (Suggestion sg, Integer confidence, ArrayList< Suggestion > changedSuggestions) |
ArrayList< Suggestion > | updateSuggestionsFragments (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< Suggestion > | findSuggestions (ArrayList< Suggestion > suggestions, Suggestion suggestion) |
ArrayList< Suggestion > | getAllLinkedSugg (Suggestion suggestion) |
ArrayList< Suggestion > | getSuggestionsForAlternatives (Integer documentId, int minimalConfidence) |
ArrayList< SugLinkedAttribute > | getLinkedSugAttrsByLink (Integer suggId) |
ArrayList< SugNestedAttribute > | getNestedSugAttrsByNested (Integer suggId) |
ArrayList< SuggestionFeedback > | getNegFeedbackFromDB (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< Suggestion > | getAllDependencies (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" |
Class provides offerining of suggestions with usage of local knowledge repository.
Class provides offerining of suggestion with usage of local knowledge repository.
Definition at line 79 of file SuggestionManager.java.
cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.SuggestionManager | ( | RequestInfo | request | ) |
Constructor
request | Informations about client request |
Definition at line 112 of file SuggestionManager.java.
|
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.
filteredSuggestions | Filtered suggestion list |
nonFilteredSuggestion | Non-filtered suggestions list |
Definition at line 1966 of file SuggestionManager.java.
|
private |
Top level method thats handle situation when there is positive feedback, added annotations or changed annotations
request | informations about client request |
Definition at line 238 of file SuggestionManager.java.
|
private |
Top level method thats handle situation when annotations are deleted.
request | informations about client request |
Definition at line 325 of file SuggestionManager.java.
|
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.
type | Type of annotation to check and breakdown |
requestInfo | Informations about client request |
newTypes | List of newly added types |
Definition at line 2970 of file SuggestionManager.java.
|
static |
Method changes group id in annotation attribute uri.
uri | old annotation type uri |
groupId | new group id |
Definition at line 2017 of file SuggestionManager.java.
|
staticprivate |
Checks if JSON from SEC API contains exception and if yes, logs it
jsonData | JSON data from SEC API |
Definition at line 864 of file SuggestionManager.java.
|
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.
session | session of user |
suggestions | list of suggestions which types will be checked |
newTypes | list of types, that was/will be created by this function |
solveAtribute | False - this function don't clone attribute type (although it is necessary) |
Definition at line 2058 of file SuggestionManager.java.
|
staticprivate |
Method clone attributes annot type without group, id, uri and attributes.
referenceType | annotation type that will be clone |
Definition at line 2836 of file SuggestionManager.java.
|
staticprivate |
Method clone attributes reference annot type and copy them to new type.
referenceType | attributes of this annotation type will be clone |
newType | cloned atributes will be copied to this annotation type |
Definition at line 2852 of file SuggestionManager.java.
|
staticprivate |
Method clone given type and all his ancestors tree if they aren't stored in DB under given user group.
currentType | type of otrer group for clone |
currentGroup | current group of clonned type |
clonedTypes | list of cloned types, this list is filled in this function, out of this function is this list processed |
Definition at line 2896 of file SuggestionManager.java.
|
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.
suggestions | List of suggestions |
changedSuggestions | List of changed suggestions |
Definition at line 2204 of file SuggestionManager.java.
|
staticprivate |
Creates SEC API request for suggestions
doc | Linearized document |
uri | URI of original document |
useAlternatives | True for work with alternatives, false otherwise |
Definition at line 888 of file SuggestionManager.java.
|
staticprivate |
Creates SEC API request for types and attributes
Definition at line 925 of file SuggestionManager.java.
|
private |
Method sets the rejected references to null and return changed suggestions.
userSuggestions | list of filtered suggestions |
refusedSuggestions | list of refused suggestions by users |
Definition at line 1873 of file SuggestionManager.java.
|
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.
source | string with characters to be escaped |
Definition at line 3594 of file SuggestionManager.java.
|
private |
Adds links in suggestion to modified suggs
list | List of suggestions |
sgFromList | Suggestion to check for links |
modified | List to which modified suggestions will be added |
fb | feedback for this suggestion |
removedSuggestions | Removed suggestions from list. |
Definition at line 1765 of file SuggestionManager.java.
|
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.
session | Informations about client session |
shouldHave | List with suggestions which client should have |
changedSuggestions | List with changed suggestions |
Definition at line 1553 of file SuggestionManager.java.
|
staticprivate |
Method filter list of suggestions by confidence.
minimalConfidence | suggestions lower than this confidence will be removed from list |
userSuggestions | suggestions that will be filtered |
Definition at line 1945 of file SuggestionManager.java.
|
staticprivate |
Method filter list of suggestions by fragments.
session | session where are stored fragments specified by user |
userSuggestions | suggestions that will be filtered |
Definition at line 2615 of file SuggestionManager.java.
|
staticprivate |
Method filter list of suggestions by their type.
session | session from user where is stored type that specifies suggestions |
userSuggestions | suggestions that will be filtered |
Definition at line 2668 of file SuggestionManager.java.
|
private |
Method filter document suggestions by user group feedback, method builds suggestion list without suggestions with negative references.
request | request from user |
docSuggestions | all document suggestions |
Definition at line 1636 of file SuggestionManager.java.
|
static |
Method filter list of suggestions by attributes in request.
requestInfo | Informations about client request |
session | session where are stored attributes specified by user |
userSuggestions | suggestions that will be filtered |
Definition at line 1930 of file SuggestionManager.java.
|
staticprivate |
Finds offsets of all ocurrences of refuse border separator in linearized document (separators are defined in Constants)
doc | Linearized document |
Definition at line 936 of file SuggestionManager.java.
|
private |
Method finds suggestion in the suggestion list by its content.
suggestions | suggestion list where method will search |
suggestion | suggestion which will be seek |
Definition at line 2547 of file SuggestionManager.java.
|
private |
Method finds suggestions in the suggestion list by its content. Suggestions, not suggestion.
suggestions | suggestion list where method will search |
suggestion | suggestion which will be seek |
Definition at line 2567 of file SuggestionManager.java.
|
private |
Method finds suggestion by id in suggestions array.
id | id of searched suggestion |
list | Array to search in |
Definition at line 2385 of file SuggestionManager.java.
|
staticprivate |
Method converts list of fragments to list of SuggestionFragments.
fragments | list of fragments |
reference | Suggestion to which new fragment should belong |
Definition at line 2587 of file SuggestionManager.java.
|
private |
Method make message with suggestions from given array.
suggestions | list of suggestions |
Definition at line 1388 of file SuggestionManager.java.
|
private |
Method searches suggestions that will be affectedy by removing annotations.
removedAnnot | list of removed annotations |
Definition at line 2159 of file SuggestionManager.java.
|
staticprivate |
Method finds all linked and nested suggestions of suggestions and return them as an ArrayList.
suggestion | suggestion with possible dependencies |
Definition at line 279 of file SuggestionManager.java.
|
private |
Method finds all linked suggestions of suggestions and return them as ArrayList.
suggestion | suggestion for which will be linked suggestions searched |
Definition at line 2803 of file SuggestionManager.java.
|
staticprivate |
Method loads annotation type specified by group and uri from the database.
groupId | id of group of querried annotation type |
uri | uri of querried annotation type |
Definition at line 3266 of file SuggestionManager.java.
|
static |
Method loads annotation type specified by uri from the database.
uri | Uri of queried annotation type |
Definition at line 3283 of file SuggestionManager.java.
|
private |
Method make message with suggestions to delete from given array.
suggestions | list of suggestions to delete |
Definition at line 1434 of file SuggestionManager.java.
|
static |
Method loads suggestion positive feedback specified by annotation.
annotId | annotation id that specify suggestion feedback |
Definition at line 3390 of file SuggestionManager.java.
|
static |
Method loads suggestion feedback specified by group and document from the database.
documentId | document id that specify suggestion feedback |
groupId | group id that specify suggestion feedback |
Definition at line 3371 of file SuggestionManager.java.
|
staticprivate |
Method loads suggestion feedback specified by suggestion ID and group ID.
suggestionId | Id of suggestion for which we are searching suggestion feedback |
groupId | ID of group to which feedback belongs |
Definition at line 3429 of file SuggestionManager.java.
|
static |
Method make from list of structured fragments list of linearized fragments.
doc | document that fragments belongs |
fragments | list of structured fragments |
Definition at line 2723 of file SuggestionManager.java.
|
private |
Method loads suggestion attributes specified by suggestion link.
suggId | id of suggestion |
Definition at line 3300 of file SuggestionManager.java.
|
private |
Method loads negative suggestion feedback specified by group and document from the database.
documentId | document id that specify suggestion feedback |
groupId | group id that specify suggestion feedback |
Definition at line 3409 of file SuggestionManager.java.
|
private |
Method loads suggestion attributes specified by nested suggestion.
suggId | id of nested suggestion |
Definition at line 3318 of file SuggestionManager.java.
|
static |
Method searches for those suggestions from the input array that are nested in ones included in the second array.
inputSuggs | All current suggestions |
suggsToDelete | Suggestions that are going removed |
Definition at line 1833 of file SuggestionManager.java.
|
private |
Definition at line 1519 of file SuggestionManager.java.
|
private |
Method searches in pair of suggestions and annots for pair that is specified by annotation.
pairs | list where will be pair searched |
annot | annotation that specify pair |
Definition at line 1997 of file SuggestionManager.java.
|
static |
Method loads suggestion specified by id from the database.
id | id that specify suggestions |
Definition at line 3445 of file SuggestionManager.java.
|
static |
Return suggestion from list by id. Return null if not found.
suggestionId | Id of suggestion |
list | List of suggestion |
Definition at line 1672 of file SuggestionManager.java.
|
private |
Top level method thats handle situation when user want suggestions.
request | informations about client request |
Definition at line 338 of file SuggestionManager.java.
|
private |
Method loads suggestions specified by document and confidence from the database.
documentId | document id that specify suggestions |
minimalConfidence | minimal confidence of suggestions |
Definition at line 3199 of file SuggestionManager.java.
|
static |
Method loads suggestions specified by document from the database.
documentId | document id that specify suggestions |
Definition at line 3217 of file SuggestionManager.java.
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.
parRequestInfo | Informations about client request |
doc | Linearized document |
uri | URI of original document |
useAlternatives | True for work with alternatives, false otherwise |
validSuggestions | List of valid suggestions |
Definition at line 787 of file SuggestionManager.java.
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.
parRequestInfo | Informations about client request |
doc | Linearized document |
uri | URI of original document |
useAlternatives | True for work with alternatives, false otherwise |
validSuggestions | List of valid suggestions |
Definition at line 724 of file SuggestionManager.java.
|
staticprivate |
Gets XML with suggestions from JSON response data from SEC API
responseData | Response data from SEC API |
Definition at line 831 of file SuggestionManager.java.
|
private |
Removes suggestions with feedback from the list and replaces all references to them by annotations from feedback (for negative feedback by null).
list | List of suggestions |
modified | List to which modified suggestions will be added |
Definition at line 1696 of file SuggestionManager.java.
|
staticprivate |
Get annotType from list with specific URI.
list | List of annotType |
uri | URI of AnnotType |
Definition at line 2035 of file SuggestionManager.java.
|
private |
Gets true value if one suggestion have link to other.
suggestion | suggestion where will be link searched |
linkedSuggestion | suggestion to which is link searched |
Definition at line 551 of file SuggestionManager.java.
|
static |
Initializes Requested types definitions in AppBean
Definition at line 585 of file SuggestionManager.java.
|
static |
Initializes Requested types definitions in AppBean from remote SEC API
conn | Connection to SEC API server |
requestInfo | Info about clients request |
Definition at line 616 of file SuggestionManager.java.
|
private |
Method adds a new suggestions to the old suggestions. Method uses these rules:
newSuggestions | new suggestions from ner |
oldSuggestions | existing suggestions for document that are in DB |
addedSugg | there will be new annotations saved |
changedSugg | there will be changed annotations saved |
Definition at line 2319 of file SuggestionManager.java.
|
private |
Method test if is there request with added annotations.
request | informations about client request |
Definition at line 3576 of file SuggestionManager.java.
|
private |
Method test if is there request with changed annotations.
request | informations about client request |
Definition at line 3546 of file SuggestionManager.java.
|
private |
Method test if is there request with removed annotations.
request | informations about client request |
Definition at line 3561 of file SuggestionManager.java.
|
staticprivate |
Method tests if array of annotation types contains type with specific uri.
types | array of types |
uri | searched type uri |
Definition at line 2874 of file SuggestionManager.java.
|
private |
Method test if is there request for document update.
request | informations about client request |
Definition at line 3488 of file SuggestionManager.java.
|
staticprivate |
Method check if suggestion is in linear document fragment.
doc | document that suggestion and fragment belongs |
sugg | suggestion that will be tested |
linFragment | linearized document fragment that will be tested |
Definition at line 2757 of file SuggestionManager.java.
|
private |
Method test if is there request with negative feedback.
request | informations about client request |
Definition at line 3532 of file SuggestionManager.java.
|
private |
Method test if is there request with positive feedback.
request | informations about client request |
Definition at line 3518 of file SuggestionManager.java.
|
private |
Finds suggestion in feedback
feedbackList | List with feedback |
searchedSugg | Searched suggestion |
Definition at line 1811 of file SuggestionManager.java.
|
private |
Method test if is there request for suggestions.
request | informations about client request |
Definition at line 3505 of file SuggestionManager.java.
|
static |
Checks whether type come under user groups of logged in user
annotType | Checked type of annotation |
requestInfo | Informations about client request |
Definition at line 496 of file SuggestionManager.java.
|
staticprivate |
Loads desired and unnecessary type definitions from database
Definition at line 644 of file SuggestionManager.java.
void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.lockDocForChange | ( | Integer | documentId | ) |
Method locks the document suggestions for change.
documentId | id of document |
Definition at line 3465 of file SuggestionManager.java.
|
private |
Method make from added suggestions string and added suggestion strings message for client.
suggestionToAddM | string with added suggestions |
suggestionToRemoveM | string with removed suggestions |
Definition at line 1495 of file SuggestionManager.java.
|
staticprivate |
Method store new suggestion feedback to DB.
feedback | suggestion feedback that will be stored |
Definition at line 3335 of file SuggestionManager.java.
|
static |
Persist types of annotations to DB
types | Types of annotations to persist |
Definition at line 3043 of file SuggestionManager.java.
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.
session | Informations about client session |
modifiedSuggestions | Suggestions which was modified in this request |
newTypes | List of new annotation types to send along with suggestions |
Definition at line 523 of file SuggestionManager.java.
|
static |
Creates message with added annotation types for the client
session | Informations about client session |
newTypes | Array with new types of annotations |
requestInfo | Informations about client request |
Definition at line 456 of file SuggestionManager.java.
|
static |
Process suggestion attributes
suggestionList | Original list of suggestions |
result | New list of suggestions |
Definition at line 3235 of file SuggestionManager.java.
|
static |
Query database for type of annotation
uri | URI of type of annotation |
em | Entity manager |
RuntimeException | If type of annotation was not found, throws exception |
Definition at line 3170 of file SuggestionManager.java.
|
private |
Refuses other suggestions for fragments for which is some suggestion confirmed
request | Informations about client request |
Definition at line 1118 of file SuggestionManager.java.
|
private |
Top level method thats handle situation when user rejected some suggestions.
request | Informations about client request |
skipSugs | Suggestions for which update of negative feedback should be skipped |
noAlternatives | List of suggestions for which alternatives should not be activated |
Definition at line 422 of file SuggestionManager.java.
void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.run | ( | ) |
Method start the thread code execution.
Definition at line 121 of file SuggestionManager.java.
|
static |
Send message to other clients
requestInfo | Informations about client request |
message | String with message |
Definition at line 401 of file SuggestionManager.java.
|
private |
Set confidence to suggestion and to its all nested suggestions.
sg | Suggestion |
confidence | Confidence |
changedSuggestions | List of changed suggestions |
Definition at line 2242 of file SuggestionManager.java.
|
static |
Return source of suggestions.
document | Document. |
Definition at line 1373 of file SuggestionManager.java.
|
package |
Method start module
Definition at line 162 of file SuggestionManager.java.
void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SuggestionManager.unlockDocForChange | ( | Integer | documentId | ) |
Method unlocks the document suggestions for change.
documentId | id of document |
Definition at line 3478 of file SuggestionManager.java.
|
private |
Top level method thats handle situation when synchronized document was updated.
request | informations about client request |
Definition at line 361 of file SuggestionManager.java.
|
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.
request | informations about client request |
oldSuggestions | existing suggestions for document that are in DB |
addedSuggestions | there will be new annotations saved |
changedSuggestions | there will be changed annotations saved |
newTypes | Array for adding new types of annotations |
Definition at line 1292 of file SuggestionManager.java.
|
staticprivate |
Method updates suggestion feedback in DB.
feedback | suggestion feedback that will be update |
Definition at line 3352 of file SuggestionManager.java.
|
private |
Method for updating negative feedback
request | Informations about client request |
skipSugs | Suggestions for which update should be skipped |
noAlternatives | List of suggestions for which alternatives should not be activated |
Definition at line 960 of file SuggestionManager.java.
|
static |
Updates fragments in suggestion. (Method copied from CoreFuncMOdule)
suggestion | Suggestion to update |
request | Informations about client request |
Definition at line 2406 of file SuggestionManager.java.
|
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.
suggestions | old suggestions to update |
request | informations about client request |
changedSugg | Array for changed suggestions |
Definition at line 2270 of file SuggestionManager.java.
|
static |
Method for updating negative feedback for one suggestion
request | Informations about client request |
groupId | Group ID of the current user |
refusedSuggID | ID of the refused Suggestion |
processAlternatives | Flag to processing alternatives |
Definition at line 1231 of file SuggestionManager.java.
|
static |
Definition at line 88 of file SuggestionManager.java.
|
staticprivate |
Definition at line 918 of file SuggestionManager.java.
|
static |
Definition at line 86 of file SuggestionManager.java.
|
static |
Definition at line 85 of file SuggestionManager.java.
|
static |
Definition at line 89 of file SuggestionManager.java.
|
static |
Name of this module
Definition at line 91 of file SuggestionManager.java.
|
static |
Definition at line 84 of file SuggestionManager.java.
|
static |
Definition at line 87 of file SuggestionManager.java.
|
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.