edu.ucsb.nceas.morpho.datapackage
Class DataPackagePlugin

java.lang.Object
  extended byedu.ucsb.nceas.morpho.datapackage.DataPackagePlugin
All Implemented Interfaces:
DataPackageInterface, PluginInterface, ServiceProvider

public class DataPackagePlugin
extends java.lang.Object
implements PluginInterface, ServiceProvider, DataPackageInterface

Class that implements the plugin for package editing


Field Summary
static java.lang.String COPYKEY
          String for accelerator key
static java.lang.String CUTKEY
           
static java.lang.String DATA_MENU_LABEL
           
static int DATAMENUPOSITION
          Constant int for data menu position
static int DOCUMENTATIONMENUPOSITION
          Constant int for data menu position
static java.lang.String EDIT_MENU_LABEL
           
static int EDITMENUPOSITION
          Constant int for edit menu position
static java.lang.String FILE_MENU_LABEL
           
static java.lang.String METADATA_MENU_LABEL
           
static java.lang.String PASTEKEY
           
 
Fields inherited from interface edu.ucsb.nceas.morpho.framework.DataPackageInterface
BOTH, LOCAL, METACAT, NEW_DATA_TABLE_COMMAND, NEW_DATAPACKAGE_COMMAND
 
Constructor Summary
DataPackagePlugin()
          Construct the plugin.
DataPackagePlugin(Morpho morpho)
          Construct of the puglin which will be used in datapackage itself
 
Method Summary
 void createOpenPreviousVersionDialog(java.lang.String title, int numOfVersion, Morpho morpho, boolean local)
          This method will create a dialog for open previouse version of a datapackage
 void delete(java.lang.String docid, java.lang.String location)
          Deletes the package.
 void download(java.lang.String docid)
          Downloads the package from metacat.
 void export(java.lang.String docid, java.lang.String path, java.lang.String location)
          Exports the package.
 void exportToEml2(java.lang.String docid, java.lang.String path, java.lang.String location)
          Exports the package to eml2
 void exportToZip(java.lang.String docid, java.lang.String path, java.lang.String location)
          Exports the package into a zip file
 Command getCommandObject(int commandIdentifier)
          return an instance of a Command object, identified by one of the integer constants defined above
 java.lang.String getDocIdFromMorphoFrame(MorphoFrame morphoFrame)
          Method to get docid from a given morpho frame
 java.lang.String getNextId(Morpho morpho)
          returns the next local id from the config file returns null if configXML was unable to increment the id number
 void initialize(Morpho morpho)
          The plugin must store a reference to the Morpho application in order to be able to call the services available through the framework.
 boolean isDataPackageInLocal(MorphoFrame morphoFrame)
          Method to determine a data package which in a morpho frame if is in local
 boolean isDataPackageInNetwork(MorphoFrame morphoFrame)
          Method to determine a data package which in a morpho frame if is in network
 void openDataPackage(java.lang.String location, java.lang.String identifier, java.util.Vector relations, ButterflyFlapCoordinator coordinator, java.lang.String doctype)
          This method is called to open a data package that resides either locally (location=local) or on a Metacat server (location=metacat).
 void openHiddenNewDataPackage(AbstractDataPackage adp, ButterflyFlapCoordinator coordinator)
          same as openNewDataPackage except the frame is notVisible
 void openNewDataPackage(AbstractDataPackage adp, ButterflyFlapCoordinator coordinator)
          This method is called to open a data package that resides either locally (location=local) or on a Metacat server (location=metacat).
 java.lang.String upload(java.lang.String docid, boolean updateIds)
          Uploads the package to metacat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_MENU_LABEL

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

EDIT_MENU_LABEL

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

METADATA_MENU_LABEL

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

DATA_MENU_LABEL

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

DOCUMENTATIONMENUPOSITION

public static final int DOCUMENTATIONMENUPOSITION
Constant int for data menu position

See Also:
Constant Field Values

DATAMENUPOSITION

public static final int DATAMENUPOSITION
Constant int for data menu position

See Also:
Constant Field Values

EDITMENUPOSITION

public static final int EDITMENUPOSITION
Constant int for edit menu position

See Also:
Constant Field Values

COPYKEY

public static final java.lang.String COPYKEY
String for accelerator key

See Also:
Constant Field Values

CUTKEY

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

PASTEKEY

public static final java.lang.String PASTEKEY
See Also:
Constant Field Values
Constructor Detail

DataPackagePlugin

public DataPackagePlugin()
Construct the plugin. Initialize our menus and toolbars.


DataPackagePlugin

public DataPackagePlugin(Morpho morpho)
Construct of the puglin which will be used in datapackage itself

Parameters:
morpho - the morpho for this application
Method Detail

initialize

public void initialize(Morpho morpho)
The plugin must store a reference to the Morpho application in order to be able to call the services available through the framework. This is also the time to register menus and toolbars with the framework.

Specified by:
initialize in interface PluginInterface
Parameters:
morpho - Morpho

openDataPackage

public void openDataPackage(java.lang.String location,
                            java.lang.String identifier,
                            java.util.Vector relations,
                            ButterflyFlapCoordinator coordinator,
                            java.lang.String doctype)
Description copied from interface: DataPackageInterface
This method is called to open a data package that resides either locally (location=local) or on a Metacat server (location=metacat).

Specified by:
openDataPackage in interface DataPackageInterface
Parameters:
location - indicates the location from which to open the data
identifier - the unique identifier to use to open the data
relations - Vector
coordinator - the coordinator for butterfly flapping
doctype - String

openNewDataPackage

public void openNewDataPackage(AbstractDataPackage adp,
                               ButterflyFlapCoordinator coordinator)
Description copied from interface: DataPackageInterface
This method is called to open a data package that resides either locally (location=local) or on a Metacat server (location=metacat).

Specified by:
openNewDataPackage in interface DataPackageInterface
Parameters:
adp - indicates the location from which to open the data
coordinator - the coordinator for butterfly flapping

openHiddenNewDataPackage

public void openHiddenNewDataPackage(AbstractDataPackage adp,
                                     ButterflyFlapCoordinator coordinator)
Description copied from interface: DataPackageInterface
same as openNewDataPackage except the frame is notVisible

Specified by:
openHiddenNewDataPackage in interface DataPackageInterface

upload

public java.lang.String upload(java.lang.String docid,
                               boolean updateIds)
                        throws MetacatUploadException
Uploads the package to metacat. The location is assumed to be DataPackageInterface.LOCAL

Specified by:
upload in interface DataPackageInterface
Parameters:
docid - the id of the package to upload
updateIds - boolean
Returns:
String
Throws:
MetacatUploadException

download

public void download(java.lang.String docid)
Downloads the package from metacat. The location is assumed to be DataPackageInterface.METACAT

Specified by:
download in interface DataPackageInterface
Parameters:
docid - the id of the package to download

delete

public void delete(java.lang.String docid,
                   java.lang.String location)
            throws java.lang.Exception
Deletes the package.

Specified by:
delete in interface DataPackageInterface
Parameters:
docid - the id of the package to download
location - String
Throws:
java.lang.Exception

export

public void export(java.lang.String docid,
                   java.lang.String path,
                   java.lang.String location)
Exports the package.

Specified by:
export in interface DataPackageInterface
Parameters:
docid - the id of the package to export
path - the directory to which the package should be exported.
location - the location where the package is now: LOCAL, METACAT or BOTH

exportToEml2

public void exportToEml2(java.lang.String docid,
                         java.lang.String path,
                         java.lang.String location)
Exports the package to eml2

Specified by:
exportToEml2 in interface DataPackageInterface
Parameters:
docid - the id of the package to export
path - the directory to which the package should be exported.
location - the location where the package is now: LOCAL, METACAT or BOTH

exportToZip

public void exportToZip(java.lang.String docid,
                        java.lang.String path,
                        java.lang.String location)
Exports the package into a zip file

Specified by:
exportToZip in interface DataPackageInterface
Parameters:
docid - the id of the package to export
path - the directory to which the package should be exported.
location - the location where the package is now: LOCAL, METACAT or BOTH

createOpenPreviousVersionDialog

public void createOpenPreviousVersionDialog(java.lang.String title,
                                            int numOfVersion,
                                            Morpho morpho,
                                            boolean local)
This method will create a dialog for open previouse version of a datapackage

Specified by:
createOpenPreviousVersionDialog in interface DataPackageInterface
Parameters:
title - the title of the dialog, docid will be set as tile
numOfVersion - the total number of versions in this docid
morpho - the morpho file
local - the package is local or not

getNextId

public java.lang.String getNextId(Morpho morpho)
returns the next local id from the config file returns null if configXML was unable to increment the id number

Specified by:
getNextId in interface DataPackageInterface
Parameters:
morpho - the morpho file
Returns:
String

getDocIdFromMorphoFrame

public java.lang.String getDocIdFromMorphoFrame(MorphoFrame morphoFrame)
Method to get docid from a given morpho frame

Specified by:
getDocIdFromMorphoFrame in interface DataPackageInterface
Parameters:
morphoFrame - the morphoFrame which contains a datapackage
Returns:
String

isDataPackageInLocal

public boolean isDataPackageInLocal(MorphoFrame morphoFrame)
Method to determine a data package which in a morpho frame if is in local

Specified by:
isDataPackageInLocal in interface DataPackageInterface
Parameters:
morphoFrame - the morpho frame containing the data package
Returns:
boolean

isDataPackageInNetwork

public boolean isDataPackageInNetwork(MorphoFrame morphoFrame)
Method to determine a data package which in a morpho frame if is in network

Specified by:
isDataPackageInNetwork in interface DataPackageInterface
Parameters:
morphoFrame - the morpho frame containing the data package
Returns:
boolean

getCommandObject

public Command getCommandObject(int commandIdentifier)
                         throws java.lang.ClassNotFoundException
return an instance of a Command object, identified by one of the integer constants defined above

Specified by:
getCommandObject in interface DataPackageInterface
Parameters:
commandIdentifier - integer constant identifying the command Options include:
  • NEW_DATAPACKAGE_COMMAND
Returns:
Command
Throws:
java.lang.ClassNotFoundException


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.