fix user account edit privileges and page state
This commit is contained in:
parent
cacd780f50
commit
c2b2dea65f
21 changed files with 209 additions and 154 deletions
|
@ -53,6 +53,7 @@ import ch.ethz.seb.sebserver.gui.service.page.PageService.PageActionBuilder;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
|
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.page.impl.PageState;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.download.DownloadService;
|
import ch.ethz.seb.sebserver.gui.service.remote.download.DownloadService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.download.SebExamConfigDownload;
|
import ch.ethz.seb.sebserver.gui.service.remote.download.SebExamConfigDownload;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
|
||||||
|
@ -574,8 +575,8 @@ public class ExamForm implements TemplateComposer {
|
||||||
return activityHomeAction;
|
return activityHomeAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pageService.onEmptyEntityKeyGoTo(action, ActionDefinition.EXAM_VIEW_LIST);
|
final PageState lastState = this.pageService.getCurrentState();
|
||||||
return action;
|
return lastState.gotoAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,9 +174,7 @@ public class ExamSebConfigMapForm implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.EXAM_CONFIGURATION_CANCEL_MODIFY)
|
.newAction(ActionDefinition.EXAM_CONFIGURATION_CANCEL_MODIFY)
|
||||||
.withEntityKey(parentEntityKey)
|
.withEntityKey(parentEntityKey)
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
action,
|
|
||||||
ActionDefinition.EXAM_VIEW_LIST))
|
|
||||||
.publishIf(() -> !isReadonly);
|
.publishIf(() -> !isReadonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,9 +160,7 @@ public class IndicatorForm implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.EXAM_INDICATOR_CANCEL_MODIFY)
|
.newAction(ActionDefinition.EXAM_INDICATOR_CANCEL_MODIFY)
|
||||||
.withEntityKey(parentEntityKey)
|
.withEntityKey(parentEntityKey)
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
action,
|
|
||||||
ActionDefinition.EXAM_VIEW_LIST))
|
|
||||||
.publishIf(() -> !isReadonly);
|
.publishIf(() -> !isReadonly);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,9 +170,7 @@ public class InstitutionForm implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.INSTITUTION_CANCEL_MODIFY)
|
.newAction(ActionDefinition.INSTITUTION_CANCEL_MODIFY)
|
||||||
.withEntityKey(entityKey)
|
.withEntityKey(entityKey)
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
action,
|
|
||||||
ActionDefinition.INSTITUTION_VIEW_LIST))
|
|
||||||
.publishIf(() -> !isReadonly);
|
.publishIf(() -> !isReadonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,9 +231,7 @@ public class LmsSetupForm implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.LMS_SETUP_CANCEL_MODIFY)
|
.newAction(ActionDefinition.LMS_SETUP_CANCEL_MODIFY)
|
||||||
.withEntityKey(entityKey)
|
.withEntityKey(entityKey)
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
action,
|
|
||||||
ActionDefinition.LMS_SETUP_VIEW_LIST))
|
|
||||||
.publishIf(() -> !readonly);
|
.publishIf(() -> !readonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,9 +208,7 @@ public class SebClientConfigForm implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_CANCEL_MODIFY)
|
.newAction(ActionDefinition.SEB_CLIENT_CONFIG_CANCEL_MODIFY)
|
||||||
.withEntityKey(entityKey)
|
.withEntityKey(entityKey)
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
action,
|
|
||||||
ActionDefinition.SEB_CLIENT_CONFIG_LIST))
|
|
||||||
.publishIf(() -> !isReadonly);
|
.publishIf(() -> !isReadonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,9 +209,7 @@ public class SebExamConfigPropForm implements TemplateComposer {
|
||||||
|
|
||||||
.newAction(ActionDefinition.SEB_EXAM_CONFIG_CANCEL_MODIFY)
|
.newAction(ActionDefinition.SEB_EXAM_CONFIG_CANCEL_MODIFY)
|
||||||
.withEntityKey(entityKey)
|
.withEntityKey(entityKey)
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
action,
|
|
||||||
ActionDefinition.SEB_EXAM_CONFIG_LIST))
|
|
||||||
.publishIf(() -> !isReadonly);
|
.publishIf(() -> !isReadonly);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,9 +133,7 @@ public class UserAccountChangePasswordForm implements TemplateComposer {
|
||||||
.publish()
|
.publish()
|
||||||
|
|
||||||
.newAction(ActionDefinition.USER_ACCOUNT_CANCEL_MODIFY)
|
.newAction(ActionDefinition.USER_ACCOUNT_CANCEL_MODIFY)
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
action,
|
|
||||||
ActionDefinition.USER_ACCOUNT_VIEW_LIST))
|
|
||||||
.publish();
|
.publish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -120,12 +120,12 @@ public class UserAccountForm implements TemplateComposer {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final boolean roleBasedEditGrant = Privilege.hasRoleBasedUserAccountEditGrant(userAccount, currentUser.get());
|
||||||
// new PageContext with actual EntityKey
|
// new PageContext with actual EntityKey
|
||||||
final PageContext formContext = pageContext.withEntityKey(userAccount.getEntityKey());
|
final PageContext formContext = pageContext.withEntityKey(userAccount.getEntityKey());
|
||||||
|
|
||||||
final boolean ownAccount = user.uuid.equals(userAccount.getModelId());
|
final boolean ownAccount = user.uuid.equals(userAccount.getModelId());
|
||||||
final EntityGrantCheck userGrantCheck = currentUser.entityGrantCheck(userAccount);
|
final EntityGrantCheck userGrantCheck = currentUser.entityGrantCheck(userAccount);
|
||||||
final boolean roleBasedEditGrant = Privilege.hasRoleBasedUserAccountEditGrant(userAccount, currentUser.get());
|
|
||||||
final boolean writeGrant = roleBasedEditGrant && userGrantCheck.w();
|
final boolean writeGrant = roleBasedEditGrant && userGrantCheck.w();
|
||||||
final boolean modifyGrant = roleBasedEditGrant && userGrantCheck.m();
|
final boolean modifyGrant = roleBasedEditGrant && userGrantCheck.m();
|
||||||
final boolean institutionalWriteGrant = currentUser.hasInstitutionalPrivilege(
|
final boolean institutionalWriteGrant = currentUser.hasInstitutionalPrivilege(
|
||||||
|
@ -262,10 +262,7 @@ public class UserAccountForm implements TemplateComposer {
|
||||||
.publishIf(() -> !readonly)
|
.publishIf(() -> !readonly)
|
||||||
|
|
||||||
.newAction(ActionDefinition.USER_ACCOUNT_CANCEL_MODIFY)
|
.newAction(ActionDefinition.USER_ACCOUNT_CANCEL_MODIFY)
|
||||||
.withEntityKey(entityKey)
|
.withExec(this.pageService.backToCurrentFunction())
|
||||||
.withExec(action -> this.pageService.onEmptyEntityKeyGoTo(
|
|
||||||
action,
|
|
||||||
ActionDefinition.USER_ACCOUNT_VIEW_LIST))
|
|
||||||
.publishIf(() -> !readonly);
|
.publishIf(() -> !readonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,9 @@ import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import ch.ethz.seb.sebserver.gbl.Constants;
|
import ch.ethz.seb.sebserver.gbl.Constants;
|
||||||
|
import ch.ethz.seb.sebserver.gbl.api.API;
|
||||||
import ch.ethz.seb.sebserver.gbl.api.EntityType;
|
import ch.ethz.seb.sebserver.gbl.api.EntityType;
|
||||||
|
import ch.ethz.seb.sebserver.gbl.api.authorization.Privilege;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.Domain;
|
import ch.ethz.seb.sebserver.gbl.model.Domain;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.Entity;
|
import ch.ethz.seb.sebserver.gbl.model.Entity;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
|
import ch.ethz.seb.sebserver.gbl.model.user.UserInfo;
|
||||||
|
@ -27,11 +29,13 @@ import ch.ethz.seb.sebserver.gui.content.action.ActionDefinition;
|
||||||
import ch.ethz.seb.sebserver.gui.service.ResourceService;
|
import ch.ethz.seb.sebserver.gui.service.ResourceService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey;
|
import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
|
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.page.PageMessageException;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageService;
|
import ch.ethz.seb.sebserver.gui.service.page.PageService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageService.PageActionBuilder;
|
import ch.ethz.seb.sebserver.gui.service.page.PageService.PageActionBuilder;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.GetUserAccount;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.GetUserAccountPage;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.GetUserAccountPage;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser.GrantCheck;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser.GrantCheck;
|
||||||
|
@ -65,6 +69,8 @@ public class UserAccountList implements TemplateComposer {
|
||||||
new LocTextKey("sebserver.useraccount.list.column.name");
|
new LocTextKey("sebserver.useraccount.list.column.name");
|
||||||
private static final LocTextKey TITLE_TEXT_KEY =
|
private static final LocTextKey TITLE_TEXT_KEY =
|
||||||
new LocTextKey("sebserver.useraccount.list.title");
|
new LocTextKey("sebserver.useraccount.list.title");
|
||||||
|
private static final LocTextKey NO_EDIT_RIGHT_MESSAGE =
|
||||||
|
new LocTextKey("sebserver.useraccount.info.notEditable");
|
||||||
|
|
||||||
// filter attribute models
|
// filter attribute models
|
||||||
private final TableFilterAttribute institutionFilter;
|
private final TableFilterAttribute institutionFilter;
|
||||||
|
@ -193,10 +199,24 @@ public class UserAccountList implements TemplateComposer {
|
||||||
.publishIf(() -> table.hasAnyContent())
|
.publishIf(() -> table.hasAnyContent())
|
||||||
|
|
||||||
.newAction(ActionDefinition.USER_ACCOUNT_MODIFY_FROM_LIST)
|
.newAction(ActionDefinition.USER_ACCOUNT_MODIFY_FROM_LIST)
|
||||||
.withSelect(table::getSelection, PageAction::applySingleSelection, EMPTY_SELECTION_TEXT_KEY)
|
.withSelect(table::getSelection, this::editAction, EMPTY_SELECTION_TEXT_KEY)
|
||||||
.publishIf(() -> userGrant.im() && table.hasAnyContent());
|
.publishIf(() -> userGrant.im() && table.hasAnyContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PageAction editAction(final PageAction pageAction) {
|
||||||
|
if (!this.resourceService.getRestService()
|
||||||
|
.getBuilder(GetUserAccount.class)
|
||||||
|
.withURIVariable(API.PARAM_MODEL_ID, pageAction.getSingleSelection().modelId)
|
||||||
|
.call()
|
||||||
|
.map(user -> Privilege.hasRoleBasedUserAccountEditGrant(user,
|
||||||
|
this.resourceService.getCurrentUser().get()))
|
||||||
|
.getOr(false)) {
|
||||||
|
throw new PageMessageException(NO_EDIT_RIGHT_MESSAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PageAction.applySingleSelection(pageAction);
|
||||||
|
}
|
||||||
|
|
||||||
private String getLocaleDisplayText(final UserInfo userInfo) {
|
private String getLocaleDisplayText(final UserInfo userInfo) {
|
||||||
return (userInfo.language != null)
|
return (userInfo.language != null)
|
||||||
? userInfo.language.getDisplayLanguage(this.pageService.getI18nSupport().getCurrentLocale())
|
? userInfo.language.getDisplayLanguage(this.pageService.getI18nSupport().getCurrentLocale())
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
|
|
||||||
package ch.ethz.seb.sebserver.gui.content.action;
|
package ch.ethz.seb.sebserver.gui.content.action;
|
||||||
|
|
||||||
import ch.ethz.seb.sebserver.gui.content.activity.PageStateDefinition;
|
import ch.ethz.seb.sebserver.gui.content.activity.PageStateDefinitionImpl;
|
||||||
import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey;
|
import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageState;
|
import ch.ethz.seb.sebserver.gui.service.page.PageStateDefinition;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.ImageIcon;
|
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.ImageIcon;
|
||||||
|
|
||||||
/** Enumeration of static action data for each action within the SEB Server GUI */
|
/** Enumeration of static action data for each action within the SEB Server GUI */
|
||||||
|
@ -18,162 +18,162 @@ public enum ActionDefinition {
|
||||||
|
|
||||||
INSTITUTION_VIEW_LIST(
|
INSTITUTION_VIEW_LIST(
|
||||||
new LocTextKey("sebserver.institution.action.list"),
|
new LocTextKey("sebserver.institution.action.list"),
|
||||||
PageStateDefinition.INSTITUTION_LIST),
|
PageStateDefinitionImpl.INSTITUTION_LIST),
|
||||||
INSTITUTION_VIEW_FORM(
|
INSTITUTION_VIEW_FORM(
|
||||||
new LocTextKey("sebserver.institution.action.form"),
|
new LocTextKey("sebserver.institution.action.form"),
|
||||||
PageStateDefinition.INSTITUTION_VIEW),
|
PageStateDefinitionImpl.INSTITUTION_VIEW),
|
||||||
INSTITUTION_NEW(
|
INSTITUTION_NEW(
|
||||||
new LocTextKey("sebserver.institution.action.new"),
|
new LocTextKey("sebserver.institution.action.new"),
|
||||||
ImageIcon.NEW,
|
ImageIcon.NEW,
|
||||||
PageStateDefinition.INSTITUTION_EDIT),
|
PageStateDefinitionImpl.INSTITUTION_EDIT),
|
||||||
INSTITUTION_VIEW_FROM_LIST(
|
INSTITUTION_VIEW_FROM_LIST(
|
||||||
new LocTextKey("sebserver.institution.action.list.view"),
|
new LocTextKey("sebserver.institution.action.list.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.INSTITUTION_VIEW,
|
PageStateDefinitionImpl.INSTITUTION_VIEW,
|
||||||
ActionCategory.INSTITUTION_LIST),
|
ActionCategory.INSTITUTION_LIST),
|
||||||
INSTITUTION_MODIFY_FROM_LIST(
|
INSTITUTION_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.institution.action.list.modify"),
|
new LocTextKey("sebserver.institution.action.list.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.INSTITUTION_EDIT,
|
PageStateDefinitionImpl.INSTITUTION_EDIT,
|
||||||
ActionCategory.INSTITUTION_LIST),
|
ActionCategory.INSTITUTION_LIST),
|
||||||
INSTITUTION_MODIFY(
|
INSTITUTION_MODIFY(
|
||||||
new LocTextKey("sebserver.institution.action.modify"),
|
new LocTextKey("sebserver.institution.action.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.INSTITUTION_EDIT,
|
PageStateDefinitionImpl.INSTITUTION_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
INSTITUTION_CANCEL_MODIFY(
|
INSTITUTION_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.INSTITUTION_VIEW,
|
PageStateDefinitionImpl.INSTITUTION_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
INSTITUTION_SAVE(
|
INSTITUTION_SAVE(
|
||||||
new LocTextKey("sebserver.institution.action.save"),
|
new LocTextKey("sebserver.institution.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.INSTITUTION_VIEW,
|
PageStateDefinitionImpl.INSTITUTION_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
INSTITUTION_ACTIVATE(
|
INSTITUTION_ACTIVATE(
|
||||||
new LocTextKey("sebserver.institution.action.activate"),
|
new LocTextKey("sebserver.institution.action.activate"),
|
||||||
ImageIcon.TOGGLE_OFF,
|
ImageIcon.TOGGLE_OFF,
|
||||||
PageStateDefinition.INSTITUTION_VIEW,
|
PageStateDefinitionImpl.INSTITUTION_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
INSTITUTION_DEACTIVATE(
|
INSTITUTION_DEACTIVATE(
|
||||||
new LocTextKey("sebserver.institution.action.deactivate"),
|
new LocTextKey("sebserver.institution.action.deactivate"),
|
||||||
ImageIcon.TOGGLE_ON,
|
ImageIcon.TOGGLE_ON,
|
||||||
PageStateDefinition.INSTITUTION_VIEW,
|
PageStateDefinitionImpl.INSTITUTION_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
USER_ACCOUNT_VIEW_LIST(
|
USER_ACCOUNT_VIEW_LIST(
|
||||||
new LocTextKey("sebserver.useraccount.action.list"),
|
new LocTextKey("sebserver.useraccount.action.list"),
|
||||||
PageStateDefinition.USER_ACCOUNT_LIST),
|
PageStateDefinitionImpl.USER_ACCOUNT_LIST),
|
||||||
USER_ACCOUNT_VIEW_FORM(
|
USER_ACCOUNT_VIEW_FORM(
|
||||||
new LocTextKey("sebserver.useraccount.action.form"),
|
new LocTextKey("sebserver.useraccount.action.form"),
|
||||||
PageStateDefinition.USER_ACCOUNT_VIEW),
|
PageStateDefinitionImpl.USER_ACCOUNT_VIEW),
|
||||||
USER_ACCOUNT_NEW(
|
USER_ACCOUNT_NEW(
|
||||||
new LocTextKey("sebserver.useraccount.action.new"),
|
new LocTextKey("sebserver.useraccount.action.new"),
|
||||||
ImageIcon.NEW,
|
ImageIcon.NEW,
|
||||||
PageStateDefinition.USER_ACCOUNT_EDIT),
|
PageStateDefinitionImpl.USER_ACCOUNT_EDIT),
|
||||||
USER_ACCOUNT_VIEW_FROM_LIST(
|
USER_ACCOUNT_VIEW_FROM_LIST(
|
||||||
new LocTextKey("sebserver.useraccount.action.view"),
|
new LocTextKey("sebserver.useraccount.action.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.USER_ACCOUNT_VIEW,
|
PageStateDefinitionImpl.USER_ACCOUNT_VIEW,
|
||||||
ActionCategory.USER_ACCOUNT_LIST),
|
ActionCategory.USER_ACCOUNT_LIST),
|
||||||
USER_ACCOUNT_MODIFY_FROM_LIST(
|
USER_ACCOUNT_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.useraccount.action.list.modify"),
|
new LocTextKey("sebserver.useraccount.action.list.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.USER_ACCOUNT_EDIT,
|
PageStateDefinitionImpl.USER_ACCOUNT_EDIT,
|
||||||
ActionCategory.USER_ACCOUNT_LIST),
|
ActionCategory.USER_ACCOUNT_LIST),
|
||||||
USER_ACCOUNT_MODIFY(
|
USER_ACCOUNT_MODIFY(
|
||||||
new LocTextKey("sebserver.useraccount.action.modify"),
|
new LocTextKey("sebserver.useraccount.action.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.USER_ACCOUNT_EDIT,
|
PageStateDefinitionImpl.USER_ACCOUNT_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
USER_ACCOUNT_CANCEL_MODIFY(
|
USER_ACCOUNT_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.USER_ACCOUNT_VIEW,
|
PageStateDefinitionImpl.USER_ACCOUNT_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
USER_ACCOUNT_SAVE(
|
USER_ACCOUNT_SAVE(
|
||||||
new LocTextKey("sebserver.useraccount.action.save"),
|
new LocTextKey("sebserver.useraccount.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.USER_ACCOUNT_VIEW,
|
PageStateDefinitionImpl.USER_ACCOUNT_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
USER_ACCOUNT_ACTIVATE(
|
USER_ACCOUNT_ACTIVATE(
|
||||||
new LocTextKey("sebserver.useraccount.action.activate"),
|
new LocTextKey("sebserver.useraccount.action.activate"),
|
||||||
ImageIcon.TOGGLE_OFF,
|
ImageIcon.TOGGLE_OFF,
|
||||||
PageStateDefinition.USER_ACCOUNT_VIEW,
|
PageStateDefinitionImpl.USER_ACCOUNT_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
USER_ACCOUNT_DEACTIVATE(
|
USER_ACCOUNT_DEACTIVATE(
|
||||||
new LocTextKey("sebserver.useraccount.action.deactivate"),
|
new LocTextKey("sebserver.useraccount.action.deactivate"),
|
||||||
ImageIcon.TOGGLE_ON,
|
ImageIcon.TOGGLE_ON,
|
||||||
PageStateDefinition.USER_ACCOUNT_VIEW,
|
PageStateDefinitionImpl.USER_ACCOUNT_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
USER_ACCOUNT_CHANGE_PASSOWRD(
|
USER_ACCOUNT_CHANGE_PASSOWRD(
|
||||||
new LocTextKey("sebserver.useraccount.action.change.password"),
|
new LocTextKey("sebserver.useraccount.action.change.password"),
|
||||||
ImageIcon.SECURE,
|
ImageIcon.SECURE,
|
||||||
PageStateDefinition.USER_ACCOUNT_PASSWORD_CHANGE,
|
PageStateDefinitionImpl.USER_ACCOUNT_PASSWORD_CHANGE,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
USER_ACCOUNT_CHANGE_PASSOWRD_SAVE(
|
USER_ACCOUNT_CHANGE_PASSOWRD_SAVE(
|
||||||
new LocTextKey("sebserver.useraccount.action.change.password.save"),
|
new LocTextKey("sebserver.useraccount.action.change.password.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.USER_ACCOUNT_VIEW,
|
PageStateDefinitionImpl.USER_ACCOUNT_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
LMS_SETUP_VIEW_LIST(
|
LMS_SETUP_VIEW_LIST(
|
||||||
new LocTextKey("sebserver.lmssetup.action.list"),
|
new LocTextKey("sebserver.lmssetup.action.list"),
|
||||||
PageStateDefinition.LMS_SETUP_LIST),
|
PageStateDefinitionImpl.LMS_SETUP_LIST),
|
||||||
LMS_SETUP_NEW(
|
LMS_SETUP_NEW(
|
||||||
new LocTextKey("sebserver.lmssetup.action.new"),
|
new LocTextKey("sebserver.lmssetup.action.new"),
|
||||||
ImageIcon.NEW,
|
ImageIcon.NEW,
|
||||||
PageStateDefinition.LMS_SETUP_EDIT),
|
PageStateDefinitionImpl.LMS_SETUP_EDIT),
|
||||||
LMS_SETUP_VIEW_FROM_LIST(
|
LMS_SETUP_VIEW_FROM_LIST(
|
||||||
new LocTextKey("sebserver.lmssetup.action.list.view"),
|
new LocTextKey("sebserver.lmssetup.action.list.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.LMS_SETUP_VIEW,
|
PageStateDefinitionImpl.LMS_SETUP_VIEW,
|
||||||
ActionCategory.LMS_SETUP_LIST),
|
ActionCategory.LMS_SETUP_LIST),
|
||||||
LMS_SETUP_MODIFY_FROM_LIST(
|
LMS_SETUP_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.lmssetup.action.list.modify"),
|
new LocTextKey("sebserver.lmssetup.action.list.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.LMS_SETUP_EDIT,
|
PageStateDefinitionImpl.LMS_SETUP_EDIT,
|
||||||
ActionCategory.LMS_SETUP_LIST),
|
ActionCategory.LMS_SETUP_LIST),
|
||||||
LMS_SETUP_MODIFY(
|
LMS_SETUP_MODIFY(
|
||||||
new LocTextKey("sebserver.lmssetup.action.modify"),
|
new LocTextKey("sebserver.lmssetup.action.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.LMS_SETUP_EDIT,
|
PageStateDefinitionImpl.LMS_SETUP_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
LMS_SETUP_SAVE_AND_TEST(
|
LMS_SETUP_SAVE_AND_TEST(
|
||||||
new LocTextKey("sebserver.lmssetup.action.savetest"),
|
new LocTextKey("sebserver.lmssetup.action.savetest"),
|
||||||
ImageIcon.TEST,
|
ImageIcon.TEST,
|
||||||
PageStateDefinition.LMS_SETUP_VIEW,
|
PageStateDefinitionImpl.LMS_SETUP_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
LMS_SETUP_TEST_AND_SAVE(
|
LMS_SETUP_TEST_AND_SAVE(
|
||||||
new LocTextKey("sebserver.lmssetup.action.testsave"),
|
new LocTextKey("sebserver.lmssetup.action.testsave"),
|
||||||
ImageIcon.TEST,
|
ImageIcon.TEST,
|
||||||
PageStateDefinition.LMS_SETUP_VIEW,
|
PageStateDefinitionImpl.LMS_SETUP_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
LMS_SETUP_CANCEL_MODIFY(
|
LMS_SETUP_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.LMS_SETUP_VIEW,
|
PageStateDefinitionImpl.LMS_SETUP_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
LMS_SETUP_SAVE(
|
LMS_SETUP_SAVE(
|
||||||
new LocTextKey("sebserver.lmssetup.action.save"),
|
new LocTextKey("sebserver.lmssetup.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.LMS_SETUP_VIEW,
|
PageStateDefinitionImpl.LMS_SETUP_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
LMS_SETUP_ACTIVATE(
|
LMS_SETUP_ACTIVATE(
|
||||||
new LocTextKey("sebserver.lmssetup.action.activate"),
|
new LocTextKey("sebserver.lmssetup.action.activate"),
|
||||||
ImageIcon.TOGGLE_OFF,
|
ImageIcon.TOGGLE_OFF,
|
||||||
PageStateDefinition.LMS_SETUP_VIEW,
|
PageStateDefinitionImpl.LMS_SETUP_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
LMS_SETUP_DEACTIVATE(
|
LMS_SETUP_DEACTIVATE(
|
||||||
new LocTextKey("sebserver.lmssetup.action.deactivate"),
|
new LocTextKey("sebserver.lmssetup.action.deactivate"),
|
||||||
ImageIcon.TOGGLE_ON,
|
ImageIcon.TOGGLE_ON,
|
||||||
PageStateDefinition.LMS_SETUP_VIEW,
|
PageStateDefinitionImpl.LMS_SETUP_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
QUIZ_DISCOVERY_VIEW_LIST(
|
QUIZ_DISCOVERY_VIEW_LIST(
|
||||||
new LocTextKey("sebserver.quizdiscovery.action.list"),
|
new LocTextKey("sebserver.quizdiscovery.action.list"),
|
||||||
PageStateDefinition.QUIZ_LIST),
|
PageStateDefinitionImpl.QUIZ_LIST),
|
||||||
QUIZ_DISCOVERY_SHOW_DETAILS(
|
QUIZ_DISCOVERY_SHOW_DETAILS(
|
||||||
new LocTextKey("sebserver.quizdiscovery.action.details"),
|
new LocTextKey("sebserver.quizdiscovery.action.details"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
|
@ -181,76 +181,76 @@ public enum ActionDefinition {
|
||||||
QUIZ_DISCOVERY_EXAM_IMPORT(
|
QUIZ_DISCOVERY_EXAM_IMPORT(
|
||||||
new LocTextKey("sebserver.quizdiscovery.action.import"),
|
new LocTextKey("sebserver.quizdiscovery.action.import"),
|
||||||
ImageIcon.IMPORT,
|
ImageIcon.IMPORT,
|
||||||
PageStateDefinition.EXAM_EDIT,
|
PageStateDefinitionImpl.EXAM_EDIT,
|
||||||
ActionCategory.QUIZ_LIST),
|
ActionCategory.QUIZ_LIST),
|
||||||
|
|
||||||
EXAM_VIEW_LIST(
|
EXAM_VIEW_LIST(
|
||||||
new LocTextKey("sebserver.exam.action.list"),
|
new LocTextKey("sebserver.exam.action.list"),
|
||||||
PageStateDefinition.EXAM_LIST),
|
PageStateDefinitionImpl.EXAM_LIST),
|
||||||
EXAM_IMPORT(
|
EXAM_IMPORT(
|
||||||
new LocTextKey("sebserver.exam.action.import"),
|
new LocTextKey("sebserver.exam.action.import"),
|
||||||
ImageIcon.IMPORT,
|
ImageIcon.IMPORT,
|
||||||
PageStateDefinition.QUIZ_LIST),
|
PageStateDefinitionImpl.QUIZ_LIST),
|
||||||
EXAM_VIEW_FROM_LIST(
|
EXAM_VIEW_FROM_LIST(
|
||||||
new LocTextKey("sebserver.exam.action.list.view"),
|
new LocTextKey("sebserver.exam.action.list.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.EXAM_LIST),
|
ActionCategory.EXAM_LIST),
|
||||||
EXAM_MODIFY_FROM_LIST(
|
EXAM_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.exam.action.list.modify"),
|
new LocTextKey("sebserver.exam.action.list.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.EXAM_EDIT,
|
PageStateDefinitionImpl.EXAM_EDIT,
|
||||||
ActionCategory.EXAM_LIST),
|
ActionCategory.EXAM_LIST),
|
||||||
EXAM_MODIFY(
|
EXAM_MODIFY(
|
||||||
new LocTextKey("sebserver.exam.action.modify"),
|
new LocTextKey("sebserver.exam.action.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.EXAM_EDIT,
|
PageStateDefinitionImpl.EXAM_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
EXAM_CANCEL_MODIFY(
|
EXAM_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
EXAM_SAVE(
|
EXAM_SAVE(
|
||||||
new LocTextKey("sebserver.exam.action.save"),
|
new LocTextKey("sebserver.exam.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
EXAM_ACTIVATE(
|
EXAM_ACTIVATE(
|
||||||
new LocTextKey("sebserver.exam.action.activate"),
|
new LocTextKey("sebserver.exam.action.activate"),
|
||||||
ImageIcon.TOGGLE_OFF,
|
ImageIcon.TOGGLE_OFF,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
EXAM_DEACTIVATE(
|
EXAM_DEACTIVATE(
|
||||||
new LocTextKey("sebserver.exam.action.deactivate"),
|
new LocTextKey("sebserver.exam.action.deactivate"),
|
||||||
ImageIcon.TOGGLE_ON,
|
ImageIcon.TOGGLE_ON,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
EXAM_CONFIGURATION_NEW(
|
EXAM_CONFIGURATION_NEW(
|
||||||
new LocTextKey("sebserver.exam.configuration.action.list.new"),
|
new LocTextKey("sebserver.exam.configuration.action.list.new"),
|
||||||
ImageIcon.NEW,
|
ImageIcon.NEW,
|
||||||
PageStateDefinition.EXAM_CONFIG_MAP_EDIT,
|
PageStateDefinitionImpl.EXAM_CONFIG_MAP_EDIT,
|
||||||
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
||||||
EXAM_CONFIGURATION_MODIFY_FROM_LIST(
|
EXAM_CONFIGURATION_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.exam.configuration.action.list.modify"),
|
new LocTextKey("sebserver.exam.configuration.action.list.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.EXAM_CONFIG_MAP_EDIT,
|
PageStateDefinitionImpl.EXAM_CONFIG_MAP_EDIT,
|
||||||
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
||||||
EXAM_CONFIGURATION_EXAM_CONFIG_VIEW_PROP(
|
EXAM_CONFIGURATION_EXAM_CONFIG_VIEW_PROP(
|
||||||
new LocTextKey("sebserver.examconfig.action.view"),
|
new LocTextKey("sebserver.examconfig.action.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_VIEW,
|
||||||
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
||||||
EXAM_CONFIGURATION_DELETE_FROM_LIST(
|
EXAM_CONFIGURATION_DELETE_FROM_LIST(
|
||||||
new LocTextKey("sebserver.exam.configuration.action.list.delete"),
|
new LocTextKey("sebserver.exam.configuration.action.list.delete"),
|
||||||
ImageIcon.DELETE,
|
ImageIcon.DELETE,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
||||||
EXAM_CONFIGURATION_EXPORT(
|
EXAM_CONFIGURATION_EXPORT(
|
||||||
new LocTextKey("sebserver.exam.configuration.action.export-config"),
|
new LocTextKey("sebserver.exam.configuration.action.export-config"),
|
||||||
ImageIcon.EXPORT,
|
ImageIcon.EXPORT,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
ActionCategory.EXAM_CONFIG_MAPPING_LIST),
|
||||||
EXAM_CONFIGURATION_GET_CONFIG_KEY(
|
EXAM_CONFIGURATION_GET_CONFIG_KEY(
|
||||||
new LocTextKey("sebserver.exam.configuration.action.get-config-key"),
|
new LocTextKey("sebserver.exam.configuration.action.get-config-key"),
|
||||||
|
@ -259,135 +259,135 @@ public enum ActionDefinition {
|
||||||
EXAM_CONFIGURATION_SAVE(
|
EXAM_CONFIGURATION_SAVE(
|
||||||
new LocTextKey("sebserver.exam.configuration.action.save"),
|
new LocTextKey("sebserver.exam.configuration.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
EXAM_CONFIGURATION_CANCEL_MODIFY(
|
EXAM_CONFIGURATION_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
EXAM_INDICATOR_NEW(
|
EXAM_INDICATOR_NEW(
|
||||||
new LocTextKey("sebserver.exam.indicator.action.list.new"),
|
new LocTextKey("sebserver.exam.indicator.action.list.new"),
|
||||||
ImageIcon.NEW,
|
ImageIcon.NEW,
|
||||||
PageStateDefinition.INDICATOR_EDIT,
|
PageStateDefinitionImpl.INDICATOR_EDIT,
|
||||||
ActionCategory.INDICATOR_LIST),
|
ActionCategory.INDICATOR_LIST),
|
||||||
EXAM_INDICATOR_MODIFY_FROM_LIST(
|
EXAM_INDICATOR_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.exam.indicator.action.list.modify"),
|
new LocTextKey("sebserver.exam.indicator.action.list.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.INDICATOR_EDIT,
|
PageStateDefinitionImpl.INDICATOR_EDIT,
|
||||||
ActionCategory.INDICATOR_LIST),
|
ActionCategory.INDICATOR_LIST),
|
||||||
EXAM_INDICATOR_DELETE_FROM_LIST(
|
EXAM_INDICATOR_DELETE_FROM_LIST(
|
||||||
new LocTextKey("sebserver.exam.indicator.action.list.delete"),
|
new LocTextKey("sebserver.exam.indicator.action.list.delete"),
|
||||||
ImageIcon.DELETE,
|
ImageIcon.DELETE,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.INDICATOR_LIST),
|
ActionCategory.INDICATOR_LIST),
|
||||||
EXAM_INDICATOR_SAVE(
|
EXAM_INDICATOR_SAVE(
|
||||||
new LocTextKey("sebserver.exam.indicator.action.save"),
|
new LocTextKey("sebserver.exam.indicator.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
EXAM_INDICATOR_CANCEL_MODIFY(
|
EXAM_INDICATOR_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.EXAM_VIEW,
|
PageStateDefinitionImpl.EXAM_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
SEB_CLIENT_CONFIG_LIST(
|
SEB_CLIENT_CONFIG_LIST(
|
||||||
new LocTextKey("sebserver.clientconfig.action.list"),
|
new LocTextKey("sebserver.clientconfig.action.list"),
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_LIST),
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_LIST),
|
||||||
SEB_CLIENT_CONFIG_NEW(
|
SEB_CLIENT_CONFIG_NEW(
|
||||||
new LocTextKey("sebserver.clientconfig.action.list.new"),
|
new LocTextKey("sebserver.clientconfig.action.list.new"),
|
||||||
ImageIcon.NEW,
|
ImageIcon.NEW,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_EDIT),
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_EDIT),
|
||||||
SEB_CLIENT_CONFIG_VIEW_FROM_LIST(
|
SEB_CLIENT_CONFIG_VIEW_FROM_LIST(
|
||||||
new LocTextKey("sebserver.clientconfig.action.list.view"),
|
new LocTextKey("sebserver.clientconfig.action.list.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_VIEW,
|
||||||
ActionCategory.SEB_CLIENT_CONFIG_LIST),
|
ActionCategory.SEB_CLIENT_CONFIG_LIST),
|
||||||
SEB_CLIENT_CONFIG_MODIFY_FROM_LIST(
|
SEB_CLIENT_CONFIG_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.clientconfig.action.list.modify"),
|
new LocTextKey("sebserver.clientconfig.action.list.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_EDIT,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_EDIT,
|
||||||
ActionCategory.SEB_CLIENT_CONFIG_LIST),
|
ActionCategory.SEB_CLIENT_CONFIG_LIST),
|
||||||
SEB_CLIENT_CONFIG_MODIFY(
|
SEB_CLIENT_CONFIG_MODIFY(
|
||||||
new LocTextKey("sebserver.clientconfig.action.modify"),
|
new LocTextKey("sebserver.clientconfig.action.modify"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_EDIT,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_CLIENT_CONFIG_CANCEL_MODIFY(
|
SEB_CLIENT_CONFIG_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_CLIENT_CONFIG_SAVE(
|
SEB_CLIENT_CONFIG_SAVE(
|
||||||
new LocTextKey("sebserver.clientconfig.action.save"),
|
new LocTextKey("sebserver.clientconfig.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_CLIENT_CONFIG_ACTIVATE(
|
SEB_CLIENT_CONFIG_ACTIVATE(
|
||||||
new LocTextKey("sebserver.clientconfig.action.activate"),
|
new LocTextKey("sebserver.clientconfig.action.activate"),
|
||||||
ImageIcon.TOGGLE_OFF,
|
ImageIcon.TOGGLE_OFF,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_CLIENT_CONFIG_DEACTIVATE(
|
SEB_CLIENT_CONFIG_DEACTIVATE(
|
||||||
new LocTextKey("sebserver.clientconfig.action.deactivate"),
|
new LocTextKey("sebserver.clientconfig.action.deactivate"),
|
||||||
ImageIcon.TOGGLE_ON,
|
ImageIcon.TOGGLE_ON,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_CLIENT_CONFIG_EXPORT(
|
SEB_CLIENT_CONFIG_EXPORT(
|
||||||
new LocTextKey("sebserver.clientconfig.action.export"),
|
new LocTextKey("sebserver.clientconfig.action.export"),
|
||||||
ImageIcon.EXPORT,
|
ImageIcon.EXPORT,
|
||||||
PageStateDefinition.SEB_CLIENT_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_CLIENT_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
SEB_EXAM_CONFIG_LIST(
|
SEB_EXAM_CONFIG_LIST(
|
||||||
new LocTextKey("sebserver.examconfig.action.list"),
|
new LocTextKey("sebserver.examconfig.action.list"),
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_LIST),
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_LIST),
|
||||||
SEB_EXAM_CONFIG_NEW(
|
SEB_EXAM_CONFIG_NEW(
|
||||||
new LocTextKey("sebserver.examconfig.action.list.new"),
|
new LocTextKey("sebserver.examconfig.action.list.new"),
|
||||||
ImageIcon.NEW,
|
ImageIcon.NEW,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_PROP_EDIT),
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_PROP_EDIT),
|
||||||
SEB_EXAM_CONFIG_VIEW_PROP_FROM_LIST(
|
SEB_EXAM_CONFIG_VIEW_PROP_FROM_LIST(
|
||||||
new LocTextKey("sebserver.examconfig.action.list.view"),
|
new LocTextKey("sebserver.examconfig.action.list.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_VIEW,
|
||||||
ActionCategory.SEB_EXAM_CONFIG_LIST),
|
ActionCategory.SEB_EXAM_CONFIG_LIST),
|
||||||
SEB_EXAM_CONFIG_VIEW_PROP(
|
SEB_EXAM_CONFIG_VIEW_PROP(
|
||||||
new LocTextKey("sebserver.examconfig.action.view"),
|
new LocTextKey("sebserver.examconfig.action.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
SEB_EXAM_CONFIG_MODIFY_PROP_FROM_LIST(
|
SEB_EXAM_CONFIG_MODIFY_PROP_FROM_LIST(
|
||||||
new LocTextKey("sebserver.examconfig.action.list.modify.properties"),
|
new LocTextKey("sebserver.examconfig.action.list.modify.properties"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_PROP_EDIT,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_PROP_EDIT,
|
||||||
ActionCategory.SEB_EXAM_CONFIG_LIST),
|
ActionCategory.SEB_EXAM_CONFIG_LIST),
|
||||||
SEB_EXAM_CONFIG_PROP_MODIFY(
|
SEB_EXAM_CONFIG_PROP_MODIFY(
|
||||||
new LocTextKey("sebserver.examconfig.action.modify.properties"),
|
new LocTextKey("sebserver.examconfig.action.modify.properties"),
|
||||||
ImageIcon.EDIT,
|
ImageIcon.EDIT,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_PROP_EDIT,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_PROP_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_EXAM_CONFIG_MODIFY(
|
SEB_EXAM_CONFIG_MODIFY(
|
||||||
new LocTextKey("sebserver.examconfig.action.modify"),
|
new LocTextKey("sebserver.examconfig.action.modify"),
|
||||||
ImageIcon.EDIT_SETTINGS,
|
ImageIcon.EDIT_SETTINGS,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_EDIT,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_EXAM_CONFIG_CANCEL_MODIFY(
|
SEB_EXAM_CONFIG_CANCEL_MODIFY(
|
||||||
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
new LocTextKey("sebserver.overall.action.modify.cancel"),
|
||||||
ImageIcon.CANCEL,
|
ImageIcon.CANCEL,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_EXAM_CONFIG_SAVE(
|
SEB_EXAM_CONFIG_SAVE(
|
||||||
new LocTextKey("sebserver.examconfig.action.save"),
|
new LocTextKey("sebserver.examconfig.action.save"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_EXAM_CONFIG_EXPORT_PLAIN_XML(
|
SEB_EXAM_CONFIG_EXPORT_PLAIN_XML(
|
||||||
new LocTextKey("sebserver.examconfig.action.export.plainxml"),
|
new LocTextKey("sebserver.examconfig.action.export.plainxml"),
|
||||||
ImageIcon.EXPORT,
|
ImageIcon.EXPORT,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_VIEW,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_VIEW,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_EXAM_CONFIG_GET_CONFIG_KEY(
|
SEB_EXAM_CONFIG_GET_CONFIG_KEY(
|
||||||
new LocTextKey("sebserver.examconfig.action.get-config-key"),
|
new LocTextKey("sebserver.examconfig.action.get-config-key"),
|
||||||
|
@ -397,42 +397,42 @@ public enum ActionDefinition {
|
||||||
SEB_EXAM_CONFIG_MODIFY_FROM_LIST(
|
SEB_EXAM_CONFIG_MODIFY_FROM_LIST(
|
||||||
new LocTextKey("sebserver.examconfig.action.list.modify"),
|
new LocTextKey("sebserver.examconfig.action.list.modify"),
|
||||||
ImageIcon.EDIT_SETTINGS,
|
ImageIcon.EDIT_SETTINGS,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_EDIT,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_EDIT,
|
||||||
ActionCategory.SEB_EXAM_CONFIG_LIST),
|
ActionCategory.SEB_EXAM_CONFIG_LIST),
|
||||||
|
|
||||||
SEB_EXAM_CONFIG_SAVE_TO_HISTORY(
|
SEB_EXAM_CONFIG_SAVE_TO_HISTORY(
|
||||||
new LocTextKey("sebserver.examconfig.action.saveToHistory"),
|
new LocTextKey("sebserver.examconfig.action.saveToHistory"),
|
||||||
ImageIcon.SAVE,
|
ImageIcon.SAVE,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_EDIT,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
SEB_EXAM_CONFIG_UNDO(
|
SEB_EXAM_CONFIG_UNDO(
|
||||||
new LocTextKey("sebserver.examconfig.action.undo"),
|
new LocTextKey("sebserver.examconfig.action.undo"),
|
||||||
ImageIcon.UNDO,
|
ImageIcon.UNDO,
|
||||||
PageStateDefinition.SEB_EXAM_CONFIG_EDIT,
|
PageStateDefinitionImpl.SEB_EXAM_CONFIG_EDIT,
|
||||||
ActionCategory.FORM),
|
ActionCategory.FORM),
|
||||||
|
|
||||||
RUNNING_EXAM_VIEW_LIST(
|
RUNNING_EXAM_VIEW_LIST(
|
||||||
new LocTextKey("sebserver.monitoring.action.list"),
|
new LocTextKey("sebserver.monitoring.action.list"),
|
||||||
PageStateDefinition.MONITORING_RUNNING_EXAM_LIST),
|
PageStateDefinitionImpl.MONITORING_RUNNING_EXAM_LIST),
|
||||||
MONITOR_EXAM_FROM_LIST(
|
MONITOR_EXAM_FROM_LIST(
|
||||||
new LocTextKey("sebserver.monitoring.exam.action.list.view"),
|
new LocTextKey("sebserver.monitoring.exam.action.list.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.MONITORING_RUNNING_EXAM,
|
PageStateDefinitionImpl.MONITORING_RUNNING_EXAM,
|
||||||
ActionCategory.RUNNING_EXAM_LIST),
|
ActionCategory.RUNNING_EXAM_LIST),
|
||||||
MONITOR_CLIENT_CONNECTION(
|
MONITOR_CLIENT_CONNECTION(
|
||||||
new LocTextKey("sebserver.monitoring.exam.connection.action.view"),
|
new LocTextKey("sebserver.monitoring.exam.connection.action.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.MONITORING_CLIENT_CONNECTION,
|
PageStateDefinitionImpl.MONITORING_CLIENT_CONNECTION,
|
||||||
ActionCategory.CLIENT_EVENT_LIST),
|
ActionCategory.CLIENT_EVENT_LIST),
|
||||||
MONITOR_EXAM_FROM_DETAILS(
|
MONITOR_EXAM_FROM_DETAILS(
|
||||||
new LocTextKey("sebserver.monitoring.exam.action.detail.view"),
|
new LocTextKey("sebserver.monitoring.exam.action.detail.view"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
PageStateDefinition.MONITORING_RUNNING_EXAM,
|
PageStateDefinitionImpl.MONITORING_RUNNING_EXAM,
|
||||||
ActionCategory.VARIA),
|
ActionCategory.VARIA),
|
||||||
|
|
||||||
LOGS_USER_ACTIVITY_LIST(
|
LOGS_USER_ACTIVITY_LIST(
|
||||||
new LocTextKey("sebserver.logs.activity.userlogs"),
|
new LocTextKey("sebserver.logs.activity.userlogs"),
|
||||||
PageStateDefinition.USER_ACTIVITY_LOGS),
|
PageStateDefinitionImpl.USER_ACTIVITY_LOGS),
|
||||||
LOGS_USER_ACTIVITY_SHOW_DETAILS(
|
LOGS_USER_ACTIVITY_SHOW_DETAILS(
|
||||||
new LocTextKey("sebserver.logs.activity.userlogs.details"),
|
new LocTextKey("sebserver.logs.activity.userlogs.details"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
|
@ -440,7 +440,7 @@ public enum ActionDefinition {
|
||||||
|
|
||||||
LOGS_SEB_CLIENT(
|
LOGS_SEB_CLIENT(
|
||||||
new LocTextKey("sebserver.logs.activity.seblogs"),
|
new LocTextKey("sebserver.logs.activity.seblogs"),
|
||||||
PageStateDefinition.SEB_CLIENT_LOGS),
|
PageStateDefinitionImpl.SEB_CLIENT_LOGS),
|
||||||
LOGS_SEB_CLIENT_SHOW_DETAILS(
|
LOGS_SEB_CLIENT_SHOW_DETAILS(
|
||||||
new LocTextKey("sebserver.logs.activity.seblogs.details"),
|
new LocTextKey("sebserver.logs.activity.seblogs.details"),
|
||||||
ImageIcon.SHOW,
|
ImageIcon.SHOW,
|
||||||
|
@ -450,14 +450,14 @@ public enum ActionDefinition {
|
||||||
|
|
||||||
public final LocTextKey title;
|
public final LocTextKey title;
|
||||||
public final ImageIcon icon;
|
public final ImageIcon icon;
|
||||||
public final PageState targetState;
|
public final PageStateDefinition targetState;
|
||||||
public final ActionCategory category;
|
public final ActionCategory category;
|
||||||
|
|
||||||
private ActionDefinition(final LocTextKey title, final PageState targetState) {
|
private ActionDefinition(final LocTextKey title, final PageStateDefinition targetState) {
|
||||||
this(title, null, targetState, ActionCategory.VARIA);
|
this(title, null, targetState, ActionCategory.VARIA);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ActionDefinition(final LocTextKey title, final ImageIcon icon, final PageState targetState) {
|
private ActionDefinition(final LocTextKey title, final ImageIcon icon, final PageStateDefinition targetState) {
|
||||||
this(title, icon, targetState, ActionCategory.VARIA);
|
this(title, icon, targetState, ActionCategory.VARIA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ public enum ActionDefinition {
|
||||||
private ActionDefinition(
|
private ActionDefinition(
|
||||||
final LocTextKey title,
|
final LocTextKey title,
|
||||||
final ImageIcon icon,
|
final ImageIcon icon,
|
||||||
final PageState targetState,
|
final PageStateDefinition targetState,
|
||||||
final ActionCategory category) {
|
final ActionCategory category) {
|
||||||
|
|
||||||
this.title = title;
|
this.title = title;
|
||||||
|
|
|
@ -119,10 +119,6 @@ public class ActionPane implements TemplateComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// final Label labelSeparator = this.widgetFactory.labelSeparator(composite);
|
|
||||||
// final GridData separatorLayout = new GridData(SWT.FILL, SWT.TOP, true, false);
|
|
||||||
// labelSeparator.setLayoutData(separatorLayout);
|
|
||||||
|
|
||||||
// title
|
// title
|
||||||
if (category.title != null) {
|
if (category.title != null) {
|
||||||
final Label actionsTitle = this.widgetFactory.labelLocalized(
|
final Label actionsTitle = this.widgetFactory.labelLocalized(
|
||||||
|
|
|
@ -30,12 +30,12 @@ import ch.ethz.seb.sebserver.gui.service.page.PageContext;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageContext.AttributeKeys;
|
import ch.ethz.seb.sebserver.gui.service.page.PageContext.AttributeKeys;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageService;
|
import ch.ethz.seb.sebserver.gui.service.page.PageService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageService.PageActionBuilder;
|
import ch.ethz.seb.sebserver.gui.service.page.PageService.PageActionBuilder;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageState;
|
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
|
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEventListener;
|
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEventListener;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.PageEventListener;
|
import ch.ethz.seb.sebserver.gui.service.page.event.PageEventListener;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.page.impl.PageState;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
|
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory;
|
||||||
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant;
|
import ch.ethz.seb.sebserver.gui.widget.WidgetFactory.CustomVariant;
|
||||||
|
@ -351,7 +351,7 @@ public class ActivitiesPane implements TemplateComposer {
|
||||||
} else {
|
} else {
|
||||||
final TreeItem item = findItemByActionDefinition(
|
final TreeItem item = findItemByActionDefinition(
|
||||||
navigation.getItems(),
|
navigation.getItems(),
|
||||||
state.activityAnchor());
|
state.definition.activityAnchor());
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
final PageAction action = getActivitySelection(item);
|
final PageAction action = getActivitySelection(item);
|
||||||
this.pageService.executePageAction(action, result -> {
|
this.pageService.executePageAction(action, result -> {
|
||||||
|
@ -379,9 +379,12 @@ public class ActivitiesPane implements TemplateComposer {
|
||||||
|
|
||||||
private void selectCurrentItem(final Tree navigation, final TreeItem item) {
|
private void selectCurrentItem(final Tree navigation, final TreeItem item) {
|
||||||
final PageState currentState = this.pageService.getCurrentState();
|
final PageState currentState = this.pageService.getCurrentState();
|
||||||
|
if (currentState == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final TreeItem currentItem = findItemByActionDefinition(
|
final TreeItem currentItem = findItemByActionDefinition(
|
||||||
item.getItems(),
|
item.getItems(),
|
||||||
currentState.activityAnchor());
|
currentState.definition.activityAnchor());
|
||||||
if (currentItem != null) {
|
if (currentItem != null) {
|
||||||
navigation.select(currentItem);
|
navigation.select(currentItem);
|
||||||
}
|
}
|
||||||
|
@ -403,7 +406,7 @@ public class ActivitiesPane implements TemplateComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
final PageState currentState = this.pageService.getCurrentState();
|
final PageState currentState = this.pageService.getCurrentState();
|
||||||
if (currentState == action.definition.targetState) {
|
if (currentState != null && currentState.definition == action.definition.targetState) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,10 @@ import ch.ethz.seb.sebserver.gui.content.UserAccountList;
|
||||||
import ch.ethz.seb.sebserver.gui.content.UserActivityLogs;
|
import ch.ethz.seb.sebserver.gui.content.UserActivityLogs;
|
||||||
import ch.ethz.seb.sebserver.gui.content.action.ActionPane;
|
import ch.ethz.seb.sebserver.gui.content.action.ActionPane;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.Activity;
|
import ch.ethz.seb.sebserver.gui.service.page.Activity;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageState;
|
import ch.ethz.seb.sebserver.gui.service.page.PageStateDefinition;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
import ch.ethz.seb.sebserver.gui.service.page.TemplateComposer;
|
||||||
|
|
||||||
public enum PageStateDefinition implements PageState {
|
public enum PageStateDefinitionImpl implements PageStateDefinition {
|
||||||
|
|
||||||
INSTITUTION_LIST(Type.LIST_VIEW, InstitutionList.class, ActivityDefinition.INSTITUTION),
|
INSTITUTION_LIST(Type.LIST_VIEW, InstitutionList.class, ActivityDefinition.INSTITUTION),
|
||||||
INSTITUTION_VIEW(Type.FORM_VIEW, InstitutionForm.class, ActivityDefinition.INSTITUTION),
|
INSTITUTION_VIEW(Type.FORM_VIEW, InstitutionForm.class, ActivityDefinition.INSTITUTION),
|
||||||
|
@ -81,7 +81,7 @@ public enum PageStateDefinition implements PageState {
|
||||||
public final Class<? extends TemplateComposer> actionPaneComposer;
|
public final Class<? extends TemplateComposer> actionPaneComposer;
|
||||||
public final Activity activityAnchor;
|
public final Activity activityAnchor;
|
||||||
|
|
||||||
private PageStateDefinition(
|
private PageStateDefinitionImpl(
|
||||||
final Type type,
|
final Type type,
|
||||||
final Class<? extends TemplateComposer> contentPaneComposer,
|
final Class<? extends TemplateComposer> contentPaneComposer,
|
||||||
final Activity activityAnchor) {
|
final Activity activityAnchor) {
|
||||||
|
@ -89,7 +89,7 @@ public enum PageStateDefinition implements PageState {
|
||||||
this(type, contentPaneComposer, ActionPane.class, activityAnchor);
|
this(type, contentPaneComposer, ActionPane.class, activityAnchor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PageStateDefinition(
|
private PageStateDefinitionImpl(
|
||||||
final Type type,
|
final Type type,
|
||||||
final Class<? extends TemplateComposer> contentPaneComposer,
|
final Class<? extends TemplateComposer> contentPaneComposer,
|
||||||
final Class<? extends TemplateComposer> actionPaneComposer,
|
final Class<? extends TemplateComposer> actionPaneComposer,
|
|
@ -38,6 +38,7 @@ import ch.ethz.seb.sebserver.gui.service.i18n.PolyglotPageService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageContext.AttributeKeys;
|
import ch.ethz.seb.sebserver.gui.service.page.PageContext.AttributeKeys;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.PageEvent;
|
import ch.ethz.seb.sebserver.gui.service.page.event.PageEvent;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
import ch.ethz.seb.sebserver.gui.service.page.impl.PageAction;
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.page.impl.PageState;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCall;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.AuthorizationContextHolder;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.AuthorizationContextHolder;
|
||||||
|
@ -85,6 +86,14 @@ public interface PageService {
|
||||||
* @return PageState of the current user. */
|
* @return PageState of the current user. */
|
||||||
PageState getCurrentState();
|
PageState getCurrentState();
|
||||||
|
|
||||||
|
/** Get a PageAction function to go back to the current state.
|
||||||
|
*
|
||||||
|
* @return a PageAction function to go back to the current state. */
|
||||||
|
default Function<PageAction, PageAction> backToCurrentFunction() {
|
||||||
|
final PageState currentState = this.getCurrentState();
|
||||||
|
return action -> (currentState != null) ? currentState.gotoAction : action;
|
||||||
|
}
|
||||||
|
|
||||||
/** Publishes a given PageEvent to the current page tree
|
/** Publishes a given PageEvent to the current page tree
|
||||||
* This goes through the page-tree and collects all listeners the are listen to
|
* This goes through the page-tree and collects all listeners the are listen to
|
||||||
* the specified page event type.
|
* the specified page event type.
|
||||||
|
@ -151,17 +160,6 @@ public interface PageService {
|
||||||
/** Clears the PageState of the current users page */
|
/** Clears the PageState of the current users page */
|
||||||
void clearState();
|
void clearState();
|
||||||
|
|
||||||
default PageAction onEmptyEntityKeyGoTo(final PageAction action, final ActionDefinition gotoActionDef) {
|
|
||||||
if (action.getEntityKey() == null) {
|
|
||||||
final PageContext pageContext = action.pageContext();
|
|
||||||
return pageActionBuilder(pageContext)
|
|
||||||
.newAction(gotoActionDef)
|
|
||||||
.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Key to store the ScrolledComposite update function within Control data map */
|
/** Key to store the ScrolledComposite update function within Control data map */
|
||||||
static String SCROLLED_COMPOSITE_UPDATE = "SCROLLED_COMPOSITE_UPDATE";
|
static String SCROLLED_COMPOSITE_UPDATE = "SCROLLED_COMPOSITE_UPDATE";
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
package ch.ethz.seb.sebserver.gui.service.page;
|
package ch.ethz.seb.sebserver.gui.service.page;
|
||||||
|
|
||||||
public interface PageState {
|
public interface PageStateDefinition {
|
||||||
|
|
||||||
enum Type {
|
enum Type {
|
||||||
UNDEFINED,
|
UNDEFINED,
|
|
@ -120,6 +120,9 @@ public class ComposerServiceImpl implements ComposerService {
|
||||||
try {
|
try {
|
||||||
composer.compose(pageContext);
|
composer.compose(pageContext);
|
||||||
PageService.updateScrolledComposite(pageContext.getParent());
|
PageService.updateScrolledComposite(pageContext.getParent());
|
||||||
|
} catch (final RuntimeException e) {
|
||||||
|
log.warn("Failed to compose: {}, pageContext: {}", name, pageContext, e);
|
||||||
|
throw e;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
log.error("Failed to compose: {}, pageContext: {}", name, pageContext, e);
|
log.error("Failed to compose: {}, pageContext: {}", name, pageContext, e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
|
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageContext.AttributeKeys;
|
import ch.ethz.seb.sebserver.gui.service.page.PageContext.AttributeKeys;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageMessageException;
|
import ch.ethz.seb.sebserver.gui.service.page.PageMessageException;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageState.Type;
|
import ch.ethz.seb.sebserver.gui.service.page.PageStateDefinition.Type;
|
||||||
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCallError;
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.RestCallError;
|
||||||
|
|
||||||
public final class PageAction {
|
public final class PageAction {
|
||||||
|
|
|
@ -35,8 +35,7 @@ import ch.ethz.seb.sebserver.gui.service.i18n.PolyglotPageService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.ComposerService;
|
import ch.ethz.seb.sebserver.gui.service.page.ComposerService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
|
import ch.ethz.seb.sebserver.gui.service.page.PageContext;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageService;
|
import ch.ethz.seb.sebserver.gui.service.page.PageService;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageState;
|
import ch.ethz.seb.sebserver.gui.service.page.PageStateDefinition.Type;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.PageState.Type;
|
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
|
import ch.ethz.seb.sebserver.gui.service.page.event.ActionEvent;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.ActionPublishEvent;
|
import ch.ethz.seb.sebserver.gui.service.page.event.ActionPublishEvent;
|
||||||
import ch.ethz.seb.sebserver.gui.service.page.event.PageEvent;
|
import ch.ethz.seb.sebserver.gui.service.page.event.PageEvent;
|
||||||
|
@ -178,28 +177,26 @@ public class PageServiceImpl implements PageService {
|
||||||
private void exec(final PageAction pageAction, final Consumer<Result<PageAction>> callback) {
|
private void exec(final PageAction pageAction, final Consumer<Result<PageAction>> callback) {
|
||||||
pageAction.applyAction(result -> {
|
pageAction.applyAction(result -> {
|
||||||
if (!result.hasError()) {
|
if (!result.hasError()) {
|
||||||
|
|
||||||
final PageAction action = result.get();
|
final PageAction action = result.get();
|
||||||
if (pageAction.fireActionEvent) {
|
if (pageAction.fireActionEvent) {
|
||||||
firePageEvent(new ActionEvent(action), action.pageContext());
|
firePageEvent(new ActionEvent(action), action.pageContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
final HttpSession httpSession = RWT
|
final HttpSession httpSession = RWT
|
||||||
.getUISession()
|
.getUISession()
|
||||||
.getHttpSession();
|
.getHttpSession();
|
||||||
|
|
||||||
log.debug("Set session PageState: {} : {}", pageAction.definition.targetState, httpSession.getId());
|
final PageState pageState = new PageState(action.definition.targetState, action);
|
||||||
httpSession.setAttribute(ATTR_PAGE_STATE, pageAction.definition.targetState);
|
log.debug("Set session PageState: {} : {}", pageState, httpSession.getId());
|
||||||
|
httpSession.setAttribute(ATTR_PAGE_STATE, pageState);
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
log.error("Failed to set current PageState: ", e);
|
log.error("Failed to set current PageState: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
callback.accept(result);
|
callback.accept(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package ch.ethz.seb.sebserver.gui.service.page.impl;
|
||||||
|
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.page.Activity;
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.page.PageStateDefinition;
|
||||||
|
import ch.ethz.seb.sebserver.gui.service.page.PageStateDefinition.Type;
|
||||||
|
|
||||||
|
public final class PageState {
|
||||||
|
|
||||||
|
public final PageStateDefinition definition;
|
||||||
|
public final PageAction gotoAction;
|
||||||
|
|
||||||
|
PageState(final PageStateDefinition definition, final PageAction goToAction) {
|
||||||
|
super();
|
||||||
|
this.definition = definition;
|
||||||
|
this.gotoAction = goToAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageStateDefinition getDefinition() {
|
||||||
|
return this.definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageAction getGotoAction() {
|
||||||
|
return this.gotoAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Type type() {
|
||||||
|
return this.definition.type();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Activity activityAnchor() {
|
||||||
|
return this.definition.activityAnchor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
final StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("PageState [definition=");
|
||||||
|
builder.append(this.definition);
|
||||||
|
builder.append(", gotoAction=");
|
||||||
|
builder.append(this.gotoAction);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -170,6 +170,7 @@ sebserver.useraccount.action.change.password=Change Password
|
||||||
sebserver.useraccount.action.change.password.save=Save New Password
|
sebserver.useraccount.action.change.password.save=Save New Password
|
||||||
|
|
||||||
sebserver.useraccount.info.pleaseSelect=Please Select a User Account first.
|
sebserver.useraccount.info.pleaseSelect=Please Select a User Account first.
|
||||||
|
sebserver.useraccount.info.notEditable=You have no edit rights for this User Account.
|
||||||
|
|
||||||
sebserver.useraccount.form.title=User Account
|
sebserver.useraccount.form.title=User Account
|
||||||
sebserver.useraccount.form.title.new=New User Account
|
sebserver.useraccount.form.title.new=New User Account
|
||||||
|
|
Loading…
Reference in a new issue