use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class EntityChangesPortletPresenter method updateDisplayForSelectedEntity.
private void updateDisplayForSelectedEntity() {
permissionChecker.hasPermission(VIEW_CHANGES, canViewChanges -> {
if (canViewChanges) {
setForbiddenVisible(false);
ProjectId projectId = getProjectId();
getSelectedEntity().ifPresent(entity -> presenter.setChangesForEntity(projectId, entity));
} else {
setForbiddenVisible(true);
presenter.clear();
}
});
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class EditProjectTagsUIActionHandler method handleEditProjectTags.
public void handleEditProjectTags() {
Place currentPlace = placeController.getWhere();
if (!(currentPlace instanceof HasProjectId)) {
return;
}
ProjectId projectId = ((HasProjectId) currentPlace).getProjectId();
ProjectTagsPlace projectTagsPlace = new ProjectTagsPlace(projectId, Optional.of(currentPlace));
placeController.goTo(projectTagsPlace);
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class ProjectEntityCrudKitSettingsConverter method fromDocument.
@Override
public ProjectEntityCrudKitSettings fromDocument(@Nonnull Document document) {
ProjectId projectId = ProjectId.get(document.getString(PROJECT_ID));
Document settingsDocument = (Document) document.get(SETTINGS);
EntityCrudKitSettings<? extends EntityCrudKitSuffixSettings> settings = converter.fromDocument(settingsDocument);
return new ProjectEntityCrudKitSettings(projectId, settings);
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class LoadProjectActionHandler method execute.
@Nonnull
@Override
public LoadProjectResult execute(@Nonnull final LoadProjectAction action, @Nonnull ExecutionContext executionContext) {
Stopwatch stopwatch = Stopwatch.createStarted();
logger.info("{} is being loaded due to request by {}", action.getProjectId(), executionContext.getUserId());
projectManager.getProject(action.getProjectId(), executionContext.getUserId());
stopwatch.stop();
logger.info("{} was loaded in {} ms due to request by {}", action.getProjectId(), stopwatch.elapsed(TimeUnit.MILLISECONDS), executionContext.getUserId());
MemoryMonitor memoryMonitor = new MemoryMonitor(logger);
memoryMonitor.monitorMemoryUsage();
memoryMonitor.logMemoryUsage();
final ProjectId projectId = action.getProjectId();
ProjectDetails projectDetails = projectDetailsManager.getProjectDetails(projectId);
if (!executionContext.getUserId().isGuest()) {
userActivityManager.addRecentProject(executionContext.getUserId(), action.getProjectId(), System.currentTimeMillis());
}
return new LoadProjectResult(action.getProjectId(), executionContext.getUserId(), projectDetails);
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class ProjectEntityCrudKitSettingsTestCase method hashCodeShouldBeEqualForSameProjectIdAndSettings.
@Test
public void hashCodeShouldBeEqualForSameProjectIdAndSettings() {
ProjectId projectId = mock(ProjectId.class);
EntityCrudKitSettings<?> settings = mock(EntityCrudKitSettings.class);
ProjectEntityCrudKitSettings settingsA = new ProjectEntityCrudKitSettings(projectId, settings);
ProjectEntityCrudKitSettings settingsB = new ProjectEntityCrudKitSettings(projectId, settings);
assertEquals(settingsA.hashCode(), settingsB.hashCode());
}
Aggregations