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

Static class which persists suggestion data to the database. More...

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

Static Public Member Functions

static ArrayList< Suggestionpersist (RequestInfo requestInfo, ArrayList< Annotation > addedAnnotations, ArrayList< Annotation > editedAnnotations, ArrayList< Suggestion > NERsuggestions, boolean solveFeedbacks, ArrayList< AnnotType > addedTypes)
 
static void updateNerSugg (EntityManager em, Suggestion sug, ArrayList< Suggestion > touchedSug, RequestInfo request)
 
static Suggestion saveSuggestionsWithoutLinks (RequestInfo requestInfo, EntityManager em, Annotation annot, HashMap< Integer, Suggestion > reqSuggs, ArrayList< Annotation > nestedInReqAnnotations, ArrayList< Suggestion > touchedSuggestions, HashMap< Annotation, Suggestion > anNewSugLinkMap)
 
static void updateLinksAndNested (Annotation annot, HashMap< Integer, Suggestion > reqSuggs, EntityManager em, ArrayList< Suggestion > touchedSuggestions)
 
static void updateSugg (EntityManager em, Suggestion suggestion, RequestInfo requestInfo, ArrayList< Suggestion > touchedSuggestions, boolean solveFeedback) throws RuntimeException
 
static void setUriOfSuggParams (Suggestion sugg)
 
static SuggestionFeedback getFeedbackByAnnot (Integer annotId, EntityManager em)
 
static Suggestion getSuggestionFromDB (Integer id, EntityManager em)
 

Static Private Member Functions

static AnnotType queryType (String uri, EntityManager em) throws RuntimeException
 
static void updateTypes (Suggestion sug, EntityManager em, String logMsg) throws RuntimeException
 
static void updateTypesInNested (Suggestion sug, EntityManager em)
 
static Suggestion saveTmpIdRefSuggestions (Suggestion sug, RequestInfo requestInfo, EntityManager em) throws RuntimeException
 
static Suggestion saveTmpIdRefSuggestions (Suggestion sug, RequestInfo requestInfo, EntityManager em, ArrayList< Suggestion > justSaved, ArrayList< Suggestion > nowSaved) throws RuntimeException
 
static void createNewFeedback (EntityManager em, Annotation annot, Suggestion sugg, UserGroup group)
 
static void changeFeedback (EntityManager em, Annotation annot, int oldSuggID, Suggestion newSugg, UserGroup group)
 
static Suggestion getSuggestionByID (Integer id, EntityManager em)
 
static SugBaseAttribute getSugAttributeByID (Integer id, EntityManager em)
 
static Suggestion getSuggestionByAnnotation (Annotation annot, EntityManager em)
 
static void setNestedZeroConfidence (EntityManager em, Annotation an, ArrayList< Suggestion > touchedSuggestions)
 
static void setNestedSugZeroConfidence (EntityManager em, Suggestion sug, ArrayList< Suggestion > touchedSuggestions)
 

Detailed Description

Static class which persists suggestion data to the database.

Static class which persists suggestion data to the database

Definition at line 49 of file SugPersister.java.

Member Function Documentation

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.changeFeedback ( EntityManager  em,
Annotation  annot,
int  oldSuggID,
Suggestion  newSugg,
UserGroup  group 
)
staticprivate

Changes existing feedback in DB

Parameters
emcurrent EntityManager
annotAnnotation
oldSuggIDOls suggestion ID
newSuggNew suggestion
groupUserGroup

Definition at line 1069 of file SugPersister.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.createNewFeedback ( EntityManager  em,
Annotation  annot,
Suggestion  sugg,
UserGroup  group 
)
staticprivate

Creates new feedback in DB

Parameters
emcurrent EntityManager
annotAnnotation
suggSuggestion
groupUserGroup

Definition at line 1047 of file SugPersister.java.

Here is the caller graph for this function:

static SuggestionFeedback cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.getFeedbackByAnnot ( Integer  annotId,
EntityManager  em 
)
static

Method loads suggestion positive feedback specified by annotation.

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

Definition at line 1164 of file SugPersister.java.

Here is the caller graph for this function:

static SugBaseAttribute cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.getSugAttributeByID ( Integer  id,
EntityManager  em 
)
staticprivate

Select suggestion attribute from database

Parameters
idId of attribute
emEntity manager
Returns
attribute or null

Definition at line 1125 of file SugPersister.java.

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.getSuggestionByAnnotation ( Annotation  annot,
EntityManager  em 
)
staticprivate

Gets suggestion from suggestion feedback table by Annotation

Parameters
annotannotation ID
emEntity manager
Returns
Suggestion or null if not found

Definition at line 1146 of file SugPersister.java.

Here is the call graph for this function:

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.getSuggestionByID ( Integer  id,
EntityManager  em 
)
staticprivate

Gets suggestion from DB by ID

Parameters
idsuggestion ID
emcurrent EntityManager
Returns
Suggestion or null if not found

Definition at line 1104 of file SugPersister.java.

Here is the caller graph for this function:

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.getSuggestionFromDB ( Integer  id,
EntityManager  em 
)
static

Method loads suggestion specified by id from the database.

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

Definition at line 1181 of file SugPersister.java.

Here is the caller graph for this function:

static ArrayList<Suggestion> cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.persist ( RequestInfo  requestInfo,
ArrayList< Annotation addedAnnotations,
ArrayList< Annotation editedAnnotations,
ArrayList< Suggestion NERsuggestions,
boolean  solveFeedbacks,
ArrayList< AnnotType addedTypes 
)
static

Persist informations from request to the database (it persists derived and related informations too)

Parameters
requestInfoInformations about client request
addedAnnotationsAdded Annotations
editedAnnotationsEdited Annotations
NERsuggestionssuggestionsFromNER
solveFeedbacksIf I should update suggestion feedback and confidence
addedTypesAdded types
Returns
If succeed, returns false, in case of error returns true

Definition at line 63 of file SugPersister.java.

Here is the call graph for this function:

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

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 842 of file SugPersister.java.

Here is the caller graph for this function:

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.saveSuggestionsWithoutLinks ( RequestInfo  requestInfo,
EntityManager  em,
Annotation  annot,
HashMap< Integer, Suggestion reqSuggs,
ArrayList< Annotation nestedInReqAnnotations,
ArrayList< Suggestion touchedSuggestions,
HashMap< Annotation, Suggestion anNewSugLinkMap 
)
static

Function saves Annotation as Suggestion into DB without linked attributes.

Parameters
requestInfoinformation about client request
emEntity manager
annotAnnotation which is converted
reqSuggsHasMap with Original Annotation ID as key and new Suggestion as value
nestedInReqAnnotationsArray with nested annotations
touchedSuggestionsArray with changed suggestions
anNewSugLinkMapAnnotation and new link map
Returns
saved suggestion

Definition at line 529 of file SugPersister.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.SugPersister.saveTmpIdRefSuggestions ( Suggestion  sug,
RequestInfo  requestInfo,
EntityManager  em 
) throws RuntimeException
staticprivate

Recursively saves suggestions in attributes of given suggestion.

Parameters
sugSuggestion for reference update
requestInfoInformations about client request
emcurrent EntityManager
Returns
uri of the new saved suggestion
Exceptions
RuntimeException

Definition at line 978 of file SugPersister.java.

Here is the caller graph for this function:

static Suggestion cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.saveTmpIdRefSuggestions ( Suggestion  sug,
RequestInfo  requestInfo,
EntityManager  em,
ArrayList< Suggestion justSaved,
ArrayList< Suggestion nowSaved 
) throws RuntimeException
staticprivate

Recursively saves suggestions in attributes of given suggestion.

Parameters
sugSuggestion for reference update
requestInfoInformations about client request
emcurrent EntityManager
justSavedList of just saved suggestions (versions before saving)
nowSavedList of just saved suggestions (really saved versions)
Returns
uri of the new saved suggestion
Exceptions
RuntimeException

Definition at line 992 of file SugPersister.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.modules.suggestionManager.SugPersister.setNestedSugZeroConfidence ( EntityManager  em,
Suggestion  sug,
ArrayList< Suggestion touchedSuggestions 
)
staticprivate

Sets Zero confidence to all nested Suggestions

Parameters
emEntity manager
sugRefused suggestion
touchedSuggestionsmodified suggestions

Definition at line 1231 of file SugPersister.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.SugPersister.setNestedZeroConfidence ( EntityManager  em,
Annotation  an,
ArrayList< Suggestion touchedSuggestions 
)
staticprivate

Sets Zero confidence to all nested Suggestions

Parameters
emEntity manager
anRefused annotation
touchedSuggestionsmodified suggestions

Definition at line 1199 of file SugPersister.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.SugPersister.setUriOfSuggParams ( Suggestion  sugg)
static

Sets uri from value in annotation link parameters of given suggestion, also recursively in nested suggestions

Parameters
suggGiven suggestion

Definition at line 810 of file SugPersister.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.SugPersister.updateLinksAndNested ( Annotation  annot,
HashMap< Integer, Suggestion reqSuggs,
EntityManager  em,
ArrayList< Suggestion touchedSuggestions 
)
static

Method updates links in saved suggestions

Parameters
annotAnnotation which is updated
reqSuggsHasMap with Original Annotation ID as key and new Suggestion as value
emEntity manager
touchedSuggestionschanged suggestions

Definition at line 645 of file SugPersister.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.SugPersister.updateNerSugg ( EntityManager  em,
Suggestion  sug,
ArrayList< Suggestion touchedSug,
RequestInfo  request 
)
static

Update suggestion from NER

Parameters
emEntity Manager
sugSuggestion
touchedSugChanged suggestions
requestinformation about client request

Definition at line 466 of file SugPersister.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.SugPersister.updateSugg ( EntityManager  em,
Suggestion  suggestion,
RequestInfo  requestInfo,
ArrayList< Suggestion touchedSuggestions,
boolean  solveFeedback 
) throws RuntimeException
static

Updates suggestion feedback and confidence in DB

Parameters
emEntity manager
suggestionUpdated suggestion
requestInfoInformation about client request
touchedSuggestionsTouched suggestions in persister
solveFeedbackdetermines if we are solving a feedback
Exceptions
RuntimeException

Definition at line 745 of file SugPersister.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.SugPersister.updateTypes ( Suggestion  sug,
EntityManager  em,
String  logMsg 
) throws RuntimeException
staticprivate

Method updates types in Suggestion

Parameters
sugsuggestion for update
emcurrent EntityManager
logMsgString with error
Exceptions
RuntimeException

Definition at line 872 of file SugPersister.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.SugPersister.updateTypesInNested ( Suggestion  sug,
EntityManager  em 
)
staticprivate

Updates types in nested suggestions (use types stored in DB)

Parameters
sugSuggestion, which attributes will be updated
emEntity manager

Definition at line 930 of file SugPersister.java.

Here is the call graph for this function:

Here is the caller graph for this function:


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