Search in sources :

Example 1 with EntityDiscussionThread

use of edu.stanford.bmir.protege.web.shared.issues.EntityDiscussionThread in project webprotege by protegeproject.

the class EntityDiscussionThreadRepository method deleteComment.

public boolean deleteComment(CommentId commentId) {
    Query<EntityDiscussionThread> query = datastore.createQuery(EntityDiscussionThread.class).field(COMMENTS_ID).equal(commentId);
    UpdateOperations<EntityDiscussionThread> update = getUpdateOperations().removeAll(COMMENTS, new BasicDBObject("_id", commentId.getId()));
    UpdateResults updateResults = datastore.updateFirst(query, update);
    return updateResults.getUpdatedCount() == 1;
}
Also used : BasicDBObject(com.mongodb.BasicDBObject) EntityDiscussionThread(edu.stanford.bmir.protege.web.shared.issues.EntityDiscussionThread) UpdateResults(org.mongodb.morphia.query.UpdateResults)

Example 2 with EntityDiscussionThread

use of edu.stanford.bmir.protege.web.shared.issues.EntityDiscussionThread in project webprotege by protegeproject.

the class GetEntityDiscussionThreadsHandler method execute.

@Nonnull
@Override
public GetEntityDiscussionThreadsResult execute(@Nonnull GetEntityDiscussionThreadsAction action, @Nonnull ExecutionContext executionContext) {
    List<EntityDiscussionThread> threads = repository.findThreads(action.getProjectId(), action.getEntity());
    OWLEntityData entityData = renderingManager.getRendering(action.getEntity());
    return new GetEntityDiscussionThreadsResult(entityData, ImmutableList.copyOf(threads));
}
Also used : GetEntityDiscussionThreadsResult(edu.stanford.bmir.protege.web.shared.issues.GetEntityDiscussionThreadsResult) EntityDiscussionThread(edu.stanford.bmir.protege.web.shared.issues.EntityDiscussionThread) OWLEntityData(edu.stanford.bmir.protege.web.shared.entity.OWLEntityData) Nonnull(javax.annotation.Nonnull)

Example 3 with EntityDiscussionThread

use of edu.stanford.bmir.protege.web.shared.issues.EntityDiscussionThread in project webprotege by protegeproject.

the class DiscussionThreadListPresenter method redisplayThreads.

private void redisplayThreads() {
    view.clear();
    stopThreadPresenters();
    for (EntityDiscussionThread thread : displayedThreads) {
        addThread(thread);
    }
}
Also used : EntityDiscussionThread(edu.stanford.bmir.protege.web.shared.issues.EntityDiscussionThread) CreateEntityDiscussionThreadAction.createEntityDiscussionThread(edu.stanford.bmir.protege.web.shared.issues.CreateEntityDiscussionThreadAction.createEntityDiscussionThread)

Aggregations

EntityDiscussionThread (edu.stanford.bmir.protege.web.shared.issues.EntityDiscussionThread)3 BasicDBObject (com.mongodb.BasicDBObject)1 OWLEntityData (edu.stanford.bmir.protege.web.shared.entity.OWLEntityData)1 CreateEntityDiscussionThreadAction.createEntityDiscussionThread (edu.stanford.bmir.protege.web.shared.issues.CreateEntityDiscussionThreadAction.createEntityDiscussionThread)1 GetEntityDiscussionThreadsResult (edu.stanford.bmir.protege.web.shared.issues.GetEntityDiscussionThreadsResult)1 Nonnull (javax.annotation.Nonnull)1 UpdateResults (org.mongodb.morphia.query.UpdateResults)1