anmolbabu has uploaded a new change for review.

Change subject: webadmin : GeoRep Config popup view
......................................................................

webadmin : GeoRep Config popup view

Change-Id: I150946fe016d85cb378ed3d548eab5581321fbfe
Signed-off-by: Anmol Babu <[email protected]>
---
A 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/GlusterConfigAwareCell.java
A 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/GlusterConfigAwareColumn.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/UICommand.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/help/HelpTag.java
A 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeGeoReplicationSessionConfigModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.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/PresenterModule.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/VolumeModule.java
A 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.java
A 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.java
A 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.ui.xml
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java
14 files changed, 635 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/39686/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/GlusterConfigAwareCell.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/GlusterConfigAwareCell.java
new file mode 100644
index 0000000..1f39dfe
--- /dev/null
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/GlusterConfigAwareCell.java
@@ -0,0 +1,87 @@
+package org.ovirt.engine.ui.common.widget.table.cell;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration;
+import org.ovirt.engine.ui.common.widget.table.column.EventHandlingCell;
+import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
+
+import com.google.gwt.cell.client.AbstractCell;
+import com.google.gwt.cell.client.SelectionCell;
+import com.google.gwt.cell.client.TextInputCell;
+import com.google.gwt.cell.client.ValueUpdater;
+import com.google.gwt.dom.client.BrowserEvents;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.NativeEvent;
+import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
+import com.google.gwt.view.client.CellPreviewEvent;
+
+public class GlusterConfigAwareCell extends 
AbstractCell<GlusterGeoRepSessionConfiguration> implements EventHandlingCell {
+
+    private SelectionCell delegate;
+    private TextInputCell textInputCell;
+
+    public GlusterConfigAwareCell() {
+        super(BrowserEvents.CHANGE);
+        delegate = new SelectionCell(new ArrayList<String>());
+        textInputCell = new TextInputCell();
+    }
+
+    private void setOptions(List<String> allowedValues) {
+        delegate = new SelectionCell(allowedValues);
+    }
+
+    @Override
+    public boolean handlesEvent(CellPreviewEvent<EntityModel> event) {
+        return BrowserEvents.CLICK.equals(event.getNativeEvent().getType());
+    }
+
+    @Override
+    public void onBrowserEvent(Context context, Element parent, final 
GlusterGeoRepSessionConfiguration configInRow, NativeEvent event, 
ValueUpdater<GlusterGeoRepSessionConfiguration> valueUpdater) {
+        List<String> allowedValuesList = configInRow.getAllowedValues();
+        boolean isValuesConstrained =
+                isValueConstrained(allowedValuesList);
+        if (isValuesConstrained) {
+            delegate.onBrowserEvent(context, parent, configInRow.getValue(), 
event, new ValueUpdater<String>() {
+                @Override
+                public void update(String value) {
+                    if (value != null) {
+                        configInRow.setValue(value);
+                    }
+                }
+            });
+        } else {
+            textInputCell.onBrowserEvent(context, parent, 
configInRow.getValue(), event, new ValueUpdater<String>() {
+                @Override
+                public void update(String value) {
+                    if (value != null) {
+                        configInRow.setValue(value);
+                    }
+
+                }
+            });
+        }
+
+    }
+
+    private boolean isValueConstrained(List<String> allowedValuesList) {
+        return allowedValuesList != null && !allowedValuesList.isEmpty()
+                && !(allowedValuesList.size() == 1 && 
allowedValuesList.get(0).isEmpty());
+    }
+
+    @Override
+    public void render(Context context, GlusterGeoRepSessionConfiguration 
value, SafeHtmlBuilder sb) {
+        List<String> allowedValues = value.getAllowedValues();
+        boolean isValuesConstrained = isValueConstrained(allowedValues);
+        SafeHtmlBuilder sbDelegate = new SafeHtmlBuilder();
+        if (isValuesConstrained) {
+            setOptions(allowedValues);
+            delegate.render(context, value.getDefaultValue(), sbDelegate);
+        } else {
+            textInputCell.render(context, value.getDefaultValue(), sbDelegate);
+        }
+        sb.append(sbDelegate.toSafeHtml());
+    }
+
+}
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/GlusterConfigAwareColumn.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/GlusterConfigAwareColumn.java
new file mode 100644
index 0000000..07b4656
--- /dev/null
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/GlusterConfigAwareColumn.java
@@ -0,0 +1,20 @@
+package org.ovirt.engine.ui.common.widget.table.column;
+
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration;
+import org.ovirt.engine.core.common.utils.Pair;
+import org.ovirt.engine.ui.common.widget.table.cell.GlusterConfigAwareCell;
+import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
+
+import com.google.gwt.user.cellview.client.Column;
+
+public class GlusterConfigAwareColumn extends Column<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>, GlusterGeoRepSessionConfiguration> {
+
+    public GlusterConfigAwareColumn() {
+        super(new GlusterConfigAwareCell());
+    }
+
+    @Override
+    public GlusterGeoRepSessionConfiguration 
getValue(EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> object) {
+        return object.getEntity().getSecond();
+    }
+}
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/UICommand.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/UICommand.java
index 7a25edb..3c9b9ef 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/UICommand.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/UICommand.java
@@ -3,6 +3,7 @@
 import java.util.List;
 
 import org.ovirt.engine.ui.uicommonweb.models.Model;
+import org.ovirt.engine.ui.uicompat.ConstantsManager;
 import org.ovirt.engine.ui.uicompat.ICommand;
 import org.ovirt.engine.ui.uicompat.ObservableCollection;
 import org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs;
@@ -24,6 +25,31 @@
         return isExecutionAllowed;
     }
 
+    public static UICommand createDefaultOkUiCommand(String name, 
ICommandTarget target) {
+        UICommand command = createOkUiCommand(name, target);
+        command.setIsDefault(true);
+        return command;
+    }
+
+    public static UICommand createOkUiCommand(String name, ICommandTarget 
target) {
+        UICommand command = new UICommand(name, target);
+        command.setTitle(ConstantsManager.getInstance().getConstants().ok());
+        return command;
+    }
+
+    public static UICommand createCancelUiCommand(String name, ICommandTarget 
target) {
+        UICommand command = new UICommand(name, target);
+        
command.setTitle(ConstantsManager.getInstance().getConstants().cancel());
+        command.setIsCancel(true);
+        return command;
+    }
+
+    public static UICommand createDefaultCancelUiCommand(String name, 
ICommandTarget target) {
+        UICommand result = createCancelUiCommand(name, target);
+        result.setIsDefault(true);
+        return result;
+    }
+
     /*
      * Call this method after adding execute prohibition reasons.
      */
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 8c249ae..7839ff7 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
@@ -486,6 +486,10 @@
 
     volume_geo_rep_resume_confirmation("volume_geo_rep_resume_confirmation", 
HelpTagType.WEBADMIN, "[gluster] Volumes main tab -> Geo-Replication sub-tab -> 
'Resume' dialog"), //$NON-NLS-1$ //$NON-NLS-2$
 
+    
volume_geo_rep_configuration_display("volume_geo_rep_configuration_display", 
HelpTagType.WEBADMIN, "[gluster] Volumes main tab -> Geo-Replication sub-tab -> 
'Options' dialog"), //$NON-NLS-1$ //$NON-NLS-2$
+
+    
volume_geo_rep_config_multiple_action_error_display("volume_geo_rep_config_multiple_action_error_display",
 HelpTagType.WEBADMIN, "[gluster] Volumes main tab -> Geo-Replication sub-tab 
-> Options -> 'Set/Reset' error dialog"), //$NON-NLS-1$ //$NON-NLS-2$
+
     new_role("new_role", HelpTagType.WEBADMIN), //$NON-NLS-1$
 
     edit_role("edit_role", HelpTagType.WEBADMIN), //$NON-NLS-1$
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeGeoReplicationSessionConfigModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeGeoReplicationSessionConfigModel.java
new file mode 100644
index 0000000..55154eb
--- /dev/null
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterVolumeGeoReplicationSessionConfigModel.java
@@ -0,0 +1,87 @@
+package org.ovirt.engine.ui.uicommonweb.models.gluster;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionConfigParameters;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration;
+import org.ovirt.engine.core.common.utils.Pair;
+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;
+
+public class GlusterVolumeGeoReplicationSessionConfigModel extends Model {
+
+    private ListModel<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>> configsModel;
+
+    private LinkedHashMap<String, String> configsMap;
+
+    private GlusterGeoRepSession geoRepSession;
+
+    private UICommand updateConfigsCommand;
+    private UICommand cancelCommand;
+
+    public GlusterVolumeGeoReplicationSessionConfigModel(GlusterGeoRepSession 
selectedGeoRepSession) {
+        configsModel = new ListModel<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>>();
+        configsMap = new LinkedHashMap<String, String>();
+        this.geoRepSession = selectedGeoRepSession;
+    }
+
+    public ListModel<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>> getConfigsModel() {
+        return configsModel;
+    }
+
+    public void setConfigsModel(ListModel<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>> configsModel) {
+        this.configsModel = configsModel;
+    }
+
+    public LinkedHashMap<String, String> getConfigs() {
+        return configsMap;
+    }
+
+    public UICommand getUpdateConfigsCommand() {
+        return updateConfigsCommand;
+    }
+
+    public void addUpdateConfigsCommand(UICommand setCommand) {
+        this.updateConfigsCommand = setCommand;
+        this.getCommands().add(setCommand);
+    }
+
+    @Override
+    public UICommand getCancelCommand() {
+        return cancelCommand;
+    }
+
+    public void addCancelCommand(UICommand cancelCommand) {
+        this.cancelCommand = cancelCommand;
+        this.getCommands().add(cancelCommand);
+    }
+
+    public void copyConfigsToMap(List<GlusterGeoRepSessionConfiguration> 
configsTocopy) {
+        for (GlusterGeoRepSessionConfiguration currentConfig : configsTocopy) {
+            configsMap.put(currentConfig.getKey(), currentConfig.getValue());
+        }
+    }
+
+    public GlusterGeoRepSession getGeoRepSession() {
+        return geoRepSession;
+    }
+
+    public void setGeoRepSession(GlusterGeoRepSession geoRepSession) {
+        this.geoRepSession = geoRepSession;
+    }
+
+    public GlusterVolumeGeoRepSessionConfigParameters 
formGeoRepConfigParameters(GlusterGeoRepSessionConfiguration sessionConfig) {
+        return new 
GlusterVolumeGeoRepSessionConfigParameters(getGeoRepSession().getMasterVolumeId(),
+                getGeoRepSession().getId(),
+                sessionConfig.getKey(),
+                sessionConfig.getValue());
+    }
+
+    public void updateCommandExecutabilities(boolean isExecutionAllowed) {
+        updateConfigsCommand.setIsExecutionAllowed(isExecutionAllowed);
+    }
+}
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java
index 67e318d..d0e65eb 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeGeoRepListModel.java
@@ -1,9 +1,17 @@
 package org.ovirt.engine.ui.uicommonweb.models.gluster;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.List;
 
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration;
+import org.ovirt.engine.core.common.queries.IdQueryParameters;
+import org.ovirt.engine.core.common.queries.VdcQueryReturnValue;
+import org.ovirt.engine.core.common.queries.VdcQueryType;
+import org.ovirt.engine.core.common.utils.Pair;
+import org.ovirt.engine.core.common.action.VdcActionParametersBase;
 import org.ovirt.engine.core.common.action.VdcActionType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters;
 import org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters;
@@ -17,6 +25,7 @@
 import org.ovirt.engine.ui.uicommonweb.UICommand;
 import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider;
 import org.ovirt.engine.ui.uicommonweb.help.HelpTag;
+import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
 import org.ovirt.engine.ui.uicommonweb.models.SearchableListModel;
 import org.ovirt.engine.ui.uicompat.ConstantsManager;
 import org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult;
@@ -181,6 +190,7 @@
         boolean allowStopSessionCommand = false;
         boolean allowResumeSessionCommand = false;
         boolean allowPauseSessionCommand = false;
+        boolean allowSessionOptionsCommand = false;
         if(volumeEntity == null) {
             return;
         }
@@ -193,6 +203,7 @@
             allowResumeSessionCommand = sessionStatus == 
GeoRepSessionStatus.PAUSED;
             allowPauseSessionCommand =
                     sessionStatus == GeoRepSessionStatus.ACTIVE || 
sessionStatus == GeoRepSessionStatus.INITIALIZING;
+            allowSessionOptionsCommand = true;
         }
         getNewSessionCommand().setIsAvailable(true);
         getRemoveSessionCommand().setIsAvailable(false);
@@ -200,7 +211,7 @@
         getStopSessionCommand().setIsExecutionAllowed(allowStopSessionCommand);
         
getPauseSessionCommand().setIsExecutionAllowed(allowPauseSessionCommand);
         
getResumeSessionCommand().setIsExecutionAllowed(allowResumeSessionCommand);
-        getSessionOptionsCommand().setIsExecutionAllowed(true);
+        
getSessionOptionsCommand().setIsExecutionAllowed(allowSessionOptionsCommand);
         getViewSessionDetailsCommand().setIsAvailable(false);
         getRefreshSessionsCommand().setIsAvailable(true);
     }
@@ -219,7 +230,7 @@
         } else if(command.equals(getResumeSessionCommand())) {
             resumeGeoRepSession();
         } else if(command.equals(getSessionOptionsCommand())) {
-
+            showSessionOptions();
         } else if(command.equals(getViewSessionDetailsCommand())) {
 
         } else if (command.equals(getRefreshSessionsCommand())) {
@@ -232,10 +243,122 @@
             
onGeoRepSessionAction(VdcActionType.PauseGlusterVolumeGeoRepSession);
         } else if 
(command.getName().equalsIgnoreCase("onResumeGeoRepSession")) {//$NON-NLS-1$
             onGeoRepSessionAction(VdcActionType.ResumeGeoRepSession);
+        } else if (command.getName().equalsIgnoreCase("ok")) {//$NON-NLS-1$
+            updateConfig();
         } else if (command.getName().equalsIgnoreCase("closeWindow")) 
{//$NON-NLS-1$
             closeWindow();
+        } else if (command.getName().equalsIgnoreCase("closeConfirmWindow")) 
{//$NON-NLS-1$
+            closeConfirmWindow();
         }
     }
+    private void closeConfirmWindow() {
+        setConfirmWindow(null);
+    }
+
+    private void showSessionOptions() {
+        if (getWindow() != null) {
+            return;
+        }
+        GlusterGeoRepSession selectedGeoRepSession = (GlusterGeoRepSession) 
getSelectedItem();
+        GlusterVolumeGeoReplicationSessionConfigModel configModel = new 
GlusterVolumeGeoReplicationSessionConfigModel(selectedGeoRepSession);
+        configModel.setTitle(constants.geoReplicationOptions());
+        
configModel.setHashName("volume_geo_rep_configuration_display");//$NON-NLS-1$
+        configModel.setHelpTag(HelpTag.volume_geo_rep_configuration_display);
+        configModel.startProgress(null);
+
+        fetchConfigForSession(selectedGeoRepSession);
+        setWindow(configModel);
+
+        addUICommandsToConfigWindow(configModel);
+    }
+
+    private void fetchConfigForSession(GlusterGeoRepSession selectedSession) {
+        
Frontend.getInstance().runQuery(VdcQueryType.GetGlusterVolumeGeoRepConfigList, 
new IdQueryParameters(selectedSession.getId()), new AsyncQuery(new 
INewAsyncCallback() {
+            @Override
+            public void onSuccess(Object model, Object returnValue) {
+                VdcQueryReturnValue vdcQueryReturnValue = 
(VdcQueryReturnValue) returnValue;
+                GlusterVolumeGeoReplicationSessionConfigModel 
geoRepConfigModel =
+                        (GlusterVolumeGeoReplicationSessionConfigModel) 
getWindow();
+                geoRepConfigModel.stopProgress();
+                boolean queryExecutionStatus = 
vdcQueryReturnValue.getSucceeded();
+                
geoRepConfigModel.updateCommandExecutabilities(queryExecutionStatus);
+                if (!queryExecutionStatus) {
+                    
geoRepConfigModel.setMessage(ConstantsManager.getInstance().getConstants().errorInFetchingVolumeOptionList());
+                } else {
+                    List<GlusterGeoRepSessionConfiguration> sessionConfigs =
+                            (List<GlusterGeoRepSessionConfiguration>) 
vdcQueryReturnValue.getReturnValue();
+                    List<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>> sessionConfigEntities =
+                            new ArrayList<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>>();
+                            for (GlusterGeoRepSessionConfiguration 
currentSession : sessionConfigs) {
+                                sessionConfigEntities.add(new 
EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>(new Pair<Boolean, 
GlusterGeoRepSessionConfiguration>(false,
+                                        currentSession)));
+                            }
+                            
geoRepConfigModel.getConfigsModel().setItems(sessionConfigEntities);
+                            geoRepConfigModel.copyConfigsToMap(sessionConfigs);
+                }
+            }
+        }));
+    }
+
+    private void updateConfig() {
+        ArrayList<VdcActionType> actionTypes = new ArrayList<VdcActionType>();
+        ArrayList<VdcActionParametersBase> parameters = new 
ArrayList<VdcActionParametersBase>();
+        IFrontendActionAsyncCallback[] callbacks;
+
+        final GlusterVolumeGeoReplicationSessionConfigModel geoRepConfigModel =
+                (GlusterVolumeGeoReplicationSessionConfigModel) getWindow();
+
+        LinkedHashMap<String, String> oldConfigs = 
geoRepConfigModel.getConfigs();
+
+        geoRepConfigModel.startProgress(null);
+
+        for (EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>> 
newConfigEntity : geoRepConfigModel.getConfigsModel()
+                .getItems()) {
+            Pair<Boolean, GlusterGeoRepSessionConfiguration> newConfigPair = 
newConfigEntity.getEntity();
+            GlusterGeoRepSessionConfiguration newConfig = 
newConfigPair.getSecond();
+            if (newConfigPair.getFirst()) {
+                actionTypes.add(VdcActionType.ResetDefaultGeoRepConfig);
+                
parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig));
+            } else if 
(!newConfig.getValue().equals(oldConfigs.get(newConfig.getKey()))) {
+                actionTypes.add(VdcActionType.SetGeoRepConfig);
+                
parameters.add(geoRepConfigModel.formGeoRepConfigParameters(newConfig));
+            }
+        }
+        int numberOfConfigUpdates = parameters.size();
+        if (numberOfConfigUpdates == 0) {
+            geoRepConfigModel.stopProgress();
+            closeWindow();
+            return;
+        }
+        callbacks = new IFrontendActionAsyncCallback[numberOfConfigUpdates];
+        callbacks[numberOfConfigUpdates - 1] = new 
IFrontendActionAsyncCallback() {
+            @Override
+            public void executed(FrontendActionAsyncResult result) {
+                geoRepConfigModel.stopProgress();
+                closeWindow();
+            }
+        };
+        Frontend.getInstance().runMultipleActions(actionTypes,
+                parameters,
+                Arrays.asList(callbacks),
+                new IFrontendActionAsyncCallback() {
+            // Failure call back. Update the config list just to reflect any 
new changes and default error msg
+            // dialog is thrown.
+            @Override
+            public void executed(FrontendActionAsyncResult result) {
+                fetchConfigForSession(geoRepConfigModel.getGeoRepSession());
+            }
+        },
+        this);
+    }
+
+    private void 
addUICommandsToConfigWindow(GlusterVolumeGeoReplicationSessionConfigModel 
geoRepConfigModel) {
+        UICommand okCommand = UICommand.createDefaultOkUiCommand("ok", 
this);//$NON-NLS-1$
+        geoRepConfigModel.addUpdateConfigsCommand(okCommand);
+
+        UICommand cancelCommand = 
UICommand.createCancelUiCommand("closeWindow", this);//$NON-NLS-1$
+        geoRepConfigModel.addCancelCommand(cancelCommand);
+    }
 
     private void closeWindow() {
         setWindow(null);
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 f8eeeda..1dda7d7 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
@@ -318,6 +318,15 @@
     @DefaultStringValue("resume")
     String resumeGeoRep();
 
+    @DefaultStringValue("Geo-Replication Options")
+    String geoReplicationOptions();
+
+    @DefaultStringValue("Set")
+    String setGeorepConfig();
+
+    @DefaultStringValue("Reset All")
+    String resetAllConfigsTitle();
+
     @DefaultStringValue("Rebalance Status")
     String volumeRebalanceStatusTitle();
 
@@ -2491,5 +2500,71 @@
             + "the command will still perform the operation on as many nodes 
as it can.\n"
             + "This command can also be used to re-perform the operation on 
the nodes where the session has died, or the operation has not be executed.")
     String geoRepForceHelp();
+
+    // Gluster Volume Snapshots
+    @DefaultStringValue("Volume Snapshot - Cluster Options")
+    String configureClusterSnapshotOptionsTitle();
+
+    @DefaultStringValue("Volume Snapshot - Volume Options")
+    String configureVolumeSnapshotOptionsTitle();
+
+    @DefaultStringValue("Update")
+    String snapshotConfigUpdateButtonLabel();
+
+    @DefaultStringValue("Update snapshot configuration options")
+    String updateSnapshotConfigurationConfirmationTitle();
+
+    @DefaultStringValue("Configuring volume snapshot options\n\n"
+            + "Changing configuration parameters will lead to deletion of 
snapshots if they exceed the new limit.\n\n"
+            + "Are you sure you want to continue?")
+    String youAreAboutChangeSnapshotConfigurationMsg();
+
+    @DefaultStringValue("existing")
+    String existingDisk();
+
+    @DefaultStringValue("creating")
+    String creatingDisk();
+
+    @DefaultStringValue("attaching")
+    String attachingDisk();
+
+    @DefaultStringValue("boot")
+    String bootDisk();
+
+    @DefaultStringValue("Storage Devices")
+    String storageDevices();
+
+    @DefaultStringValue("Session DB Id")
+    String sessionDbId();
+
+    @DefaultStringValue("User Name")
+    String userName();
+
+    @DefaultStringValue("Volume will be restored to the state of selected 
snapshot.\nDo you want to continue?")
+    String confirmVolumeSnapshotRestoreMesage();
+
+    @DefaultStringValue("The volume will be brought down and restored to the 
state of the selected snapshot.\nDo you want to continue?")
+    String confirmVolumeSnapshotRestoreWithStopMessage();
+
+    @DefaultStringValue("All snapshots will be removed. Do you want to 
continue?")
+    String confirmVolumeSnapshotDeleteAllMessage();
+
+    @DefaultStringValue("The selected snapshot will be activated. Do you want 
to continue?")
+    String confirmVolumeSnapshotActivateMessage();
+
+    @DefaultStringValue("The selected snapshot will be deactivated.\n Do you 
want to continue?")
+    String confirmVolumeSnapshotDeactivateMessage();
+
+    @DefaultStringValue("Geo-replication set config")
+    String geoReplicationConfigSetTitle();
+
+    @DefaultStringValue("Geo-replication session configuration set failed")
+    String geoRepSessionConfigSetFailed();
+
+    @DefaultStringValue("Geo-replication reset config")
+    String geoReplicationConfigResetTitle();
+
+    @DefaultStringValue("Geo-replication session configuration reset failed")
+    String geoRepSessionConfigResetFailed();
 }
 
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 202301f..b1c007b 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
@@ -3952,4 +3952,34 @@
 
     @DefaultStringValue("Snapshot Options")
     String snapshotConfigHeaderLabel();
+
+    @DefaultStringValue("Mount Point")
+    String mountPoint();
+
+    @DefaultStringValue("Device is already in use")
+    String deviceIsAlreadyUsed();
+
+    @DefaultStringValue("Sync")
+    String syncStorageDevices();
+
+    @DefaultStringValue("Terminate Session")
+    String terminateSession();
+
+    @DefaultStringValue("Restore")
+    String restoreVolumeSnapshot();
+
+    @DefaultStringValue("Delete")
+    String deleteVolumeSnapshot();
+
+    @DefaultStringValue("Delete All")
+    String deleteAllVolumeSnapshots();
+
+    @DefaultStringValue("Activate")
+    String activateVolumeSnapshot();
+
+    @DefaultStringValue("Deactivate")
+    String deactivateVolumeSnapshot();
+
+    @DefaultStringValue("Reset")
+    String resetGeoRepSessionConfig();
 }
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 33aa555..d7a626f 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
@@ -43,6 +43,7 @@
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.BrickAdvancedDetailsPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.DetachGlusterHostsPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.GlusterVolumeGeoRepActionConfirmPopUpViewPresenterWidget;
+import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.RemoveBrickPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.RemoveBrickStatusPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.ReplaceBrickPopupPresenterWidget;
@@ -159,13 +160,13 @@
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.disk.SubTabDiskStoragePresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.disk.SubTabDiskTemplatePresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.disk.SubTabDiskVmPresenter;
+import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabGlusterVolumeSnapshotPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabVolumeBrickPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabVolumeEventPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabVolumeGeneralPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabVolumeGeoRepPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabVolumeParameterPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabVolumePermissionPresenter;
-import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.SubTabGlusterVolumeSnapshotPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.gluster.VolumeSubTabPanelPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.HostSubTabPanelPresenter;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostBrickPresenter;
@@ -280,6 +281,7 @@
 import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.BrickAdvancedDetailsPopupView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.DetachGlusterHostsPopupView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.GeoRepActionConfirmPopUpView;
+import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.GlusterVolumeGeoReplicationSessionConfigPopupView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.RemoveBrickPopupView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.RemoveBrickStatusPopupView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.ReplaceBrickPopupView;
@@ -401,13 +403,13 @@
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.disk.SubTabDiskStorageView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.disk.SubTabDiskTemplateView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.disk.SubTabDiskVmView;
+import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabGlusterVolumeSnapshotView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabVolumeBrickView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabVolumeEventView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabVolumeGeneralView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabVolumeGeoRepView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabVolumeParameterView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabVolumePermissionView;
-import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.SubTabGlusterVolumeSnapshotView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.gluster.VolumeSubTabPanelView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.host.HostSubTabPanelView;
 import 
org.ovirt.engine.ui.webadmin.section.main.view.tab.host.SubTabHostBrickView;
@@ -1162,6 +1164,10 @@
                 
GlusterVolumeGeoRepActionConfirmPopUpViewPresenterWidget.ViewDef.class,
                 GeoRepActionConfirmPopUpView.class);
 
+        
bindPresenterWidget(GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.class,
+                
GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.ViewDef.class,
+                GlusterVolumeGeoReplicationSessionConfigPopupView.class);
+
         bindPresenterWidget(RemoveBrickStatusPopupPresenterWidget.class,
                 RemoveBrickStatusPopupPresenterWidget.ViewDef.class,
                 RemoveBrickStatusPopupView.class);
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/VolumeModule.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/VolumeModule.java
index 30d42d3..10640d8 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/VolumeModule.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/VolumeModule.java
@@ -33,6 +33,7 @@
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.AddBrickPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.BrickAdvancedDetailsPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.GlusterVolumeGeoRepActionConfirmPopUpViewPresenterWidget;
+import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.RemoveBrickPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.RemoveBrickStatusPopupPresenterWidget;
 import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.ReplaceBrickPopupPresenterWidget;
@@ -150,12 +151,14 @@
 
     @Provides
     @Singleton
-    public SearchableDetailModelProvider<GlusterGeoRepSession, 
VolumeListModel, VolumeGeoRepListModel> getVolumeGeoRepListProvider(EventBus 
eventBus, final Provider<DefaultConfirmationPopupPresenterWidget> 
defaultConfirmPopupProvider, final 
Provider<GlusterVolumeGeoRepActionConfirmPopUpViewPresenterWidget> 
geoRepActionConfirmationPopupProvider) {
+    public SearchableDetailModelProvider<GlusterGeoRepSession, 
VolumeListModel, VolumeGeoRepListModel> getVolumeGeoRepListProvider(EventBus 
eventBus, final Provider<DefaultConfirmationPopupPresenterWidget> 
defaultConfirmPopupProvider, final 
Provider<GlusterVolumeGeoRepActionConfirmPopUpViewPresenterWidget> 
geoRepActionConfirmationPopupProvider, final 
Provider<GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget> 
geoRepConfigPopupProvider) {
         return new SearchableDetailTabModelProvider<GlusterGeoRepSession, 
VolumeListModel, VolumeGeoRepListModel>(eventBus, defaultConfirmPopupProvider, 
VolumeListModel.class, VolumeGeoRepListModel.class) {
             @Override
             public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> 
getModelPopup(VolumeGeoRepListModel source, UICommand lastExecutedCommand, 
Model windowModel) {
                 if(lastExecutedCommand == getModel().getStartSessionCommand() 
|| lastExecutedCommand == getModel().getStopSessionCommand() || 
lastExecutedCommand == getModel().getPauseSessionCommand() || 
lastExecutedCommand == getModel().getResumeSessionCommand()) {
                     return geoRepActionConfirmationPopupProvider.get();
+                }  else if (lastExecutedCommand == 
getModel().getSessionOptionsCommand()) {
+                            return geoRepConfigPopupProvider.get();
                 } else {
                     return defaultConfirmPopupProvider.get();
                 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.java
new file mode 100644
index 0000000..ed0aabb
--- /dev/null
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.java
@@ -0,0 +1,23 @@
+package org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster;
+
+import 
org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget;
+import 
org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoReplicationSessionConfigModel;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+
+public class GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget 
extends 
AbstractModelBoundPopupPresenterWidget<GlusterVolumeGeoReplicationSessionConfigModel,
 GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.ViewDef> {
+
+    public interface ViewDef extends 
AbstractModelBoundPopupPresenterWidget.ViewDef<GlusterVolumeGeoReplicationSessionConfigModel>
 {
+    }
+
+    @Inject
+    public 
GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget(EventBus eventBus, 
ViewDef view) {
+        super(eventBus, view);
+    }
+
+    @Override
+    public void init(final GlusterVolumeGeoReplicationSessionConfigModel 
model) {
+        super.init(model);
+    }
+}
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.java
new file mode 100644
index 0000000..175b25d
--- /dev/null
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.java
@@ -0,0 +1,121 @@
+package org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster;
+
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration;
+import org.ovirt.engine.core.common.utils.Pair;
+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.EntityModelCellTable;
+import org.ovirt.engine.ui.common.widget.table.column.CheckboxColumn;
+import org.ovirt.engine.ui.common.widget.table.column.EntityModelTextColumn;
+import org.ovirt.engine.ui.common.widget.table.column.GlusterConfigAwareColumn;
+import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
+import org.ovirt.engine.ui.uicommonweb.models.ListModel;
+import 
org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoReplicationSessionConfigModel;
+import org.ovirt.engine.ui.webadmin.ApplicationConstants;
+import org.ovirt.engine.ui.webadmin.ApplicationResources;
+import 
org.ovirt.engine.ui.webadmin.section.main.presenter.popup.gluster.GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget;
+
+import com.google.gwt.cell.client.FieldUpdater;
+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.gwt.view.client.NoSelectionModel;
+import com.google.inject.Inject;
+
+public class GlusterVolumeGeoReplicationSessionConfigPopupView extends 
AbstractModelBoundPopupView<GlusterVolumeGeoReplicationSessionConfigModel> 
implements GlusterVolumeGeoReplicationSessionConfigPopupPresenterWidget.ViewDef 
{
+
+    interface Driver extends 
SimpleBeanEditorDriver<GlusterVolumeGeoReplicationSessionConfigModel, 
GlusterVolumeGeoReplicationSessionConfigPopupView> {
+    }
+
+    interface ViewUiBinder extends UiBinder<SimpleDialogPanel, 
GlusterVolumeGeoReplicationSessionConfigPopupView> {
+        ViewUiBinder uiBinder = GWT.create(ViewUiBinder.class);
+    }
+
+    interface ViewIdHandler extends 
ElementIdHandler<GlusterVolumeGeoReplicationSessionConfigPopupView> {
+        ViewIdHandler idHandler = GWT.create(ViewIdHandler.class);
+    }
+
+    @UiField(provided = true)
+    @Ignore
+    @WithElementId
+    EntityModelCellTable<ListModel<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>>> geoReplicationConfigTable;
+
+    private ApplicationConstants constants;
+
+    private final Driver driver = GWT.create(Driver.class);
+
+    @Inject
+    public GlusterVolumeGeoReplicationSessionConfigPopupView(EventBus eventBus,
+            ApplicationResources resources,
+            ApplicationConstants constants) {
+        super(eventBus, resources);
+        this.constants = constants;
+        initConfigTable();
+        initWidget(ViewUiBinder.uiBinder.createAndBindUi(this));
+        ViewIdHandler.idHandler.generateAndSetIds(this);
+        driver.initialize(this);
+    }
+
+    private void initConfigTable() {
+        geoReplicationConfigTable = new 
EntityModelCellTable<ListModel<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>>>(false, true);
+        geoReplicationConfigTable.setSelectionModel(new NoSelectionModel());
+
+        geoReplicationConfigTable.addEntityModelColumn(new 
EntityModelTextColumn<Pair<Boolean, GlusterGeoRepSessionConfiguration>>() {
+            @Override
+            protected String getText(Pair<Boolean, 
GlusterGeoRepSessionConfiguration> entity) {
+                return entity.getSecond().getKey();
+            }
+        },
+                constants.optionKeyVolumeParameter());
+
+        geoReplicationConfigTable.addEntityModelColumn(new 
EntityModelTextColumn<Pair<Boolean, GlusterGeoRepSessionConfiguration>>() {
+            @Override
+            protected String getText(Pair<Boolean, 
GlusterGeoRepSessionConfiguration> entity) {
+                return entity.getSecond().getDescription() == null ? 
constants.notAvailableLabel() : entity.getSecond()
+                        .getDescription();
+            }
+        },
+                constants.descriptionVolumeParameter());
+
+        geoReplicationConfigTable.addColumn(new GlusterConfigAwareColumn(),
+                constants.optionValueVolumeParameter(),
+                "100px");//$NON-NLS-1$
+
+        geoReplicationConfigTable.addColumn(new 
CheckboxColumn<EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>>>(true, new 
FieldUpdater<EntityModel<Pair<Boolean, GlusterGeoRepSessionConfiguration>>, 
Boolean>() {
+
+            @Override
+            public void update(int index,
+                    EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>> object,
+                    Boolean value) {
+                object.getEntity().setFirst(value);
+            }
+        }) {
+
+            @Override
+            protected boolean canEdit(EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>> object) {
+                return true;
+            }
+
+            @Override
+            public Boolean getValue(EntityModel<Pair<Boolean, 
GlusterGeoRepSessionConfiguration>> object) {
+                return object.getEntity().getFirst();
+            }
+        }, constants.resetGeoRepSessionConfig());
+    }
+
+    @Override
+    public void edit(GlusterVolumeGeoReplicationSessionConfigModel object) {
+        driver.edit(object);
+        geoReplicationConfigTable.asEditor().edit(object.getConfigsModel());
+    }
+
+    @Override
+    public GlusterVolumeGeoReplicationSessionConfigModel flush() {
+        return driver.flush();
+    }
+}
+
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.ui.xml
new file mode 100644
index 0000000..eb31971
--- /dev/null
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/gluster/GlusterVolumeGeoReplicationSessionConfigPopupView.ui.xml
@@ -0,0 +1,24 @@
+<?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:d="urn:import:org.ovirt.engine.ui.common.widget.dialog"
+       xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor"
+       xmlns:g="urn:import:com.google.gwt.user.client.ui"
+       xmlns:w="urn:import:org.ovirt.engine.ui.common.widget">
+
+       <ui:style>
+               .tablePanel {
+               padding: 5px;
+               border: 1px solid #CED8DF;
+               height: 400px;
+               }
+       </ui:style>
+
+       <d:SimpleDialogPanel width="1000px" height="550px">
+               <d:content>
+                       <g:ScrollPanel addStyleNames="{style.tablePanel}">
+                               <e:EntityModelCellTable 
ui:field="geoReplicationConfigTable" />
+                       </g:ScrollPanel>
+               </d:content>
+       </d:SimpleDialogPanel>
+</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/gluster/SubTabVolumeGeoRepView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java
index bb73c0f..dba9600 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/gluster/SubTabVolumeGeoRepView.java
@@ -102,7 +102,7 @@
         getTable().addActionButton(new 
WebAdminButtonDefinition<GlusterGeoRepSession>(constants.geoRepSessionsOptions())
 {
             @Override
             protected UICommand resolveCommand() {
-                return null;
+                return getDetailModel().getSessionOptionsCommand();
             }
         });
 


-- 
To view, visit https://gerrit.ovirt.org/39686
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I150946fe016d85cb378ed3d548eab5581321fbfe
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5-gluster
Gerrit-Owner: anmolbabu <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to