diff --git a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/Messages.java b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/Messages.java index b028503e3..1b8765452 100644 --- a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/Messages.java +++ b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/Messages.java @@ -863,6 +863,10 @@ public interface Messages extends com.google.gwt.i18n.client.Messages { @Key("sharing.edit") String sharing_edit(); + @DefaultMessage("ICD Edit") + @Key("sharing.icd.edit") + String sharing_icd_edit(); + @DefaultMessage("Link sharing enabled") @Key("sharing.linkSharingEnabled") diff --git a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/portlet/PortletUiImpl.java b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/portlet/PortletUiImpl.java index f0ee16552..ca98bc6a2 100644 --- a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/portlet/PortletUiImpl.java +++ b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/portlet/PortletUiImpl.java @@ -197,6 +197,7 @@ public void addAction(final UIAction action) { button.addClickHandler(event -> action.execute()); action.setStateChangedHandler(value -> { button.setEnabled(value.isEnabled()); + button.setVisible(value.isVisible()); if (!action.hasIcon()) { button.setText(value.getLabel()); } diff --git a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingEditorImpl.java b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingEditorImpl.java index e3fba4f82..f6efebe8a 100644 --- a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingEditorImpl.java +++ b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingEditorImpl.java @@ -58,6 +58,8 @@ private static String getPermissionLabel(SharingPermission permission) { return MESSAGES.sharing_manage(); case EDIT: return MESSAGES.sharing_edit(); + case ICD_EDIT: + return MESSAGES.sharing_icd_edit(); case COMMENT: return MESSAGES.sharing_comment(); case VIEW: diff --git a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingsPresenter.java b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingsPresenter.java index 106fc8d36..d714434a0 100644 --- a/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingsPresenter.java +++ b/webprotege-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/sharing/SharingSettingsPresenter.java @@ -4,26 +4,20 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget; import com.google.web.bindery.event.shared.EventBus; import edu.stanford.bmir.protege.web.client.Messages; -import edu.stanford.bmir.protege.web.client.app.PermissionScreener; -import edu.stanford.bmir.protege.web.client.app.Presenter; -import edu.stanford.bmir.protege.web.client.dispatch.DispatchErrorMessageDisplay; -import edu.stanford.bmir.protege.web.client.dispatch.DispatchServiceCallbackWithProgressDisplay; -import edu.stanford.bmir.protege.web.client.dispatch.DispatchServiceManager; -import edu.stanford.bmir.protege.web.client.dispatch.ProgressDisplay; +import edu.stanford.bmir.protege.web.client.app.*; +import edu.stanford.bmir.protege.web.client.dispatch.*; import edu.stanford.bmir.protege.web.client.permissions.PermissionManager; import edu.stanford.bmir.protege.web.client.progress.BusyView; import edu.stanford.bmir.protege.web.client.settings.SettingsPresenter; import edu.stanford.bmir.protege.web.client.uuid.UuidV4Provider; import edu.stanford.bmir.protege.web.shared.perspective.ChangeRequestId; import edu.stanford.bmir.protege.web.shared.project.ProjectId; -import edu.stanford.bmir.protege.web.shared.sharing.GetProjectSharingSettingsAction; -import edu.stanford.bmir.protege.web.shared.sharing.ProjectSharingSettings; -import edu.stanford.bmir.protege.web.shared.sharing.SetProjectSharingSettingsAction; -import edu.stanford.bmir.protege.web.shared.sharing.SetProjectSharingSettingsResult; +import edu.stanford.bmir.protege.web.shared.sharing.*; import javax.annotation.Nonnull; import javax.inject.Inject; import java.util.Optional; +import java.util.logging.Logger; import static com.google.common.base.Preconditions.checkNotNull; import static edu.stanford.bmir.protege.web.shared.access.BuiltInAction.EDIT_SHARING_SETTINGS; @@ -68,6 +62,8 @@ public class SharingSettingsPresenter implements Presenter { @Nonnull private UuidV4Provider uuidV4Provider; + private final static Logger logger = Logger.getLogger(SharingSettingsPresenter.class.getName()); + @Inject public SharingSettingsPresenter(@Nonnull ProjectId projectId, @Nonnull SharingSettingsView view, diff --git a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/itemlist/GetUserIdCompletionsAction.java b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/itemlist/GetUserIdCompletionsAction.java index 9039fefc4..0b0f0898c 100644 --- a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/itemlist/GetUserIdCompletionsAction.java +++ b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/itemlist/GetUserIdCompletionsAction.java @@ -1,6 +1,6 @@ package edu.stanford.bmir.protege.web.shared.itemlist; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.*; import com.google.common.base.Objects; import edu.stanford.bmir.protege.web.shared.user.UserId; diff --git a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/GetProjectSharingSettingsResult.java b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/GetProjectSharingSettingsResult.java index 318639a81..c7f1a7395 100644 --- a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/GetProjectSharingSettingsResult.java +++ b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/GetProjectSharingSettingsResult.java @@ -1,6 +1,6 @@ package edu.stanford.bmir.protege.web.shared.sharing; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.*; import com.google.common.base.Objects; import edu.stanford.bmir.protege.web.shared.dispatch.Result; @@ -25,7 +25,8 @@ private GetProjectSharingSettingsResult(ProjectSharingSettings projectSharingSet this.projectSharingSettings = checkNotNull(projectSharingSettings); } - public static GetProjectSharingSettingsResult create(ProjectSharingSettings projectSharingSettings) { + @JsonCreator + public static GetProjectSharingSettingsResult create(@JsonProperty("settings") ProjectSharingSettings projectSharingSettings) { return new GetProjectSharingSettingsResult(projectSharingSettings); } diff --git a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/ProjectSharingSettings.java b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/ProjectSharingSettings.java index d057907fb..db528ed09 100644 --- a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/ProjectSharingSettings.java +++ b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/ProjectSharingSettings.java @@ -1,5 +1,6 @@ package edu.stanford.bmir.protege.web.shared.sharing; +import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Objects; import edu.stanford.bmir.protege.web.shared.project.ProjectId; @@ -22,7 +23,7 @@ public class ProjectSharingSettings implements Serializable { private ProjectId projectId; - private List sharingSettings = new ArrayList<>(); + private List sharingSettings; @Nullable private SharingPermission linkSharingPermission = null; @@ -33,20 +34,25 @@ public class ProjectSharingSettings implements Serializable { private ProjectSharingSettings() { } - public ProjectSharingSettings(ProjectId projectId, Optional linkSharingPermission, List sharingSettings) { + public ProjectSharingSettings(@JsonProperty("projectId") ProjectId projectId, + @JsonProperty("linkSharingPermission") Optional linkSharingPermission, + @JsonProperty("sharingSettings") List sharingSettings) { this.projectId = checkNotNull(projectId); - this.sharingSettings.addAll(checkNotNull(sharingSettings)); + this.sharingSettings = new ArrayList<>(checkNotNull(sharingSettings)); this.linkSharingPermission = checkNotNull(linkSharingPermission).orElse(null); } + @JsonProperty("projectId") public ProjectId getProjectId() { return projectId; } + @JsonProperty("sharingSettings") public List getSharingSettings() { return new ArrayList<>(sharingSettings); } + @JsonProperty("linkSharingPermission") public Optional getLinkSharingPermission() { return Optional.ofNullable(linkSharingPermission); } diff --git a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/SharingPermission.java b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/SharingPermission.java index f22c85617..407689081 100644 --- a/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/SharingPermission.java +++ b/webprotege-gwt-ui-shared/src/main/java/edu/stanford/bmir/protege/web/shared/sharing/SharingPermission.java @@ -25,6 +25,8 @@ public enum SharingPermission implements Serializable { */ EDIT, + ICD_EDIT, + /** * A user can manage a project */