use of edu.stanford.bmir.protege.web.shared.user.UserId 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.user.UserId in project webprotege by protegeproject.
the class EventPollingManager method pollForProjectEvents.
public void pollForProjectEvents() {
GWT.log("[Event Polling Manager] Polling for project events for " + projectId + " from " + nextTag);
UserId userId = loggedInUserProvider.getCurrentUserId();
dispatchServiceManager.execute(new GetProjectEventsAction(nextTag, projectId), new DispatchServiceCallback<GetProjectEventsResult>() {
@Override
public void handleSuccess(GetProjectEventsResult result) {
dispatchEvents(result.getEvents());
}
});
}
use of edu.stanford.bmir.protege.web.shared.user.UserId 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.user.UserId in project webprotege by protegeproject.
the class ChangePasswordActionHandler method executeAuthenticatedAction.
@Override
protected ChangePasswordResult executeAuthenticatedAction(ChangePasswordAction action, ExecutionContext executionContext) {
SaltedPasswordDigest newPassword = action.getNewPassword();
Salt newSalt = action.getNewSalt();
UserId userId = action.getUserId();
authenticationManager.setDigestedPassword(userId, newPassword, newSalt);
return new ChangePasswordResult(AuthenticationResponse.SUCCESS);
}
use of edu.stanford.bmir.protege.web.shared.user.UserId in project webprotege by protegeproject.
the class AbstractUpdateFrameHandler method execute.
/**
* Executes the specified action, against the specified project in the specified context.
* @param action The action to be handled/executed
* @param executionContext The {@link edu.stanford.bmir.protege.web.server.dispatch.ExecutionContext} that should be
* used to provide details such as the
* {@link edu.stanford.bmir.protege.web.shared.user.UserId} of the user who requested the action be executed.
* @return The result of the execution to be returned to the client.
*/
@Nonnull
@Override
public Result execute(@Nonnull A action, @Nonnull ExecutionContext executionContext) {
LabelledFrame<F> from = action.getFrom();
LabelledFrame<F> to = action.getTo();
final EventTag startTag = eventManager.getCurrentTag();
if (from.equals(to)) {
return createResponse(action.getTo(), eventManager.getEventsFromTag(startTag));
}
UserId userId = executionContext.getUserId();
FrameTranslator<F, S> translator = createTranslator();
final FrameChangeGenerator<F, S> changeGenerator = new FrameChangeGenerator<>(from.getFrame(), to.getFrame(), translator, rootOntology, changeDescriptionGeneratorFactory);
ChangeDescriptionGenerator<S> generator = changeDescriptionGeneratorFactory.get("Edited " + from.getDisplayName());
applyChanges.applyChanges(userId, changeGenerator);
EventList<ProjectEvent<?>> events = eventManager.getEventsFromTag(startTag);
return createResponse(action.getTo(), events);
}
Aggregations