@Override public void onDocumentSelected(AjaxRequestTarget aTarget) { AnnotatorState state = getModelObject(); String username = SecurityContextHolder.getContext().getAuthentication().getName(); /* * Changed for #152, getDocument was returning null even after opening a document * Also, surrounded following code into if block to avoid error. */ if (state.getProject() == null) { setResponsePage(getApplication().getHomePage()); return; } if (state.getDocument() != null) { try { documentService.createSourceDocument(state.getDocument()); upgradeCasAndSave(state.getDocument(), username); actionLoadDocument(aTarget); curationPanel.getEditor().loadFeatureEditorModels(aTarget); } catch (Exception e) { LOG.error("Unable to load data", e); error("Unable to load data: " + ExceptionUtils.getRootCauseMessage(e)); } } } });
@Override public void onDocumentSelected(AjaxRequestTarget aTarget) { AnnotatorState state = getModelObject(); String username = SecurityContextHolder.getContext().getAuthentication().getName(); /* * Changed for #152, getDocument was returning null even after opening a document * Also, surrounded following code into if block to avoid error. */ if (state.getProject() == null) { setResponsePage(getApplication().getHomePage()); return; } if (state.getDocument() != null) { try { documentService.createSourceDocument(state.getDocument()); upgradeCasAndSave(state.getDocument(), username); actionLoadDocument(aTarget); curationPanel.getEditor().loadFeatureEditorModels(aTarget); } catch (Exception e) { LOG.error("Unable to load data", e); error("Unable to load data: " + ExceptionUtils.getRootCauseMessage(e)); } } } });
private void actionFinishDocument(AjaxRequestTarget aTarget) { finishDocumentDialog.setConfirmAction((aCallbackTarget) -> { actionValidateDocument(aCallbackTarget, getEditorCas()); AnnotatorState state = getModelObject(); SourceDocument sourceDocument = state.getDocument(); if (SourceDocumentState.CURATION_FINISHED.equals(sourceDocument.getState())) { documentService.transitionSourceDocumentState(sourceDocument, CURATION_FINISHED_TO_CURATION_IN_PROGRESS); } else { documentService.transitionSourceDocumentState(sourceDocument, CURATION_IN_PROGRESS_TO_CURATION_FINISHED); } aCallbackTarget.add(finishDocumentIcon); aCallbackTarget.add(finishDocumentLink); aCallbackTarget.add(curationPanel.getEditor()); aCallbackTarget.add(remergeDocumentLink); }); finishDocumentDialog.show(aTarget); }
private void actionFinishDocument(AjaxRequestTarget aTarget) { finishDocumentDialog.setConfirmAction((aCallbackTarget) -> { actionValidateDocument(aCallbackTarget, getEditorCas()); AnnotatorState state = getModelObject(); SourceDocument sourceDocument = state.getDocument(); if (SourceDocumentState.CURATION_FINISHED.equals(sourceDocument.getState())) { documentService.transitionSourceDocumentState(sourceDocument, CURATION_FINISHED_TO_CURATION_IN_PROGRESS); } else { documentService.transitionSourceDocumentState(sourceDocument, CURATION_IN_PROGRESS_TO_CURATION_FINISHED); } aCallbackTarget.add(finishDocumentIcon); aCallbackTarget.add(finishDocumentLink); aCallbackTarget.add(curationPanel.getEditor()); aCallbackTarget.add(remergeDocumentLink); }); finishDocumentDialog.show(aTarget); }
curationContainer = builder.buildCurationContainer(state); curationContainer.setBratAnnotatorModel(state); curationPanel.getEditor().reset(aTarget); updatePanel(curationContainer, aTarget); updateSentenceNumber(mergeJCas, state.getFirstVisibleUnitAddress());
curationContainer = builder.buildCurationContainer(state); curationContainer.setBratAnnotatorModel(state); curationPanel.getEditor().reset(aTarget); updatePanel(curationContainer, aTarget); updateSentenceNumber(mergeJCas, state.getFirstVisibleUnitAddress());