uk.ac.kcl.cch.jb.pliny.views.utils
Class PlinyArchiveImporter

java.lang.Object
  extended byuk.ac.kcl.cch.jb.pliny.views.utils.PlinyArchiveImporter
All Implemented Interfaces:
IGetsArchiveEntries, IPlinyImporter

public class PlinyArchiveImporter
extends Object
implements IPlinyImporter, IGetsArchiveEntries

the Pliny Archive importer. The Pliny Archive is a ZIP file. The ZIP file contains an XML file containing the data about Pliny model objects that come from the backing store, and items that have been stored by IResourceExtensionProcessors. For each Resource that has a IResoruceExtensionProcessor associated with it, the importer will give processor a chance to fetch the data the exporter stored in the archive for it, by a call to the processor's #processArchiveEntries method.

Author:
John Bradley
See Also:
PlinyArchiveExporter

Constructor Summary
PlinyArchiveImporter()
           
PlinyArchiveImporter(String fileName)
           
 
Method Summary
 void dispose()
           
 InputStream getArchiveEntry(String name)
          asks the archive reader to deliver an InputStream from the archive for the given component name.
 boolean getOptions(org.eclipse.swt.widgets.Shell parentShell)
          the importer will call this method when it is time to get options from the user that will control this importer.
 void run(org.eclipse.core.runtime.IProgressMonitor monitor)
          the exportAction will call this method when it is time to do the import.
 void setFileName(String fileName)
          the export Action will call this method to provide a String containing the fully qualified fileName that is to be used for the import.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlinyArchiveImporter

public PlinyArchiveImporter()

PlinyArchiveImporter

public PlinyArchiveImporter(String fileName)
Method Detail

setFileName

public void setFileName(String fileName)
Description copied from interface: IPlinyImporter
the export Action will call this method to provide a String containing the fully qualified fileName that is to be used for the import.

Specified by:
setFileName in interface IPlinyImporter
Parameters:
fileName -

dispose

public void dispose()

getArchiveEntry

public InputStream getArchiveEntry(String name)
Description copied from interface: IGetsArchiveEntries
asks the archive reader to deliver an InputStream from the archive for the given component name. If null is returned, the archive had no data component of the given name.

Specified by:
getArchiveEntry in interface IGetsArchiveEntries
Parameters:
name - String requested archive data component.
Returns:
InputStream for the requested component, or null if there was none.

run

public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
         throws PlinyImportException
Description copied from interface: IPlinyImporter
the exportAction will call this method when it is time to do the import.

Specified by:
run in interface IPlinyImporter
Parameters:
monitor - monitor to be used during the import
Throws:
PlinyImportException - all internally arising exceptions should be converted to this exception

getOptions

public boolean getOptions(org.eclipse.swt.widgets.Shell parentShell)
Description copied from interface: IPlinyImporter
the importer will call this method when it is time to get options from the user that will control this importer. The return value is true if the user has confirmed that the import is to go ahead. Simply return true and do nothing else if there are no options to be provided. If there are options, this code should invoke a wizard to get them from the user.

Specified by:
getOptions in interface IPlinyImporter
Parameters:
parentShell - Shell to be used to support display of a wizard for options.
Returns:
true if user wants to proceed to actual import