Martin Betak has uploaded a new change for review. Change subject: engine: Remove GetTimeZonesQuery usages ......................................................................
engine: Remove GetTimeZonesQuery usages Removed last usages of the no loger existing GetTimeZonesQuery in fronted and replaced with usage of the new TimeZoneType enum. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1011547 Change-Id: I575460833def554cfe5c8b6e4ec4a08c09167bb8 Signed-off-by: Martin Betak <mbe...@redhat.com> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.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/models/vms/CloudInitModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java 4 files changed, 10 insertions(+), 37 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/96/19596/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java index a276f95..a7af96f 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java @@ -147,7 +147,6 @@ // Configuration values GetConfigurationValue(VdcQueryAuthType.User), GetConfigurationValues(VdcQueryAuthType.User), - GetTimeZones(VdcQueryAuthType.User), GetDefaultTimeZone(VdcQueryAuthType.User), GetAvailableStoragePoolVersions(VdcQueryAuthType.User), GetAvailableClusterVersionsByStoragePool, 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 d037005..97abd55 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 @@ -372,23 +372,6 @@ Frontend.RunQuery(VdcQueryType.GetVmByVmId, new IdQueryParameters(vmId), aQuery); } - public static void getTimeZoneList(AsyncQuery aQuery, TimeZoneType timeZoneType) { - aQuery.converterCallback = new IAsyncConverter() { - @Override - public Object Convert(Object source, AsyncQuery _asyncQuery) - { - if (source == null) - { - return new HashMap<String, String>(); - } - return source; - } - }; - TimeZoneQueryParams params = new TimeZoneQueryParams(); - params.setTimeZoneType(timeZoneType); - Frontend.RunQuery(VdcQueryType.GetTimeZones, params, aQuery); - } - public static void getDataCenterList(AsyncQuery aQuery) { aQuery.converterCallback = new IAsyncConverter() { @Override diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/CloudInitModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/CloudInitModel.java index b215c0f..1284868 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/CloudInitModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/CloudInitModel.java @@ -16,12 +16,9 @@ import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface; import org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol; -import org.ovirt.engine.ui.frontend.AsyncQuery; -import org.ovirt.engine.ui.frontend.INewAsyncCallback; import org.ovirt.engine.ui.uicommonweb.Linq; import org.ovirt.engine.ui.uicommonweb.Linq.IPredicate; import org.ovirt.engine.ui.uicommonweb.UICommand; -import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider; import org.ovirt.engine.ui.uicommonweb.models.EntityModel; import org.ovirt.engine.ui.uicommonweb.models.ListModel; import org.ovirt.engine.ui.uicommonweb.models.Model; @@ -378,22 +375,16 @@ getNetworkEnabled().setEntity(false); getAttachmentEnabled().setEntity(false); - AsyncDataProvider.getTimeZoneList(new AsyncQuery(this, new INewAsyncCallback() { - @Override - public void onSuccess(Object model, Object returnValue) { - @SuppressWarnings("unchecked") - Map<String, String> timezones = (Map<String, String>) returnValue; - getTimeZoneList().setItems(timezones.entrySet()); + Map<String, String> timezones = TimeZoneType.GENERAL_TIMEZONE.getTimeZoneList(); + getTimeZoneList().setItems(timezones.entrySet()); - getTimeZoneList().setSelectedItem(Linq.firstOrDefault(timezones.entrySet(), - new IPredicate<Map.Entry<String, String>>() { - @Override - public boolean match(Map.Entry<String, String> item) { - return item.getValue().startsWith("(GMT) Greenwich"); //$NON-NLS-1$ - } - })); - } - }), TimeZoneType.GENERAL_TIMEZONE); + getTimeZoneList().setSelectedItem(Linq.firstOrDefault(timezones.entrySet(), + new IPredicate<Map.Entry<String, String>>() { + @Override + public boolean match(Map.Entry<String, String> item) { + return item.getValue().startsWith("(GMT) Greenwich"); //$NON-NLS-1$ + } + })); getAttachmentType().setItems(attachmentTypes.entrySet()); getAttachmentType().setSelectedItem(Linq.firstOrDefault(attachmentTypes.entrySet())); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java index 8124329..0942fab 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java @@ -1130,7 +1130,7 @@ Frontend.getQueryCompleteEvent().addListener(this); Frontend.Subscribe(new VdcQueryType[] { VdcQueryType.GetStorageDomainsByStoragePoolId, - VdcQueryType.GetImagesListByStoragePoolId, VdcQueryType.GetTimeZones, + VdcQueryType.GetImagesListByStoragePoolId, VdcQueryType.GetDefaultTimeZone, VdcQueryType.GetStoragePoolsByClusterService, VdcQueryType.GetDomainList, VdcQueryType.GetConfigurationValue, VdcQueryType.GetVdsGroupsByStoragePoolId, VdcQueryType.GetVmTemplatesByStoragePoolId, -- To view, visit http://gerrit.ovirt.org/19596 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I575460833def554cfe5c8b6e4ec4a08c09167bb8 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Betak <mbe...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches