protected JCas getEditorCas() throws IOException { if (state.getDocument() == null) { throw new IllegalStateException("Please open a document first!"); } // If we have a timestamp, then use it to detect if there was a concurrent access verifyAndUpdateDocumentTimestamp(state, curationDocumentService .getCurationCasTimestamp(state.getDocument())); return curationDocumentService.readCurationCas(state.getDocument()); }
protected JCas getEditorCas() throws IOException { if (state.getDocument() == null) { throw new IllegalStateException("Please open a document first!"); } // If we have a timestamp, then use it to detect if there was a concurrent access verifyAndUpdateDocumentTimestamp(state, curationDocumentService .getCurationCasTimestamp(state.getDocument())); return curationDocumentService.readCurationCas(state.getDocument()); }
public static boolean isFinished(final IModel<AnnotatorState> aModel, User user, DocumentService aRepository) { return aRepository.existsAnnotationDocument(aModel.getObject().getDocument(), user) && aRepository.getAnnotationDocument(aModel.getObject().getDocument(), user) .getState().equals(AnnotationDocumentState.FINISHED); } }
@Override public void onTargetRespond(AjaxRequestTarget aTarget) { AnnotatorState state = getModelObject(); if (state.getDocument() != null) { render(aTarget); } }
@Override protected void onConfigure() { super.onConfigure(); setEnabled(state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); }
/** * @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); }
@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(); setVisible(getModelObject().getDocument() != null); } };
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = CurationPage.this.getModelObject(); setEnabled(state.getProject() != null && state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotatorState state = CurationPage.this.getModelObject(); setEnabled(state.getProject() != null && state.getDocument() != null && !documentService .getSourceDocument(state.getDocument().getProject(), state.getDocument().getName()) .getState().equals(SourceDocumentState.CURATION_FINISHED)); } });
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()); } }
private JCas getJCas(AnnotatorState aState, AnnotationDocument aDocument) throws IOException { if (aState.getMode().equals(Mode.AUTOMATION) || aState.getMode().equals(Mode.CORRECTION)) { return correctionDocumentService.readCorrectionCas(aState.getDocument()); } else { return documentService.readAnnotationCas(aDocument); } }
private void actionJumpToAnnotation(AjaxRequestTarget aTarget) throws IOException { AnnotatorState state = getModelObject(); editorPanel.getEditorPage().actionShowSelectedDocument(aTarget, state.getDocument(), state.getSelection().getBegin(), state.getSelection().getEnd()); }
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()); }
private void updateCurationView(final CurationContainer curationContainer, final SourceListView curationViewItem, AjaxRequestTarget aTarget, JCas jCas) { Sentence currentSent = WebAnnoCasUtil.getCurrentSentence(jCas, curationViewItem.getBegin(), curationViewItem.getEnd()); state.setFirstVisibleUnit(WebAnnoCasUtil.findWindowStartCenteringOnSelection(jCas, currentSent, curationViewItem.getBegin(), state.getProject(), state.getDocument(), state.getPreferences().getWindowSize())); curationContainer.setBratAnnotatorModel(state); onChange(aTarget); }
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()); }