org.eclipse.mylar.internal.monitor.usage.ui.wizards
Class UsageSubmissionWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.eclipse.mylar.internal.monitor.usage.ui.wizards.UsageSubmissionWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard, org.eclipse.ui.INewWizard, org.eclipse.ui.IWorkbenchWizard

public class UsageSubmissionWizard
extends org.eclipse.jface.wizard.Wizard
implements org.eclipse.ui.INewWizard

A wizard for uploading the Mylar statistics to a website

Author:
Shawn Minto

Field Summary
static java.lang.String BACKGROUND
           
private  java.io.File backgroundFile
           
private  IBackgroundPage backgroundPage
           
private  boolean displayBackgroundPage
           
private  boolean failed
           
private  GetNewUserIdPage getUidPage
           
static java.lang.String LOG
           
private  java.io.File monitorFile
           
private  boolean performUpload
           
static java.lang.String QUESTIONAIRE
           
private  java.io.File questionnaireFile
           
private  IQuestionnairePage questionnairePage
           
private  java.lang.String resp
          the response for the http request
static java.lang.String STATS
           
private  int status
          The status from the http request
private  int uid
          The id of the user
private  UsageUploadWizardPage uploadPage
           
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
UsageSubmissionWizard()
           
UsageSubmissionWizard(boolean performUpload)
           
 
Method Summary
 void addBackgroundPage()
           
 void addPages()
           
 boolean canFinish()
           
 boolean failed()
           
private  java.lang.String getData(java.io.InputStream i)
           
 int getExistingUid(java.lang.String firstName, java.lang.String lastName, java.lang.String emailAddress, boolean anonymous)
           
 java.lang.String getMonitorFileName()
           
 int getNewUid(java.lang.String firstName, java.lang.String lastName, java.lang.String emailAddress, boolean anonymous, java.lang.String jobFunction, java.lang.String companySize, java.lang.String companyFunction, boolean contactEmail)
           
 int getUid()
           
 UsageUploadWizardPage getUploadPage()
           
private  void init(boolean performUpload)
           
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
           
 boolean performCancel()
           
 boolean performFinish()
           
 void performUpload(org.eclipse.core.runtime.IProgressMonitor monitor)
           
private  void setTitles()
           
private  void upload(java.io.File f, java.lang.String type, org.eclipse.core.runtime.IProgressMonitor monitor)
          Method to upload a file to a cgi script
private  java.io.File zipFilesForUpload()
           
 
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
 
Methods inherited from interface org.eclipse.jface.wizard.IWizard
createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, setContainer
 

Field Detail

LOG

public static final java.lang.String LOG
See Also:
Constant Field Values

STATS

public static final java.lang.String STATS
See Also:
Constant Field Values

QUESTIONAIRE

public static final java.lang.String QUESTIONAIRE
See Also:
Constant Field Values

BACKGROUND

public static final java.lang.String BACKGROUND
See Also:
Constant Field Values

failed

private boolean failed

displayBackgroundPage

private boolean displayBackgroundPage

uid

private int uid
The id of the user


monitorFile

private final java.io.File monitorFile

uploadPage

private UsageUploadWizardPage uploadPage

getUidPage

private GetNewUserIdPage getUidPage

questionnairePage

private IQuestionnairePage questionnairePage

backgroundPage

private IBackgroundPage backgroundPage

performUpload

private boolean performUpload

questionnaireFile

private java.io.File questionnaireFile

backgroundFile

private java.io.File backgroundFile

status

private int status
The status from the http request


resp

private java.lang.String resp
the response for the http request

Constructor Detail

UsageSubmissionWizard

public UsageSubmissionWizard()

UsageSubmissionWizard

public UsageSubmissionWizard(boolean performUpload)
Method Detail

setTitles

private void setTitles()

init

private void init(boolean performUpload)

performFinish

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

performUpload

public void performUpload(org.eclipse.core.runtime.IProgressMonitor monitor)

performCancel

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

canFinish

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

getUploadPage

public UsageUploadWizardPage getUploadPage()

init

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

addPages

public void addPages()
Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard

addBackgroundPage

public void addBackgroundPage()

upload

private void upload(java.io.File f,
                    java.lang.String type,
                    org.eclipse.core.runtime.IProgressMonitor monitor)
Method to upload a file to a cgi script

Parameters:
f - The file to upload

getMonitorFileName

public java.lang.String getMonitorFileName()

getExistingUid

public int getExistingUid(java.lang.String firstName,
                          java.lang.String lastName,
                          java.lang.String emailAddress,
                          boolean anonymous)

getNewUid

public int getNewUid(java.lang.String firstName,
                     java.lang.String lastName,
                     java.lang.String emailAddress,
                     boolean anonymous,
                     java.lang.String jobFunction,
                     java.lang.String companySize,
                     java.lang.String companyFunction,
                     boolean contactEmail)

getData

private java.lang.String getData(java.io.InputStream i)

getUid

public int getUid()

failed

public boolean failed()

zipFilesForUpload

private java.io.File zipFilesForUpload()