com.softwareag.cis.plugin.ext.plugins.command
Class InstallPlugInCommand

java.lang.Object
  extended by com.softwareag.cis.plugin.command.AbstractCommand
      extended by com.softwareag.cis.plugin.ext.plugins.command.InstallPlugInCommand
All Implemented Interfaces:
Command, com.softwareag.cis.plugin.interfaces.Component
Direct Known Subclasses:
CompileLayoutsCommand

public class InstallPlugInCommand
extends AbstractCommand

This class provides support to install a plug-in either via a command line interface and via the plug-in management perspective in the GUI TODO refactoring


Nested Class Summary
static class InstallPlugInCommand.InvalidPlugInArchiveException
          Custom Exception used in case if the target plug-in directory is unknown or if zip entry is null
static class InstallPlugInCommand.PlugInDescriptorMerger
          Utility class for merging two plug-in descriptors.
 
Field Summary
 
Fields inherited from class com.softwareag.cis.plugin.command.AbstractCommand
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
InstallPlugInCommand(java.util.Locale lc)
           
 
Method Summary
 void execute(CommandContext context)
          Execute given command in this context If the context is not instanceof AbstractCommandContext the exception is rized which causes error message popup.
 int getCategory()
          Returns the category constant which can be used in some comparing i.e.
 java.lang.String getImageURL()
          The URL address of image on button for installing Plug-ins
 java.lang.String getName()
          Get localized Install Plug-in name of the command
static void main(java.lang.String[] args)
          Provide command line interface for installation of plugins.
static void streamCopy(java.io.InputStream in, java.io.OutputStream out)
          Synchronized stream copy The method do not allow other threads to read from the input or write to the output while copying is taking place
 
Methods inherited from class com.softwareag.cis.plugin.command.AbstractCommand
execute, executeWrapped, getComparator, getId, getLocale, getSelectable, getSubCommands, isEnabled, isEnabled, isSameGroup, isToBeVisualized, isVisible, setEnabled, setLocale, setSelectable, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstallPlugInCommand

public InstallPlugInCommand(java.util.Locale lc)
Method Detail

getName

public java.lang.String getName()
Get localized Install Plug-in name of the command

Specified by:
getName in interface Command
Specified by:
getName in class AbstractCommand
Returns:
Stirng Install Plug-in

getImageURL

public java.lang.String getImageURL()
The URL address of image on button for installing Plug-ins

Specified by:
getImageURL in interface Command
Specified by:
getImageURL in class AbstractCommand
Returns:
the path of the application's installPlugIn image

execute

public void execute(CommandContext context)
Execute given command in this context If the context is not instanceof AbstractCommandContext the exception is rized which causes error message popup. More detailed it sets the zip file and installs the plugin.

Specified by:
execute in interface Command
Specified by:
execute in class AbstractCommand
Parameters:
context -

getCategory

public int getCategory()
Returns the category constant which can be used in some comparing i.e. to check whether this command belongs to same group as other

Specified by:
getCategory in interface Command
Specified by:
getCategory in class AbstractCommand
Returns:
one of the CATEGORY_* values

streamCopy

public static void streamCopy(java.io.InputStream in,
                              java.io.OutputStream out)
                       throws java.io.IOException
Synchronized stream copy The method do not allow other threads to read from the input or write to the output while copying is taking place

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Provide command line interface for installation of plugins. The following options are supported: The parameter -cis.home is optionally. The value defaults to the value given with -t.

Throws:
java.lang.Exception