Skip to content

Commit

Permalink
Who linearization (#42)
Browse files Browse the repository at this point in the history
added linearization development
  • Loading branch information
alexsilaghi authored Aug 19, 2024
1 parent 6bd4aef commit 9ee6a08
Show file tree
Hide file tree
Showing 189 changed files with 5,427 additions and 702 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Build package
run: mvn --batch-mode clean package
- name: Build and push image
run: mvn --batch-mode -pl webprotege-gwt-ui-server dockerfile:build dockerfile:push
run: mvn --batch-mode -pl webprotege-gwt-ui-server -am package install
- name: Release
uses: softprops/action-gh-release@v1
env:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>edu.stanford.protege</groupId>
<artifactId>webprotege-gwt-ui</artifactId>
<version>6.0.2-WHO</version>
<version>6.0.6-WHO</version>
<packaging>pom</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion webprotege-gwt-ui-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>edu.stanford.protege</groupId>
<artifactId>webprotege-gwt-ui</artifactId>
<version>6.0.2-WHO</version>
<version>6.0.6-WHO</version>
</parent>

<artifactId>webprotege-gwt-ui-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package edu.stanford.bmir.protege.web.client.app;


import edu.stanford.bmir.protege.web.shared.dispatch.actions.AppEnvVariables;
import edu.stanford.bmir.protege.web.shared.inject.ApplicationSingleton;

import javax.inject.Inject;

@ApplicationSingleton
public class ApplicationEnvironmentManager {

private AppEnvVariables appEnvVariables;

@Inject
public ApplicationEnvironmentManager() {

}

public void loadAppEnvVariables(AppEnvVariables envVariables) {
this.appEnvVariables = envVariables;
}


public AppEnvVariables getAppEnvVariables() {
return appEnvVariables;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package edu.stanford.bmir.protege.web.client.app;

import edu.stanford.bmir.protege.web.client.dispatch.DispatchServiceManager;
import edu.stanford.bmir.protege.web.shared.dispatch.actions.FetchAppEnvVariables;

import javax.annotation.Nonnull;
import javax.inject.Inject;

public class FetchApplicationEnvVariablesTask implements ApplicationInitManager.ApplicationInitializationTask {

@Nonnull
private final DispatchServiceManager dispatch;

@Nonnull
private final ApplicationEnvironmentManager applicationEnvironmentManager;

@Inject
public FetchApplicationEnvVariablesTask(@Nonnull DispatchServiceManager dispatch, @Nonnull ApplicationEnvironmentManager applicationEnvironmentManager) {
this.dispatch = dispatch;
this.applicationEnvironmentManager = applicationEnvironmentManager;
}

@Override
public void run(ApplicationInitManager.ApplicationInitTaskCallback callback) {
dispatch.execute(new FetchAppEnvVariables(), result -> {
applicationEnvironmentManager.loadAppEnvVariables(result);
callback.taskComplete();
});
}

@Override
public String getName() {
return "FetchApplicationEnvVariablesTask";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import javax.annotation.Nonnull;
import javax.inject.Inject;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
Expand Down Expand Up @@ -43,7 +44,7 @@ public void run(ApplicationInitManager.ApplicationInitTaskCallback callback) {
new DispatchServiceCallback<GetAuthenticatedUserDetailsResult>(errorMessageDisplay) {
@Override
public void handleSuccess(GetAuthenticatedUserDetailsResult result) {
logger.info("[ReadLoggedInUserInitializationTask] set logged user: " + result);
logger.log(Level.FINE, "[ReadLoggedInUserInitializationTask] set logged user: " + result);

loggedInUserManager.setLoggedInUser(new UserInSession(result.getUserDetails(),
result.getPermittedActions()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ public class WebProtegeInitializer {
private static boolean properlyInitialized = false;

private final ReadLoggedInUserInitializationTask readLoggedInUserInitializationTask;
private final FetchApplicationEnvVariablesTask fetchApplicationEnvVariablesTask;

@Nonnull
private final MessageBox messageBox;

@Inject
protected WebProtegeInitializer(@Nonnull ReadLoggedInUserInitializationTask readLoggedInUserInitializationTask,
@Nonnull FetchApplicationEnvVariablesTask fetchApplicationEnvVariablesTask,
@Nonnull MessageBox messageBox) {
this.readLoggedInUserInitializationTask = readLoggedInUserInitializationTask;
this.fetchApplicationEnvVariablesTask = fetchApplicationEnvVariablesTask;
this.messageBox = messageBox;
}

Expand Down Expand Up @@ -67,6 +70,7 @@ public void init(AsyncCallback<Void> initCompleteCallback) {
private void runInitTasks(final AsyncCallback<Void> callback) {
List<ApplicationInitManager.ApplicationInitializationTask> initTasks = new ArrayList<>();
initTasks.add(readLoggedInUserInitializationTask);
initTasks.add(fetchApplicationEnvVariablesTask);
ApplicationInitManager initManager = new ApplicationInitManager(initTasks);
// Run the tasks and mark proper initalization on finish.
initManager.runTasks(new AsyncCallback<Void>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.common.collect.Ordering;
import com.google.gwt.i18n.shared.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
import edu.stanford.bmir.protege.web.client.Messages;
import edu.stanford.bmir.protege.web.client.dispatch.DispatchServiceManager;
import edu.stanford.bmir.protege.web.client.download.ProjectRevisionDownloader;
Expand Down Expand Up @@ -109,8 +108,8 @@ public void displayChangesForProject() {
GetProjectChangesAction action = GetProjectChangesAction.create(projectId, Optional.empty(), pageRequest);
lastAction = Optional.of(action);
dispatch.execute(action,
hasBusy,
this::fillView);
hasBusy,
this::fillView);
}

public void displayChangesForEntity(@Nonnull OWLEntity entity) {
Expand All @@ -120,8 +119,8 @@ public void displayChangesForEntity(@Nonnull OWLEntity entity) {
PageRequest pageRequest = PageRequest.requestPage(view.getPageNumber());
GetProjectChangesAction action = GetProjectChangesAction.create(projectId, Optional.of(entity), pageRequest);
dispatch.execute(action,
hasBusy,
this::fillView);
hasBusy,
this::fillView);
}

public void displayChangesForWatches(@Nonnull UserId userId) {
Expand All @@ -130,8 +129,8 @@ public void displayChangesForWatches(@Nonnull UserId userId) {
view.clear();
GetWatchedEntityChangesAction action = GetWatchedEntityChangesAction.create(projectId, userId);
dispatch.execute(action,
hasBusy,
this::fillView);
hasBusy,
this::fillView);
}

public void clear() {
Expand All @@ -142,11 +141,11 @@ private void fillView(HasProjectChanges result) {
Page<ProjectChange> changes = result.getProjectChanges();
view.clear();
permissionChecker.hasPermission(VIEW_CHANGES,
viewChanges -> {
if (viewChanges) {
insertChangesIntoView(changes);
}
});
viewChanges -> {
if (viewChanges) {
insertChangesIntoView(changes);
}
});
}

private void insertChangesIntoView(Page<ProjectChange> changes) {
Expand All @@ -173,7 +172,7 @@ private void insertChangesIntoView(Page<ProjectChange> changes) {
view.setRevertRevisionVisible(false);
if (revertChangesVisible) {
permissionChecker.hasPermission(REVERT_CHANGES,
view::setRevertRevisionVisible);
view::setRevertRevisionVisible);
}
view.setRevertRevisionHandler(revisionNumber -> ChangeListPresenter.this.handleRevertRevision(
projectChange));
Expand Down Expand Up @@ -212,7 +211,7 @@ private void startRevertChangesWorkflow(final ProjectChange projectChange) {
private void revertChanges(ProjectChange projectChange) {
final RevisionNumber revisionNumber = projectChange.getRevisionNumber();
dispatch.execute(RevertRevisionAction.create(projectId, revisionNumber),
this::handleChangedReverted);
this::handleChangedReverted);
}

private void handleChangedReverted(@Nonnull RevertRevisionResult result) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package edu.stanford.bmir.protege.web.client.change.combined;

import com.google.gwt.user.client.ui.IsWidget;
import edu.stanford.bmir.protege.web.client.change.ChangeDetailsView;

/**
* Matthew Horridge
* Stanford Center for Biomedical Informatics Research
* 26/02/15
*/
public interface CombinedChangeDetailsView extends IsWidget, ChangeDetailsView {

}
Loading

0 comments on commit 9ee6a08

Please sign in to comment.