com.centrasite.control.adapters
Class AbstractFileImport

java.lang.Object
  extended by com.softwareag.cis.plugin.command.AbstractCommand
      extended by com.centrasite.control.AbstractCommandExt
          extended by com.centrasite.control.AbstractPromptCommand
              extended by com.centrasite.control.AbstractBrowseCommand
                  extended by com.centrasite.control.adapters.AbstractFileImport
All Implemented Interfaces:
com.centrasite.control.discovery.PromptYesNoHandler, com.softwareag.cis.plugin.command.Command, com.softwareag.cis.plugin.interfaces.Component, com.softwareag.cis.plugin.interfaces.RunnableDeferred

public abstract class AbstractFileImport
extends com.centrasite.control.AbstractBrowseCommand
implements com.softwareag.cis.plugin.interfaces.RunnableDeferred, com.centrasite.control.discovery.PromptYesNoHandler

This is the abstract layer of file imports with prompting for missing resources (files) in cycles. Moreover it supports a resource-already-present check and issues a confirmation prompt.

The subclass must provided these key methods:

Both methods may throw a WSDLCallbackException to indicate that a resource (file) is missing.
The user of the concrete class starts its processing with 'doImport()'


Field Summary
 
Fields inherited from class com.softwareag.cis.plugin.command.AbstractCommand
rcs_id
 
Fields inherited from interface com.softwareag.cis.plugin.interfaces.RunnableDeferred
rcs_id
 
Fields inherited from interface com.softwareag.cis.plugin.command.Command
CATEGORY_APPLICATION_HIGH_PRIO, CATEGORY_APPLICATION_LOW_PRIO, CATEGORY_COPY, CATEGORY_DELETE, CATEGORY_DOCUMENT, CATEGORY_EDIT, CATEGORY_EXECUTE, CATEGORY_FAVORITES, CATEGORY_IMPORT_EXPORT, CATEGORY_LCM, CATEGORY_LINK, CATEGORY_MIN, CATEGORY_MISC, CATEGORY_NEW, CATEGORY_OBJECT, CATEGORY_OPEN, CATEGORY_PREFERENCES, CATEGORY_SAVE, CATEGORY_SEARCH, CATEGORY_SHOW, CATEGORY_UPDATE, CATEGORY_UPDATE_EXT, CATEGORY_VIEW, COMMAND_ACTIVATE_DEACTIVATE, COMMAND_ADD_CATEGORY, COMMAND_ADD_COPY, COMMAND_ADD_DOCUMENT, COMMAND_ADD_FOLDER, COMMAND_ADD_TO_FAVORITES, COMMAND_ADD_TO_LIST, COMMAND_ADD_TYPE, COMMAND_ADD_VERSION, COMMAND_ATTACH_WS_POLICY, COMMAND_ATTACH_WSDL, COMMAND_CHANGE_LIFEC_STATE, COMMAND_CHANGE_PROVIDING_ORG, COMMAND_CHECK_CONN, COMMAND_COMPARE, COMMAND_COPY_SHORTCUT, COMMAND_DELETE, COMMAND_DOCUMENTATION, COMMAND_DOWNLOAD, COMMAND_DOWNLOAD_BPEL, COMMAND_DOWNLOAD_WSDL, COMMAND_DOWNLOAD_XMLSCHEMA, COMMAND_EDIT_DETAILS, COMMAND_EXPORT, COMMAND_EXPORT_CONTENTS, COMMAND_EXPORT_FAVORITE, COMMAND_GENERATE_REPORT, COMMAND_IMPACT_ANALYSIS, COMMAND_IMPORT_ASSET, COMMAND_LC_CREATE_NEW_VERS, COMMAND_NOTIFY_ME, COMMAND_PERMISSIONS, COMMAND_REGISTER_AS_CONSUMER, COMMAND_REGISTER_CONS, COMMAND_REMOVE_FROM_FAVORITES, COMMAND_RENAME, COMMAND_RENAME_LIST, COMMAND_SHOW_DETAILS, COMMAND_VIRTUALIZE
 
Constructor Summary
AbstractFileImport(com.centrasite.control.ActionContext context, com.centrasite.control.Connector connector, java.lang.String serverUri, java.lang.String clientUri, boolean useFileMapper)
          Super constructor for all sub classes.
 
Method Summary
abstract  boolean checkExist()
          Check if the resource to be imported already exists.
 void executeCommand(com.centrasite.control.ActionContext actionContext, java.lang.String clientPath)
           
 void executeCommand(com.centrasite.control.ActionContext actionContext, java.lang.String clientPath, java.lang.String serverPath)
          Called right after the prompt-window was confirmed; checks the specified filename and enter it into file mapper table.
 int getCategory()
           
 java.lang.String getImageURL()
           
 java.lang.String getLabel()
           
 java.lang.String getName()
           
 java.lang.String getTitle()
           
abstract  java.lang.String getTitleMsgID()
          Get the message ID for window title
abstract  java.lang.String getUpdateMsgID()
          Get the message ID that object should be updated
 void handleNo(com.centrasite.control.ActionContext actionContext)
           
 void handleYes(com.centrasite.control.ActionContext actionContext)
          Prompt confirmed with "Yes"
abstract  void register()
          Do the import work by registering objects.
 void run()
          called after an intermediate prompt window was confirmed, via executeDefered()
 
Methods inherited from class com.centrasite.control.AbstractBrowseCommand
execute
 
Methods inherited from class com.centrasite.control.AbstractPromptCommand
getPromptValue
 
Methods inherited from class com.centrasite.control.AbstractCommandExt
execute, executeWrapped, getId, getLocale, getSubCommands, isEnabled, isEnabled, isImplemented, isSameGroup, isToBeVisualized, setLocale
 
Methods inherited from class com.softwareag.cis.plugin.command.AbstractCommand
execute, executeWrapped, getComparator, getSelectable, isEnabled, isSameGroup, isVisible, setEnabled, setSelectable, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFileImport

public AbstractFileImport(com.centrasite.control.ActionContext context,
                          com.centrasite.control.Connector connector,
                          java.lang.String serverUri,
                          java.lang.String clientUri,
                          boolean useFileMapper)
Super constructor for all sub classes.

Parameters:
context -
connector -
serverUri - filename of server side (an accessible temp. file)
clientUri - original filename of the client side
useFileMapper - true: make use of the file mapper (for client/server file relation) false: no file mapper usage
Method Detail

checkExist

public abstract boolean checkExist()
                            throws com.centrasite.jaxr.webservice.WSDLCallbackException,
                                   java.lang.Exception
Check if the resource to be imported already exists.

Returns:
true: object does already exist --> issue confirmation prompt false: object not present, register immediately
Throws:
com.centrasite.jaxr.webservice.WSDLCallbackException - file is missing, request for input
java.lang.Exception - any other error

register

public abstract void register()
                       throws com.centrasite.jaxr.webservice.WSDLCallbackException,
                              java.lang.Exception
Do the import work by registering objects.

Throws:
com.centrasite.jaxr.webservice.WSDLCallbackException - file is missing, request for input
java.lang.Exception - any other error

getUpdateMsgID

public abstract java.lang.String getUpdateMsgID()
Get the message ID that object should be updated

Returns:
the message ID ("INMCS_xxx")

getTitleMsgID

public abstract java.lang.String getTitleMsgID()
Get the message ID for window title

Returns:
the message ID ("INMCS_xxx")

run

public void run()
         throws java.lang.Exception
called after an intermediate prompt window was confirmed, via executeDefered()

Specified by:
run in interface com.softwareag.cis.plugin.interfaces.RunnableDeferred
Throws:
java.lang.Exception
See Also:
RunnableDeferred.run()

handleYes

public void handleYes(com.centrasite.control.ActionContext actionContext)
Prompt confirmed with "Yes"

Specified by:
handleYes in interface com.centrasite.control.discovery.PromptYesNoHandler
See Also:
PromptYesNoHandler.handleYes(com.centrasite.control.ActionContext)

handleNo

public void handleNo(com.centrasite.control.ActionContext actionContext)
Specified by:
handleNo in interface com.centrasite.control.discovery.PromptYesNoHandler
See Also:
PromptYesNoHandler.handleNo(com.centrasite.control.ActionContext)

executeCommand

public void executeCommand(com.centrasite.control.ActionContext actionContext,
                           java.lang.String clientPath)
Specified by:
executeCommand in class com.centrasite.control.AbstractPromptCommand

executeCommand

public void executeCommand(com.centrasite.control.ActionContext actionContext,
                           java.lang.String clientPath,
                           java.lang.String serverPath)
Called right after the prompt-window was confirmed; checks the specified filename and enter it into file mapper table.

Specified by:
executeCommand in class com.centrasite.control.AbstractPromptCommand
Parameters:
actionContext -
clientPath -
serverPath -
See Also:
AbstractPromptCommand.executeCommand(com.centrasite.control.ActionContext, java.lang.String, java.lang.String)

getCategory

public int getCategory()
Specified by:
getCategory in interface com.softwareag.cis.plugin.command.Command
Specified by:
getCategory in class com.centrasite.control.AbstractCommandExt

getImageURL

public java.lang.String getImageURL()
Specified by:
getImageURL in interface com.softwareag.cis.plugin.command.Command
Specified by:
getImageURL in class com.centrasite.control.AbstractCommandExt

getName

public java.lang.String getName()
Specified by:
getName in interface com.softwareag.cis.plugin.command.Command
Specified by:
getName in class com.centrasite.control.AbstractCommandExt

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in class com.centrasite.control.AbstractPromptCommand

getLabel

public java.lang.String getLabel()
Specified by:
getLabel in class com.centrasite.control.AbstractPromptCommand