Noam Slomianko has uploaded a new change for review. Change subject: webadmin: add comment field to storage pool ......................................................................
webadmin: add comment field to storage pool Part of the adding a comment field to many parts of the system - Add column in the data base - change dao - add comment to storage_pool - add comment to Model & ModelList - reflect changes in the UI Change-Id: I68ffb2f281cb5d6f39ab79259f34fa0b71910a50 Bug-Url: https://bugzilla.redhat.com/610501 Signed-off-by: Noam Slomianko <[email protected]> --- M backend/manager/dbscripts/storages_sp.sql M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage_pool.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/ConfigureLocalStorageModel.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/section/main/view/popup/datacenter/DataCenterPopupView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.ui.xml M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabDataCenterView.java 11 files changed, 68 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/13675/1 diff --git a/backend/manager/dbscripts/storages_sp.sql b/backend/manager/dbscripts/storages_sp.sql index 3952922..c1e93f9 100644 --- a/backend/manager/dbscripts/storages_sp.sql +++ b/backend/manager/dbscripts/storages_sp.sql @@ -11,12 +11,13 @@ v_master_domain_version INTEGER, v_spm_vds_id UUID , v_compatibility_version VARCHAR(40), - v_quota_enforcement_type INTEGER) + v_quota_enforcement_type INTEGER, + v_comment VARCHAR(4000)) RETURNS VOID AS $procedure$ BEGIN -INSERT INTO storage_pool(description, id, name, storage_pool_type,status,master_domain_version,spm_vds_id,compatibility_version,quota_enforcement_type) - VALUES(v_description, v_id, v_name, v_storage_pool_type,v_status,v_master_domain_version,v_spm_vds_id,v_compatibility_version,v_quota_enforcement_type); +INSERT INTO storage_pool(description, id, name, storage_pool_type,status,master_domain_version,spm_vds_id,compatibility_version,quota_enforcement_type,comment) + VALUES(v_description, v_id, v_name, v_storage_pool_type,v_status,v_master_domain_version,v_spm_vds_id,v_compatibility_version,v_quota_enforcement_type,v_comment); END; $procedure$ LANGUAGE plpgsql; @@ -33,7 +34,8 @@ v_master_domain_version INTEGER, v_spm_vds_id UUID , v_compatibility_version VARCHAR(40), - v_quota_enforcement_type INTEGER) + v_quota_enforcement_type INTEGER, + v_comment VARCHAR(4000)) RETURNS VOID --The [storage_pool] table doesn't have a timestamp column. Optimistic concurrency logic cannot be generated @@ -43,7 +45,8 @@ SET description = v_description,name = v_name,storage_pool_type = v_storage_pool_type, status = v_status,storage_pool_format_type = v_storage_pool_format_type,master_domain_version = v_master_domain_version, spm_vds_id = v_spm_vds_id,compatibility_version = v_compatibility_version, - _update_date = LOCALTIMESTAMP,quota_enforcement_type=v_quota_enforcement_type + _update_date = LOCALTIMESTAMP,quota_enforcement_type=v_quota_enforcement_type, + comment = v_comment WHERE id = v_id; END; $procedure$ LANGUAGE plpgsql; @@ -54,7 +57,8 @@ v_storage_pool_type INTEGER, v_storage_pool_format_type VARCHAR(50), v_compatibility_version VARCHAR(40), - v_quota_enforcement_type INTEGER) + v_quota_enforcement_type INTEGER, + v_comment VARCHAR(4000)) RETURNS VOID --The [storage_pool] table doesn't have a timestamp column. Optimistic concurrency logic cannot be generated @@ -63,7 +67,8 @@ UPDATE storage_pool SET description = v_description,name = v_name,storage_pool_type = v_storage_pool_type, storage_pool_format_type = v_storage_pool_format_type,compatibility_version = v_compatibility_version, - _update_date = LOCALTIMESTAMP,quota_enforcement_type = v_quota_enforcement_type + _update_date = LOCALTIMESTAMP,quota_enforcement_type = v_quota_enforcement_type, + comment = v_comment WHERE id = v_id; END; $procedure$ LANGUAGE plpgsql; diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage_pool.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage_pool.java index 9db4f3f..6f92a7b 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage_pool.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage_pool.java @@ -48,8 +48,11 @@ private QuotaEnforcementTypeEnum quotaEnforcementType = QuotaEnforcementTypeEnum.DISABLED; + private String comment; + public storage_pool() { description = ""; + comment = ""; masterDomainVersion = 0; } @@ -73,6 +76,14 @@ this.description = value; } + public String getComment(){ + return comment; + } + + public void setComment(String value){ + comment = value; + } + @Override public Guid getId() { return this.id; diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java index f8b7d0a..6e8ff78 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java @@ -43,6 +43,7 @@ .getString("compatibility_version"))); entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type"))); entity.setStoragePoolFormatType(getStorageFormatTypeForPool(rs)); + entity.setComment(rs.getString("comment")); return entity; } } @@ -140,7 +141,8 @@ .addValue("spm_vds_id", pool.getspm_vds_id()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType()) .addValue("compatibility_version", - pool.getcompatibility_version()); + pool.getcompatibility_version()) + .addValue("comment", pool.getComment()); getCallsHandler().executeModification("Insertstorage_pool", parameterSource); @@ -161,7 +163,8 @@ .addValue("compatibility_version", pool.getcompatibility_version()) .addValue("quota_enforcement_type", - pool.getQuotaEnforcementType().getValue()); + pool.getQuotaEnforcementType().getValue()) + .addValue("comment", pool.getComment()); getCallsHandler().executeModification("Updatestorage_pool", parameterSource); } @@ -177,7 +180,8 @@ .addValue("compatibility_version", pool.getcompatibility_version()) .addValue("quota_enforcement_type", - pool.getQuotaEnforcementType().getValue()); + pool.getQuotaEnforcementType().getValue()) + .addValue("comment", pool.getComment()); getCallsHandler().executeModification("Updatestorage_pool_partial", parameterSource); } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java index 6db6e58..7c81f8f 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java @@ -249,6 +249,7 @@ obj.setrecovery_mode(instance.getrecovery_mode()); obj.setspm_vds_id(instance.getspm_vds_id()); obj.setcompatibility_version(instance.getcompatibility_version()); + obj.setComment(instance.getComment()); return obj; } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java index def4da1..6683ae9 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java @@ -316,6 +316,7 @@ } model.getDescription().setEntity(dataCenter.getdescription()); + model.getComment().setEntity(dataCenter.getComment()); model.setOriginalName(dataCenter.getname()); AsyncDataProvider.GetStorageDomainList(new AsyncQuery(this, @@ -703,6 +704,7 @@ // Save changes. dataCenter.setname((String) model.getName().getEntity()); dataCenter.setdescription((String) model.getDescription().getEntity()); + dataCenter.setComment((String) model.getComment().getEntity()); dataCenter.setstorage_pool_type((StorageType) model.getStorageTypeList().getSelectedItem()); dataCenter.setcompatibility_version((Version) model.getVersion().getSelectedItem()); dataCenter.setQuotaEnforcementType((QuotaEnforcementTypeEnum) model.getQuotaEnforceTypeListModel() diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java index 51ab9da..96c1b00 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java @@ -144,10 +144,21 @@ this.quotaEnforceTypeListModel = quotaEnforceTypeListModel; } + private EntityModel comment; + + public EntityModel getComment() { + return comment; + } + + public void setComment(EntityModel value) { + comment = value; + } + public DataCenterModel() { setName(new EntityModel()); setDescription(new EntityModel()); + setComment(new EntityModel()); setVersion(new ListModel()); setStorageTypeList(new ListModel()); @@ -295,6 +306,8 @@ getDescription().ValidateEntity(new IValidation[] { new AsciiOrNoneValidation() }); + getComment().ValidateEntity(new IValidation[] { new AsciiOrNoneValidation() }); + // TODO: add this code to async validate. // string name = (string)Name.Entity; // if (String.Compare(name, OriginalName, true) != 0 && !DataProvider.IsDataCenterNameUnique(name)) diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/ConfigureLocalStorageModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/ConfigureLocalStorageModel.java index 297507b..4037e89 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/ConfigureLocalStorageModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/ConfigureLocalStorageModel.java @@ -267,6 +267,7 @@ getDataCenter().setDataCenterId(candidate.getId()); getDataCenter().getName().setEntity(candidate.getname()); getDataCenter().getDescription().setEntity(candidate.getdescription()); + getDataCenter().getComment().setEntity(candidate.getComment()); Version version = candidate.getcompatibility_version(); getDataCenter().getVersion().setSelectedItem(version); 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 f7d54a5..ee07275 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 @@ -157,6 +157,9 @@ @DefaultStringValue("Description") String descriptionLabel(); + @DefaultStringValue("Comment") + String commentLabel(); + @DefaultStringValue("VM network") String vmNetworkLabel(); @@ -921,6 +924,9 @@ @DefaultStringValue("Description") String descriptionDc(); + @DefaultStringValue("Comment") + String commentDc(); + // Storage DC @DefaultStringValue("Domain Status in Data-Center") String domainStatusInDcStorageDc(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.java index 020be25..04fb5e1 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.java @@ -46,6 +46,11 @@ @WithElementId EntityModelTextBoxEditor descriptionEditor; + @UiField + @Path(value = "comment.entity") + @WithElementId + EntityModelTextBoxEditor commentEditor; + @UiField(provided = true) @Path(value = "storageTypeList.selectedItem") @WithElementId @@ -92,6 +97,7 @@ void localize(ApplicationConstants constants) { nameEditor.setLabel(constants.nameLabel()); descriptionEditor.setLabel(constants.descriptionLabel()); + commentEditor.setLabel(constants.commentLabel()); storageTypeListEditor.setLabel(constants.dataCenterPopupStorageTypeLabel()); versionEditor.setLabel(constants.dataCenterPopupVersionLabel()); quotaEnforceTypeEditor.setLabel(constants.dataCenterPopupQuotaEnforceTypeLabel()); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.ui.xml b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.ui.xml index dd851a8..11d430e 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.ui.xml +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/datacenter/DataCenterPopupView.ui.xml @@ -13,6 +13,7 @@ <g:FlowPanel> <e:EntityModelTextBoxEditor ui:field="nameEditor" /> <e:EntityModelTextBoxEditor ui:field="descriptionEditor" /> + <e:EntityModelTextBoxEditor ui:field="commentEditor" /> <e:ListModelListBoxEditor ui:field="storageTypeListEditor" /> <e:ListModelListBoxEditor ui:field="versionEditor" /> <e:ListModelListBoxEditor ui:field="quotaEnforceTypeEditor" /> diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabDataCenterView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabDataCenterView.java index d5d221a..af8a8a1 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabDataCenterView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabDataCenterView.java @@ -87,6 +87,14 @@ }; getTable().addColumn(descColumn, constants.descriptionDc(), "300px"); //$NON-NLS-1$ + TextColumnWithTooltip<storage_pool> comColumn = new TextColumnWithTooltip<storage_pool>() { + @Override + public String getValue(storage_pool object) { + return object.getComment(); + } + }; + getTable().addColumn(comColumn, constants.commentDc(), "300px"); //$NON-NLS-1$ + getTable().addActionButton(new WebAdminButtonDefinition<storage_pool>(constants.newDC()) { @Override protected UICommand resolveCommand() { -- To view, visit http://gerrit.ovirt.org/13675 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68ffb2f281cb5d6f39ab79259f34fa0b71910a50 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Noam Slomianko <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
