Frank Kobzik has uploaded a new change for review. Change subject: frontend: Allow enabling/disabling SSO ......................................................................
frontend: Allow enabling/disabling SSO This small feature allows controlling SSO per VM. Changes: - new radio buttons in New/Edit VM/Template/VmPool dialog. Change-Id: I213110a1554cd67b6cd8560477b5d7551e89f24e Signed-off-by: Frantisek Kobzik <fkob...@redhat.com> Bug-Url: https://bugzilla.redhat.com/758946 --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java 16 files changed, 116 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/20/19620/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java index e74763c..8658320 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java @@ -1569,4 +1569,13 @@ @DefaultStringValue("Attach a VirtIO-SCSI controller when running the VM") String isVirtioScsiEnabledInfo(); + + @DefaultStringValue("Single Sign On method") + String ssoMethod(); + + @DefaultStringValue("Disable Single Sign On") + String none(); + + @DefaultStringValue("Use Guest Agent") + String guestAgent(); } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java index f2a4250..42f200c 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java @@ -219,6 +219,20 @@ @WithElementId("coresPerSocket") public ListModelListBoxEditor<Object> corePerSocketEditor; + @UiField + @Ignore + public Label ssoMethodLabel; + + @UiField(provided = true) + @Path(value = "ssoMethodNone.entity") + @WithElementId("ssoMethodNone") + public EntityModelRadioButtonEditor ssoMethodNone; + + @UiField(provided = true) + @Path(value = "ssoMethodGuestAgent.entity") + @WithElementId("ssoMethodGuestAgent") + public EntityModelRadioButtonEditor ssoMethodGuestAgent; + @UiField(provided = true) @Path(value = "isSoundcardEnabled.entity") @WithElementId("isSoundcardEnabled") @@ -629,6 +643,8 @@ cdAttachedEditor = new EntityModelCheckBoxEditor(Align.LEFT, new ModeSwitchingVisibilityRenderer()); allowConsoleReconnectEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); isSoundcardEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); + ssoMethodNone = new EntityModelRadioButtonEditor("ssoMethod", new ModeSwitchingVisibilityRenderer()); //$NON-NLS-1$ + ssoMethodGuestAgent = new EntityModelRadioButtonEditor("ssoMethod", new ModeSwitchingVisibilityRenderer());//$NON-NLS-1$ copyTemplatePermissionsEditor = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); isMemoryBalloonDeviceEnabled = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer(), true); isVirtioScsiEnabled = new EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer()); @@ -972,6 +988,10 @@ usbSupportEditor.setLabel(constants.usbPolicyVmPopup()); numOfMonitorsEditor.setLabel(constants.monitorsVmPopup()); allowConsoleReconnectEditor.setLabel(constants.allowConsoleReconnect()); + isSoundcardEnabledEditor.setLabel(constants.soundcardEnabled()); + isSingleQxlEnabledEditor.setLabel(constants.singleQxlEnabled()); + ssoMethodNone.setLabel(constants.none()); + ssoMethodGuestAgent.setLabel(constants.guestAgent()); // Host Tab hostTab.setLabel(constants.hostVmPopup()); @@ -1005,8 +1025,6 @@ totalvCPUsEditor.setLabel(constants.numOfVCPUs()); corePerSocketEditor.setLabel(constants.coresPerSocket()); numOfSocketsEditor.setLabel(constants.numOfSockets()); - isSoundcardEnabledEditor.setLabel(constants.soundcardEnabled()); - isSingleQxlEnabledEditor.setLabel(constants.singleQxlEnabled()); } protected void applyStyles() { @@ -1284,6 +1302,24 @@ specificHost.setValue(true, true); } }); + + ssoMethodGuestAgent.asRadioButton().addValueChangeHandler(new ValueChangeHandler<Boolean>() { + @Override + public void onValueChange(ValueChangeEvent<Boolean> event) { + if (Boolean.TRUE.equals(event.getValue())) { + ValueChangeEvent.fire(ssoMethodNone.asRadioButton(), false); + } + } + }); + + ssoMethodNone.asRadioButton().addValueChangeHandler(new ValueChangeHandler<Boolean>() { + @Override + public void onValueChange(ValueChangeEvent<Boolean> event) { + if (Boolean.TRUE.equals(event.getValue())) { + ValueChangeEvent.fire(ssoMethodGuestAgent.asRadioButton(), false); + } + } + }); } private void updateDisksWarningByImageStatus(List<DiskModel> disks, ImageStatus imageStatus) { @@ -1386,10 +1422,12 @@ isSingleQxlEnabledEditor.setTabIndex(nextTabIndex++); numOfMonitorsEditor.setTabIndex(nextTabIndex++); isSmartcardEnabledEditor.setTabIndex(nextTabIndex++); - nextTabIndex = expander.setTabIndexes(nextTabIndex); - allowConsoleReconnectEditor.setTabIndex(nextTabIndex++); isSoundcardEnabledEditor.setTabIndex(nextTabIndex++); isConsoleDeviceEnabledEditor.setTabIndex(nextTabIndex++); + ssoMethodNone.setTabIndex(nextTabIndex++); + ssoMethodGuestAgent.setTabIndex(nextTabIndex++); + nextTabIndex = expander.setTabIndexes(nextTabIndex); + allowConsoleReconnectEditor.setTabIndex(nextTabIndex++); // ==Host Tab== nextTabIndex = hostTab.setTabIndexes(nextTabIndex); @@ -1454,7 +1492,10 @@ nativeUsbWarningMessage, expander, numOfMonitorsEditor, - vncKeyboardLayoutEditor + vncKeyboardLayoutEditor, + ssoMethodLabel, + ssoMethodNone, + ssoMethodGuestAgent ); } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml index bf1dfad..4e2b076 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml @@ -455,13 +455,18 @@ </g:FlowPanel> <e:EntityModelCheckBoxEditor ui:field="isSmartcardEnabledEditor" addStyleNames="{style.checkbox}" /> <g:Label ui:field="nativeUsbWarningMessage" text="{constants.nativeUsbSupportWarning}" addStyleNames="{style.warningMessageLabel}" /> + <e:EntityModelCheckBoxEditor ui:field="isSoundcardEnabledEditor" addStyleNames="{style.checkbox}" /> + <e:EntityModelCheckBoxEditor ui:field="isConsoleDeviceEnabledEditor" addStyleNames="{style.checkbox}" /> + <g:Label ui:field="ssoMethodLabel" text="{constants.ssoMethod}" addStyleNames="{style.sectionLabel}" /> + <g:FlowPanel> + <e:EntityModelRadioButtonEditor ui:field="ssoMethodNone"/> + <e:EntityModelRadioButtonEditor ui:field="ssoMethodGuestAgent"/> + </g:FlowPanel> <d:AdvancedParametersExpander ui:field="expander"/> <g:FlowPanel ui:field="expanderContent" addStyleNames="{style.expanderContent}"> <g:Label addStyleNames="{style.warningLabel}" text="{constants.advancedOptionsLabel}" /> <e:EntityModelCheckBoxEditor ui:field="allowConsoleReconnectEditor" addStyleNames="{style.checkboxWithLongLabel}" /> </g:FlowPanel> - <e:EntityModelCheckBoxEditor ui:field="isSoundcardEnabledEditor" addStyleNames="{style.checkbox}" /> - <e:EntityModelCheckBoxEditor ui:field="isConsoleDeviceEnabledEditor" addStyleNames="{style.checkbox}" /> </g:FlowPanel> </t:content> </t:DialogTab> diff --git a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml index 38268ca..8dd69c8 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml @@ -105,6 +105,7 @@ <include name="common/businessentities/TagsType.java" /> <include name="common/EventNotificationMethods.java" /> <include name="common/businessentities/UsbPolicy.java" /> + <include name="common/businessentities/SsoMethod.java" /> <include name="common/businessentities/VDS.java" /> <include name="common/businessentities/VDSDomainsData.java" /> <include name="common/businessentities/VdsDynamic.java" /> diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java index f087efe..ff5ae4e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java @@ -475,6 +475,7 @@ vm.setName(name); vm.setVmOs((Integer) model.getOSType().getSelectedItem()); vm.setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); + vm.setSsoMethod(model.extractSelectedSsoMethod()); vm.setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); vm.setNumOfMonitors((Integer) model.getNumOfMonitors().getSelectedItem()); vm.setSingleQxlPci((Boolean)model.getIsSingleQxlEnabled().getEntity()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java index 8b5cfaa..defb93b 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java @@ -456,6 +456,7 @@ template.setStateless((Boolean) model.getIsStateless().getEntity()); template.setRunAndPause((Boolean) model.getIsRunAndPause().getEntity()); template.setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); + template.setSsoMethod(model.extractSelectedSsoMethod()); template.setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); template.setDefaultBootSequence(model.getBootSequence()); template.setIsoPath(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java index b04f57e..c8069ae 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java @@ -612,6 +612,7 @@ tempVar.setCpuPerSocket(Integer.parseInt(model.getTotalCPUCores().getEntity().toString()) / (Integer) model.getNumOfSockets().getSelectedItem()); tempVar.setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); + tempVar.setSsoMethod(model.extractSelectedSsoMethod()); tempVar.setStateless((Boolean) model.getIsStateless().getEntity()); tempVar.setRunAndPause(((Boolean) model.getIsRunAndPause().getEntity())); tempVar.setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); @@ -1044,6 +1045,7 @@ gettempVm().setStateless((Boolean) model.getIsStateless().getEntity()); gettempVm().setRunAndPause(((Boolean) model.getIsRunAndPause().getEntity())); gettempVm().setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); + gettempVm().setSsoMethod(model.extractSelectedSsoMethod()); gettempVm().setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); gettempVm().setDefaultBootSequence(model.getBootSequence()); gettempVm().setIsoPath(model.getCdImage().getIsChangable() ? (String) model.getCdImage() diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java index a7f26c0..e485ee9 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java @@ -170,6 +170,7 @@ getModel().getIsSmartcardEnabled().setEntity(vm.isSmartcardEnabled()); getModel().getIsDeleteProtected().setEntity(vm.isDeleteProtected()); + getModel().selectSsoMethod(vm.getSsoMethod()); getModel().getNumOfSockets().setSelectedItem(vm.getNumOfSockets()); getModel().getNumOfSockets().setIsChangable(!vm.isRunning()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java index 01787a2..b57c646 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java @@ -207,6 +207,7 @@ getModel().getIsStateless().setEntity(this.vm.isStateless()); getModel().getIsRunAndPause().setEntity(this.vm.isRunAndPause()); getModel().getIsDeleteProtected().setEntity(this.vm.isDeleteProtected()); + getModel().selectSsoMethod(this.vm.getSsoMethod()); updateSelectedCdImage(this.vm.getStaticData()); updateTimeZone(this.vm.getTimeZone()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java index e11bdb4..f5ab22e 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java @@ -95,6 +95,7 @@ doChangeDefautlHost(template.getDedicatedVmForVds()); getModel().getIsDeleteProtected().setEntity(template.isDeleteProtected()); + getModel().selectSsoMethod(template.getSsoMethod()); getModel().getIsStateless().setEntity(template.isStateless()); getModel().getAllowConsoleReconnect().setEntity(template.isAllowConsoleReconnect()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java index 2865ade..955b75b 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java @@ -96,6 +96,7 @@ getModel().setBootSequence(vmBase.getDefaultBootSequence()); getModel().getIsHighlyAvailable().setEntity(vmBase.isAutoStartup()); getModel().getIsDeleteProtected().setEntity(vmBase.isDeleteProtected()); + getModel().selectSsoMethod(vmBase.getSsoMethod()); getModel().getIsRunAndPause().setEntity(false); boolean hasCd = !StringHelper.isNullOrEmpty(vmBase.getIsoPath()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java index 0e8a7af..788690c 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SpiceConsoleModel.java @@ -16,6 +16,7 @@ import org.ovirt.engine.core.common.businessentities.DisplayType; import org.ovirt.engine.core.common.businessentities.ImageFileType; import org.ovirt.engine.core.common.businessentities.RepoImage; +import org.ovirt.engine.core.common.businessentities.SsoMethod; import org.ovirt.engine.core.common.businessentities.StorageDomain; import org.ovirt.engine.core.common.businessentities.UsbPolicy; import org.ovirt.engine.core.common.businessentities.VM; @@ -540,7 +541,7 @@ // Only if the VM has agent and we connect through user-portal // we attempt to perform SSO (otherwise an error will be thrown) if (!getConfigurator().getIsAdmin() && getEntity().getHasAgent() - && getEntity().getStatus() == VMStatus.Up) { + && getEntity().getStatus() == VMStatus.Up && SsoMethod.GUEST_AGENT.equals(getEntity().getSsoMethod())) { getLogger().info("SpiceConsoleManager::Connect: Attempting to perform SSO on Desktop " //$NON-NLS-1$ + getEntity().getName()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java index 8c9b8b8..1b00b6a 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java @@ -160,6 +160,7 @@ getModel().getIsStateless().setEntity(this.template.isStateless()); getModel().getIsRunAndPause().setEntity(this.template.isRunAndPause()); getModel().getIsDeleteProtected().setEntity(this.template.isDeleteProtected()); + getModel().selectSsoMethod(this.template.getSsoMethod()); getModel().getIsSmartcardEnabled().setEntity(this.template.isSmartcardEnabled()); getModel().getVncKeyboardLayout().setSelectedItem(this.template.getVncKeyboardLayout()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java index 8124329..66e7516 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java @@ -11,6 +11,7 @@ import org.ovirt.engine.core.common.businessentities.DisplayType; import org.ovirt.engine.core.common.businessentities.MigrationSupport; import org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum; +import org.ovirt.engine.core.common.businessentities.SsoMethod; import org.ovirt.engine.core.common.businessentities.StorageDomain; import org.ovirt.engine.core.common.businessentities.StoragePool; import org.ovirt.engine.core.common.businessentities.UsbPolicy; @@ -160,6 +161,8 @@ getIsSmartcardEnabled().setIsChangable(false); getAllowConsoleReconnect().setIsChangable(false); getVncKeyboardLayout().setIsChangable(false); + getSsoMethodNone().setIsChangable(false); + getSsoMethodGuestAgent().setIsChangable(false); // ==Host Tab== getIsAutoAssign().setIsChangable(false); @@ -690,6 +693,26 @@ this.privateIsDeleteProtected = deleteProtected; } + private NotChangableForVmInPoolEntityModel ssoMethodNone; + + public EntityModel getSsoMethodNone() { + return ssoMethodNone; + } + + public void setSsoMethodNone(NotChangableForVmInPoolEntityModel ssoMethodNone) { + this.ssoMethodNone = ssoMethodNone; + } + + private NotChangableForVmInPoolEntityModel ssoMethodGuestAgent; + + public EntityModel getSsoMethodGuestAgent() { + return ssoMethodGuestAgent; + } + + public void setSsoMethodGuestAgent(NotChangableForVmInPoolEntityModel ssoMethodGuestAgent) { + this.ssoMethodGuestAgent = ssoMethodGuestAgent; + } + private NotChangableForVmInPoolEntityModel copyPermissions; public EntityModel getCopyPermissions() { @@ -1160,6 +1183,8 @@ setIsRunAndPause(new NotChangableForVmInPoolEntityModel()); setIsSmartcardEnabled(new NotChangableForVmInPoolEntityModel()); setIsDeleteProtected(new NotChangableForVmInPoolEntityModel()); + setSsoMethodNone(new NotChangableForVmInPoolEntityModel()); + setSsoMethodGuestAgent(new NotChangableForVmInPoolEntityModel()); setConsoleDeviceEnabled(new NotChangableForVmInPoolEntityModel()); setCopyPermissions(new NotChangableForVmInPoolEntityModel()); // by default not available - only for new VM @@ -1351,6 +1376,7 @@ getIsAutoAssign().setEntity(true); getIsTemplatePublic().setEntity(true); getIsSingleQxlEnabled().setEntity(false); + selectSsoMethod(SsoMethod.GUEST_AGENT); getHostCpu().setEntity(false); getMigrationMode().setIsChangable(true); @@ -2210,6 +2236,17 @@ } + public SsoMethod extractSelectedSsoMethod() { + return Boolean.TRUE.equals(getSsoMethodGuestAgent().getEntity()) + ? SsoMethod.GUEST_AGENT + : SsoMethod.NONE; + } + + public void selectSsoMethod(SsoMethod ssoMethod) { + getSsoMethodNone().setEntity(SsoMethod.NONE.equals(ssoMethod)); + getSsoMethodGuestAgent().setEntity(SsoMethod.GUEST_AGENT.equals(ssoMethod)); + } + class TotalCpuCoresComposableValidation implements IValidation { @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java index 8e30c52..7dff1ee 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java @@ -352,6 +352,7 @@ private VM privatecurrentVm; public VM getcurrentVm() + { return privatecurrentVm; } @@ -1370,6 +1371,7 @@ tempVar.setRunAndPause(((Boolean) model.getIsRunAndPause().getEntity())); tempVar.setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); tempVar.setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); + tempVar.setSsoMethod(model.extractSelectedSsoMethod()); tempVar.setDefaultBootSequence(model.getBootSequence()); tempVar.setAutoStartup((Boolean) model.getIsHighlyAvailable().getEntity()); tempVar.setIsoPath(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ @@ -1961,6 +1963,8 @@ getcurrentVm().setRunAndPause((Boolean) model.getIsRunAndPause().getEntity()); getcurrentVm().setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); getcurrentVm().setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); + getcurrentVm().setSsoMethod(model.extractSelectedSsoMethod()); + getcurrentVm().setSsoMethod(model.extractSelectedSsoMethod()); getcurrentVm().setDefaultBootSequence(model.getBootSequence()); getcurrentVm().setIsoPath(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java index 24a7d2e..9012455 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java @@ -607,6 +607,7 @@ getcurrentVm().setStateless((Boolean) model.getIsStateless().getEntity()); getcurrentVm().setSmartcardEnabled((Boolean) model.getIsSmartcardEnabled().getEntity()); getcurrentVm().setDeleteProtected((Boolean) model.getIsDeleteProtected().getEntity()); + getcurrentVm().setSsoMethod(model.extractSelectedSsoMethod()); getcurrentVm().setDefaultBootSequence(model.getBootSequence()); getcurrentVm().setIsoPath(model.getCdImage().getIsChangable() ? (String) model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$ -- To view, visit http://gerrit.ovirt.org/19620 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I213110a1554cd67b6cd8560477b5d7551e89f24e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Frank Kobzik <fkob...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches