Daniel Erez has uploaded a new change for review.

Change subject: webadmin: Remove deprecated CopyTemplate logic
......................................................................

webadmin: Remove deprecated CopyTemplate logic

CopyTemplate is deprecated since MSD (multiple storage domains),
hence its logic is no longer needed in the UI.

Change-Id: I481ee7bd0c81d8d72d8bc4b6c2a09f22d4d6867a
Signed-off-by: Daniel Erez <de...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/TemplateModule.java
2 files changed, 0 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/13907/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
index ccc1769..84e587c 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
@@ -11,7 +11,6 @@
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.action.VdcReturnValueBase;
 import org.ovirt.engine.core.common.action.VmTemplateParametersBase;
-import org.ovirt.engine.core.common.businessentities.DiskImage;
 import org.ovirt.engine.core.common.businessentities.DisplayType;
 import org.ovirt.engine.core.common.businessentities.MigrationSupport;
 import org.ovirt.engine.core.common.businessentities.Quota;
@@ -92,38 +91,6 @@
         privateExportCommand = value;
     }
 
-    private UICommand privateCopyCommand;
-
-    public UICommand getCopyCommand()
-    {
-        return privateCopyCommand;
-    }
-
-    private void setCopyCommand(UICommand value)
-    {
-        privateCopyCommand = value;
-    }
-
-    // get { return SelectedItems == null ? new object[0] : 
SelectedItems.Cast<VmTemplate>().Select(a =>
-    // a.vmt_guid).Cast<object>().ToArray(); }
-    protected Object[] getSelectedKeys()
-    {
-        if (getSelectedItems() == null)
-        {
-            return new Object[0];
-        }
-        else
-        {
-            ArrayList<Guid> items = new ArrayList<Guid>();
-            for (Object item : getSelectedItems())
-            {
-                VmTemplate a = (VmTemplate) item;
-                items.add(a.getId());
-            }
-            return items.toArray(new Guid[] {});
-        }
-    }
-
     private SystemTreeItemModel systemTreeSelectedItem;
 
     @Override
@@ -153,42 +120,11 @@
         setEditCommand(new UICommand("Edit", this)); //$NON-NLS-1$
         setRemoveCommand(new UICommand("Remove", this)); //$NON-NLS-1$
         setExportCommand(new UICommand("Export", this)); //$NON-NLS-1$
-        setCopyCommand(new UICommand("Copy", this)); //$NON-NLS-1$
 
         UpdateActionAvailability();
 
         getSearchNextPageCommand().setIsAvailable(true);
         getSearchPreviousPageCommand().setIsAvailable(true);
-    }
-
-    private void Copy()
-    {
-        VmTemplate template = (VmTemplate) getSelectedItem();
-
-        if (getWindow() != null)
-        {
-            return;
-        }
-
-        CopyDiskModel model = new CopyDiskModel();
-        setWindow(model);
-        
model.setTitle(ConstantsManager.getInstance().getConstants().copyTemplateTitle());
-        model.setHashName("copy_template"); //$NON-NLS-1$
-        model.setIsVolumeFormatAvailable(false);
-        model.setEntity(this);
-
-        model.StartProgress(null);
-
-        AsyncDataProvider.GetTemplateDiskList(new AsyncQuery(this, new 
INewAsyncCallback() {
-            @Override
-            public void OnSuccess(Object target, Object returnValue) {
-                TemplateListModel templateListModel = (TemplateListModel) 
target;
-                CopyDiskModel copyDiskModel = (CopyDiskModel) 
templateListModel.getWindow();
-                ArrayList<DiskImage> diskImages = (ArrayList<DiskImage>) 
returnValue;
-
-                copyDiskModel.init(diskImages);
-            }
-        }), template.getId());
     }
 
     @Override
@@ -667,17 +603,6 @@
                     .blankTemplateCannotBeExported());
             getExportCommand().setIsExecutionAllowed(false);
         }
-
-        getCopyCommand().setIsExecutionAllowed(items.size() == 1 && item != 
null
-                && VdcActionUtils.CanExecute(items, VmTemplate.class, 
VdcActionType.MoveOrCopyTemplate));
-
-        if (getCopyCommand().getIsExecutionAllowed() && blankSelected)
-        {
-            
getCopyCommand().getExecuteProhibitionReasons().add(ConstantsManager.getInstance()
-                    .getConstants()
-                    .blankTemplateCannotBeCopied());
-            getCopyCommand().setIsExecutionAllowed(false);
-        }
     }
 
     /**
@@ -719,10 +644,6 @@
         else if (command == getRemoveCommand())
         {
             remove();
-        }
-        else if (command == getCopyCommand())
-        {
-            Copy();
         }
         else if (command == getExportCommand())
         {
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/TemplateModule.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/TemplateModule.java
index 4e9412c..33f4547 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/TemplateModule.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/TemplateModule.java
@@ -48,7 +48,6 @@
     public MainModelProvider<VmTemplate, TemplateListModel> 
getTemplateListProvider(ClientGinjector ginjector,
             final Provider<TemplateNewPresenterWidget> popupProvider,
             final Provider<VmExportPopupPresenterWidget> exportPopupProvider,
-            final Provider<DisksAllocationPopupPresenterWidget> 
copyPopupProvider,
             final Provider<RemoveConfirmationPopupPresenterWidget> 
removeConfirmPopupProvider) {
         return new MainTabModelProvider<VmTemplate, 
TemplateListModel>(ginjector, TemplateListModel.class) {
             @Override
@@ -60,8 +59,6 @@
                     return popupProvider.get();
                 } else if (lastExecutedCommand == 
getModel().getExportCommand()) {
                     return exportPopupProvider.get();
-                } else if (lastExecutedCommand == getModel().getCopyCommand()) 
{
-                    return copyPopupProvider.get();
                 } else {
                     return super.getModelPopup(source, lastExecutedCommand, 
windowModel);
                 }


--
To view, visit http://gerrit.ovirt.org/13907
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I481ee7bd0c81d8d72d8bc4b6c2a09f22d4d6867a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <de...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to