summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-08-01 17:32:19 (GMT)
committer Mike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-08-01 17:32:19 (GMT)
commit26468140cd8e95bbaa324ebbb6c35cc219216d70 (patch)
tree304b0d7e44a045d3c79d92d6f7962a9bf4bfe405
parent68fea16a21eeb40f6790cba8a225e070e5a6b7fd (diff)
downloadQCG-Data-26468140cd8e95bbaa324ebbb6c35cc219216d70.zip
QCG-Data-26468140cd8e95bbaa324ebbb6c35cc219216d70.tar.gz
QCG-Data-26468140cd8e95bbaa324ebbb6c35cc219216d70.tar.bz2
working on CRUD for synch config
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form41
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java153
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form29
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java47
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java22
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.form1
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.java1
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SynchConfigTableModel.java10
-rw-r--r--idrop-swing/src/main/resources/log4j.properties2
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties2
-rw-r--r--idrop-web/grails-app/conf/BuildConfig.groovy8
12 files changed, 277 insertions, 41 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form
index 1c0df6d..6a46d63 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form
@@ -210,6 +210,13 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlSynchData">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
+ <BevelBorder/>
+ </Border>
+ </Property>
+ </Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
@@ -218,10 +225,36 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlSynchName">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="20" insetsLeft="20" insetsBottom="30" insetsRight="20" anchor="17" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblSynchName">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="IDROPConfigurationPanel.lblSynchName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtSynchName">
+ <Properties>
+ <Property name="columns" type="int" value="40"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="IDROPConfigurationPanel.txtSynchName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
<Container class="javax.swing.JPanel" name="pnlLocalSynch">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="0" gridWidth="9" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="10" anchor="17" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="0" gridY="1" gridWidth="9" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="10" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
@@ -267,7 +300,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="1" gridWidth="9" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="20" insetsLeft="20" insetsBottom="20" insetsRight="20" anchor="10" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="0" gridY="2" gridWidth="9" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="20" insetsLeft="20" insetsBottom="20" insetsRight="20" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
@@ -319,7 +352,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="3" gridWidth="9" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="20" insetsLeft="20" insetsBottom="20" insetsRight="20" anchor="10" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="0" gridY="4" gridWidth="9" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="20" insetsLeft="20" insetsBottom="20" insetsRight="20" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
@@ -356,7 +389,7 @@
<Container class="javax.swing.JPanel" name="pnlIrodsSynch">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="5" gridWidth="9" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="10" anchor="17" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="0" gridY="6" gridWidth="9" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="10" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
index 0d73539..2a10c22 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
@@ -6,9 +6,11 @@
*/
package org.irods.jargon.idrop.desktop.systraygui;
+import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Toolkit;
+import java.util.Date;
import java.util.List;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
@@ -23,7 +25,10 @@ import org.irods.jargon.idrop.desktop.systraygui.viscomponents.SynchConfigTableM
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.irods.jargon.idrop.finder.IRODSFinderDialog;
+import org.irods.jargon.transfer.dao.domain.FrequencyType;
import org.irods.jargon.transfer.dao.domain.Synchronization;
+import org.irods.jargon.transfer.dao.domain.SynchronizationType;
+import org.irods.jargon.transfer.engine.synch.ConflictingSynchException;
import org.irods.jargon.transfer.engine.synch.SynchException;
import org.irods.jargon.transfer.engine.synch.SynchManagerService;
import org.openide.util.Exceptions;
@@ -38,7 +43,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
private final IDROPCore idropCore;
private static final org.slf4j.Logger log = LoggerFactory.getLogger(IDROPConfigurationPanel.class);
private JTable jTableSynch = null;
- private Synchronization selectedSynchronization = null;
+ private Synchronization selectedSynchronization = null;
/** Creates new form IDROPConfigurationPanel */
public IDROPConfigurationPanel(java.awt.Frame parent, boolean modal, IDROPCore idropCore) {
@@ -72,6 +77,9 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
scrollSynchTable = new javax.swing.JScrollPane();
pnlConfigSynchDetails = new javax.swing.JPanel();
pnlSynchData = new javax.swing.JPanel();
+ pnlSynchName = new javax.swing.JPanel();
+ lblSynchName = new javax.swing.JLabel();
+ txtSynchName = new javax.swing.JTextField();
pnlLocalSynch = new javax.swing.JPanel();
txtLocalPath = new javax.swing.JTextField();
btnChooseLocalSynch = new javax.swing.JButton();
@@ -183,8 +191,24 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
pnlConfigSynchDetails.setLayout(new java.awt.BorderLayout());
+ pnlSynchData.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
pnlSynchData.setLayout(new java.awt.GridBagLayout());
+ lblSynchName.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblSynchName.text")); // NOI18N
+ pnlSynchName.add(lblSynchName);
+
+ txtSynchName.setColumns(40);
+ txtSynchName.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtSynchName.text")); // NOI18N
+ pnlSynchName.add(txtSynchName);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.insets = new java.awt.Insets(20, 20, 30, 20);
+ pnlSynchData.add(pnlSynchName, gridBagConstraints);
+
txtLocalPath.setColumns(80);
txtLocalPath.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalPath.text")); // NOI18N
txtLocalPath.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalPath.toolTipText")); // NOI18N
@@ -207,7 +231,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 0;
+ gridBagConstraints.gridy = 1;
gridBagConstraints.gridwidth = 9;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
@@ -234,7 +258,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
+ gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 9;
gridBagConstraints.gridheight = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
@@ -253,7 +277,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
+ gridBagConstraints.gridy = 4;
gridBagConstraints.gridwidth = 9;
gridBagConstraints.gridheight = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
@@ -282,7 +306,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 5;
+ gridBagConstraints.gridy = 6;
gridBagConstraints.gridwidth = 9;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
@@ -400,15 +424,15 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
List<Synchronization> synchronizations = synchConfigurationService.listAllSynchronizations();
if (jTableSynch == null) {
- SynchConfigTableModel synchConfigTableModel = new SynchConfigTableModel(idropCore, synchronizations);
+ SynchConfigTableModel synchConfigTableModel = new SynchConfigTableModel(idropCore, synchronizations);
jTableSynch = new JTable(synchConfigTableModel);
jTableSynch.getSelectionModel().addListSelectionListener(new SynchListSelectionHandler(thisPanel));
scrollSynchTable.setViewportView(jTableSynch);
scrollSynchTable.validate();
} else {
SynchConfigTableModel synchConfigTableModel = (SynchConfigTableModel) jTableSynch.getModel();
- synchConfigTableModel.setSynchronizations(synchronizations);
- synchConfigTableModel.fireTableDataChanged();
+ synchConfigTableModel.setSynchronizations(synchronizations);
+ synchConfigTableModel.fireTableDataChanged();
}
} catch (SynchException ex) {
log.error("error setting up synchs table", ex);
@@ -470,8 +494,91 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
// TODO add your handling code here:
}//GEN-LAST:event_btnNewSynchActionPerformed
+ /**
+ * User signals that the displayed synchronization should be updated
+ * @param evt
+ */
private void btnUpdateSynchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateSynchActionPerformed
- // TODO add your handling code here:
+
+ final IDROPConfigurationPanel thisPanel = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ resetSynchPanel();
+ if (selectedSynchronization == null) {
+ MessageManager.showError(thisPanel, "Please select a synchronization from the table", MessageManager.TITLE_MESSAGE);
+ return;
+ }
+
+ if (txtLocalPath.getText().trim().isEmpty()) {
+ txtLocalPath.setBackground(Color.RED);
+ MessageManager.showError(thisPanel, "Please select a local path", MessageManager.TITLE_MESSAGE);
+ return;
+ }
+
+ if (txtIrodsPath.getText().trim().isEmpty()) {
+ txtIrodsPath.setBackground(Color.RED);
+ MessageManager.showError(thisPanel, "Please select an iRODS path", MessageManager.TITLE_MESSAGE);
+ return;
+ }
+
+ if (txtSynchName.getText().trim().isEmpty()) {
+ txtSynchName.setBackground(Color.RED);
+ MessageManager.showError(thisPanel, "Please enter a unique name for this synchronization", MessageManager.TITLE_MESSAGE);
+ return;
+ }
+
+ // edits pass, do update
+ log.info("saving synch data");
+ Synchronization synchronization = selectedSynchronization;
+ synchronization.setUpdatedAt(new Date());
+ synchronization.setFrequencyType(FrequencyType.EVERY_HOUR); // FIXME: create code to set this viz the combo
+
+ synchronization.setName(txtSynchName.getText().trim());
+ synchronization.setSynchronizationMode(SynchronizationType.ONE_WAY_LOCAL_TO_IRODS); // FIXME: set properly from radio
+ synchronization.setLocalSynchDirectory(txtLocalPath.getText().trim());
+ synchronization.setIrodsSynchDirectory(txtIrodsPath.getText().trim());
+ selectedSynchronization = synchronization;
+
+ try {
+ thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ idropCore.getIdropConfigurationService().updateSynchronization(synchronization);
+
+ ListSelectionModel lsm = (ListSelectionModel) thisPanel.getSynchTable().getSelectionModel();
+
+ if (lsm.isSelectionEmpty()) {
+ return;
+ } else {
+ // Find out which indexes are selected.
+ int minIndex = lsm.getMinSelectionIndex();
+ int maxIndex = lsm.getMaxSelectionIndex();
+ for (int i = minIndex; i <= maxIndex; i++) {
+ if (lsm.isSelectedIndex(i)) {
+ int modelIdx = thisPanel.getSynchTable().convertRowIndexToModel(i);
+ SynchConfigTableModel model = (SynchConfigTableModel) thisPanel.getSynchTable().getModel();
+ model.getSynchronizations().set(modelIdx, synchronization);
+ model.fireTableDataChanged();
+ break;
+ }
+ }
+ }
+
+ } catch (IdropException ex) {
+ MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE);
+ } catch (ConflictingSynchException ex) {
+ MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE);
+ } finally {
+ thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ idropCore.closeIRODSConnection(
+ idropCore.getIrodsAccount());
+ }
+ }
+ });
+
+
}//GEN-LAST:event_btnUpdateSynchActionPerformed
/**
@@ -479,16 +586,15 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
* @param evt
*/
private void btnSynchNowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSynchNowActionPerformed
- // TODO add your handling code here:
log.info("synch now button pressed");
if (selectedSynchronization == null) {
MessageManager.showWarning(this, "Please select a synhronization", MessageManager.TITLE_MESSAGE);
return;
}
-
+
log.info("selected synchronization is:{}", selectedSynchronization);
-
- int result = JOptionPane.showConfirmDialog(this,
+
+ int result = JOptionPane.showConfirmDialog(this,
"Synchronize?",
"Do you want to synchronize now?",
JOptionPane.OK_CANCEL_OPTION);
@@ -504,7 +610,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
}//GEN-LAST:event_btnSynchNowActionPerformed
private void checkVerifyChecksumOnTransferActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkVerifyChecksumOnTransferActionPerformed
- log.info("updating verify checksom to:{}", checkVerifyChecksumOnTransfer.isSelected());
+ log.info("updating verify checksom to:{}", checkVerifyChecksumOnTransfer.isSelected());
try {
idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.VERIFY_CHECKSUM_ON_TRANSFER, Boolean.toString(checkVerifyChecksumOnTransfer.isSelected()));
} catch (IdropException ex) {
@@ -530,6 +636,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel5;
private javax.swing.JComboBox jcomboSynchFrequency;
+ private javax.swing.JLabel lblSynchName;
private javax.swing.JPanel panelSynchToolbar;
private javax.swing.JPanel pnlBottom;
private javax.swing.JPanel pnlCenter;
@@ -544,6 +651,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
private javax.swing.JPanel pnlSynchData;
private javax.swing.JPanel pnlSynchFrequency;
private javax.swing.JPanel pnlSynchMode;
+ private javax.swing.JPanel pnlSynchName;
private javax.swing.JPanel pnlTop;
private javax.swing.JRadioButton radioBackup;
private javax.swing.JRadioButton radioFeed;
@@ -552,6 +660,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
private javax.swing.JTabbedPane tabConfig;
private javax.swing.JTextField txtIrodsPath;
private javax.swing.JTextField txtLocalPath;
+ private javax.swing.JTextField txtSynchName;
// End of variables declaration//GEN-END:variables
private void initWithConfigData() {
@@ -561,6 +670,15 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
checkVerifyChecksumOnTransfer.setSelected(idropConfig.isVerifyChecksum());
}
+ /**
+ * Reset colors in synch panel when re-validating
+ */
+ private void resetSynchPanel() {
+ txtLocalPath.setBackground(Color.WHITE);
+ txtIrodsPath.setBackground(Color.WHITE);
+ txtSynchName.setBackground(Color.WHITE);
+ }
+
class SynchListSelectionHandler implements ListSelectionListener {
private final IDROPConfigurationPanel idropConfigurationPanel;
@@ -578,10 +696,6 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
ListSelectionModel lsm = (ListSelectionModel) e.getSource();
- int firstIndex = e.getFirstIndex();
- int lastIndex = e.getLastIndex();
- boolean isAdjusting = e.getValueIsAdjusting();
-
if (lsm.isSelectionEmpty()) {
return;
} else {
@@ -612,8 +726,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
// initialize data
txtLocalPath.setText(selectedSynchronization.getLocalSynchDirectory());
txtIrodsPath.setText(selectedSynchronization.getIrodsSynchDirectory());
- // FIXME: stuff is just defaulting for now
- // FIXME: display name and make changable, with all of the necessary updates (should be in txfr engine synch mgr
+ txtSynchName.setText(selectedSynchronization.getName());
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
index 38ff277..85eaea6 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
@@ -1268,9 +1268,26 @@
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTransferStatusMessage">
+ <Properties>
+ <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="ff" green="0" red="0" type="rgb"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
<Container class="javax.swing.JPanel" name="pnlTransferType">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
@@ -1287,6 +1304,11 @@
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnlTransferFileCounts">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
@@ -1298,6 +1320,11 @@
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnlTransferByteCounts">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="3" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index ee14568..05eae73 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -280,12 +280,17 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
IRODSOutlineModel irodsTreeModel = (IRODSOutlineModel) irodsTree.getModel();
try {
- irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
- // if a get callback on completion, notify the local tree model
- if (ts.getTransferType() == TransferStatus.TransferType.GET
- && ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
- ((LocalFileSystemModel) getFileTree().getModel()).notifyCompletionOfOperation(getFileTree(), ts);
+ if (ts.getTransferType() == TransferStatus.TransferType.SYNCH || ts.getTransferType() == TransferStatus.TransferType.REPLICATE) {
+ log.info("no need to notify tree for synch or replicate");
+ } else {
+ irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
+ // if a get callback on completion, notify the local tree model
+ if (ts.getTransferType() == TransferStatus.TransferType.GET
+ && ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
+ ((LocalFileSystemModel) getFileTree().getModel()).notifyCompletionOfOperation(getFileTree(), ts);
+ }
}
+
} catch (IdropException ex) {
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
this.showIdropException(ex);
@@ -308,6 +313,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
transferStatusProgressBar.setMinimum(0);
transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
transferStatusProgressBar.setValue(0);
+ } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_INITIALIZATION) {
+ lblTransferStatusMessage.setText("Synchronization Initializing");
+ } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_DIFF_GENERATION) {
+ lblTransferStatusMessage.setText("Synchronization looking for updates");
+ } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_DIFF_STEP) {
+ lblTransferStatusMessage.setText("Synchronizing differences");
+ } else if (ts.getTransferState() == TransferStatus.TransferState.SYNCH_COMPLETION) {
+ lblTransferStatusMessage.setText("");
+ } else if (ts.getTransferEnclosingType() == TransferStatus.TransferType.SYNCH) {
+ lblTransferStatusMessage.setText("Transfer to synchronize local and iRODS");
}
}
});
@@ -1193,6 +1208,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
userNameLabel = new javax.swing.JLabel();
pnlTransferOverview = new javax.swing.JPanel();
pnlTransferStatus = new javax.swing.JPanel();
+ lblTransferStatusMessage = new javax.swing.JLabel();
pnlTransferType = new javax.swing.JPanel();
lblTransferTypeLabel = new javax.swing.JLabel();
lblTransferType = new javax.swing.JLabel();
@@ -1738,23 +1754,37 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
pnlTransferOverview.setLayout(new java.awt.BorderLayout());
+ pnlTransferStatus.setLayout(new java.awt.GridBagLayout());
+
+ lblTransferStatusMessage.setForeground(new java.awt.Color(0, 0, 255));
+ pnlTransferStatus.add(lblTransferStatusMessage, new java.awt.GridBagConstraints());
+
lblTransferTypeLabel.setText("Transfer Type:");
pnlTransferType.add(lblTransferTypeLabel);
lblTransferType.setText(" ");
pnlTransferType.add(lblTransferType);
- pnlTransferStatus.add(pnlTransferType);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 1;
+ pnlTransferStatus.add(pnlTransferType, gridBagConstraints);
lblTransferFilesCounts.setText("Files: /");
pnlTransferFileCounts.add(lblTransferFilesCounts);
- pnlTransferStatus.add(pnlTransferFileCounts);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 2;
+ gridBagConstraints.gridy = 1;
+ pnlTransferStatus.add(pnlTransferFileCounts, gridBagConstraints);
lblTransferByteCounts.setText("Bytes (total): /");
pnlTransferByteCounts.add(lblTransferByteCounts);
- pnlTransferStatus.add(pnlTransferByteCounts);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 3;
+ gridBagConstraints.gridy = 1;
+ pnlTransferStatus.add(pnlTransferByteCounts, gridBagConstraints);
pnlTransferOverview.add(pnlTransferStatus, java.awt.BorderLayout.NORTH);
@@ -2472,6 +2502,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
private javax.swing.JLabel lblTags;
private javax.swing.JLabel lblTransferByteCounts;
private javax.swing.JLabel lblTransferFilesCounts;
+ private javax.swing.JLabel lblTransferStatusMessage;
private javax.swing.JLabel lblTransferType;
private javax.swing.JLabel lblTransferTypeLabel;
private javax.swing.JList listLocalDrives;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
index 51713af..46c20e7 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -65,4 +65,6 @@ public interface IdropConfigurationService {
* @throws ConflictingSynchException
*/
void createNewSynchronization(final Synchronization synchConfiguration) throws IdropException, ConflictingSynchException;
+
+ void updateSynchronization(final Synchronization synchConfiguration) throws IdropException, ConflictingSynchException;
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
index 1a449b9..9cf7c90 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
@@ -303,4 +303,26 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
log.info("synch saved");
}
+
+ @Override
+ public void updateSynchronization(final Synchronization synchConfiguration) throws IdropException, ConflictingSynchException {
+ log.info("updateSynchronization()");
+ if (synchConfiguration == null) {
+ throw new IllegalArgumentException("null synchConfiguration");
+ }
+ log.info("synchConfiguration:{}", synchConfiguration);
+ SynchManagerService synchManagerService = idropCore.getTransferManager().getTransferServiceFactory().instanceSynchManagerService();
+ try {
+ synchManagerService.updateSynchConfiguration(synchConfiguration);
+ } catch (ConflictingSynchException cse) {
+ log.error("synch configuration is conflicting:{}", synchConfiguration, cse);
+ throw cse;
+ } catch (SynchException ex) {
+ log.error("error creating synch", ex);
+ throw new IdropException("error creating synch", ex);
+ }
+
+ log.info("synch saved");
+
+ }
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.form
index 75b83e9..9939525 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.form
@@ -400,6 +400,7 @@
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="bnGroupSynchType"/>
</Property>
+ <Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/viscomponents/Bundle.properties" key="SetupWizard.radioBackup.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.java
index 96644bc..2e7aa86 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SetupWizard.java
@@ -269,6 +269,7 @@ public class SetupWizard extends javax.swing.JDialog {
pnlSynchMode.add(jLabel1);
bnGroupSynchType.add(radioBackup);
+ radioBackup.setSelected(true);
radioBackup.setText(org.openide.util.NbBundle.getMessage(SetupWizard.class, "SetupWizard.radioBackup.text")); // NOI18N
pnlSynchMode.add(radioBackup);
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SynchConfigTableModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SynchConfigTableModel.java
index aff1291..45cbbc2 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SynchConfigTableModel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/SynchConfigTableModel.java
@@ -14,13 +14,13 @@ import org.irods.jargon.transfer.dao.domain.Synchronization;
public class SynchConfigTableModel extends DefaultTableModel {
private final IDROPCore idropCore;
- private List<Synchronization> synchronizations;
- private Object[] columnNames = new Object[]{"Name", "Local Path", "iRODS Path"};
+ private List<Synchronization> synchronizations;
+ private Object[] columnNames = new Object[]{"Name", "Local Path", "iRODS Path"};
public void setSynchronizations(List<Synchronization> synchronizations) {
this.synchronizations = synchronizations;
}
-
+
@Override
public int getRowCount() {
if (synchronizations == null) {
@@ -65,4 +65,8 @@ public class SynchConfigTableModel extends DefaultTableModel {
public Synchronization getSynchronizationAt(int row) {
return synchronizations.get(row);
}
+
+ public List<Synchronization> getSynchronizations() {
+ return synchronizations;
+ }
}
diff --git a/idrop-swing/src/main/resources/log4j.properties b/idrop-swing/src/main/resources/log4j.properties
index 8d74b52..9434b5a 100644
--- a/idrop-swing/src/main/resources/log4j.properties
+++ b/idrop-swing/src/main/resources/log4j.properties
@@ -3,7 +3,7 @@
log4j.category.org.irods.jargon.idrop=INFO, A1
log4j.category.org.irods.jargon.core=ERROR, A1
log4j.categor.org.irods.jargon.usertagging=ERROR,A1
-log4j.category.org.irods.jargon.transfer=DEBUG, A1
+log4j.category.org.irods.jargon.transfer=INFO, A1
log4j.category.org.irods.jargon.datautils=WARN, A1
log4j.category.org.hibernate=ERROR, A1
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties b/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties
index 73ded8d..d2cc95c 100644
--- a/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties
@@ -32,3 +32,5 @@ IDROPConfigurationPanel.txtIrodsPath.text=
IDROPConfigurationPanel.btnSynchNow.text=Synch Now
IDROPConfigurationPanel.btnSynchNow.toolTipText=Synchronize now
IDROPConfigurationPanel.checkVerifyChecksumOnTransfer.text=Verfiy Checksum on get/put transfers
+IDROPConfigurationPanel.lblSynchName.text=Name this synchronization folder:
+IDROPConfigurationPanel.txtSynchName.text=
diff --git a/idrop-web/grails-app/conf/BuildConfig.groovy b/idrop-web/grails-app/conf/BuildConfig.groovy
index 45a73ae..33ed09b 100644
--- a/idrop-web/grails-app/conf/BuildConfig.groovy
+++ b/idrop-web/grails-app/conf/BuildConfig.groovy
@@ -29,10 +29,10 @@ grails.project.dependency.resolution = {
test 'org.irods.jargon:jargon-test:2.4.1-SNAPSHOT'
test 'org.mockito:mockito-all:1.8.1'
provided 'junit:junit:4.8.1'
- compile 'org.irods.jargon:jargon-core:2.4.1-SNAPSHOT'
- compile 'org.irods.jargon:jargon-security:2.4.1-SNAPSHOT'
- compile 'org.irods.jargon:jargon-data-utils:2.4.1-SNAPSHOT'
- compile ('org.irods.jargon:jargon-user-tagging:2.4.1-SNAPSHOT') {
+ compile 'org.irods.jargon:jargon-core:2.5.0-beta2-SNAPSHOT'
+ compile 'org.irods.jargon:jargon-security:2.5.0-beta2-SNAPSHOT'
+ compile 'org.irods.jargon:jargon-data-utils:2.5.0-beta2-SNAPSHOT'
+ compile ('org.irods.jargon:jargon-user-tagging:2.5.0-beta2-SNAPSHOT') {
exclude 'junit'
}
compile 'org.springframework.security:spring-security-core:3.0.5.RELEASE'