use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class GetPerspectiveLayoutActionHandler method execute.
@Nonnull
@Override
public GetPerspectiveLayoutResult execute(@Nonnull GetPerspectiveLayoutAction action, @Nonnull ExecutionContext executionContext) {
PerspectiveId perspectiveId = action.getPerspectiveId();
ProjectId projectId = action.getProjectId();
UserId userId = action.getUserId();
PerspectiveLayout perspectiveLayout = perspectiveLayoutStore.getPerspectiveLayout(projectId, userId, perspectiveId);
return new GetPerspectiveLayoutResult(perspectiveLayout);
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class GetPerspectivesActionHandler method execute.
@Nonnull
@Override
public GetPerspectivesResult execute(@Nonnull GetPerspectivesAction action, @Nonnull ExecutionContext executionContext) {
ProjectId projectId = action.getProjectId();
UserId userId = action.getUserId();
ImmutableList<PerspectiveId> perspectives = perspectivesManager.getPerspectives(projectId, userId);
return new GetPerspectivesResult(perspectives);
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class ActiveProjectManagerImpl method getActiveProjectDetails.
@Override
public void getActiveProjectDetails(Consumer<Optional<ProjectDetails>> projectDetailsConsumer) {
if (cachedProjectDetails.isPresent()) {
projectDetailsConsumer.accept(cachedProjectDetails);
} else {
Optional<ProjectId> activeProjectId = getActiveProjectId();
if (activeProjectId.isPresent()) {
dispatchServiceManager.execute(new GetProjectDetailsAction(activeProjectId.get()), result -> {
GWT.log("[ActiveProjectManagerImpl] Got details: " + result.getProjectDetails());
cachedProjectDetails = Optional.of(result.getProjectDetails());
projectDetailsConsumer.accept(cachedProjectDetails);
});
} else {
projectDetailsConsumer.accept(Optional.empty());
}
}
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class WatchPresenter method start.
public void start(final OWLEntity forEntity) {
final UserId userId = loggedInUserProvider.getCurrentUserId();
dispatchServiceManager.execute(new GetWatchesAction(projectId, userId, forEntity), new DispatchServiceCallback<GetWatchesResult>() {
@Override
public void handleSuccess(GetWatchesResult result) {
Set<Watch> watches = result.getWatches();
updateDialog(watches);
WebProtegeDialog<WatchTypeSelection> dlg = new WebProtegeDialog<>(controller);
dlg.show();
controller.setDialogButtonHandler(DialogButton.OK, (data, closer) -> {
closer.hide();
handleWatchTypeForEntity(data, forEntity);
});
}
});
}
use of edu.stanford.bmir.protege.web.shared.project.ProjectId in project webprotege by protegeproject.
the class EntitySearcher method invoke.
/**
* Invokes the entity searcher to perform a search.
*/
public void invoke() {
Stopwatch stopwatch = Stopwatch.createStarted();
matchCounter.reset();
searchCounter.reset();
results.clear();
tagsByLabel.clear();
tagsManager.getProjectTags().forEach(tag -> tagsByLabel.put(tag.getLabel(), tag));
tagsByEntity.clear();
tagsByEntity.putAll(tagsManager.getTags(projectId));
Pattern searchPattern = compileSearchPattern(searchWords);
entityStreamSupplier.get().filter(this::isRequiredEntityType).peek(this::incrementSearchCounter).map(this::performMatch).filter(Objects::nonNull).peek(this::incrementMatchCounter).sorted().skip(skip).limit(limit).map(m -> toSearchResult(searchPattern, m)).forEach(results::add);
logger.info(BROWSING, "{} {} Performed entity search for \"{}\". Found {} matches in {} entities in {} ms.", projectId, userId, searchString, matchCounter.getCounter(), searchCounter.getCounter(), stopwatch.elapsed(TimeUnit.MILLISECONDS));
}
Aggregations