org.purl.sword.client
Class PostDialog

java.lang.Object
  extended by org.purl.sword.client.PostDialog
All Implemented Interfaces:
ActionListener, EventListener, ChangeListener

public class PostDialog
extends Object
implements ActionListener, ChangeListener

Dialog for users to enter details of post destinations.

Author:
Neil Taylor

Field Summary
protected static String ADD
          label for the add command.
protected static String BROWSE
          label for the browse command.
protected static String CLEAR
          label for the clear command.
protected static String DELETE
          label for the delete command.
protected static String EDIT
          label for the edit command.
 
Constructor Summary
PostDialog(JFrame parentFrame)
           
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Handle the button click to select a file to upload.
 void addDepositUrls(String[] deposits)
          Add a list of deposit URLs.
 void addFiles(String[] files)
          Add a list of file names.
 void addFileTypes(String[] types)
          Add a list of file types.
 void addFormatNamespaces(String[] namespaces)
          Add the list of formatNamespace strings.
 void addOnBehalfOf(String[] users)
          Add a list of onBehalfOf names.
 void addUserIds(String[] users)
          Add a list of user ids.
 boolean corruptMD5()
          Determine if the MD5 hash should be corrupted.
 boolean corruptRequest()
          Determine if the POST request should be corrupted.
protected  JPanel createControls()
          Create the controls for the main panel.
protected  JPanel createDestinationsPanel()
          Create the destinations panel.
 PostDestination[] getDestinations()
          Get the list of Post Destinations.
 String getFile()
          Get the file details.
 String getFileType()
          Get the filetype value.
 String getFormatNamespace()
          Get the format namespace value.
 String getOnBehalfOf()
          Get the onBehalfOf value.
 String getPostLocation()
          Get the post location.
 void setDepositLocation(String location)
          Set the deposit location.
 int show()
          Show the dialog with ok and cancel options.
 PostDestination showDestinationDialog(PostDestination destination)
          Show the destination dialog.
 void stateChanged(ChangeEvent evt)
          Detect a state change event for the checkbox.
 boolean useMd5()
          Determine if the MD5 checkbox is selected.
 boolean useNoOp()
          Determine if the noOp checkbox is selected.
 boolean useVerbose()
          Determine if the verbose checkbox is selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BROWSE

protected static final String BROWSE
label for the browse command.

See Also:
Constant Field Values

ADD

protected static final String ADD
label for the add command.

See Also:
Constant Field Values

EDIT

protected static final String EDIT
label for the edit command.

See Also:
Constant Field Values

DELETE

protected static final String DELETE
label for the delete command.

See Also:
Constant Field Values

CLEAR

protected static final String CLEAR
label for the clear command.

See Also:
Constant Field Values
Constructor Detail

PostDialog

public PostDialog(JFrame parentFrame)
Parameters:
parentFrame -
Method Detail

show

public int show()
Show the dialog with ok and cancel options.

Returns:
The return value from displaying JOptionPane. Either JOptionPane.OK_OPTION or JOptionPane.CANCEL_OPTION.

createControls

protected final JPanel createControls()
Create the controls for the main panel.

Returns:
The panel.

createDestinationsPanel

protected JPanel createDestinationsPanel()
Create the destinations panel. This contains a list and four buttons to operate on values in the list.

Returns:
The panel containing the controls.

actionPerformed

public void actionPerformed(ActionEvent evt)
Handle the button click to select a file to upload.

Specified by:
actionPerformed in interface ActionListener

showDestinationDialog

public PostDestination showDestinationDialog(PostDestination destination)
Show the destination dialog. This is used to enter the URL, username, password and onBehalfOf name for a destination.

Parameters:
destination - The post destination. If this is not null, the values in the object are used to set the current values in the dialog controls.
Returns:
The post destination value.

getDestinations

public PostDestination[] getDestinations()
Get the list of Post Destinations.

Returns:
The destinations.

getFile

public String getFile()
Get the file details.

Returns:
The value.

getFileType

public String getFileType()
Get the filetype value.

Returns:
The value.

getOnBehalfOf

public String getOnBehalfOf()
Get the onBehalfOf value.

Returns:
The value.

getFormatNamespace

public String getFormatNamespace()
Get the format namespace value.

Returns:
The value.

useMd5

public boolean useMd5()
Determine if the MD5 checkbox is selected.

Returns:
True if the MD5 checkbox is selected.

useNoOp

public boolean useNoOp()
Determine if the noOp checkbox is selected.

Returns:
True if the checkbox is selected.

useVerbose

public boolean useVerbose()
Determine if the verbose checkbox is selected.

Returns:
True if the checkbox is selected.

getPostLocation

public String getPostLocation()
Get the post location.

Returns:
The post location.

corruptMD5

public boolean corruptMD5()
Determine if the MD5 hash should be corrupted.

Returns:
True if the corrupt MD5 checkbox is selected. The MD5 checkbox must also be selected.

corruptRequest

public boolean corruptRequest()
Determine if the POST request should be corrupted.

Returns:
True if the corrupt request checkbox is selected.

stateChanged

public void stateChanged(ChangeEvent evt)
Detect a state change event for the checkbox.

Specified by:
stateChanged in interface ChangeListener
Parameters:
evt - The event.

addUserIds

public void addUserIds(String[] users)
Add a list of user ids.

Parameters:
users - The user ids.

addDepositUrls

public void addDepositUrls(String[] deposits)
Add a list of deposit URLs.

Parameters:
deposits - The URLs.

addOnBehalfOf

public void addOnBehalfOf(String[] users)
Add a list of onBehalfOf names.

Parameters:
users - The names.

addFormatNamespaces

public void addFormatNamespaces(String[] namespaces)
Add the list of formatNamespace strings.

Parameters:
namespaces - list of strings.

addFileTypes

public void addFileTypes(String[] types)
Add a list of file types.

Parameters:
types - The file types.

addFiles

public void addFiles(String[] files)
Add a list of file names.

Parameters:
files - The list of files.

setDepositLocation

public void setDepositLocation(String location)
Set the deposit location.

Parameters:
location - The location.


Copyright © 2011 DuraSpace. All Rights Reserved.