热门标签 | 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;
}
}

推荐阅读
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 深入解析Spring Cloud Ribbon负载均衡机制
    本文详细介绍了Spring Cloud中的Ribbon组件如何实现服务调用的负载均衡。通过分析其工作原理、源码结构及配置方式,帮助读者理解Ribbon在分布式系统中的重要作用。 ... [详细]
  • Scala 实现 UTF-8 编码属性文件读取与克隆
    本文介绍如何使用 Scala 以 UTF-8 编码方式读取属性文件,并实现属性文件的克隆功能。通过这种方式,可以确保配置文件在多线程环境下的一致性和高效性。 ... [详细]
  • 本文深入探讨了 Java 中的 Serializable 接口,解释了其实现机制、用途及注意事项,帮助开发者更好地理解和使用序列化功能。 ... [详细]
  • 本文详细介绍了Akka中的BackoffSupervisor机制,探讨其在处理持久化失败和Actor重启时的应用。通过具体示例,展示了如何配置和使用BackoffSupervisor以实现更细粒度的异常处理。 ... [详细]
  • 本文详细介绍了 Apache Jena 库中的 Txn.executeWrite 方法,通过多个实际代码示例展示了其在不同场景下的应用,帮助开发者更好地理解和使用该方法。 ... [详细]
  • 2023年京东Android面试真题解析与经验分享
    本文由一位拥有6年Android开发经验的工程师撰写,详细解析了京东面试中常见的技术问题。涵盖引用传递、Handler机制、ListView优化、多线程控制及ANR处理等核心知识点。 ... [详细]
  • 从 .NET 转 Java 的自学之路:IO 流基础篇
    本文详细介绍了 Java 中的 IO 流,包括字节流和字符流的基本概念及其操作方式。探讨了如何处理不同类型的文件数据,并结合编码机制确保字符数据的正确读写。同时,文中还涵盖了装饰设计模式的应用,以及多种常见的 IO 操作实例。 ... [详细]
  • 深入理解Java泛型:JDK 5的新特性
    本文详细介绍了Java泛型的概念及其在JDK 5中的应用,通过具体代码示例解释了泛型的引入、作用和优势。同时,探讨了泛型类、泛型方法和泛型接口的实现,并深入讲解了通配符的使用。 ... [详细]
  • 本文详细介绍了 Dockerfile 的编写方法及其在网络配置中的应用,涵盖基础指令、镜像构建与发布流程,并深入探讨了 Docker 的默认网络、容器互联及自定义网络的实现。 ... [详细]
  • c# – UWP:BrightnessOverride StartOverride逻辑 ... [详细]
  • 使用 Azure Service Principal 和 Microsoft Graph API 获取 AAD 用户列表
    本文介绍了一段通用代码示例,该代码不仅能够操作 Azure Active Directory (AAD),还可以通过 Azure Service Principal 的授权访问和管理 Azure 订阅资源。Azure 的架构可以分为两个层级:AAD 和 Subscription。 ... [详细]
  • 本文详细介绍了Java中的访问器(getter)和修改器(setter),探讨了它们在保护数据完整性、增强代码可维护性方面的重要作用。通过具体示例,展示了如何正确使用这些方法来控制类属性的访问和更新。 ... [详细]
  • 使用Python在SAE上开发新浪微博应用的初步探索
    最近重新审视了新浪云平台(SAE)提供的服务,发现其已支持Python开发。本文将详细介绍如何利用Django框架构建一个简单的新浪微博应用,并分享开发过程中的关键步骤。 ... [详细]
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社区 版权所有