热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument.getState()方法的使用及代码示例

本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument.getState()方法的一些代码示例

本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument.getState()方法的一些代码示例,展示了SourceDocument.getState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SourceDocument.getState()方法的具体详情如下:
包路径:de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument
类名称:SourceDocument
方法名:getState

SourceDocument.getState介绍

暂无

代码示例

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api

public DocumentStateChangedEvent(Object aSource, SourceDocument aDocument,
SourceDocumentState aPreviousState)
{
super(aSource);
document = aDocument;
previousState = aPreviousState;
newState = aDocument.getState();
}

代码示例来源:origin: webanno/webanno

public DocumentStateChangedEvent(Object aSource, SourceDocument aDocument,
SourceDocumentState aPreviousState)
{
super(aSource);
document = aDocument;
previousState = aPreviousState;
newState = aDocument.getState();
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

@Override
@Transactional
public SourceDocumentState setSourceDocumentState(SourceDocument aDocument,
SourceDocumentState aState)
{
Validate.notNull(aDocument, "Source document must be specified");
Validate.notNull(aState, "State must be specified");

SourceDocumentState oldState = aDocument.getState();

aDocument.setState(aState);

createSourceDocument(aDocument);

// Notify about change in document state
if (!Objects.equals(oldState, aDocument.getState())) {
applicationEventPublisher
.publishEvent(new DocumentStateChangedEvent(this, aDocument, oldState));
}

return oldState;
}

代码示例来源:origin: webanno/webanno

@Override
@Transactional
public SourceDocumentState setSourceDocumentState(SourceDocument aDocument,
SourceDocumentState aState)
{
Validate.notNull(aDocument, "Source document must be specified");
Validate.notNull(aState, "State must be specified");

SourceDocumentState oldState = aDocument.getState();

aDocument.setState(aState);

createSourceDocument(aDocument);

// Notify about change in document state
if (!Objects.equals(oldState, aDocument.getState())) {
applicationEventPublisher
.publishEvent(new DocumentStateChangedEvent(this, aDocument, oldState));
}

return oldState;
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/de.tudarmstadt.ukp.clarin.webanno.project

private boolean existsCurationDocument(Project aProject) {
boolean curatiOnDocumentExist= false;
List documents = repository
.listSourceDocuments(aProject);
for (de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument sourceDocument : documents) {
// If the curation document is exist (either finished or in progress
if (sourceDocument.getState().equals(
SourceDocumentState.CURATION_FINISHED)
|| sourceDocument.getState().equals(
SourceDocumentState.CURATION_IN_PROGRESS)) {
curatiOnDocumentExist= true;
break;
}
}
return curationDocumentExist;
}

代码示例来源:origin: webanno/webanno

@Override
public boolean existsCurationDocument(Project aProject)
{
Validate.notNull(aProject, "Project must be specified");

boolean curatiOnDocumentExist= false;
List documents = listSourceDocuments(aProject);
for (SourceDocument sourceDocument : documents) {
// If the curation document is finished
if (SourceDocumentState.CURATION_FINISHED.equals(sourceDocument.getState())) {
curatiOnDocumentExist= true;
break;
}
}
return curationDocumentExist;
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

@Override
public boolean existsCurationDocument(Project aProject)
{
Validate.notNull(aProject, "Project must be specified");

boolean curatiOnDocumentExist= false;
List documents = listSourceDocuments(aProject);
for (SourceDocument sourceDocument : documents) {
// If the curation document is finished
if (SourceDocumentState.CURATION_FINISHED.equals(sourceDocument.getState())) {
curatiOnDocumentExist= true;
break;
}
}
return curationDocumentExist;
}

代码示例来源:origin: webanno/webanno

public RDocument(SourceDocument aDocument)
{
id = aDocument.getId();
name = aDocument.getName();
state = AeroRemoteApiController.sourceDocumentStateToString(aDocument.getState());
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-remote

public RDocument(SourceDocument aDocument)
{
id = aDocument.getId();
name = aDocument.getName();
state = AeroRemoteApiController.sourceDocumentStateToString(aDocument.getState());
}

代码示例来源:origin: webanno/webanno

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());
}
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-curation

@Override
protected void onConfigure()
{
super.onConfigure();

setEnabled(state.getDocument() != null && !documentService
.getSourceDocument(state.getDocument().getProject(),
state.getDocument().getName())
.getState().equals(SourceDocumentState.CURATION_FINISHED));
}

代码示例来源:origin: webanno/webanno

@Override
protected void onConfigure()
{
super.onConfigure();

setEnabled(state.getDocument() != null && !documentService
.getSourceDocument(state.getDocument().getProject(),
state.getDocument().getName())
.getState().equals(SourceDocumentState.CURATION_FINISHED));
}

代码示例来源:origin: webanno/webanno

private void exportSourceDocuments(Project aProject, ExportedProject exProject)
{
List sourceDocuments = new ArrayList<>();
// add source documents to a project
List documents = documentService.listSourceDocuments(aProject);
for (SourceDocument sourceDocument : documents) {
ExportedSourceDocument exDocument = new ExportedSourceDocument();
exDocument.setFormat(sourceDocument.getFormat());
exDocument.setName(sourceDocument.getName());
exDocument.setState(sourceDocument.getState());
exDocument.setTimestamp(sourceDocument.getTimestamp());
exDocument.setSentenceAccessed(sourceDocument.getSentenceAccessed());
exDocument.setCreated(sourceDocument.getCreated());
exDocument.setUpdated(sourceDocument.getUpdated());
sourceDocuments.add(exDocument);
}
exProject.setSourceDocuments(sourceDocuments);
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-curation

@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));
}
});

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

private void exportSourceDocuments(Project aProject, ExportedProject exProject)
{
List sourceDocuments = new ArrayList<>();
// add source documents to a project
List documents = documentService.listSourceDocuments(aProject);
for (SourceDocument sourceDocument : documents) {
ExportedSourceDocument exDocument = new ExportedSourceDocument();
exDocument.setFormat(sourceDocument.getFormat());
exDocument.setName(sourceDocument.getName());
exDocument.setState(sourceDocument.getState());
exDocument.setTimestamp(sourceDocument.getTimestamp());
exDocument.setSentenceAccessed(sourceDocument.getSentenceAccessed());
exDocument.setCreated(sourceDocument.getCreated());
exDocument.setUpdated(sourceDocument.getUpdated());
sourceDocuments.add(exDocument);
}
exProject.setSourceDocuments(sourceDocuments);
}

代码示例来源:origin: webanno/webanno

@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));
}
});

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-curation

@Override
protected String load()
{
AnnotatorState state = CurationPage.this.getModelObject();
if (state.getProject() != null && state.getDocument() != null) {
if (documentService
.getSourceDocument(state.getDocument().getProject(),
state.getDocument().getName()).getState()
.equals(SourceDocumentState.CURATION_FINISHED)) {
return "images/accept.png";
}
else {
return "images/inprogress.png";
}
}
else {
return "images/inprogress.png";
}
}
}));

代码示例来源:origin: webanno/webanno

@Override
protected String load()
{
AnnotatorState state = CurationPage.this.getModelObject();
if (state.getProject() != null && state.getDocument() != null) {
if (documentService
.getSourceDocument(state.getDocument().getProject(),
state.getDocument().getName()).getState()
.equals(SourceDocumentState.CURATION_FINISHED)) {
return "images/accept.png";
}
else {
return "images/inprogress.png";
}
}
else {
return "images/inprogress.png";
}
}
}));

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-curation

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);
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-brat

public static boolean isDocumentFinished(DocumentService aRepository,
AnnotatorState aBratAnnotatorModel)
{
try {
if (aBratAnnotatorModel.getMode().equals(Mode.CURATION)) {
// Load document freshly from DB so we get the latest state. The document state
// in the annotator state might be stale.
SourceDocument doc = aRepository.getSourceDocument(
aBratAnnotatorModel.getDocument().getProject().getId(),
aBratAnnotatorModel.getDocument().getId());
return doc.getState().equals(SourceDocumentState.CURATION_FINISHED);
}
else {
// if annotationDocument is finished, disable editing
AnnotationDocument adoc = aRepository.getAnnotationDocument(
aBratAnnotatorModel.getDocument(), aBratAnnotatorModel.getUser());

return adoc.getState().equals(AnnotationDocumentState.FINISHED);
}
}
catch (Exception e) {
return false;
}
}

推荐阅读
author-avatar
我是田小勇2702932553
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有