ExportLDIFPanel.java revision 6638c2755466ca601450700d5a39f390f23d4781
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* The panel where the user can export the contents of the server to an LDIF
* file.
*
*/
public class ExportLDIFPanel extends InclusionExclusionPanel
{
private static final long serialVersionUID = 2256902594454214644L;
private JTextField file;
private JCheckBox compressData;
private JCheckBox encryptData;
private JCheckBox generateSignedHash;
private JTextField wrapColumn;
private JLabel lNoBackendsFound;
private JLabel lExportOptions;
private JLabel lRemoteFileHelp;
private JCheckBox excludeOperationalAttrs;
private DocumentListener documentListener;
private ScheduleSummaryPanel schedulePanel;
/**
* Default constructor.
*
*/
public ExportLDIFPanel()
{
super();
createLayout();
}
/** {@inheritDoc} */
public LocalizableMessage getTitle()
{
return INFO_CTRL_PANEL_EXPORT_LDIF_TITLE.get();
}
/** {@inheritDoc} */
public Component getPreferredFocusComponent()
{
return file;
}
/** {@inheritDoc} */
public void toBeDisplayed(boolean visible)
{
if (visible)
{
}
}
/**
* Creates the layout of the panel (but the contents are not populated here).
*/
private void createLayout()
{
lNoBackendsFound.setVisible(false);
documentListener = new DocumentListener()
{
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
}
};
new BrowseActionListener(file,
compressData.setSelected(false);
/*
gbc.gridy ++;
gbc.insets.top = 5;
add(encryptData, gbc);
*/
{
/** {@inheritDoc} */
{
}
});
encryptData.setSelected(false);
generateSignedHash.setEnabled(false);
/*
gbc.gridy ++;
gbc.insets.left = 30;
add(generateSignedHash, gbc);
*/
{
/** {@inheritDoc} */
{
}
});
wrapColumn.setEnabled(false);
wrapText.setSelected(false);
excludeOperationalAttrs.setOpaque(false);
}
/** {@inheritDoc} */
{
ev.getNewDescriptor());
{
public void run()
{
}
});
}
/** {@inheritDoc} */
protected void checkOKButtonEnable()
{
}
/** {@inheritDoc} */
public void okClicked()
{
if (backendName == null)
{
}
{
}
else if (isLocal())
{
if (f.isDirectory())
{
}
}
if (wrapText.isSelected())
{
int minValue = 1;
int maxValue = 1000;
maxValue);
{
}
}
{
{
}
boolean confirmed = true;
{
{
}
}
{
null,
progressDialog.setVisible(true);
}
}
{
}
}
/** {@inheritDoc} */
public void cancelClicked()
{
super.cancelClicked();
}
private ScheduleType getSchedule()
{
return schedulePanel.getSchedule();
}
/**
* The class that performs the export.
*
*/
protected class ExportTask extends InclusionExclusionTask
{
/**
* The constructor of the task.
* @param info the control panel info.
* @param dlg the progress dialog that shows the progress of the task.
*/
{
}
/** {@inheritDoc} */
{
return Type.EXPORT_LDIF;
}
/** {@inheritDoc} */
public LocalizableMessage getTaskDescription()
{
}
/** {@inheritDoc} */
{
boolean canLaunch = true;
{
// All the operations are incompatible if they apply to this
// backend.
{
canLaunch = false;
}
}
return canLaunch;
}
/** {@inheritDoc} */
public void runTask()
{
try
{
if (isServerRunning())
{
}
else
{
}
if (returnCode != 0)
{
}
else
{
}
}
catch (Throwable t)
{
lastException = t;
}
}
/** {@inheritDoc} */
{
return backendSet;
}
/** {@inheritDoc} */
{
if (!overwrite.isSelected())
{
}
if (compressData.isSelected())
{
}
if (wrapText.isSelected())
{
}
{
}
if (isServerRunning())
{
}
return args;
}
/** {@inheritDoc} */
protected String getCommandLinePath()
{
return getCommandLinePath("export-ldif");
}
};
}