@Override protected List<SourceDocument> getListOfDocs() { AnnotatorState state = getModelObject(); return new ArrayList<>(documentService .listAnnotatableDocuments(state.getProject(), state.getUser()).keySet()); }
@Override protected List<SourceDocument> getListOfDocs() { AnnotatorState state = getModelObject(); return new ArrayList<>(documentService .listAnnotatableDocuments(state.getProject(), state.getUser()).keySet()); }
/** * @deprecated The UI class {@link AnnotatorState} should not be passed here. Use * {@link #delete(SourceDocument, String, JCas, VID)} instead. */ @Deprecated default void setFeatureValue(AnnotatorState aState, JCas aJCas, int aAddress, AnnotationFeature aFeature, Object aValue) { setFeatureValue(aState.getDocument(), aState.getUser().getUsername(), aJCas, aAddress, aFeature, aValue); }
/** * @deprecated The UI class {@link AnnotatorState} should not be passed here. Use * {@link #delete(SourceDocument, String, JCas, VID)} instead. */ @Deprecated default void delete(AnnotatorState aState, JCas aJCas, VID aVid) { delete(aState.getDocument(), aState.getUser().getUsername(), aJCas, aVid); }
/** * @deprecated The UI class {@link AnnotatorState} should not be passed here. Use * {@link #delete(SourceDocument, String, JCas, VID)} instead. */ @Deprecated default void setFeatureValue(AnnotatorState aState, JCas aJCas, int aAddress, AnnotationFeature aFeature, Object aValue) { setFeatureValue(aState.getDocument(), aState.getUser().getUsername(), aJCas, aAddress, aFeature, aValue); }
/** * Load the user preferences. A side-effect of this method is that the active annotation layer * is refreshed based on the visibility preferences and based on the project to which the * document being edited belongs. */ protected void loadPreferences() throws BeansException, IOException { AnnotatorState state = getModelObject(); PreferencesUtil.loadPreferences(userPreferenceService, annotationService, state, state.getUser().getUsername()); } }
private List<LearningRecord> listLearningRecords() { return learningRecordService.listRecords(getModelObject().getUser().getUsername(), alStateModel.getObject().getLayer(), 50); }
private void refreshSuggestions() { AnnotatorState state = getModelObject(); ActiveLearningUserState alState = alStateModel.getObject(); alState.setSuggestions( activeLearningService.getSuggestions(state.getUser(), alState.getLayer())); }
private List<LearningRecord> listLearningRecords() { return learningRecordService.listRecords(getModelObject().getUser().getUsername(), alStateModel.getObject().getLayer(), 50); }
private void actionStopSession(AjaxRequestTarget target) { ActiveLearningUserState alState = alStateModel.getObject(); AnnotatorState state = getModelObject(); target.add(mainContainer); // Stop current session alState.setSessionActive(false); applicationEventPublisherHolder.get().publishEvent(new ActiveLearningSessionCompletedEvent( this, state.getProject(), state.getUser().getUsername())); }
private void actionStopSession(AjaxRequestTarget target) { ActiveLearningUserState alState = alStateModel.getObject(); AnnotatorState state = getModelObject(); target.add(mainContainer); // Stop current session alState.setSessionActive(false); applicationEventPublisherHolder.get().publishEvent(new ActiveLearningSessionCompletedEvent( this, state.getProject(), state.getUser().getUsername())); }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = AutomationPage.this.getModelObject(); setEnabled(state.getDocument() != null && !documentService .isAnnotationFinished(state.getDocument(), state.getUser())); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = AnnotationPage.this.getModelObject(); setEnabled(state.getDocument() != null && !documentService .isAnnotationFinished(state.getDocument(), state.getUser())); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = AutomationPage.this.getModelObject(); setEnabled(state.getDocument() != null && !documentService .isAnnotationFinished(state.getDocument(), state.getUser())); } });
private void actionStartSession(AjaxRequestTarget target, Form<?> form) { ActiveLearningUserState alState = alStateModel.getObject(); AnnotatorState state = getModelObject(); // Start new session alState.setSessionActive(true); refreshSuggestions(); moveToNextRecommendation(target, false); applicationEventPublisherHolder.get().publishEvent(new ActiveLearningSessionStartedEvent( this, state.getProject(), state.getUser().getUsername())); }
private void createNewChainLinkAnnotation(ChainAdapter aAdapter, JCas aJCas) { LOG.trace("createNewChainLinkAnnotation()"); AnnotatorState state = getModelObject(); Selection selection = state.getSelection(); AnnotationFS originFs = selectByAddr(aJCas, selection.getOrigin()); AnnotationFS targetFs = selectByAddr(aJCas, selection.getTarget()); // Creating a new chain link int addr = aAdapter.addArc(state.getDocument(), state.getUser().getUsername(), aJCas, originFs, targetFs); selection.selectArc(new VID(addr), originFs, targetFs); }
private void actionRemergeDocument(AjaxRequestTarget aTarget) throws IOException { AnnotatorState state = CurationPage.this.getModelObject(); curationDocumentService.removeCurationDocumentContent(state.getDocument(), state.getUser().getUsername()); actionLoadDocument(aTarget); info("Re-merge finished!"); aTarget.add(getFeedbackPanel()); }
boolean isAnnotationFinished() { AnnotatorState state = getModelObject(); if (state.getMode().equals(Mode.CURATION)) { return state.getDocument().getState().equals(SourceDocumentState.CURATION_FINISHED); } else { return documentService.isAnnotationFinished(state.getDocument(), state.getUser()); } }
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = CurationPage.this.getModelObject(); setVisible(state.getProject() != null && (projectService.isAdmin(state.getProject(), state.getUser()) || !state.getProject().isDisableExport())); } });
private void createNewSpanAnnotation(AjaxRequestTarget aTarget, SpanAdapter aAdapter, JCas aJCas) throws IOException, AnnotationException { handleForwardAnnotation(aTarget, aAdapter, aJCas); AnnotatorState state = getModelObject(); Selection selection = state.getSelection(); AnnotationFS annoFs = aAdapter.add(state.getDocument(), state.getUser().getUsername(), aJCas, selection.getBegin(), selection.getEnd()); selection.selectSpan(new VID(annoFs), aJCas, annoFs.getBegin(), annoFs.getEnd()); }