Administration Tools

org.topcased.service.updatesiteproject
Class UpdateSiteProjectWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.topcased.service.updatesiteproject.UpdateSiteProjectWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard

public class UpdateSiteProjectWizard
extends org.eclipse.jface.wizard.Wizard

This is the main class of the Wizard This class can search the features included, plugins or plugins required to the features choosen This class can copy/unjar the features/plugins to a destination This class can create a FTP or SSH connections and give some information about them


Field Summary
 java.lang.String error
           
static int FILE
          FILE - Identifier of connection host protocol
static int FTP
          FTP - Identifier of connection host protocol
static java.lang.String PRIVATE_KEY_PATH
          PRIVATE_KEY_PATH - If a SSH connection is used
static int SSH
          SSH - Identifier of connection host protocol
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
UpdateSiteProjectWizard()
           
 
Method Summary
 void addPages()
          Add all the necessary pages of the wizard
 boolean canFinish()
           
 boolean checkFilePath(java.lang.String object, java.lang.String path)
          This method concerns and works with the featurePage object.
static java.lang.String checkPath(java.lang.String pathToCheck, boolean pathNature)
          This method is aimed to solve path problems independantly of the system.
 void copyTemporaryFeature(java.lang.String name)
          This method is applied only in the case of SSH or FTP access.
 void createConnectionFTP()
          create a FTP connection to the remote FTP server
 boolean createConnectionSSH()
          This method establishes a SSH connection in two major steps : - key exchange between the client and the server - authentication of a user using one of the three methods allowed
 void disconnect()
          This method disconnect a client form a remote FTP or SSH server.
 java.lang.String getApplicationFeatureProject()
           
 java.lang.String getArchFeatureProject()
           
 BrowseUpdateSiteProjectPage getBrowsePage()
           
 org.eclipse.ftp.internal.FTPClient getClientFTP()
           
 SftpClient getClientSFTP()
           
 SshClient getClientSSH()
           
 java.lang.String getColocationFeatureProject()
           
 ConnectUpdateSiteProjectPage getConnectPage()
           
 java.lang.String getCplV10HtmlPath()
           
 java.lang.String getDescriptionFeatureProject()
           
 java.lang.String getEclipseUpdateJpgPath()
           
 java.lang.String getExclusiveFeatureProject()
           
 java.lang.String getHost()
           
 java.lang.String getImageFeatureProject()
           
 java.util.Vector getIOErrorVector()
           
 java.lang.String getLabelFeatureProject()
           
 java.lang.String getLicenceHtmlPath()
           
 java.util.Map getMapFeatures()
           
 java.util.Map getMapPA()
           
 java.util.Map getMapUS()
           
 java.lang.String getNameFeatureProject()
           
 java.lang.String getNlFeatureProject()
           
 java.lang.String getOsFeatureProject()
           
 java.lang.String getPassword()
           
 java.lang.String getPluginFeatureProject()
           
 int getPort()
           
 java.lang.String getPrimaryFeatureProject()
           
 java.lang.String getProjectPath()
           
 int getProtocolConnexion()
           
 java.lang.String getProviderNameFeatureProject()
           
 java.lang.String getUpdateSitePath()
           
 java.lang.String getUrlDescriptionFeatureProject()
           
 java.lang.String getUsername()
           
 java.lang.String getVersionFeatureProject()
           
 java.lang.String getWsFeatureProject()
           
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
           
 boolean isConnected()
           
 boolean performCancel()
          Function executed when the button 'Cancel' is clicked
 boolean performFinish()
           
 void setApplicationFeatureProject(java.lang.String applicationFeatureProject)
           
 void setArchFeatureProject(java.lang.String archFeatureProject)
           
 void setClientFTP(org.eclipse.ftp.internal.FTPClient clientFTP)
           
 void setClientSFTP(SftpClient clientSFTP)
           
 void setClientSSH(SshClient clientSSH)
           
 void setColocationFeatureProject(java.lang.String colocationFeatureProject)
           
 void setCplV10HtmlPath(java.lang.String cplV10HtmlPath)
           
 void setDescriptionFeatureProject(java.lang.String descriptionFeatureProject)
           
 void setEclipseUpdateJpgPath(java.lang.String eclipseUpdateJpgPath)
           
 void setExclusiveFeatureProject(java.lang.String exclusiveFeatureProject)
           
 void setHost(java.lang.String host)
           
 void setImageFeatureProject(java.lang.String imageFeatureProject)
           
 void setLabelFeatureProject(java.lang.String labelFeatureProject)
           
 void setLicenceHtmlPath(java.lang.String licenceHtmlPath)
           
 void setNameFeatureProject(java.lang.String idFeatureProject)
           
 void setNlFeatureProject(java.lang.String nlFeatureProject)
           
 void setOsFeatureProject(java.lang.String osFeatureProject)
           
 void setPassword(java.lang.String password)
           
 void setPluginFeatureProject(java.lang.String pluginFeatureProject)
           
 void setPort(int port)
           
 void setPrimaryFeatureProject(java.lang.String primaryFeatureProject)
           
 void setProjectPath(java.lang.String path)
           
 void setProtocolConnexion(int protocolConnexion)
           
 void setProviderNameFeatureProject(java.lang.String providerNameFeatureProject)
           
 void setUpdateSitePath(java.lang.String path)
           
 void setUrlDescriptionFeatureProject(java.lang.String urlDescriptionFeatureProject)
           
 void setUsername(java.lang.String username)
           
 void setVersionFeatureProject(java.lang.String versionFeatureProject)
           
 void setWsFeatureProject(java.lang.String wsFeatureProject)
           
 boolean userAuthenticationSHH(SshAuthenticationClient client)
          This method authenticates a client according to the choosen method (public key, interactive keyboard, password)
 void zipFile(java.io.File[] files, java.util.jar.JarOutputStream output, java.lang.String path)
          Zip Files
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FTP

public static final int FTP
FTP - Identifier of connection host protocol

See Also:
Constant Field Values

SSH

public static final int SSH
SSH - Identifier of connection host protocol

See Also:
Constant Field Values

FILE

public static final int FILE
FILE - Identifier of connection host protocol

See Also:
Constant Field Values

PRIVATE_KEY_PATH

public static final java.lang.String PRIVATE_KEY_PATH
PRIVATE_KEY_PATH - If a SSH connection is used

See Also:
Constant Field Values

error

public java.lang.String error
Constructor Detail

UpdateSiteProjectWizard

public UpdateSiteProjectWizard()
Method Detail

init

public void init(org.eclipse.ui.IWorkbench workbench,
                 org.eclipse.jface.viewers.IStructuredSelection selection)
See Also:
IWorkbenchWizard.init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)

checkPath

public static java.lang.String checkPath(java.lang.String pathToCheck,
                                         boolean pathNature)
This method is aimed to solve path problems independantly of the system. First, the good file separator is added at the end of the path. Secondly, the function check that all the file separator contained are correct. If it is not the case, they are replaced by the good one.

Parameters:
pathToCheck - The string to evaluate
pathNature - The string nature : true for a local path, false for a distant path.
Returns:
The new path corrected.

performCancel

public boolean performCancel()
Function executed when the button 'Cancel' is clicked

Specified by:
performCancel in interface org.eclipse.jface.wizard.IWizard
Overrides:
performCancel in class org.eclipse.jface.wizard.Wizard
Returns:
boolean true if the wizard is canceled, false otherwise

getIOErrorVector

public java.util.Vector getIOErrorVector()
Returns:
Returns the iOErrorVector.

addPages

public void addPages()
Add all the necessary pages of the wizard

Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard

performFinish

public boolean performFinish()
Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard
See Also:
IWizard.performFinish()

canFinish

public boolean canFinish()
Specified by:
canFinish in interface org.eclipse.jface.wizard.IWizard
Overrides:
canFinish in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.canFinish()

getConnectPage

public ConnectUpdateSiteProjectPage getConnectPage()
Returns:
the connection page

getBrowsePage

public BrowseUpdateSiteProjectPage getBrowsePage()
Returns:
Returns the browsePage.

getHost

public java.lang.String getHost()
Returns:
Returns the host.

setHost

public void setHost(java.lang.String host)
Parameters:
host - The host to set.

getPort

public int getPort()
Returns:
Returns the port.

setPort

public void setPort(int port)
Parameters:
port - The port to set.

getPassword

public java.lang.String getPassword()
Returns:
Returns the password.

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - The password to set.

getProtocolConnexion

public int getProtocolConnexion()
Returns:
Returns the protocolConnexion.

setProtocolConnexion

public void setProtocolConnexion(int protocolConnexion)
Parameters:
protocolConnexion - The protocolConnexion to set.

getUsername

public java.lang.String getUsername()
Returns:
Returns the username.

setUsername

public void setUsername(java.lang.String username)
Parameters:
username - The username to set.

getUpdateSitePath

public java.lang.String getUpdateSitePath()
Returns:
the update site path

setUpdateSitePath

public void setUpdateSitePath(java.lang.String path)
Parameters:
path - the update site path to set

getProjectPath

public java.lang.String getProjectPath()
Returns:
the project path

setProjectPath

public void setProjectPath(java.lang.String path)
Parameters:
path - the project path to set

getCplV10HtmlPath

public java.lang.String getCplV10HtmlPath()
Returns:
Returns the cplV10HtmlPath.

setCplV10HtmlPath

public void setCplV10HtmlPath(java.lang.String cplV10HtmlPath)
Parameters:
cplV10HtmlPath - The cplV10HtmlPath to set.

getEclipseUpdateJpgPath

public java.lang.String getEclipseUpdateJpgPath()
Returns:
Returns the eclipseUpdateJpgPath.

setEclipseUpdateJpgPath

public void setEclipseUpdateJpgPath(java.lang.String eclipseUpdateJpgPath)
Parameters:
eclipseUpdateJpgPath - The eclipseUpdateJpgPath to set.

getLicenceHtmlPath

public java.lang.String getLicenceHtmlPath()
Returns:
Returns the licenceHtmlPath.

setLicenceHtmlPath

public void setLicenceHtmlPath(java.lang.String licenceHtmlPath)
Parameters:
licenceHtmlPath - The licenceHtmlPath to set.

getApplicationFeatureProject

public java.lang.String getApplicationFeatureProject()
Returns:
Returns the applicationFeatureProject.

setApplicationFeatureProject

public void setApplicationFeatureProject(java.lang.String applicationFeatureProject)
Parameters:
applicationFeatureProject - The applicationFeatureProject to set.

getArchFeatureProject

public java.lang.String getArchFeatureProject()
Returns:
Returns the archFeatureProject.

setArchFeatureProject

public void setArchFeatureProject(java.lang.String archFeatureProject)
Parameters:
archFeatureProject - The archFeatureProject to set.

getColocationFeatureProject

public java.lang.String getColocationFeatureProject()
Returns:
Returns the colocationFeatureProject.

setColocationFeatureProject

public void setColocationFeatureProject(java.lang.String colocationFeatureProject)
Parameters:
colocationFeatureProject - The colocationFeatureProject to set.

getDescriptionFeatureProject

public java.lang.String getDescriptionFeatureProject()
Returns:
Returns the descriptionFeatureProject.

setDescriptionFeatureProject

public void setDescriptionFeatureProject(java.lang.String descriptionFeatureProject)
Parameters:
descriptionFeatureProject - The descriptionFeatureProject to set.

getExclusiveFeatureProject

public java.lang.String getExclusiveFeatureProject()
Returns:
Returns the exclusiveFeatureProject.

setExclusiveFeatureProject

public void setExclusiveFeatureProject(java.lang.String exclusiveFeatureProject)
Parameters:
exclusiveFeatureProject - The exclusiveFeatureProject to set.

getNameFeatureProject

public java.lang.String getNameFeatureProject()
Returns:
Returns the idFeatureProject.

setNameFeatureProject

public void setNameFeatureProject(java.lang.String idFeatureProject)
Parameters:
idFeatureProject - The idFeatureProject to set.

getVersionFeatureProject

public java.lang.String getVersionFeatureProject()
Returns:
Returns the versionFeatureProject.

setVersionFeatureProject

public void setVersionFeatureProject(java.lang.String versionFeatureProject)
Parameters:
versionFeatureProject - The versionFeatureProject to set.

getImageFeatureProject

public java.lang.String getImageFeatureProject()
Returns:
Returns the imageFeatureProject.

setImageFeatureProject

public void setImageFeatureProject(java.lang.String imageFeatureProject)
Parameters:
imageFeatureProject - The imageFeatureProject to set.

getLabelFeatureProject

public java.lang.String getLabelFeatureProject()
Returns:
Returns the labelFeatureProject.

setLabelFeatureProject

public void setLabelFeatureProject(java.lang.String labelFeatureProject)
Parameters:
labelFeatureProject - The labelFeatureProject to set.

getNlFeatureProject

public java.lang.String getNlFeatureProject()
Returns:
Returns the nlFeatureProject.

setNlFeatureProject

public void setNlFeatureProject(java.lang.String nlFeatureProject)
Parameters:
nlFeatureProject - The nlFeatureProject to set.

getOsFeatureProject

public java.lang.String getOsFeatureProject()
Returns:
Returns the osFeatureProject.

setOsFeatureProject

public void setOsFeatureProject(java.lang.String osFeatureProject)
Parameters:
osFeatureProject - The osFeatureProject to set.

getPluginFeatureProject

public java.lang.String getPluginFeatureProject()
Returns:
Returns the pluginFeatureProject.

setPluginFeatureProject

public void setPluginFeatureProject(java.lang.String pluginFeatureProject)
Parameters:
pluginFeatureProject - The pluginFeatureProject to set.

getPrimaryFeatureProject

public java.lang.String getPrimaryFeatureProject()
Returns:
Returns the primaryFeatureProject.

setPrimaryFeatureProject

public void setPrimaryFeatureProject(java.lang.String primaryFeatureProject)
Parameters:
primaryFeatureProject - The primaryFeatureProject to set.

getProviderNameFeatureProject

public java.lang.String getProviderNameFeatureProject()
Returns:
Returns the providerNameFeatureProject.

setProviderNameFeatureProject

public void setProviderNameFeatureProject(java.lang.String providerNameFeatureProject)
Parameters:
providerNameFeatureProject - The providerNameFeatureProject to set.

getUrlDescriptionFeatureProject

public java.lang.String getUrlDescriptionFeatureProject()
Returns:
Returns the urlDescriptionFeatureProject.

setUrlDescriptionFeatureProject

public void setUrlDescriptionFeatureProject(java.lang.String urlDescriptionFeatureProject)
Parameters:
urlDescriptionFeatureProject - The urlDescriptionFeatureProject to set.

getWsFeatureProject

public java.lang.String getWsFeatureProject()
Returns:
Returns the wsFeatureProject.

setWsFeatureProject

public void setWsFeatureProject(java.lang.String wsFeatureProject)
Parameters:
wsFeatureProject - The wsFeatureProject to set.

getMapUS

public java.util.Map getMapUS()
Returns:
the feature map of the update site

getMapPA

public java.util.Map getMapPA()
Returns:
the feature map of the project location

getMapFeatures

public java.util.Map getMapFeatures()
Returns:
Returns the mapFeatures.

getClientFTP

public org.eclipse.ftp.internal.FTPClient getClientFTP()
Returns:
Returns the clientFTP.

setClientFTP

public void setClientFTP(org.eclipse.ftp.internal.FTPClient clientFTP)
Parameters:
clientFTP - The clientFTP to set.

getClientSFTP

public SftpClient getClientSFTP()
Returns:
Returns the clientSFTP.

setClientSFTP

public void setClientSFTP(SftpClient clientSFTP)
Parameters:
clientSFTP - The clientSFTP to set.

getClientSSH

public SshClient getClientSSH()
Returns:
Returns the clientSSH.

setClientSSH

public void setClientSSH(SshClient clientSSH)
Parameters:
clientSSH - The clientSSH to set.

createConnectionFTP

public void createConnectionFTP()
create a FTP connection to the remote FTP server


userAuthenticationSHH

public boolean userAuthenticationSHH(SshAuthenticationClient client)
This method authenticates a client according to the choosen method (public key, interactive keyboard, password)

Parameters:
client - represents the current method authentication tried by a client
Returns:
returns true is the user is authenticated, false if the authentication method has failed.

createConnectionSSH

public boolean createConnectionSSH()
This method establishes a SSH connection in two major steps : - key exchange between the client and the server - authentication of a user using one of the three methods allowed

Returns:
returns true if the connection is established for a given user, false if the connection failed

disconnect

public void disconnect()
This method disconnect a client form a remote FTP or SSH server. First, the connection state is checked with the method isConnected().


isConnected

public boolean isConnected()
Returns:
true if the wizard is connected to a remote server, false otherwise

zipFile

public void zipFile(java.io.File[] files,
                    java.util.jar.JarOutputStream output,
                    java.lang.String path)
             throws java.io.IOException
Zip Files

Parameters:
files - : all files to zip
output - : destination jar
path - : path in the jar
Throws:
java.io.IOException

checkFilePath

public boolean checkFilePath(java.lang.String object,
                             java.lang.String path)
This method concerns and works with the featurePage object. This method checks and detects the cases where a path is already affected for a object which can be the public License, the image project or the HTML page.

Returns:
true if the given path is not already contained in the map, otherwise false.

copyTemporaryFeature

public void copyTemporaryFeature(java.lang.String name)
This method is applied only in the case of SSH or FTP access. Before displaying feature information, the file is opied in a local temporary directory.

Parameters:
name - The feature name
pathDestination -

Administration Tools

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.