Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.dialogs
Class SaveFileTransferAndRestoreDialog

java.lang.Object
  extended by SystemPromptDialog
      extended by com.ibm.etools.iseries.rse.ui.dialogs.SaveFileTransferAndRestoreDialog
All Implemented Interfaces:
IQSYSLibraryPromptListener, IQSYSObjectPromptListener

public class SaveFileTransferAndRestoreDialog
extends SystemPromptDialog
implements IQSYSObjectPromptListener

This dialog is launched when user selects "Restore on iSeries..." on a .savf local file, and it prompts the user for the information we will need to do the action.


Field Summary
static String Copyright
           
 
Fields inherited from interface com.ibm.etools.iseries.rse.ui.widgets.IQSYSObjectPromptListener
copyright
 
Constructor Summary
SaveFileTransferAndRestoreDialog(Shell shell)
          Constructor
 
Method Summary
protected  Control createInner(Composite parent)
           
protected  IQSYSLibrary createLibrary(Shell shell, IBMiConnection connection, String libName, String libType, String libText, String libAut, String libCrtAut, String libAddlParms)
          Helper method to create a new library
protected  Control getInitialFocusControl()
           
 String getRestoreLibraryName()
           
 IQSYSLibrary getRSETempLibrary(Shell shell, IBMiConnection connection, String libName, String msgId)
          Helper method to create, if necessary, the RSE temporary library.
 int getSaveFileCommand()
          Gets the save file command.
 String getSaveFileLibraryName()
          Gets the library name of the save file.
 void libraryNameChanged(SystemMessage errorMessage)
          The user has entered or selected text in the library entry field and it has been validated by the ISeriesLibraryPrompt.
 void modifyText(ModifyEvent e)
           
 void objectNameChanged(SystemMessage errorMessage)
          The user has entered or selected text in the object entry field and it has been validated by the ISeriesObjectPrompt.
protected  boolean processOK()
          Called when user presses OK button.
 void setLocalFileName(String fullName, String name)
          Set the selected local file (eg, xxx.savf)
protected  SystemMessage verify(boolean setFocus)
          Verify the contents of the dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

SaveFileTransferAndRestoreDialog

public SaveFileTransferAndRestoreDialog(Shell shell)
Constructor

Method Detail

setLocalFileName

public void setLocalFileName(String fullName,
                             String name)
Set the selected local file (eg, xxx.savf)


createInner

protected Control createInner(Composite parent)

getSaveFileCommand

public int getSaveFileCommand()
                       throws IOException
Gets the save file command.

Returns:
the save file command.
Throws:
IOException - if an I/O error occurs.

getSaveFileLibraryName

public String getSaveFileLibraryName()
                              throws IOException
Gets the library name of the save file.

Returns:
the save file library name.
Throws:
IOException - if an I/O error occurs.

getInitialFocusControl

protected Control getInitialFocusControl()

objectNameChanged

public void objectNameChanged(SystemMessage errorMessage)
Description copied from interface: IQSYSObjectPromptListener
The user has entered or selected text in the object entry field and it has been validated by the ISeriesObjectPrompt.

Specified by:
objectNameChanged in interface IQSYSObjectPromptListener
Parameters:
errorMessage - Will be null if the input is valid, or a translated msg if not

libraryNameChanged

public void libraryNameChanged(SystemMessage errorMessage)
Description copied from interface: IQSYSLibraryPromptListener
The user has entered or selected text in the library entry field and it has been validated by the ISeriesLibraryPrompt.

Specified by:
libraryNameChanged in interface IQSYSLibraryPromptListener
Parameters:
errorMessage - Will be null if the input is valid, or a translated msg if not

modifyText

public void modifyText(ModifyEvent e)

verify

protected SystemMessage verify(boolean setFocus)
Verify the contents of the dialog


processOK

protected boolean processOK()
Called when user presses OK button. Return true to close dialog. Return false to not close dialog.


getRestoreLibraryName

public String getRestoreLibraryName()
Returns:
Returns the rstLibName.

createLibrary

protected IQSYSLibrary createLibrary(Shell shell,
                                     IBMiConnection connection,
                                     String libName,
                                     String libType,
                                     String libText,
                                     String libAut,
                                     String libCrtAut,
                                     String libAddlParms)
                              throws SystemMessageException
Helper method to create a new library

Parameters:
shell - - the shell to host any prompts or message dialogs
connection - - the iSeries connection object to use to create the library
libName - - the name of the library to create
libType - - "*PROD" or "*TEST".
libText - - optional text description for the new library. We will add single quote delimiters
libAut - - optional value for the AUT parameter. Eg, "*ALL"
libCrtAut - - optional value for the CRTAUT parameter. Eg, "*ALL"
libAddlParms - - any additional fully-formed parameters to tack onto the end of the CRTLIB command
Throws:
SystemMessageException

getRSETempLibrary

public IQSYSLibrary getRSETempLibrary(Shell shell,
                                      IBMiConnection connection,
                                      String libName,
                                      String msgId)
                               throws SystemMessageException
Helper method to create, if necessary, the RSE temporary library. Since the RSE can't use QTEMP due to toolbox restrictions, whenever a temporary library is needed we try to use the same one: QRSETEMP.
This method will test for the existance of this library, and if not found, will create prompt the user to create it, and if agreed to will run the CRTLIB command for it, and also change the object owner to be QSYS. The library attribute is set to *TEST

Parameters:
shell - - the shell to host any prompts or message dialogs
connection - - the ISeries connection object to use to create the library
libName - - the name for the new library. Pass null for the default name of QRSETEMP
msgId - - the id of the message to use to ask the user if they want to create the library. Pass null to use our default message or *NONE for no message, else the message is assumed to have one substitution variable, which is the name of the library.
Returns:
the QRSETEMP library handle if it exists or was created via this call, or null if the user chose not to create it, or something went wrong.
Throws:
SystemMessageException

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.