Search in sources :

Example 6 with ProjectDetails

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

the class AvailableProjectsCache method setInTrash.

public boolean setInTrash(ProjectId projectId, boolean inTrash) {
    AvailableProject availableProject = cache.get(projectId);
    if (availableProject == null) {
        return false;
    }
    if (availableProject.getProjectDetails().isInTrash() == inTrash) {
        return false;
    }
    ProjectDetails replacementDetails = availableProject.getProjectDetails().builder().setInTrash(inTrash).build();
    cache.put(projectId, new AvailableProject(replacementDetails, availableProject.isDownloadable(), availableProject.isTrashable(), availableProject.getLastOpenedAt()));
    return true;
}
Also used : ProjectDetails(edu.stanford.bmir.protege.web.shared.project.ProjectDetails) AvailableProject(edu.stanford.bmir.protege.web.shared.project.AvailableProject)

Example 7 with ProjectDetails

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

the class ProjectDetailsRepository_IT method setUp.

@Before
public void setUp() {
    MongoClient mongoClient = MongoTestUtils.createMongoClient();
    database = mongoClient.getDatabase(MongoTestUtils.getTestDbName());
    repository = new ProjectDetailsRepository(database, new ProjectDetailsConverter());
    projectDetails = new ProjectDetails(projectId, "The Display Name", "The Description", owner, IN_TRASH, CREATED_AT, createdBy, MODIFIED_AT, lastModifiedBy);
    // Insert project details
    repository.save(projectDetails);
}
Also used : MongoClient(com.mongodb.MongoClient) ProjectDetails(edu.stanford.bmir.protege.web.shared.project.ProjectDetails) Before(org.junit.Before)

Aggregations

ProjectDetails (edu.stanford.bmir.protege.web.shared.project.ProjectDetails)7 ProjectId (edu.stanford.bmir.protege.web.shared.project.ProjectId)4 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)3 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)2 SlackWebhookRepository (edu.stanford.bmir.protege.web.server.webhook.SlackWebhookRepository)2 WebhookRepository (edu.stanford.bmir.protege.web.server.webhook.WebhookRepository)2 NewProjectSettings (edu.stanford.bmir.protege.web.shared.project.NewProjectSettings)2 UnknownProjectException (edu.stanford.bmir.protege.web.shared.project.UnknownProjectException)2 ProjectSettings (edu.stanford.bmir.protege.web.shared.projectsettings.ProjectSettings)2 SlackIntegrationSettings (edu.stanford.bmir.protege.web.shared.projectsettings.SlackIntegrationSettings)2 WebhookSetting (edu.stanford.bmir.protege.web.shared.projectsettings.WebhookSetting)2 WebhookSettings (edu.stanford.bmir.protege.web.shared.projectsettings.WebhookSettings)2 ProjectWebhook (edu.stanford.bmir.protege.web.shared.webhook.ProjectWebhook)2 ProjectWebhookEventType (edu.stanford.bmir.protege.web.shared.webhook.ProjectWebhookEventType)2 SlackWebhook (edu.stanford.bmir.protege.web.shared.webhook.SlackWebhook)2 java.util (java.util)2 Collectors.toList (java.util.stream.Collectors.toList)2 Inject (javax.inject.Inject)2 Stopwatch (com.google.common.base.Stopwatch)1 MongoClient (com.mongodb.MongoClient)1