edu.ucsb.nceas.morpho.framework
Interface DataPackageInterface

All Known Implementing Classes:
DataPackagePlugin

public interface DataPackageInterface

All component plugins that handle access to data packages should implement this interface and register themselves as a service provider for the interface withthe framework.


Field Summary
static java.lang.String BOTH
          used to signify that this package is stored on metacat and locally.
static java.lang.String LOCAL
          used to signify that this package is located locally
static java.lang.String METACAT
          used to signify that this package is located on a metacat server
 
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)
          This method is called to delete a datapackage from metacat or the local disk.
 void download(java.lang.String docid)
          This method is called to download a datapackage from metacat to the local disk.
 void export(java.lang.String docid, java.lang.String path, java.lang.String location)
          This method exports an entire data package to a given location.
 void exportToZip(java.lang.String docid, java.lang.String path, java.lang.String location)
          This method exports an entire data package to a given location in a zip file.
 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
 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)
          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 updatedIds)
          This method is called to upload a datapackage that is currently stored locally to metacat and return a new id or orignal id.
 

Field Detail

METACAT

public static final java.lang.String METACAT
used to signify that this package is located on a metacat server

LOCAL

public static final java.lang.String LOCAL
used to signify that this package is located locally

BOTH

public static final java.lang.String BOTH
used to signify that this package is stored on metacat and locally.
Method Detail

openDataPackage

public void openDataPackage(java.lang.String location,
                            java.lang.String identifier,
                            java.util.Vector relations,
                            ButterflyFlapCoordinator coordinator)
This method is called to open a data package that resides either locally (location=local) or on a Metacat server (location=metacat).
Parameters:
location - indicates the location from which to open the data
identifier - the unique identifier to use to open the data
coordinator - the coordinator for butterfly flapping

upload

public java.lang.String upload(java.lang.String docid,
                               boolean updatedIds)
                        throws MetacatUploadException
This method is called to upload a datapackage that is currently stored locally to metacat and return a new id or orignal id.
Parameters:
docid - the id of the package to upload
updateIds - boolean to tell whether to automatically update ids when a conflict is found.

download

public void download(java.lang.String docid)
This method is called to download a datapackage from metacat to the local disk.
Parameters:
docid - the docid of the package to download

delete

public void delete(java.lang.String docid,
                   java.lang.String location)
This method is called to delete a datapackage from metacat or the local disk.
Parameters:
docid - the id of the package to delete
location - the location to delete it from. we do not necessarilly want to delete the package from metacat and the local disk. the user could just want to delete it in one of those places.

export

public void export(java.lang.String docid,
                   java.lang.String path,
                   java.lang.String location)
This method exports an entire data package to a given location.
Parameters:
id - the docid of the package to export
path - the location to export it to
location - the current location of the package: METACAT, LOCAL or BOTH

exportToZip

public void exportToZip(java.lang.String docid,
                        java.lang.String path,
                        java.lang.String location)
This method exports an entire data package to a given location in a zip file.
Parameters:
id - the docid of the package to export
path - the location to export it to
location - the current location of the package: METACAT, LOCAL 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
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
Parameters:
morpho - the morpho file

getDocIdFromMorphoFrame

public java.lang.String getDocIdFromMorphoFrame(MorphoFrame morphoFrame)
Method to get docid from a given morpho frame
Parameters:
morphoFrame - the morphoFrame which contains a datapackage

isDataPackageInLocal

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

isDataPackageInNetwork

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


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