Gilad Chaplik has uploaded a new change for review. Change subject: webadmin: Introduce CPU profiles ......................................................................
webadmin: Introduce CPU profiles * CPU profiles sub tab added under Cluster Main tab. * Added create, edit and remove cpu profile dialog * Added permissions inner tab within CPU profiles sub tab, to allow setting permission on CPU profile. * Disk Profile's models common logic was extracted to common base classes, in order to suit CPU profiles Models. Change-Id: I0c51fa8559f9538bb29b41d1d1b24fdfdabc8cb1 Signed-off-by: Gilad Chaplik <gchap...@redhat.com> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/CommonModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/PermissionListModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileBaseModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileBaseModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileListModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditCpuProfileModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditDiskProfileModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/NewCpuProfileModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileBaseModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileListModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveCpuProfileModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveDiskProfileModel.java A frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveProfileModel.java M frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/UiCommonModule.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/ClusterModule.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/profile/CpuProfilePopupPresenterWidget.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterCpuProfilePresenter.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterPermissionPresenter.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.ui.xml M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/DiskProfilePopupView.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.ui.xml A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterCpuProfileView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterCpuQosView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterStorageQosView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/storage/DiskProfilesListModelTable.java A frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/uicommon/model/CpuProfilePermissionModelProvider.java 38 files changed, 1,478 insertions(+), 474 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/37/31837/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 21c5481..a12ec39 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 @@ -1716,10 +1716,7 @@ String UnlimitedNetworkQoS(); @DefaultStringValue("Unlimited") - String UnlimitedStorageQos(); - - @DefaultStringValue("Unlimited") - String UnlimitedCpuQos(); + String unlimitedQos(); @DefaultStringValue("Password") String hostPasswordLabel(); @@ -1894,10 +1891,10 @@ String authz(); @DefaultStringValue("Name") - String diskProfileNameLabel(); + String profileNameLabel(); @DefaultStringValue("Description") - String diskProfileDescriptionLabel(); + String profileDescriptionLabel(); @DefaultStringValue("QoS Name") String storageQosName(); @@ -1906,12 +1903,12 @@ String cpuQosName(); @DefaultStringValue("New") - String newDiskProfile(); + String newProfile(); @DefaultStringValue("Edit") - String editDiskProfile(); + String editProfile(); @DefaultStringValue("Remove") - String removeDiskProfile(); + String removeProfile(); } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java index dba6b42..d4366fc 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java @@ -80,6 +80,7 @@ import org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; import org.ovirt.engine.core.common.businessentities.network.VnicProfile; import org.ovirt.engine.core.common.businessentities.network.VnicProfileView; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; import org.ovirt.engine.core.common.businessentities.profiles.DiskProfile; import org.ovirt.engine.core.common.interfaces.SearchType; import org.ovirt.engine.core.common.mode.ApplicationMode; @@ -3280,6 +3281,10 @@ { return ((DiskProfile) entity).getId(); } + else if (entity instanceof CpuProfile) + { + return ((CpuProfile) entity).getId(); + } return Guid.Empty; } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java index ff59357..05ebc6d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java @@ -502,7 +502,15 @@ edit_disk_profile("edit_disk_profile", HelpTagType.WEBADMIN, "Storage Tab > Disk Profiles sub-tab -> Edit Disk Profile dialog"), //$NON-NLS-1$ //$NON-NLS-2$ - remove_disk_profile("remove_disk_profile", HelpTagType.WEBADMIN, "Storage Tab > Disk Profiles sub-tab -> Remove Disk Profile dialog"); //$NON-NLS-1$ //$NON-NLS-2$ + remove_disk_profile("remove_disk_profile", HelpTagType.WEBADMIN, "Storage Tab > Disk Profiles sub-tab -> Remove Disk Profile dialog"), //$NON-NLS-1$ //$NON-NLS-2$ + + cpu_profiles("cpu profiles", HelpTagType.UNKNOWN), //$NON-NLS-1$ + + new_cpu_profile("new_cpu_profile", HelpTagType.WEBADMIN, "Clusters Tab > Cpu Profiles sub-tab -> New Cpu Profile dialog"), //$NON-NLS-1$ //$NON-NLS-2$ + + edit_cpu_profile("edit_cpu_profile", HelpTagType.WEBADMIN, "Cluster Tab > Cpu Profiles sub-tab -> Edit Cpu Profile dialog"), //$NON-NLS-1$ //$NON-NLS-2$ + + remove_cpu_profile("remove_cpu_profile", HelpTagType.WEBADMIN, "Clsuter Tab > Cpu Profiles sub-tab -> Remove Cpu Profile dialog"); //$NON-NLS-1$ //$NON-NLS-2$ public final String name; diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/CommonModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/CommonModel.java index 7872e19..6f3e13c 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/CommonModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/CommonModel.java @@ -85,7 +85,7 @@ // NOTE: when adding a new ListModel here, be sure to add it to the list in initItems() private SearchableListModel dataCenterList; - private SearchableListModel clusterList; + private ClusterListModel clusterList; private SearchableListModel hostList; private StorageListModel storageList; private SearchableListModel vmList; @@ -1112,6 +1112,14 @@ this.storageList = storageList; } + public ClusterListModel getClusterList() { + return clusterList; + } + + public void setClusterList(ClusterListModel clusterList) { + this.clusterList = clusterList; + } + public BookmarkListModel getBookmarkList() { return privateBookmarkList; diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java index fa9cbbc..62d1c9d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterListModel.java @@ -18,6 +18,7 @@ import org.ovirt.engine.core.common.businessentities.VmRngDevice; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity; import org.ovirt.engine.core.common.interfaces.SearchType; +import org.ovirt.engine.core.common.queries.ConfigurationValues; import org.ovirt.engine.core.common.queries.IdQueryParameters; import org.ovirt.engine.core.common.queries.SearchParameters; import org.ovirt.engine.core.common.queries.VdcQueryReturnValue; @@ -46,6 +47,7 @@ import org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterFeaturesUtil; import org.ovirt.engine.ui.uicommonweb.models.hosts.HostDetailModel; import org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel; import org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel; import org.ovirt.engine.ui.uicompat.ConstantsManager; import org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult; @@ -191,6 +193,16 @@ this.affinityGroupListModel = affinityGroupListModel; } + private CpuProfileListModel cpuProfileListModel; + + public CpuProfileListModel getCpuProfileListModel() { + return cpuProfileListModel; + } + + public void setCpuProfileListModel(CpuProfileListModel cpuProfileListModel) { + this.cpuProfileListModel = cpuProfileListModel; + } + public ClusterListModel() { setTitle(ConstantsManager.getInstance().getConstants().clustersTitle()); @@ -252,6 +264,7 @@ setClusterServiceModel(new ClusterServiceModel()); setClusterGlusterHookListModel(new ClusterGlusterHookListModel()); setAffinityGroupListModel(new ClusterAffinityGroupListModel()); + setCpuProfileListModel(new CpuProfileListModel()); ObservableCollection<EntityModel> list = new ObservableCollection<EntityModel>(); list.add(new ClusterGeneralModel()); @@ -260,6 +273,7 @@ list.add(getClusterVmListModel()); list.add(getClusterServiceModel()); list.add(getClusterGlusterHookListModel()); + list.add(getCpuProfileListModel()); list.add(new PermissionListModel()); list.add(getAffinityGroupListModel()); setDetailModels(list); @@ -275,6 +289,9 @@ getClusterGlusterHookListModel().setIsAvailable(vdsGroup != null && vdsGroup.supportsGlusterService() && GlusterFeaturesUtil.isGlusterHookSupported(vdsGroup.getcompatibility_version())); getAffinityGroupListModel().setIsAvailable(vdsGroup != null && vdsGroup.supportsVirtService()); + getCpuProfileListModel().setIsAvailable(vdsGroup != null && vdsGroup.supportsVirtService() + && Boolean.TRUE.equals(AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.CpuQosSupported, + vdsGroup.getcompatibility_version().getValue()))); } @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/PermissionListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/PermissionListModel.java index 13cf08f..baad32f 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/PermissionListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/configure/PermissionListModel.java @@ -22,6 +22,7 @@ import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity; import org.ovirt.engine.core.common.businessentities.network.Network; import org.ovirt.engine.core.common.businessentities.network.VnicProfile; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; import org.ovirt.engine.core.common.businessentities.profiles.DiskProfile; import org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters; import org.ovirt.engine.core.common.queries.VdcQueryType; @@ -388,6 +389,9 @@ if (getEntity() instanceof DiskProfile) { return VdcObjectType.DiskProfile; } + if (getEntity() instanceof CpuProfile) { + return VdcObjectType.CpuProfile; + } return VdcObjectType.Unknown; } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileBaseModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileBaseModel.java new file mode 100644 index 0000000..8b52a35 --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileBaseModel.java @@ -0,0 +1,73 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import java.util.List; + +import org.ovirt.engine.core.common.action.CpuProfileParameters; +import org.ovirt.engine.core.common.action.ProfileParametersBase; +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.businessentities.VDSGroup; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; +import org.ovirt.engine.core.common.businessentities.qos.CpuQos; +import org.ovirt.engine.core.common.businessentities.qos.QosType; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.ui.uicommonweb.models.EntityModel; +import org.ovirt.engine.ui.uicompat.ConstantsManager; + +public abstract class CpuProfileBaseModel extends ProfileBaseModel<CpuProfile, CpuQos, VDSGroup> { + + private final static CpuQos EMPTY_QOS; + + static { + EMPTY_QOS = new CpuQos(); + EMPTY_QOS.setName(ConstantsManager.getInstance().getConstants().unlimitedQoSTitle()); + EMPTY_QOS.setId(Guid.Empty); + } + + public CpuProfileBaseModel(EntityModel sourceModel, + Guid dcId, + Guid defaultQosId, + VdcActionType vdcActionType) { + super(sourceModel, dcId, defaultQosId, vdcActionType); + } + + @Override + public void flush() { + if (getProfile() == null) { + setProfile(new CpuProfile()); + } + CpuProfile cpuProfile = getProfile(); + cpuProfile.setName(getName().getEntity()); + cpuProfile.setDescription(getDescription().getEntity()); + VDSGroup cluster = getParentListModel().getSelectedItem(); + cpuProfile.setClusterId(cluster != null ? cluster.getId() : null); + CpuQos cpuQos = getQos().getSelectedItem(); + cpuProfile.setQosId(cpuQos != null + && cpuQos.getId() != null + && !cpuQos.getId().equals(Guid.Empty) + ? cpuQos.getId() : null); + } + + @Override + protected void postInitQosList(List<CpuQos> qosList) { + qosList.add(0, EMPTY_QOS); + getQos().setItems(qosList); + if (getDefaultQosId() != null) { + for (CpuQos cpuQos : qosList) { + if (getDefaultQosId().equals(cpuQos.getId())) { + getQos().setSelectedItem(cpuQos); + break; + } + } + } + } + + @Override + protected QosType getQosType() { + return QosType.CPU; + } + + @Override + protected ProfileParametersBase<CpuProfile> getParameters() { + return new CpuProfileParameters(getProfile(), getProfile().getId()); + } +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileListModel.java new file mode 100644 index 0000000..7258963 --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/CpuProfileListModel.java @@ -0,0 +1,59 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import org.ovirt.engine.core.common.businessentities.VDSGroup; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; +import org.ovirt.engine.core.common.businessentities.qos.CpuQos; +import org.ovirt.engine.core.common.businessentities.qos.QosType; +import org.ovirt.engine.core.common.queries.VdcQueryType; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.ui.uicommonweb.help.HelpTag; +import org.ovirt.engine.ui.uicompat.ConstantsManager; + +public class CpuProfileListModel extends ProfileListModel<CpuProfile, CpuQos, VDSGroup> { + + public CpuProfileListModel() { + setTitle(ConstantsManager.getInstance().getConstants().cpuProfileTitle()); + setHelpTag(HelpTag.cpu_profiles); + setHashName("cpu_profiles"); //$NON-NLS-1$ + } + + @Override + protected ProfileBaseModel<CpuProfile, CpuQos, VDSGroup> getNewProfileModel() { + return new NewCpuProfileModel(this, getStoragePoolId()); + } + + @Override + protected ProfileBaseModel<CpuProfile, CpuQos, VDSGroup> getEditProfileModel() { + return new EditCpuProfileModel(this, (CpuProfile) getSelectedItem(), getStoragePoolId()); + } + + @Override + protected RemoveProfileModel<CpuProfile> getRemoveProfileModel() { + return new RemoveCpuProfileModel(this, getSelectedItems()); + } + + @Override + protected QosType getQosType() { + return QosType.CPU; + } + + @Override + protected VDSGroup getParentEntity() { + return (VDSGroup) getEntity(); + } + + @Override + protected Guid getStoragePoolId() { + return getParentEntity() != null ? getParentEntity().getStoragePoolId() : null; + } + + @Override + protected VdcQueryType getQueryType() { + return VdcQueryType.GetCpuProfilesByClusterId; + } + + @Override + protected String getListName() { + return "CpuProfileListModel"; //$NON-NLS-1$ + } +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileBaseModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileBaseModel.java index fa9c738..6763400 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileBaseModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileBaseModel.java @@ -1,34 +1,20 @@ package org.ovirt.engine.ui.uicommonweb.models.profiles; -import java.util.ArrayList; import java.util.List; import org.ovirt.engine.core.common.action.DiskProfileParameters; +import org.ovirt.engine.core.common.action.ProfileParametersBase; import org.ovirt.engine.core.common.action.VdcActionType; -import org.ovirt.engine.core.common.action.VdcReturnValueBase; import org.ovirt.engine.core.common.businessentities.StorageDomain; import org.ovirt.engine.core.common.businessentities.profiles.DiskProfile; import org.ovirt.engine.core.common.businessentities.qos.QosType; import org.ovirt.engine.core.common.businessentities.qos.StorageQos; -import org.ovirt.engine.core.common.queries.QosQueryParameterBase; -import org.ovirt.engine.core.common.queries.VdcQueryReturnValue; -import org.ovirt.engine.core.common.queries.VdcQueryType; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.ui.frontend.AsyncQuery; -import org.ovirt.engine.ui.frontend.Frontend; -import org.ovirt.engine.ui.frontend.INewAsyncCallback; -import org.ovirt.engine.ui.uicommonweb.UICommand; import org.ovirt.engine.ui.uicommonweb.models.EntityModel; -import org.ovirt.engine.ui.uicommonweb.models.ListModel; -import org.ovirt.engine.ui.uicommonweb.models.Model; -import org.ovirt.engine.ui.uicommonweb.validation.IValidation; -import org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation; -import org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation; import org.ovirt.engine.ui.uicompat.ConstantsManager; -import org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult; -import org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback; -public abstract class DiskProfileBaseModel extends Model { +public abstract class DiskProfileBaseModel extends ProfileBaseModel<DiskProfile, StorageQos, StorageDomain> { + private final static StorageQos EMPTY_QOS; static { @@ -37,122 +23,22 @@ EMPTY_QOS.setId(Guid.Empty); } - private EntityModel<String> name; - private EntityModel<String> description; - private final EntityModel sourceModel; - private ListModel<StorageDomain> storageDomains; - private ListModel<StorageQos> qos; - private DiskProfile diskProfile; - private final Guid defaultQosId; - private final VdcActionType vdcActionType; - - public EntityModel<String> getName() - { - return name; - } - - private void setName(EntityModel<String> value) - { - name = value; - } - - public EntityModel<String> getDescription() { - return description; - } - - public void setDescription(EntityModel<String> description) { - this.description = description; - } - - public ListModel<StorageDomain> getStorageDomains() { - return storageDomains; - } - - public void setStorageDomains(ListModel<StorageDomain> storageDomains) { - this.storageDomains = storageDomains; - } - - public void setDiskProfile(DiskProfile diskProfile) { - this.diskProfile = diskProfile; - } - - public DiskProfile getDiskProfile() { - return diskProfile; - } - - public ListModel<StorageQos> getQos() { - return qos; - } - - public void setQos(ListModel<StorageQos> qos) { - this.qos = qos; - } - public DiskProfileBaseModel(EntityModel sourceModel, Guid dcId, Guid defaultQosId, VdcActionType vdcActionType) { - this.sourceModel = sourceModel; - this.defaultQosId = defaultQosId; - this.vdcActionType = vdcActionType; - - setName(new EntityModel<String>()); - setDescription(new EntityModel<String>()); - setStorageDomains(new ListModel<StorageDomain>()); - setQos(new ListModel<StorageQos>()); - - initStorageQosList(dcId); - initCommands(); + super(sourceModel, dcId, defaultQosId, vdcActionType); } - protected void initCommands() { - UICommand okCommand = new UICommand("OnSave", this); //$NON-NLS-1$ - okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); - okCommand.setIsDefault(true); - getCommands().add(okCommand); - UICommand cancelCommand = new UICommand("Cancel", this); //$NON-NLS-1$ - cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); - cancelCommand.setIsCancel(true); - getCommands().add(cancelCommand); - } - - private void onSave() { - if (getProgress() != null) { - return; - } - - if (!validate()) { - return; - } - - // Save changes. - flush(); - - startProgress(null); - - Frontend.getInstance().runAction(vdcActionType, - new DiskProfileParameters(diskProfile, diskProfile.getId()), - new IFrontendActionAsyncCallback() { - @Override - public void executed(FrontendActionAsyncResult result) { - VdcReturnValueBase returnValue = result.getReturnValue(); - stopProgress(); - - if (returnValue != null && returnValue.getSucceeded()) { - cancel(); - } - } - }, - this); - } - + @Override public void flush() { - if (diskProfile == null) { - diskProfile = new DiskProfile(); + if (getProfile() == null) { + setProfile(new DiskProfile()); } + DiskProfile diskProfile = getProfile(); diskProfile.setName(getName().getEntity()); diskProfile.setDescription(getDescription().getEntity()); - StorageDomain storageDomain = getStorageDomains().getSelectedItem(); + StorageDomain storageDomain = getParentListModel().getSelectedItem(); diskProfile.setStorageDomainId(storageDomain != null ? storageDomain.getId() : null); StorageQos storageQos = getQos().getSelectedItem(); diskProfile.setQosId(storageQos != null @@ -161,46 +47,13 @@ ? storageQos.getId() : null); } - private void cancel() { - sourceModel.setWindow(null); - } - @Override - public void executeCommand(UICommand command) { - super.executeCommand(command); - - if ("OnSave".equals(command.getName())) { //$NON-NLS-1$ - onSave(); - } - else if ("Cancel".equals(command.getName())) {//$NON-NLS-1$ - cancel(); - } - } - - public void initStorageQosList(Guid dataCenterId) { - if (dataCenterId == null) { - return; - } - - Frontend.getInstance().runQuery(VdcQueryType.GetAllQosByStoragePoolIdAndType, - new QosQueryParameterBase(dataCenterId, QosType.STORAGE), - new AsyncQuery(new INewAsyncCallback() { - - @Override - public void onSuccess(Object model, Object returnValue) { - DiskProfileBaseModel.this.initQosList(returnValue == null ? new ArrayList<StorageQos>() - : (List<StorageQos>) ((VdcQueryReturnValue) returnValue).getReturnValue()); - } - - })); - } - - private void initQosList(List<StorageQos> qosList) { + protected void postInitQosList(List<StorageQos> qosList) { qosList.add(0, EMPTY_QOS); getQos().setItems(qosList); - if (defaultQosId != null) { + if (getDefaultQosId() != null) { for (StorageQos storageQos : qosList) { - if (defaultQosId.equals(storageQos.getId())) { + if (getDefaultQosId().equals(storageQos.getId())) { getQos().setSelectedItem(storageQos); break; } @@ -208,10 +61,13 @@ } } - public boolean validate() { - getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new SpecialAsciiI18NOrNoneValidation() }); - - return getName().getIsValid(); + @Override + protected QosType getQosType() { + return QosType.STORAGE; } + @Override + protected ProfileParametersBase<DiskProfile> getParameters() { + return new DiskProfileParameters(getProfile(), getProfile().getId()); + } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileListModel.java index 63538b8..284f42c 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/DiskProfileListModel.java @@ -1,253 +1,59 @@ package org.ovirt.engine.ui.uicommonweb.models.profiles; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.ovirt.engine.core.common.businessentities.StorageDomain; import org.ovirt.engine.core.common.businessentities.profiles.DiskProfile; import org.ovirt.engine.core.common.businessentities.qos.QosType; import org.ovirt.engine.core.common.businessentities.qos.StorageQos; -import org.ovirt.engine.core.common.queries.IdQueryParameters; -import org.ovirt.engine.core.common.queries.QosQueryParameterBase; -import org.ovirt.engine.core.common.queries.VdcQueryReturnValue; import org.ovirt.engine.core.common.queries.VdcQueryType; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.ui.frontend.AsyncQuery; -import org.ovirt.engine.ui.frontend.Frontend; -import org.ovirt.engine.ui.frontend.INewAsyncCallback; -import org.ovirt.engine.ui.uicommonweb.UICommand; import org.ovirt.engine.ui.uicommonweb.help.HelpTag; -import org.ovirt.engine.ui.uicommonweb.models.EntityModel; -import org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel; -import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel; import org.ovirt.engine.ui.uicompat.ConstantsManager; -import org.ovirt.engine.ui.uicompat.ObservableCollection; -import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs; -public class DiskProfileListModel extends ListWithDetailsModel { - private UICommand newCommand; - private UICommand editCommand; - private UICommand removeCommand; - private Map<Guid, StorageQos> qosMap; - PermissionListModel permissionListModel; +public class DiskProfileListModel extends ProfileListModel<DiskProfile, StorageQos, StorageDomain> { public DiskProfileListModel() { setTitle(ConstantsManager.getInstance().getConstants().diskProfilesTitle()); setHelpTag(HelpTag.disk_profiles); setHashName("disk_profiles"); //$NON-NLS-1$ - - setNewCommand(new UICommand("New", this)); //$NON-NLS-1$ - setEditCommand(new UICommand("Edit", this)); //$NON-NLS-1$ - setRemoveCommand(new UICommand("Remove", this)); //$NON-NLS-1$ - - updateActionAvailability(); } @Override - protected void initDetailModels() { - super.initDetailModels(); - ObservableCollection<EntityModel> list = new ObservableCollection<EntityModel>(); - permissionListModel = new PermissionListModel(); - list.add(permissionListModel); - setDetailModels(list); - } - - public void newProfile() { - if (getWindow() != null) { - return; - } - - NewDiskProfileModel model = new NewDiskProfileModel(this, - getEntity().getStoragePoolId()); - setWindow(model); - - initProfileStorageDomains(model); - } - - public void edit() { - if (getWindow() != null) { - return; - } - - EditDiskProfileModel model = - new EditDiskProfileModel(this, (DiskProfile) getSelectedItem(), getEntity().getStoragePoolId()); - setWindow(model); - - initProfileStorageDomains(model); - } - - public void remove() { - if (getWindow() != null) { - return; - } - - RemoveDiskProfileModel model = new RemoveDiskProfileModel(this, getSelectedItems()); - setWindow(model); - } - - private void initProfileStorageDomains(DiskProfileBaseModel model) { - model.getStorageDomains().setItems(Arrays.<StorageDomain> asList(getEntity())); - model.getStorageDomains().setSelectedItem(getEntity()); - model.getStorageDomains().setIsChangable(false); - } - - public void cancel() { - setWindow(null); + protected ProfileBaseModel<DiskProfile, StorageQos, StorageDomain> getNewProfileModel() { + return new NewDiskProfileModel(this, getStoragePoolId()); } @Override - protected void onEntityChanged() { - super.onEntityChanged(); - - if (getEntity() != null) { - getSearchCommand().execute(); - } - - updateActionAvailability(); + protected ProfileBaseModel<DiskProfile, StorageQos, StorageDomain> getEditProfileModel() { + return new EditDiskProfileModel(this, (DiskProfile) getSelectedItem(), getStoragePoolId()); } @Override - public void search() { - if (getEntity() != null) { - super.search(); - } + protected RemoveProfileModel<DiskProfile> getRemoveProfileModel() { + return new RemoveDiskProfileModel(this, getSelectedItems()); } @Override - protected void syncSearch() { - if (getEntity() == null) { - return; - } - Guid dcId = getEntity().getStoragePoolId(); - if (dcId == null) { // not attached to data center - fetchDiskProfiles(); - } else { - Frontend.getInstance().runQuery(VdcQueryType.GetAllQosByStoragePoolIdAndType, - new QosQueryParameterBase(dcId, QosType.STORAGE), - new AsyncQuery(new INewAsyncCallback() { - @Override - public void onSuccess(Object model, Object returnValue) { - List<StorageQos> qosList = - (ArrayList<StorageQos>) ((VdcQueryReturnValue) returnValue).getReturnValue(); - qosMap = new HashMap<Guid, StorageQos>(); - if (qosList != null) { - for (StorageQos storageQos : qosList) { - qosMap.put(storageQos.getId(), storageQos); - } - } - fetchDiskProfiles(); - } - })); - } - } - - private void fetchDiskProfiles() { - Frontend.getInstance().runQuery(VdcQueryType.GetDiskProfilesByStorageDomainId, - new IdQueryParameters(DiskProfileListModel.this.getEntity().getId()), - new AsyncQuery(new INewAsyncCallback() { - - @Override - public void onSuccess(Object model1, Object returnValue1) { - DiskProfileListModel.this.setItems((List<DiskProfile>) ((VdcQueryReturnValue) returnValue1).getReturnValue()); - } - })); + protected QosType getQosType() { + return QosType.STORAGE; } @Override - protected void entityPropertyChanged(Object sender, PropertyChangedEventArgs e) { - super.entityPropertyChanged(sender, e); - - if (e.propertyName.equals("name")) { //$NON-NLS-1$ - getSearchCommand().execute(); - } - } - - private void updateActionAvailability() { - StorageDomain storageDomain = getEntity(); - - getNewCommand().setIsExecutionAllowed(storageDomain != null); - getEditCommand().setIsExecutionAllowed((getSelectedItems() != null && getSelectedItems().size() == 1)); - getRemoveCommand().setIsExecutionAllowed((getSelectedItems() != null && getSelectedItems().size() > 0)); - } - - @Override - protected void onSelectedItemChanged() { - super.onSelectedItemChanged(); - updateActionAvailability(); - } - - @Override - protected void selectedItemsChanged() { - super.selectedItemsChanged(); - updateActionAvailability(); - } - - @Override - public void executeCommand(UICommand command) { - super.executeCommand(command); - - if (command == getNewCommand()) { - newProfile(); - } - else if (command == getEditCommand()) { - edit(); - } - else if (command == getRemoveCommand()) { - remove(); - } - else if ("Cancel".equals(command.getName())) { //$NON-NLS-1$ - cancel(); - } - } - - public UICommand getNewCommand() { - return newCommand; - } - - private void setNewCommand(UICommand value) { - newCommand = value; - } - - @Override - public UICommand getEditCommand() { - return editCommand; - } - - private void setEditCommand(UICommand value) { - editCommand = value; - } - - public UICommand getRemoveCommand() { - return removeCommand; - } - - private void setRemoveCommand(UICommand value) { - removeCommand = value; - } - - @Override - public StorageDomain getEntity() { + protected StorageDomain getParentEntity() { return (StorageDomain) ((super.getEntity() instanceof StorageDomain) ? super.getEntity() : null); } - public StorageQos getStorageQos(Guid qosId) { - return qosMap.get(qosId); + @Override + protected Guid getStoragePoolId() { + return getParentEntity() != null ? getParentEntity().getStoragePoolId() : null; } - public PermissionListModel getPermissionListModel() { - return permissionListModel; - } - - public void setPermissionListModel(PermissionListModel permissionListModel) { - this.permissionListModel = permissionListModel; + @Override + protected VdcQueryType getQueryType() { + return VdcQueryType.GetDiskProfilesByStorageDomainId; } @Override protected String getListName() { return "DiskProfileListModel"; //$NON-NLS-1$ } - } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditCpuProfileModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditCpuProfileModel.java new file mode 100644 index 0000000..b19436c --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditCpuProfileModel.java @@ -0,0 +1,33 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.ui.uicommonweb.help.HelpTag; +import org.ovirt.engine.ui.uicommonweb.models.EntityModel; +import org.ovirt.engine.ui.uicompat.ConstantsManager; + +public class EditCpuProfileModel extends CpuProfileBaseModel { + + public EditCpuProfileModel(EntityModel sourceModel, + CpuProfile profile, + Guid dataCenterId) { + super(sourceModel, + dataCenterId, + profile.getQosId(), + VdcActionType.UpdateCpuProfile); + setTitle(ConstantsManager.getInstance().getConstants().cpuProfileTitle()); + setHelpTag(HelpTag.edit_cpu_profile); + setHashName("edit_cpu_profile"); //$NON-NLS-1$ + + setProfile(profile); + + getName().setEntity(profile.getName()); + getDescription().setEntity(profile.getDescription()); + } + + public EditCpuProfileModel(CpuProfile profile) { + this(null, profile, null); + } + +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditDiskProfileModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditDiskProfileModel.java index 2b38c47..edfe7c5 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditDiskProfileModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/EditDiskProfileModel.java @@ -20,7 +20,7 @@ setHelpTag(HelpTag.edit_disk_profile); setHashName("edit_disk_profile"); //$NON-NLS-1$ - setDiskProfile(profile); + setProfile(profile); getName().setEntity(profile.getName()); getDescription().setEntity(profile.getDescription()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/NewCpuProfileModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/NewCpuProfileModel.java new file mode 100644 index 0000000..71fa97f --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/NewCpuProfileModel.java @@ -0,0 +1,23 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.ui.uicommonweb.help.HelpTag; +import org.ovirt.engine.ui.uicommonweb.models.EntityModel; +import org.ovirt.engine.ui.uicompat.ConstantsManager; + +public class NewCpuProfileModel extends CpuProfileBaseModel { + + public NewCpuProfileModel(EntityModel sourceModel, + Guid dcId) { + super(sourceModel, dcId, null, VdcActionType.AddCpuProfile); + setTitle(ConstantsManager.getInstance().getConstants().cpuProfileTitle()); + setHelpTag(HelpTag.new_cpu_profile); + setHashName("new_cpu_profile"); //$NON-NLS-1$ + } + + public NewCpuProfileModel() { + this(null, null); + } + +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileBaseModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileBaseModel.java new file mode 100644 index 0000000..483442a --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileBaseModel.java @@ -0,0 +1,192 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import java.util.ArrayList; +import java.util.List; + +import org.ovirt.engine.core.common.action.ProfileParametersBase; +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.businessentities.BusinessEntity; +import org.ovirt.engine.core.common.businessentities.profiles.ProfileBase; +import org.ovirt.engine.core.common.businessentities.qos.QosBase; +import org.ovirt.engine.core.common.businessentities.qos.QosType; +import org.ovirt.engine.core.common.queries.QosQueryParameterBase; +import org.ovirt.engine.core.common.queries.VdcQueryReturnValue; +import org.ovirt.engine.core.common.queries.VdcQueryType; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.ui.frontend.AsyncQuery; +import org.ovirt.engine.ui.frontend.Frontend; +import org.ovirt.engine.ui.frontend.INewAsyncCallback; +import org.ovirt.engine.ui.uicommonweb.UICommand; +import org.ovirt.engine.ui.uicommonweb.models.EntityModel; +import org.ovirt.engine.ui.uicommonweb.models.ListModel; +import org.ovirt.engine.ui.uicommonweb.models.Model; +import org.ovirt.engine.ui.uicommonweb.validation.AsciiOrNoneValidation; +import org.ovirt.engine.ui.uicommonweb.validation.IValidation; +import org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation; +import org.ovirt.engine.ui.uicommonweb.validation.SpecialAsciiI18NOrNoneValidation; +import org.ovirt.engine.ui.uicompat.ConstantsManager; +import org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult; +import org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback; + +public abstract class ProfileBaseModel<P extends ProfileBase, Q extends QosBase, R extends BusinessEntity<Guid>> extends Model { + + private EntityModel<String> name; + private EntityModel<String> description; + private final EntityModel sourceModel; + private ListModel<R> parentListModel; + private ListModel<Q> qos; + private P profile; + private final Guid defaultQosId; + private final VdcActionType vdcActionType; + + public EntityModel<String> getName() { + return name; + } + + public void setName(EntityModel<String> name) { + this.name = name; + } + + public EntityModel<String> getDescription() { + return description; + } + + public void setDescription(EntityModel<String> description) { + this.description = description; + } + + public ListModel<R> getParentListModel() { + return parentListModel; + } + + public void setParentListModel(ListModel<R> parentListModel) { + this.parentListModel = parentListModel; + } + + public ListModel<Q> getQos() { + return qos; + } + + public void setQos(ListModel<Q> qos) { + this.qos = qos; + } + + public P getProfile() { + return profile; + } + + public void setProfile(P profile) { + this.profile = profile; + } + + public EntityModel getSourceModel() { + return sourceModel; + } + + public Guid getDefaultQosId() { + return defaultQosId; + } + + public ProfileBaseModel(EntityModel sourceModel, + Guid dcId, + Guid defaultQosId, + VdcActionType vdcActionType) { + this.sourceModel = sourceModel; + this.defaultQosId = defaultQosId; + this.vdcActionType = vdcActionType; + + setName(new EntityModel<String>()); + setDescription(new EntityModel<String>()); + setParentListModel(new ListModel<R>()); + setQos(new ListModel<Q>()); + + initQosList(dcId); + initCommands(); + } + + protected void initCommands() { + UICommand okCommand = new UICommand("OnSave", this); //$NON-NLS-1$ + okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); + okCommand.setIsDefault(true); + getCommands().add(okCommand); + UICommand cancelCommand = new UICommand("Cancel", this); //$NON-NLS-1$ + cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); + cancelCommand.setIsCancel(true); + getCommands().add(cancelCommand); + } + + private void onSave() { + if (getProgress() != null) { + return; + } + + if (!validate()) { + return; + } + + // Save changes. + flush(); + + startProgress(null); + + Frontend.getInstance().runAction(vdcActionType, + getParameters(), + new IFrontendActionAsyncCallback() { + @Override + public void executed(FrontendActionAsyncResult result) { + stopProgress(); + cancel(); + } + }, + this); + } + + protected abstract ProfileParametersBase<P> getParameters(); + + public abstract void flush(); + + private void cancel() { + sourceModel.setWindow(null); + } + + @Override + public void executeCommand(UICommand command) { + super.executeCommand(command); + + if ("OnSave".equals(command.getName())) { //$NON-NLS-1$ + onSave(); + } + else if ("Cancel".equals(command.getName())) {//$NON-NLS-1$ + cancel(); + } + } + + private void initQosList(Guid dataCenterId) { + if (dataCenterId == null) { + return; + } + + Frontend.getInstance().runQuery(VdcQueryType.GetAllQosByStoragePoolIdAndType, + new QosQueryParameterBase(dataCenterId, getQosType()), + new AsyncQuery(new INewAsyncCallback() { + + @Override + public void onSuccess(Object model, Object returnValue) { + ProfileBaseModel.this.postInitQosList(returnValue == null ? new ArrayList<Q>() + : (List<Q>) ((VdcQueryReturnValue) returnValue).getReturnValue()); + } + + })); + } + + protected abstract QosType getQosType(); + + protected abstract void postInitQosList(List<Q> list); + + public boolean validate() { + getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new SpecialAsciiI18NOrNoneValidation() }); + getDescription().validateEntity(new IValidation[] { new AsciiOrNoneValidation() }); + return getName().getIsValid(); + } + +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileListModel.java new file mode 100644 index 0000000..6302eff --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/ProfileListModel.java @@ -0,0 +1,256 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.ovirt.engine.core.common.businessentities.BusinessEntity; +import org.ovirt.engine.core.common.businessentities.profiles.ProfileBase; +import org.ovirt.engine.core.common.businessentities.qos.QosBase; +import org.ovirt.engine.core.common.businessentities.qos.QosType; +import org.ovirt.engine.core.common.queries.IdQueryParameters; +import org.ovirt.engine.core.common.queries.QosQueryParameterBase; +import org.ovirt.engine.core.common.queries.VdcQueryReturnValue; +import org.ovirt.engine.core.common.queries.VdcQueryType; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.ui.frontend.AsyncQuery; +import org.ovirt.engine.ui.frontend.Frontend; +import org.ovirt.engine.ui.frontend.INewAsyncCallback; +import org.ovirt.engine.ui.uicommonweb.UICommand; +import org.ovirt.engine.ui.uicommonweb.help.HelpTag; +import org.ovirt.engine.ui.uicommonweb.models.EntityModel; +import org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel; +import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel; +import org.ovirt.engine.ui.uicompat.ConstantsManager; +import org.ovirt.engine.ui.uicompat.ObservableCollection; +import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs; + +public abstract class ProfileListModel<P extends ProfileBase, Q extends QosBase, R extends BusinessEntity<Guid>> extends ListWithDetailsModel { + private UICommand newCommand; + private UICommand editCommand; + private UICommand removeCommand; + private Map<Guid, Q> qosMap; + PermissionListModel permissionListModel; + + public ProfileListModel() { + setTitle(ConstantsManager.getInstance().getConstants().diskProfilesTitle()); + setHelpTag(HelpTag.disk_profiles); + setHashName("disk_profiles"); //$NON-NLS-1$ + + setNewCommand(new UICommand("New", this)); //$NON-NLS-1$ + setEditCommand(new UICommand("Edit", this)); //$NON-NLS-1$ + setRemoveCommand(new UICommand("Remove", this)); //$NON-NLS-1$ + + updateActionAvailability(); + } + + protected abstract ProfileBaseModel<P, Q, R> getNewProfileModel(); + + protected abstract ProfileBaseModel<P, Q, R> getEditProfileModel(); + + protected abstract RemoveProfileModel<P> getRemoveProfileModel(); + + protected abstract QosType getQosType(); + + protected abstract R getParentEntity(); + + protected abstract Guid getStoragePoolId(); + + protected abstract VdcQueryType getQueryType(); + + @Override + protected void initDetailModels() { + super.initDetailModels(); + ObservableCollection<EntityModel> list = new ObservableCollection<EntityModel>(); + permissionListModel = new PermissionListModel(); + list.add(permissionListModel); + setDetailModels(list); + } + + public void newProfile() { + if (getWindow() != null) { + return; + } + + ProfileBaseModel<P, Q, R> model = getNewProfileModel(); + setWindow(model); + + initProfileParentList(model); + } + + public void edit() { + if (getWindow() != null) { + return; + } + + ProfileBaseModel<P, Q, R> model = getEditProfileModel(); + setWindow(model); + + initProfileParentList(model); + } + + + public void remove() { + if (getWindow() != null) { + return; + } + + RemoveProfileModel<P> model = getRemoveProfileModel(); + setWindow(model); + } + + private void initProfileParentList(ProfileBaseModel<P, Q, R> model) { + model.getParentListModel().setItems(Arrays.<R> asList(getParentEntity())); + model.getParentListModel().setSelectedItem(getParentEntity()); + model.getParentListModel().setIsChangable(false); + } + + public void cancel() { + setWindow(null); + } + + @Override + protected void onEntityChanged() { + super.onEntityChanged(); + + if (getEntity() != null) { + getSearchCommand().execute(); + } + + updateActionAvailability(); + } + + @Override + public void search() { + if (getEntity() != null) { + super.search(); + } + } + + @Override + protected void syncSearch() { + if (getEntity() == null) { + return; + } + Guid dcId = getStoragePoolId(); + if (dcId == null) { // not attached to data center + fetchProfiles(); + } else { + Frontend.getInstance().runQuery(VdcQueryType.GetAllQosByStoragePoolIdAndType, + new QosQueryParameterBase(dcId, getQosType()), + new AsyncQuery(new INewAsyncCallback() { + @Override + public void onSuccess(Object model, Object returnValue) { + List<Q> qosList = + (ArrayList<Q>) ((VdcQueryReturnValue) returnValue).getReturnValue(); + qosMap = new HashMap<Guid, Q>(); + if (qosList != null) { + for (Q qos : qosList) { + qosMap.put(qos.getId(), qos); + } + } + fetchProfiles(); + } + })); + } + } + + private void fetchProfiles() { + Frontend.getInstance().runQuery(getQueryType(), + new IdQueryParameters(ProfileListModel.this.getParentEntity().getId()), + new AsyncQuery(new INewAsyncCallback() { + + @Override + public void onSuccess(Object model1, Object returnValue) { + ProfileListModel.this.setItems((List<P>) ((VdcQueryReturnValue) returnValue).getReturnValue()); + } + })); + } + + @Override + protected void entityPropertyChanged(Object sender, PropertyChangedEventArgs e) { + super.entityPropertyChanged(sender, e); + + if (e.propertyName.equals("name")) { //$NON-NLS-1$ + getSearchCommand().execute(); + } + } + + private void updateActionAvailability() { + R parentEntity = getParentEntity(); + + getNewCommand().setIsExecutionAllowed(parentEntity != null); + getEditCommand().setIsExecutionAllowed((getSelectedItems() != null && getSelectedItems().size() == 1)); + getRemoveCommand().setIsExecutionAllowed((getSelectedItems() != null && getSelectedItems().size() > 0)); + } + + @Override + protected void onSelectedItemChanged() { + super.onSelectedItemChanged(); + updateActionAvailability(); + } + + @Override + protected void selectedItemsChanged() { + super.selectedItemsChanged(); + updateActionAvailability(); + } + + @Override + public void executeCommand(UICommand command) { + super.executeCommand(command); + + if (command == getNewCommand()) { + newProfile(); + } + else if (command == getEditCommand()) { + edit(); + } + else if (command == getRemoveCommand()) { + remove(); + } + else if ("Cancel".equals(command.getName())) { //$NON-NLS-1$ + cancel(); + } + } + + public UICommand getNewCommand() { + return newCommand; + } + + private void setNewCommand(UICommand value) { + newCommand = value; + } + + @Override + public UICommand getEditCommand() { + return editCommand; + } + + private void setEditCommand(UICommand value) { + editCommand = value; + } + + public UICommand getRemoveCommand() { + return removeCommand; + } + + private void setRemoveCommand(UICommand value) { + removeCommand = value; + } + + public Q getQos(Guid qosId) { + return qosMap.get(qosId); + } + + public PermissionListModel getPermissionListModel() { + return permissionListModel; + } + + public void setPermissionListModel(PermissionListModel permissionListModel) { + this.permissionListModel = permissionListModel; + } + +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveCpuProfileModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveCpuProfileModel.java new file mode 100644 index 0000000..949a316 --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveCpuProfileModel.java @@ -0,0 +1,32 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import java.util.List; + +import org.ovirt.engine.core.common.action.CpuProfileParameters; +import org.ovirt.engine.core.common.action.VdcActionParametersBase; +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; +import org.ovirt.engine.ui.uicommonweb.help.HelpTag; +import org.ovirt.engine.ui.uicommonweb.models.ListModel; +import org.ovirt.engine.ui.uicompat.ConstantsManager; + +public class RemoveCpuProfileModel extends RemoveProfileModel<CpuProfile> { + + public RemoveCpuProfileModel(ListModel sourceListModel, List<CpuProfile> profiles) { + super(sourceListModel, profiles); + setHelpTag(HelpTag.remove_cpu_profile); + setTitle(ConstantsManager.getInstance().getConstants().removeCpuProfileTitle()); + setHashName("remove_cpu_prfoile"); //$NON-NLS-1$ + } + + @Override + protected VdcActionType getRemoveActionType() { + return VdcActionType.RemoveCpuProfile; + } + + @Override + protected VdcActionParametersBase getRemoveProfileParams(CpuProfile profile) { + return new CpuProfileParameters(profile, profile.getId()); + } + +} diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveDiskProfileModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveDiskProfileModel.java index 6c9c104..4b0a832 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveDiskProfileModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveDiskProfileModel.java @@ -1,95 +1,32 @@ package org.ovirt.engine.ui.uicommonweb.models.profiles; -import java.util.ArrayList; import java.util.List; import org.ovirt.engine.core.common.action.DiskProfileParameters; import org.ovirt.engine.core.common.action.VdcActionParametersBase; import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.businessentities.profiles.DiskProfile; -import org.ovirt.engine.ui.frontend.Frontend; -import org.ovirt.engine.ui.uicommonweb.UICommand; import org.ovirt.engine.ui.uicommonweb.help.HelpTag; -import org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel; import org.ovirt.engine.ui.uicommonweb.models.ListModel; import org.ovirt.engine.ui.uicompat.ConstantsManager; -import org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult; -import org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback; -public class RemoveDiskProfileModel extends ConfirmationModel { - - private final List<DiskProfile> profiles; - private final ListModel sourceListModel; +public class RemoveDiskProfileModel extends RemoveProfileModel<DiskProfile> { public RemoveDiskProfileModel(ListModel sourceListModel, List<DiskProfile> profiles) { + super(sourceListModel, profiles); setHelpTag(HelpTag.remove_disk_profile); setTitle(ConstantsManager.getInstance().getConstants().removeDiskProfileTitle()); setHashName("remove_disk_prfoile"); //$NON-NLS-1$ - - this.sourceListModel = sourceListModel; - this.profiles = profiles; - - ArrayList<String> items = new ArrayList<String>(); - for (DiskProfile profile : profiles) { - items.add(profile.getName()); - } - setItems(items); - - getCommands().add(new UICommand("OnRemove", this).setTitle(ConstantsManager.getInstance().getConstants().ok()) //$NON-NLS-1$ - .setIsDefault(true)); - getCommands().add(new UICommand("Cancel", this).setTitle(ConstantsManager.getInstance().getConstants().cancel()) //$NON-NLS-1$ - .setIsCancel(true)); - } - - private void onRemove() { - if (getProgress() != null) { - return; - } - - ArrayList<VdcActionParametersBase> vdcActionParametersBaseList = new ArrayList<VdcActionParametersBase>(); - for (DiskProfile profile : getProfiles()) { - VdcActionParametersBase parameters = getRemoveDiskProfileParams(profile); - vdcActionParametersBaseList.add(parameters); - - } - - startProgress(null); - - Frontend.getInstance().runMultipleAction(VdcActionType.RemoveDiskProfile, vdcActionParametersBaseList, - new IFrontendMultipleActionAsyncCallback() { - - @Override - public void executed(FrontendMultipleActionAsyncResult result) { - stopProgress(); - cancel(); - - } - }, null); - } - - protected VdcActionParametersBase getRemoveDiskProfileParams(DiskProfile profile) { - return new DiskProfileParameters(profile, profile.getId()); - } - - public List<DiskProfile> getProfiles() { - return profiles; - } - - private void cancel() { - sourceListModel.setWindow(null); - sourceListModel.setConfirmWindow(null); } @Override - public void executeCommand(UICommand command) { - super.executeCommand(command); + protected VdcActionType getRemoveActionType() { + return VdcActionType.RemoveDiskProfile; + } - if ("Cancel".equals(command.getName())) {//$NON-NLS-1$ - cancel(); - } - else if ("OnRemove".equals(command.getName())) {//$NON-NLS-1$ - onRemove(); - } + @Override + protected VdcActionParametersBase getRemoveProfileParams(DiskProfile profile) { + return new DiskProfileParameters(profile, profile.getId()); } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveProfileModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveProfileModel.java new file mode 100644 index 0000000..d04b6b0 --- /dev/null +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/profiles/RemoveProfileModel.java @@ -0,0 +1,89 @@ +package org.ovirt.engine.ui.uicommonweb.models.profiles; + +import java.util.ArrayList; +import java.util.List; + +import org.ovirt.engine.core.common.action.VdcActionParametersBase; +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.businessentities.profiles.ProfileBase; +import org.ovirt.engine.ui.frontend.Frontend; +import org.ovirt.engine.ui.uicommonweb.UICommand; +import org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel; +import org.ovirt.engine.ui.uicommonweb.models.ListModel; +import org.ovirt.engine.ui.uicompat.ConstantsManager; +import org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult; +import org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback; + +public abstract class RemoveProfileModel<P extends ProfileBase> extends ConfirmationModel { + + private final List<P> profiles; + private final ListModel sourceListModel; + + public RemoveProfileModel(ListModel sourceListModel, List<P> profiles) { + this.sourceListModel = sourceListModel; + this.profiles = profiles; + + ArrayList<String> items = new ArrayList<String>(); + for (P profile : profiles) { + items.add(profile.getName()); + } + setItems(items); + + getCommands().add(new UICommand("OnRemove", this).setTitle(ConstantsManager.getInstance().getConstants().ok()) //$NON-NLS-1$ + .setIsDefault(true)); + getCommands().add(new UICommand("Cancel", this).setTitle(ConstantsManager.getInstance().getConstants().cancel()) //$NON-NLS-1$ + .setIsCancel(true)); + } + + protected abstract VdcActionType getRemoveActionType(); + + protected abstract VdcActionParametersBase getRemoveProfileParams(P profile); + + private void onRemove() { + if (getProgress() != null) { + return; + } + + ArrayList<VdcActionParametersBase> vdcActionParametersBaseList = new ArrayList<VdcActionParametersBase>(); + for (P profile : getProfiles()) { + VdcActionParametersBase parameters = getRemoveProfileParams(profile); + vdcActionParametersBaseList.add(parameters); + + } + + startProgress(null); + + Frontend.getInstance().runMultipleAction(getRemoveActionType(), vdcActionParametersBaseList, + new IFrontendMultipleActionAsyncCallback() { + + @Override + public void executed(FrontendMultipleActionAsyncResult result) { + stopProgress(); + cancel(); + + } + }, null); + } + + public List<P> getProfiles() { + return profiles; + } + + private void cancel() { + sourceListModel.setWindow(null); + sourceListModel.setConfirmWindow(null); + } + + @Override + public void executeCommand(UICommand command) { + super.executeCommand(command); + + if ("Cancel".equals(command.getName())) {//$NON-NLS-1$ + cancel(); + } + else if ("OnRemove".equals(command.getName())) {//$NON-NLS-1$ + onRemove(); + } + } + +} diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java index 226daee..8190c6a 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIConstants.java @@ -2374,5 +2374,11 @@ @DefaultStringValue("Remove Disk Profile(s)") String removeDiskProfileTitle(); + + @DefaultStringValue("Remove CPU Profile(s)") + String removeCpuProfileTitle(); + + @DefaultStringValue("CPU Profile") + String cpuProfileTitle(); } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java index 7923127..359f795 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java @@ -3855,4 +3855,13 @@ @DefaultStringValue("Description") String cpuQosDescription(); + + @DefaultStringValue("CPU Profiles") + String cpuProfilesSubTabLabel(); + + @DefaultStringValue("Cluster") + String cpuProfileClusterLabel(); + + @DefaultStringValue("QoS") + String cpuProfileQosLabel(); } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java index 43e8a44..fbb2bd8 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/ClientGinjectorExtension.java @@ -33,6 +33,7 @@ import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface; import org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; import org.ovirt.engine.core.common.businessentities.network.VnicProfileView; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; import org.ovirt.engine.core.common.businessentities.profiles.DiskProfile; import org.ovirt.engine.core.common.businessentities.qos.CpuQos; import org.ovirt.engine.core.common.businessentities.qos.StorageQos; @@ -93,6 +94,7 @@ import org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel; import org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel; import org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel; import org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel; import org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileListModel; import org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileTemplateListModel; @@ -271,6 +273,8 @@ SearchableDetailModelProvider<Permissions, ClusterListModel, PermissionListModel> getSubTabClusterPermissionModelProvider(); + SearchableDetailModelProvider<CpuProfile, ClusterListModel, CpuProfileListModel> getSubTabClusterCpuProfileModelProvider(); + // VirtualMachine DetailModelProvider<VmListModel, VmGeneralModel> getSubTabVirtualMachineGeneralModelProvider(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java index 0436a49..3d97a3c 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/PresenterModule.java @@ -68,6 +68,7 @@ import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.instancetypes.InstanceTypesPopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.pool.PoolEditPopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.pool.PoolNewPopupPresenterWidget; +import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.profile.CpuProfilePopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.profile.DiskProfilePopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.profile.VnicProfilePopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.provider.ExternalSubnetPopupPresenterWidget; @@ -131,6 +132,7 @@ import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabVolumePresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster.ClusterSubTabPanelPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster.SubTabClusterAffinityGroupPresenter; +import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster.SubTabClusterCpuProfilePresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster.SubTabClusterGeneralPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster.SubTabClusterGlusterHookPresenter; import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster.SubTabClusterHostPresenter; @@ -301,6 +303,7 @@ import org.ovirt.engine.ui.webadmin.section.main.view.popup.networkQoS.NetworkQoSPopupView; import org.ovirt.engine.ui.webadmin.section.main.view.popup.pool.PoolEditPopupView; import org.ovirt.engine.ui.webadmin.section.main.view.popup.pool.PoolNewPopupView; +import org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.CpuProfilePopupView; import org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.DiskProfilePopupView; import org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView; import org.ovirt.engine.ui.webadmin.section.main.view.popup.provider.ExternalSubnetPopupView; @@ -368,6 +371,7 @@ import org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabVolumeView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.ClusterSubTabPanelView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.SubTabClusterAffinityGroupView; +import org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.SubTabClusterCpuProfileView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.SubTabClusterGeneralView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.SubTabClusterGlusterHookView; import org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.SubTabClusterHostView; @@ -755,6 +759,10 @@ SubTabClusterPermissionPresenter.ViewDef.class, SubTabClusterPermissionView.class, SubTabClusterPermissionPresenter.ProxyDef.class); + bindPresenter(SubTabClusterCpuProfilePresenter.class, + SubTabClusterCpuProfilePresenter.ViewDef.class, + SubTabClusterCpuProfileView.class, + SubTabClusterCpuProfilePresenter.ProxyDef.class); // Host bindPresenter(HostSubTabPanelPresenter.class, @@ -1465,6 +1473,9 @@ bindPresenterWidget(DiskProfilePopupPresenterWidget.class, DiskProfilePopupPresenterWidget.ViewDef.class, DiskProfilePopupView.class); + bindPresenterWidget(CpuProfilePopupPresenterWidget.class, + CpuProfilePopupPresenterWidget.ViewDef.class, + CpuProfilePopupView.class); // External Subnet bindPresenterWidget(ExternalSubnetPopupPresenterWidget.class, diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/UiCommonModule.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/UiCommonModule.java index 84b5781..9eb0714 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/UiCommonModule.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/UiCommonModule.java @@ -24,6 +24,7 @@ import org.ovirt.engine.ui.webadmin.uicommon.model.BookmarkModelProvider; import org.ovirt.engine.ui.webadmin.uicommon.model.ClusterPolicyClusterModelProvider; import org.ovirt.engine.ui.webadmin.uicommon.model.ClusterPolicyModelProvider; +import org.ovirt.engine.ui.webadmin.uicommon.model.CpuProfilePermissionModelProvider; import org.ovirt.engine.ui.webadmin.uicommon.model.DiskProfilePermissionModelProvider; import org.ovirt.engine.ui.webadmin.uicommon.model.EventFirstRowModelProvider; import org.ovirt.engine.ui.webadmin.uicommon.model.EventModelProvider; @@ -111,6 +112,9 @@ // disk profiles permissions bind(DiskProfilePermissionModelProvider.class).asEagerSingleton(); + + // cpu profiles permissions + bind(CpuProfilePermissionModelProvider.class).asEagerSingleton(); } void bindIntegration() { diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/ClusterModule.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/ClusterModule.java index b516b43..69feff6 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/ClusterModule.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/ClusterModule.java @@ -6,6 +6,7 @@ import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity; import org.ovirt.engine.core.common.businessentities.network.Network; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; import org.ovirt.engine.core.common.scheduling.AffinityGroup; import org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget; import org.ovirt.engine.ui.common.presenter.ModelBoundPresenterWidget; @@ -31,6 +32,7 @@ import org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterVmListModel; import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel; import org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.affinity_groups.list.ClusterAffinityGroupListModel; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel; import org.ovirt.engine.ui.webadmin.section.main.presenter.ReportPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.PermissionsPopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.cluster.ClusterManageNetworkPopupPresenterWidget; @@ -42,6 +44,7 @@ import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.DetachGlusterHostsPopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.guide.GuidePopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.host.MultipleHostsPopupPresenterWidget; +import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.profile.CpuProfilePopupPresenterWidget; import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.scheduling.AffinityGroupPopupPresenterWidget; import com.google.gwt.event.shared.EventBus; @@ -293,6 +296,41 @@ }; } + @Provides + @Singleton + public SearchableDetailModelProvider<CpuProfile, ClusterListModel, CpuProfileListModel> getStorageCpuProfileListProvider(EventBus eventBus, + Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, + final Provider<CpuProfilePopupPresenterWidget> profilePopupProvider, + final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider) { + return new SearchableDetailTabModelProvider<CpuProfile, ClusterListModel, CpuProfileListModel>(eventBus, + defaultConfirmPopupProvider, + ClusterListModel.class, + CpuProfileListModel.class) { + @Override + public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(CpuProfileListModel source, + UICommand lastExecutedCommand, + Model windowModel) { + if (lastExecutedCommand == getModel().getNewCommand() + || lastExecutedCommand == getModel().getEditCommand()) { + return profilePopupProvider.get(); + } else { + return super.getModelPopup(source, lastExecutedCommand, windowModel); + } + } + + @Override + public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(CpuProfileListModel source, + UICommand lastExecutedCommand) { + if (lastExecutedCommand == getModel().getRemoveCommand()) { //$NON-NLS-1$ + return removeConfirmPopupProvider.get(); + } else { + return super.getConfirmModelPopup(source, lastExecutedCommand); + } + } + + }; + } + @Override protected void configure() { } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java index 54c137f..937f0d5 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/place/ApplicationPlaces.java @@ -154,6 +154,9 @@ public static final String clusterAffinityGroupsSubTabPlace = clusterMainTabPlace + SUB_TAB_PREFIX + "affinity_groups"; //$NON-NLS-1$ + public static final String clusterCpuProfileSubTabPlace = clusterMainTabPlace + SUB_TAB_PREFIX + + "cpu_profiles"; //$NON-NLS-1$ + public static final String clusterPermissionSubTabPlace = clusterMainTabPlace + SUB_TAB_PREFIX + "permissions"; //$NON-NLS-1$ diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/profile/CpuProfilePopupPresenterWidget.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/profile/CpuProfilePopupPresenterWidget.java new file mode 100644 index 0000000..b9faefd --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/profile/CpuProfilePopupPresenterWidget.java @@ -0,0 +1,19 @@ +package org.ovirt.engine.ui.webadmin.section.main.presenter.popup.profile; + +import org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileBaseModel; + +import com.google.gwt.event.shared.EventBus; +import com.google.inject.Inject; + +public class CpuProfilePopupPresenterWidget extends AbstractModelBoundPopupPresenterWidget<CpuProfileBaseModel, CpuProfilePopupPresenterWidget.ViewDef> { + + public interface ViewDef extends AbstractModelBoundPopupPresenterWidget.ViewDef<CpuProfileBaseModel> { + } + + @Inject + public CpuProfilePopupPresenterWidget(EventBus eventBus, ViewDef view) { + super(eventBus, view); + } + +} diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterCpuProfilePresenter.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterCpuProfilePresenter.java new file mode 100644 index 0000000..9f2b3f3 --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterCpuProfilePresenter.java @@ -0,0 +1,61 @@ +package org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster; + +import org.ovirt.engine.core.common.businessentities.VDSGroup; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; +import org.ovirt.engine.ui.common.place.PlaceRequestFactory; +import org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter; +import org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider; +import org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData; +import org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel; +import org.ovirt.engine.ui.webadmin.ApplicationConstants; +import org.ovirt.engine.ui.webadmin.place.ApplicationPlaces; +import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.ClusterSelectionChangeEvent; + +import com.google.gwt.event.shared.EventBus; +import com.google.inject.Inject; +import com.gwtplatform.mvp.client.TabData; +import com.gwtplatform.mvp.client.annotations.NameToken; +import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit; +import com.gwtplatform.mvp.client.annotations.ProxyEvent; +import com.gwtplatform.mvp.client.annotations.TabInfo; +import com.gwtplatform.mvp.client.proxy.PlaceManager; +import com.gwtplatform.mvp.client.proxy.PlaceRequest; +import com.gwtplatform.mvp.client.proxy.TabContentProxyPlace; + +public class SubTabClusterCpuProfilePresenter extends + AbstractSubTabPresenter<VDSGroup, ClusterListModel, CpuProfileListModel, SubTabClusterCpuProfilePresenter.ViewDef, SubTabClusterCpuProfilePresenter.ProxyDef> { + + @ProxyCodeSplit + @NameToken(ApplicationPlaces.clusterCpuProfileSubTabPlace) + public interface ProxyDef extends TabContentProxyPlace<SubTabClusterCpuProfilePresenter> { + } + + public interface ViewDef extends AbstractSubTabPresenter.ViewDef<VDSGroup> { + } + + @TabInfo(container = ClusterSubTabPanelPresenter.class) + static TabData getTabData(ApplicationConstants applicationConstants, + SearchableDetailModelProvider<CpuProfile, ClusterListModel, CpuProfileListModel> modelProvider) { + return new ModelBoundTabData(applicationConstants.cpuProfilesSubTabLabel(), 7, + modelProvider); + } + + @Inject + public SubTabClusterCpuProfilePresenter(EventBus eventBus, ViewDef view, ProxyDef proxy, + PlaceManager placeManager, + SearchableDetailModelProvider<CpuProfile, ClusterListModel, CpuProfileListModel> modelProvider) { + super(eventBus, view, proxy, placeManager, modelProvider, ClusterSubTabPanelPresenter.TYPE_SetTabContent); + } + + @Override + protected PlaceRequest getMainTabRequest() { + return PlaceRequestFactory.get(ApplicationPlaces.clusterMainTabPlace); + } + + @ProxyEvent + public void onClusterSelectionChange(ClusterSelectionChangeEvent event) { + updateMainTabSelection(event.getSelectedItems()); + } + +} diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterPermissionPresenter.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterPermissionPresenter.java index 4579d5b..4eecf6c 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterPermissionPresenter.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/SubTabClusterPermissionPresenter.java @@ -36,7 +36,7 @@ @TabInfo(container = ClusterSubTabPanelPresenter.class) static TabData getTabData(ApplicationConstants applicationConstants, SearchableDetailModelProvider<Permissions, ClusterListModel, PermissionListModel> modelProvider) { - return new ModelBoundTabData(applicationConstants.clusterPermissionSubTabLabel(), 7, modelProvider); + return new ModelBoundTabData(applicationConstants.clusterPermissionSubTabLabel(), 8, modelProvider); } @Inject diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.java new file mode 100644 index 0000000..a34897a --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.java @@ -0,0 +1,110 @@ +package org.ovirt.engine.ui.webadmin.section.main.view.popup.profile; + +import org.ovirt.engine.core.common.businessentities.VDSGroup; +import org.ovirt.engine.core.common.businessentities.qos.CpuQos; +import org.ovirt.engine.ui.common.idhandler.ElementIdHandler; +import org.ovirt.engine.ui.common.idhandler.WithElementId; +import org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView; +import org.ovirt.engine.ui.common.widget.dialog.SimpleDialogPanel; +import org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor; +import org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxEditor; +import org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileBaseModel; +import org.ovirt.engine.ui.webadmin.ApplicationConstants; +import org.ovirt.engine.ui.webadmin.ApplicationResources; +import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.profile.CpuProfilePopupPresenterWidget; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.editor.client.SimpleBeanEditorDriver; +import com.google.gwt.event.shared.EventBus; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.inject.Inject; + +public class CpuProfilePopupView extends AbstractModelBoundPopupView<CpuProfileBaseModel> implements CpuProfilePopupPresenterWidget.ViewDef { + + interface Driver extends SimpleBeanEditorDriver<CpuProfileBaseModel, CpuProfilePopupView> { + } + + interface ViewUiBinder extends UiBinder<SimpleDialogPanel, CpuProfilePopupView> { + ViewUiBinder uiBinder = GWT.create(ViewUiBinder.class); + } + + interface ViewIdHandler extends ElementIdHandler<CpuProfilePopupView> { + ViewIdHandler idHandler = GWT.create(ViewIdHandler.class); + } + + @UiField + @Path("name.entity") + @WithElementId("name") + StringEntityModelTextBoxEditor nameEditor; + + @UiField + @Path("description.entity") + @WithElementId("description") + StringEntityModelTextBoxEditor descriptionEditor; + + @UiField(provided = true) + @Path(value = "qos.selectedItem") + @WithElementId("qos") + public ListModelListBoxEditor<CpuQos> qosEditor; + + @UiField(provided = true) + @Path("parentListModel.selectedItem") + ListModelListBoxEditor<VDSGroup> clusterEditor; + + private final Driver driver = GWT.create(Driver.class); + + @Inject + public CpuProfilePopupView(EventBus eventBus, ApplicationResources resources, ApplicationConstants constants) { + super(eventBus, resources); + clusterEditor = new ListModelListBoxEditor<VDSGroup>(new NullSafeRenderer<VDSGroup>() { + @Override + public String renderNullSafe(VDSGroup cluster) { + return cluster.getName(); + } + }); + qosEditor = new ListModelListBoxEditor<CpuQos>(new NullSafeRenderer<CpuQos>() { + @Override + public String renderNullSafe(CpuQos cpuQos) { + return cpuQos.getName(); + } + }); + initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); + localize(constants); + ViewIdHandler.idHandler.generateAndSetIds(this); + driver.initialize(this); + } + + private void localize(ApplicationConstants constants) { + nameEditor.setLabel(constants.profileNameLabel()); + descriptionEditor.setLabel(constants.profileDescriptionLabel()); + clusterEditor.setLabel(constants.cpuProfileClusterLabel()); + qosEditor.setLabel(constants.cpuProfileQosLabel()); + } + + @Override + public void focusInput() { + nameEditor.setFocus(true); + } + + @Override + public void edit(CpuProfileBaseModel object) { + driver.edit(object); + } + + @Override + public CpuProfileBaseModel flush() { + return driver.flush(); + } + + @Override + public int setTabIndexes(int nextTabIndex) { + clusterEditor.setTabIndex(nextTabIndex++); + nameEditor.setTabIndex(nextTabIndex++); + descriptionEditor.setTabIndex(nextTabIndex++); + qosEditor.setTabIndex(nextTabIndex++); + + return nextTabIndex; + } +} diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.ui.xml b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.ui.xml new file mode 100644 index 0000000..c722534 --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/CpuProfilePopupView.ui.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> +<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" + xmlns:g="urn:import:com.google.gwt.user.client.ui" + xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog" + xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" + xmlns:ge="urn:import:org.ovirt.engine.ui.common.widget.editor.generic" > + + <d:SimpleDialogPanel width="470px" height="220px"> + <d:content> + <g:FlowPanel> + <e:ListModelListBoxEditor ui:field="clusterEditor" /> + <ge:StringEntityModelTextBoxEditor ui:field="nameEditor" /> + <ge:StringEntityModelTextBoxEditor ui:field="descriptionEditor" /> + <e:ListModelListBoxEditor ui:field="qosEditor"/> + </g:FlowPanel> + </d:content> + </d:SimpleDialogPanel> + +</ui:UiBinder> + diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/DiskProfilePopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/DiskProfilePopupView.java index bda370a..6425609 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/DiskProfilePopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/profile/DiskProfilePopupView.java @@ -50,7 +50,7 @@ public ListModelListBoxEditor<StorageQos> qosEditor; @UiField(provided = true) - @Path("storageDomains.selectedItem") + @Path("parentListModel.selectedItem") ListModelListBoxEditor<StorageDomain> storageDomainEditor; private final Driver driver = GWT.create(Driver.class); @@ -77,8 +77,8 @@ } private void localize(ApplicationConstants constants) { - nameEditor.setLabel(constants.diskProfileNameLabel()); - descriptionEditor.setLabel(constants.diskProfileDescriptionLabel()); + nameEditor.setLabel(constants.profileNameLabel()); + descriptionEditor.setLabel(constants.profileDescriptionLabel()); storageDomainEditor.setLabel(constants.diskProfileStorageDomainLabel()); qosEditor.setLabel(constants.diskProfileQosLabel()); } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.java new file mode 100644 index 0000000..6d7f043 --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.java @@ -0,0 +1,166 @@ +package org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster; + +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; +import org.ovirt.engine.core.common.businessentities.qos.CpuQos; +import org.ovirt.engine.ui.common.CommonApplicationConstants; +import org.ovirt.engine.ui.common.system.ClientStorage; +import org.ovirt.engine.ui.common.uicommon.model.SearchableTableModelProvider; +import org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip; +import org.ovirt.engine.ui.common.widget.uicommon.AbstractModelBoundTableWidget; +import org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionWithInheritedPermissionListModelTable; +import org.ovirt.engine.ui.uicommonweb.UICommand; +import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel; +import org.ovirt.engine.ui.uicompat.Event; +import org.ovirt.engine.ui.uicompat.EventArgs; +import org.ovirt.engine.ui.uicompat.IEventListener; +import org.ovirt.engine.ui.webadmin.uicommon.model.CpuProfilePermissionModelProvider; +import org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; +import com.google.gwt.event.shared.EventBus; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.user.client.ui.SimplePanel; +import com.google.gwt.user.client.ui.SplitLayoutPanel; +import com.google.gwt.user.client.ui.Widget; + +public class CpuProfilesListModelTable extends AbstractModelBoundTableWidget<CpuProfile, CpuProfileListModel> { + + interface WidgetUiBinder extends UiBinder<Widget, CpuProfilesListModelTable> { + WidgetUiBinder uiBinder = GWT.create(WidgetUiBinder.class); + } + + private final PermissionWithInheritedPermissionListModelTable<PermissionListModel> permissionListModelTable; + + @UiField + SplitLayoutPanel splitLayoutPanel; + + @UiField + SimplePanel tableContainer; + + SimplePanel permissionContainer; + + private boolean permissionPanelVisible = false; + + public CpuProfilesListModelTable(SearchableTableModelProvider<CpuProfile, CpuProfileListModel> modelProvider, + CpuProfilePermissionModelProvider cpuProfilePermissionModelProvider, + EventBus eventBus, + ClientStorage clientStorage, + CommonApplicationConstants constants) { + super(modelProvider, eventBus, clientStorage, false); + // Create cpu profile table + tableContainer.add(getTable()); + + // Create permission panel + permissionListModelTable = + new PermissionWithInheritedPermissionListModelTable<PermissionListModel>(cpuProfilePermissionModelProvider, + eventBus, + clientStorage); + permissionListModelTable.initTable(constants); + permissionContainer = new SimplePanel(); + permissionContainer.add(permissionListModelTable); + } + + @Override + protected Widget getWrappedWidget() { + return WidgetUiBinder.uiBinder.createAndBindUi(this); + } + + @Override + public void initTable(final CommonApplicationConstants constants) { + getTable().enableColumnResizing(); + + TextColumnWithTooltip<CpuProfile> nameColumn = + new TextColumnWithTooltip<CpuProfile>() { + @Override + public String getValue(CpuProfile object) { + return object.getName(); + } + }; + getTable().addColumn(nameColumn, constants.profileNameLabel(), "200px"); //$NON-NLS-1$ + nameColumn.makeSortable(); + + TextColumnWithTooltip<CpuProfile> descriptionColumn = + new TextColumnWithTooltip<CpuProfile>() { + @Override + public String getValue(CpuProfile object) { + return object.getDescription(); + } + }; + getTable().addColumn(descriptionColumn, constants.profileDescriptionLabel(), "200px"); //$NON-NLS-1$ + descriptionColumn.makeSortable(); + + TextColumnWithTooltip<CpuProfile> qosColumn = new TextColumnWithTooltip<CpuProfile>() { + @Override + public String getValue(CpuProfile object) { + String name = constants.unlimitedQos(); + if (object.getQosId() != null) { + CpuQos cpuQos = getModel().getQos(object.getQosId()); + if (cpuQos != null) { + name = cpuQos.getName(); + } + } + return name; + } + }; + getTable().addColumn(qosColumn, constants.cpuQosName(), "200px"); //$NON-NLS-1$ + qosColumn.makeSortable(); + + getTable().addActionButton(new WebAdminButtonDefinition<CpuProfile>(constants.newProfile()) { + @Override + protected UICommand resolveCommand() { + return getModel().getNewCommand(); + } + }); + getTable().addActionButton(new WebAdminButtonDefinition<CpuProfile>(constants.editProfile()) { + @Override + protected UICommand resolveCommand() { + return getModel().getEditCommand(); + } + }); + getTable().addActionButton(new WebAdminButtonDefinition<CpuProfile>(constants.removeProfile()) { + @Override + protected UICommand resolveCommand() { + return getModel().getRemoveCommand(); + } + }); + + // Add selection listener + getModel().getSelectedItemChangedEvent().addListener(new IEventListener() { + @Override + public void eventRaised(Event ev, Object sender, EventArgs args) { + updatePermissionPanel(); + } + }); + + getModel().getItemsChangedEvent().addListener(new IEventListener() { + @Override + public void eventRaised(Event ev, Object sender, EventArgs args) { + updatePermissionPanel(); + } + }); + } + + private void updatePermissionPanel() { + final CpuProfile cpuProfile = (CpuProfile) getModel().getSelectedItem(); + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + + @Override + public void execute() { + if (permissionPanelVisible && cpuProfile == null) { + splitLayoutPanel.clear(); + splitLayoutPanel.add(tableContainer); + permissionPanelVisible = false; + } else if (!permissionPanelVisible && cpuProfile != null) { + splitLayoutPanel.clear(); + splitLayoutPanel.addEast(permissionContainer, 600); + splitLayoutPanel.add(tableContainer); + permissionPanelVisible = true; + } + } + }); + } +} diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.ui.xml b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.ui.xml new file mode 100644 index 0000000..f49b482 --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/CpuProfilesListModelTable.ui.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> +<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" + xmlns:g="urn:import:com.google.gwt.user.client.ui" + xmlns:e="urn:import:com.google.gwt.editor.ui.client"> + + <ui:style> + .container { + position: absolute !important; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; + } + + @external .gwt-TabLayoutPanel; + @external .gwt-TabLayoutPanel .gwt-TabLayoutPanelTabs; + @external .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab; + @external .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab-selected; + @external .gwt-TabLayoutPanel .gwt-TabLayoutPanelContent; + + .gwt-TabLayoutPanel .gwt-TabLayoutPanelTabs { + background: #CCC; + } + + .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab { + background-image: + url("images/main_tab_middle.png"); + background-repeat: repeat-x; + } + + .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab-selected { + background-image: url("images/tab_middle_selected.png"); + background-repeat: repeat-x; + } + + .gwt-TabLayoutPanel .gwt-TabLayoutPanelContent { + border-width: 0px; + padding: 0px; + } + </ui:style> + + <g:SplitLayoutPanel ui:field="splitLayoutPanel" addStyleNames="{style.container}"> + <g:center> + <g:SimplePanel ui:field="tableContainer"/> + </g:center> + </g:SplitLayoutPanel> + +</ui:UiBinder> \ No newline at end of file diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterCpuProfileView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterCpuProfileView.java new file mode 100644 index 0000000..4b938c9 --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/cluster/SubTabClusterCpuProfileView.java @@ -0,0 +1,45 @@ +package org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster; + +import org.ovirt.engine.core.common.businessentities.VDSGroup; +import org.ovirt.engine.core.common.businessentities.profiles.CpuProfile; +import org.ovirt.engine.ui.common.CommonApplicationConstants; +import org.ovirt.engine.ui.common.CommonApplicationMessages; +import org.ovirt.engine.ui.common.CommonApplicationTemplates; +import org.ovirt.engine.ui.common.idhandler.ElementIdHandler; +import org.ovirt.engine.ui.common.system.ClientStorage; +import org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider; +import org.ovirt.engine.ui.common.view.AbstractSubTabTableWidgetView; +import org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel; +import org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster.SubTabClusterCpuProfilePresenter; +import org.ovirt.engine.ui.webadmin.uicommon.model.CpuProfilePermissionModelProvider; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.shared.EventBus; +import com.google.inject.Inject; + +public class SubTabClusterCpuProfileView extends AbstractSubTabTableWidgetView<VDSGroup, CpuProfile, ClusterListModel, CpuProfileListModel> + implements SubTabClusterCpuProfilePresenter.ViewDef { + + interface ViewIdHandler extends ElementIdHandler<SubTabClusterCpuProfileView> { + ViewIdHandler idHandler = GWT.create(ViewIdHandler.class); + } + + @Inject + public SubTabClusterCpuProfileView(SearchableDetailModelProvider<CpuProfile, ClusterListModel, CpuProfileListModel> modelProvider, + CpuProfilePermissionModelProvider permissionModelProvider, + EventBus eventBus, + ClientStorage clientStorage, + CommonApplicationConstants constants, + CommonApplicationMessages messages, + CommonApplicationTemplates templates) { + super(new CpuProfilesListModelTable(modelProvider, + permissionModelProvider, + eventBus, + clientStorage, + constants)); + ViewIdHandler.idHandler.generateAndSetIds(this); + initTable(constants); + initWidget(getModelBoundTableWidget()); + } +} diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterCpuQosView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterCpuQosView.java index 41b3ee3..98ccaac 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterCpuQosView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterCpuQosView.java @@ -59,7 +59,7 @@ TextColumnWithTooltip<CpuQos> cpuLimitColumn = new TextColumnWithTooltip<CpuQos>() { @Override public String getValue(CpuQos object) { - return object.getCpuLimit() == null ? constants.UnlimitedCpuQos() + return object.getCpuLimit() == null ? constants.unlimitedQos() : object.getCpuLimit().toString(); } }; diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterStorageQosView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterStorageQosView.java index 87ace1b..de1eb7f 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterStorageQosView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterStorageQosView.java @@ -59,7 +59,7 @@ TextColumnWithTooltip<StorageQos> throughputColumn = new TextColumnWithTooltip<StorageQos>() { @Override public String getValue(StorageQos object) { - return object.getMaxThroughput() == null ? constants.UnlimitedStorageQos() + return object.getMaxThroughput() == null ? constants.unlimitedQos() : object.getMaxThroughput().toString(); } }; @@ -69,7 +69,7 @@ TextColumnWithTooltip<StorageQos> readThroughputColumn = new TextColumnWithTooltip<StorageQos>() { @Override public String getValue(StorageQos object) { - return object.getMaxReadThroughput() == null ? constants.UnlimitedStorageQos() + return object.getMaxReadThroughput() == null ? constants.unlimitedQos() : object.getMaxReadThroughput().toString(); } }; @@ -79,7 +79,7 @@ TextColumnWithTooltip<StorageQos> writeThroughputColumn = new TextColumnWithTooltip<StorageQos>() { @Override public String getValue(StorageQos object) { - return object.getMaxWriteThroughput() == null ? constants.UnlimitedStorageQos() + return object.getMaxWriteThroughput() == null ? constants.unlimitedQos() : object.getMaxWriteThroughput().toString(); } }; @@ -89,7 +89,7 @@ TextColumnWithTooltip<StorageQos> iopsColumn = new TextColumnWithTooltip<StorageQos>() { @Override public String getValue(StorageQos object) { - return object.getMaxIops() == null ? constants.UnlimitedStorageQos() + return object.getMaxIops() == null ? constants.unlimitedQos() : object.getMaxIops().toString(); } }; @@ -99,7 +99,7 @@ TextColumnWithTooltip<StorageQos> readIopsColumn = new TextColumnWithTooltip<StorageQos>() { @Override public String getValue(StorageQos object) { - return object.getMaxReadIops() == null ? constants.UnlimitedStorageQos() + return object.getMaxReadIops() == null ? constants.unlimitedQos() : object.getMaxReadIops().toString(); } }; @@ -109,7 +109,7 @@ TextColumnWithTooltip<StorageQos> writeIopsColumn = new TextColumnWithTooltip<StorageQos>() { @Override public String getValue(StorageQos object) { - return object.getMaxWriteIops() == null ? constants.UnlimitedStorageQos() + return object.getMaxWriteIops() == null ? constants.unlimitedQos() : object.getMaxWriteIops().toString(); } }; diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/storage/DiskProfilesListModelTable.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/storage/DiskProfilesListModelTable.java index 7bf9ef8..3a2167a 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/storage/DiskProfilesListModelTable.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/storage/DiskProfilesListModelTable.java @@ -80,7 +80,7 @@ return object.getName(); } }; - getTable().addColumn(nameColumn, constants.diskProfileNameLabel(), "200px"); //$NON-NLS-1$ + getTable().addColumn(nameColumn, constants.profileNameLabel(), "200px"); //$NON-NLS-1$ nameColumn.makeSortable(); TextColumnWithTooltip<DiskProfile> descriptionColumn = @@ -90,15 +90,15 @@ return object.getDescription(); } }; - getTable().addColumn(descriptionColumn, constants.diskProfileDescriptionLabel(), "200px"); //$NON-NLS-1$ + getTable().addColumn(descriptionColumn, constants.profileDescriptionLabel(), "200px"); //$NON-NLS-1$ descriptionColumn.makeSortable(); TextColumnWithTooltip<DiskProfile> qosColumn = new TextColumnWithTooltip<DiskProfile>() { @Override public String getValue(DiskProfile object) { - String name = constants.UnlimitedStorageQos(); + String name = constants.unlimitedQos(); if (object.getQosId() != null) { - StorageQos storageQos = getModel().getStorageQos(object.getQosId()); + StorageQos storageQos = getModel().getQos(object.getQosId()); if (storageQos != null) { name = storageQos.getName(); } @@ -109,19 +109,19 @@ getTable().addColumn(qosColumn, constants.storageQosName(), "200px"); //$NON-NLS-1$ qosColumn.makeSortable(); - getTable().addActionButton(new WebAdminButtonDefinition<DiskProfile>(constants.newDiskProfile()) { + getTable().addActionButton(new WebAdminButtonDefinition<DiskProfile>(constants.newProfile()) { @Override protected UICommand resolveCommand() { return getModel().getNewCommand(); } }); - getTable().addActionButton(new WebAdminButtonDefinition<DiskProfile>(constants.editDiskProfile()) { + getTable().addActionButton(new WebAdminButtonDefinition<DiskProfile>(constants.editProfile()) { @Override protected UICommand resolveCommand() { return getModel().getEditCommand(); } }); - getTable().addActionButton(new WebAdminButtonDefinition<DiskProfile>(constants.removeDiskProfile()) { + getTable().addActionButton(new WebAdminButtonDefinition<DiskProfile>(constants.removeProfile()) { @Override protected UICommand resolveCommand() { return getModel().getRemoveCommand(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/uicommon/model/CpuProfilePermissionModelProvider.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/uicommon/model/CpuProfilePermissionModelProvider.java new file mode 100644 index 0000000..6996edf --- /dev/null +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/uicommon/model/CpuProfilePermissionModelProvider.java @@ -0,0 +1,63 @@ +package org.ovirt.engine.ui.webadmin.uicommon.model; + +import org.ovirt.engine.core.common.businessentities.Permissions; +import org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget; +import org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget; +import org.ovirt.engine.ui.common.presenter.popup.RolePermissionsRemoveConfirmationPopupPresenterWidget; +import org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider; +import org.ovirt.engine.ui.uicommonweb.UICommand; +import org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel; +import org.ovirt.engine.ui.uicommonweb.models.Model; +import org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel; +import org.ovirt.engine.ui.uicommonweb.models.profiles.CpuProfileListModel; +import org.ovirt.engine.ui.webadmin.section.main.presenter.popup.PermissionsPopupPresenterWidget; + +import com.google.gwt.event.shared.EventBus; +import com.google.inject.Inject; +import com.google.inject.Provider; + +public class CpuProfilePermissionModelProvider extends SearchableDetailTabModelProvider<Permissions, CpuProfileListModel, PermissionListModel> { + + private final Provider<PermissionsPopupPresenterWidget> popupProvider; + private final Provider<RolePermissionsRemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider; + + @Inject + public CpuProfilePermissionModelProvider(EventBus eventBus, + Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, + final Provider<PermissionsPopupPresenterWidget> popupProvider, + final Provider<RolePermissionsRemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider) { + super(eventBus, defaultConfirmPopupProvider, CpuProfileListModel.class, PermissionListModel.class); + this.popupProvider = popupProvider; + this.removeConfirmPopupProvider = removeConfirmPopupProvider; + } + + @Override + public PermissionListModel getModel() { + return getCommonModel().getClusterList().getCpuProfileListModel().getPermissionListModel(); + } + + @Override + protected CpuProfileListModel getMainModel() { + return getCommonModel().getClusterList().getCpuProfileListModel(); + } + + @Override + public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(PermissionListModel source, + UICommand lastExecutedCommand, Model windowModel) { + if (lastExecutedCommand.equals(getModel().getAddCommand())) { + return popupProvider.get(); + } else { + return super.getModelPopup(source, lastExecutedCommand, windowModel); + } + } + + @Override + public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(PermissionListModel source, + UICommand lastExecutedCommand) { + if (lastExecutedCommand.equals(getModel().getRemoveCommand())) { + return removeConfirmPopupProvider.get(); + } else { + return super.getConfirmModelPopup(source, lastExecutedCommand); + } + } +} -- To view, visit http://gerrit.ovirt.org/31837 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c51fa8559f9538bb29b41d1d1b24fdfdabc8cb1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches