edu.ucsb.nceas.morpho.plugins.datapackagewizard
Class DataPackageWizardPlugin

java.lang.Object
  extended byedu.ucsb.nceas.morpho.plugins.datapackagewizard.DataPackageWizardPlugin
All Implemented Interfaces:
DataPackageWizardInterface, PluginInterface, ServiceProvider

public class DataPackageWizardPlugin
extends java.lang.Object
implements PluginInterface, ServiceProvider, DataPackageWizardInterface

Main controller class for creating and starting a Data Package Wizard Plugin


Field Summary
 
Fields inherited from interface edu.ucsb.nceas.morpho.plugins.DataPackageWizardInterface
ACCESS, ACCESS_PAGE, ATTRIBUTE_PAGE, CITATION_PAGE, CODE_DEFINITION, CODE_IMPORT_PAGE, CODE_IMPORT_SUMMARY, CUSTOM_UNIT_PAGE, DATA_FORMAT, DATA_LOCATION, ENTITY, GENERAL, GEOGRAPHIC, GEOGRAPHIC_PAGE, INTRODUCTION, KEYWORDS, KEYWORDS_PAGE, METHODS, METHODS_PAGE, PARTY_ASSOCIATED, PARTY_ASSOCIATED_PAGE, PARTY_CITATION_AUTHOR, PARTY_CONTACT, PARTY_CONTACT_PAGE, PARTY_CREATOR, PARTY_CREATOR_PAGE, PARTY_INTRO, PARTY_PERSONNEL, PROJECT, SUMMARY, TAXONOMIC, TEMPORAL, TEMPORAL_PAGE, TEXT_IMPORT_WIZARD, USAGE_RIGHTS
 
Constructor Summary
DataPackageWizardPlugin()
          Constructor
 
Method Summary
static boolean deleteExistingAndAddPageDataToDOM(AbstractDataPackage adp, java.util.List pageList, java.lang.String rootXPath, java.lang.String subtreeGenericName)
          deletes all existing subtrees of name subtreeGenericName, then inserts data for each AbstractUIPage in pageList into the passed AbstractDataPackage
 AbstractUIPage getPage(java.lang.String pageID)
          returns the WizardPage with the corresponding pageID provided
 void initialize(Morpho morpho)
          Required by PluginInterface; called automatically at runtime
static void main(java.lang.String[] args)
           
static boolean populatePartiesList(CustomList partiesCustomList, java.util.List partiesOrderedMapList, java.lang.String partyXPathRoot, java.lang.String pageType)
          Given a UI CustomList, populates it from the nvps in the List of OrderedMap objects passed as partiesOrderedMapList
 void startCodeDefImportWizard(DataPackageWizardListener listener)
          method to start the Code Definitions Import wizard
 void startEntityWizard(DataPackageWizardListener listener)
          Required by DataPackageWizardInterface: method to start the Entity wizard
 void startPackageWizard(DataPackageWizardListener listener)
          Required by DataPackageWizardInterface: method to start the Package wizard
static void updateDOMFromPartiesList(CustomList partiesCustomList, java.lang.String rootXPath, java.lang.String subtreeGenericName, java.lang.String pageType)
          Given a CustomList containing Party listings, updates the DOM to contain those listings
static void updatePartiesListFromDOM(CustomList partiesCustomList, java.lang.String rootXPath, java.lang.String subtreeGenericName, java.lang.String pageType)
          Given a CustomList containing Party listings, updates that list to contain the parties in the DOM
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataPackageWizardPlugin

public DataPackageWizardPlugin()
Constructor

Method Detail

initialize

public void initialize(Morpho morpho)
Required by PluginInterface; called automatically at runtime

Specified by:
initialize in interface PluginInterface
Parameters:
morpho - a reference to the Morpho

startPackageWizard

public void startPackageWizard(DataPackageWizardListener listener)
Required by DataPackageWizardInterface: method to start the Package wizard

Specified by:
startPackageWizard in interface DataPackageWizardInterface
Parameters:
listener - the DataPackageWizardListener to be called back when the Package Wizard has finished

startEntityWizard

public void startEntityWizard(DataPackageWizardListener listener)
Required by DataPackageWizardInterface: method to start the Entity wizard

Specified by:
startEntityWizard in interface DataPackageWizardInterface
Parameters:
listener - the DataPackageWizardListener to be called back when the Entity Wizard has finished

startCodeDefImportWizard

public void startCodeDefImportWizard(DataPackageWizardListener listener)
method to start the Code Definitions Import wizard

Specified by:
startCodeDefImportWizard in interface DataPackageWizardInterface
Parameters:
listener - the DataPackageWizardListener to be called back when the Wizard has finished

getPage

public AbstractUIPage getPage(java.lang.String pageID)
returns the WizardPage with the corresponding pageID provided

Specified by:
getPage in interface DataPackageWizardInterface
Parameters:
pageID - the String pageID for the WizardPage to be returned
Returns:
the corresponding WizardPage with this ID

main

public static void main(java.lang.String[] args)

deleteExistingAndAddPageDataToDOM

public static boolean deleteExistingAndAddPageDataToDOM(AbstractDataPackage adp,
                                                        java.util.List pageList,
                                                        java.lang.String rootXPath,
                                                        java.lang.String subtreeGenericName)
deletes all existing subtrees of name subtreeGenericName, then inserts data for each AbstractUIPage in pageList into the passed AbstractDataPackage

Parameters:
adp - the AbstractDataPackage where the data will be inserted
pageList - List of AbstractUIPages that are the source of the data, in the order that they should be added to the DOM
rootXPath - the String that represents the "root" of the XPath to the content of each AbstractUIPage, NOT INCLUDING PREDICATES. example - if the list contains "Party" widgets, being used for "creator" entries, then xPathRoot = "creator"
subtreeGenericName - String - eg "contact", "project" etc (@see lib/eml200KeymapConfig.xml)
Returns:
boolean true if this page data successfully added to the datapkg, false if not.

updateDOMFromPartiesList

public static void updateDOMFromPartiesList(CustomList partiesCustomList,
                                            java.lang.String rootXPath,
                                            java.lang.String subtreeGenericName,
                                            java.lang.String pageType)
Given a CustomList containing Party listings, updates the DOM to contain those listings

Parameters:
partiesCustomList - CustomList the UI CustomList containing the party objects to be added to the DOM
rootXPath - the String that represents the "root" of the XPath to the content of each AbstractUIPage, NOT INCLUDING PREDICATES. example - if the list contains "Party" widgets, being used for "creator" entries, then xPathRoot = "creator"
subtreeGenericName - String - eg "contact", "project" etc (@see lib/eml200KeymapConfig.xml)
pageType - the type of page object to use, as defined in the DataPackageWizardInterface class - eg: DataPackageWizardInterface.PARTY_CREATOR DataPackageWizardInterface.PARTY_PERSONNEL etc...

updatePartiesListFromDOM

public static void updatePartiesListFromDOM(CustomList partiesCustomList,
                                            java.lang.String rootXPath,
                                            java.lang.String subtreeGenericName,
                                            java.lang.String pageType)
Given a CustomList containing Party listings, updates that list to contain the parties in the DOM

Parameters:
partiesCustomList - CustomList the UI CustomList containing the party objects to be added to the DOM
rootXPath - the String that represents the "root" of the XPath to the content of each AbstractUIPage, NOT INCLUDING PREDICATES. example - if the list contains "Party" widgets, being used for "creator" entries, then xPathRoot = "creator"
subtreeGenericName - String - eg "contact", "project" etc (@see lib/eml200KeymapConfig.xml)

populatePartiesList

public static boolean populatePartiesList(CustomList partiesCustomList,
                                          java.util.List partiesOrderedMapList,
                                          java.lang.String partyXPathRoot,
                                          java.lang.String pageType)
Given a UI CustomList, populates it from the nvps in the List of OrderedMap objects passed as partiesOrderedMapList

Parameters:
partiesCustomList - CustomList the CustomList of parties to be updated
partiesOrderedMapList - List the list OrderedMaps containing party nvps to be made into entries on the parties list
partyXPathRoot - String - the xpath relative to the subtree root we're dealing with - so for example, if we're in dataset, contact's path would be: /contact or if we're dealing with project, the path would be /project/personnel etc
Returns:
boolean


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