Package ucar.unidata.idv
Class IdvPersistenceManager
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.IdvPersistenceManager
- All Implemented Interfaces:
ActionListener,EventListener,IdvConstants,PrototypeManager
This class defines what is to be saved when we are
doing an advanced save of the state to a bundle
- Author:
- IDV development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String_more_static final intThe type to specify all bundlesstatic final intThe type to specify the datastatic final intThe type to specify the display templatesstatic final intThe type to specify the "Favorites" bundlesstatic final StringCategory namestatic final StringCategory namestatic final StringThe separator to use when displaying categoriesstatic final StringThe separator used in XMLstatic final StringThe macro for the bundle path in data pathsstatic final Stringproperty idstatic final Stringproperty idstatic final Stringproperty id for ensemble liststatic final Stringstatic final Stringproperty idstatic final StringThe macro for the zidv path in data pathsFields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, windowFields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOERRORSINGUI, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_APPEARANCEMODE, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, PROP_USE_TIMEDRIVER, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddBundleCategory(int bundleType, String category) Add the directoryvoidaddFileMapping(String identifier, List files) Add a file mapping.protected booleanaddToBundle(Hashtable data, boolean usePersistenceManager, List displayControls) This method adds into the given hashtable the data sources, display controls, view managers and extra gui state for later persistence.protected booleanaddToBundle(Hashtable data, List dataSources, List displayControls, List viewManagers, String jython) Add the given state, if non null, to the bundle hashtableprotected Stringreplace any macros in the bundle xmlstatic StringcategoriesToString(List cats) Utility to convert a list of categories into a single string to show the user.voidchangeData(Object[] input) change databooleanchangeState(DataSource dataSource) n/abooleanchangeState(DataSource dataSource, boolean andReload) n/avoidClear any filemappings.voidClear the prototype for the given classvoidcopyBundle(SavedBundle bundle, List categories, int bundleType) Copy the bundle to the given category areavoiddecodeBase64Bundle(String base64Bundle) This does the actual work of converting the given base 64 encoded bundle xml into a String and loading it in.voiddecodeJnlpFile(String filename) Decode the jnlp filevoidUsing the XmlEncoder, decode the given xml string.voiddecodeXml(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) Using the XmlEncoder, decode the given xml string.booleandecodeXmlFile(String xmlFile, boolean checkToRemove) Read in the contents of the given xmlFile and evaluate the xmlbooleandecodeXmlFile(String xmlFile, boolean checkToRemove, boolean letUserChangeData) Read in the contents of the given xmlFile and evaluate the xmlbooleandecodeXmlFile(String xmlFile, boolean checkToRemove, Hashtable bundleProperties) Read in the contents of the given xmlFile and evaluate the xmlbooleandecodeXmlFile(String xmlFile, String label, boolean checkToRemove) Read in the contents of the given xmlFile and evaluate the xmlbooleandecodeXmlFile(String xmlFile, String label, boolean checkToRemove, boolean letUserChangeData, Hashtable bundleProperties) decode the xmlbooleandecodeXmlFile(String xmlFile, String label, boolean checkToRemove, Hashtable bundleProperties) Import the bundle fileprotected voiddecodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog) This does the real work of decoding an xml bundle.protected voiddecodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) This does the real work of decoding an xml bundle.voiddeleteBundle(String templateFile) Remove the given templatevoiddeleteBundleCategory(int bundleType, String category) Delete the directory and all of its contents that the given category represents.voidImport the given file as the given bundle typevoidCalled from the menu command to open the default bundlevoiddoSave()Save the current state off to the current xidv filenamebooleanSave the current state into the specified filenamebooleanSave the current state into the specified filenamebooleanSave the current state into the specified filenamevoiddoSaveAs()Have the user select an xidv filename and write the current application state to it.voidThis api is called from the ISL to generate the zidv file using the export tag with what equals zidv and filenamevoidCalled from the menu command to save the current state as the default bundlevoidHave the user select an xidv filename for their favoritesvoidexport(SavedBundle bundle, int bundleType) Export the bundleextractBundleFromJnlp(String filename) This reads in the jnlp xml from the given filename.fileToCategories(String root, String filename) The given filename is a full path under the given root.getAllCategories(int bundleType) Get a list of all of the categories for the given bundleTypegetBundleDirectory(int bundleType) Get the directory that holds the given bundle typestatic StringGets the bundle idv version.getBundles(int bundleType) Get the list ofSavedBundlesgetBundleTitle(int bundleType) Get the title to use for the given bundle typegetBundleXml(boolean formatXml) This creates an xml encoded hashtable that contains the application state.getBundleXml(boolean formatXml, boolean usePersistenceManager) This creates an xml encoded hashtable that contains the application state.static StringgetBundleXml(List<SavedBundle> bundles, boolean includeCategoryInUrl) Make the bundles xmlvoidCreate and add into the list the specicalControlDescriptors that use the display templates.Get the last xidv filename for doing saves/saveas.Get the CurrentTemplateName property.Get list of data soruce bundlesprotected ListGet the data sources we should persistGet the list of display templates.Create, if needed, and return the list ofSavedBundlesget categoriesCreate, if needed, and return te GUI panel to put into the file dialog when saving a file.getJnlpBundle(String xml) A utility to create a jnlp file from the given bundlegetJnlpBundle(String xml, boolean embedBundle, String extraArgs) A utility to create a jnlp file from the given bundleCreate, if needed, and return the list of locally savedSavedBundlesInstantiate a new object for the given class.booleanShould the visad data be savedbooleanShould the data sources be savedbooleanShould the displays be savedbooleanShould the jython be savedbooleanShould the view state be savedgetWritableBundles(int bundleType) Get the list ofSavedBundles that are writablegetXmlBundles(int type) get list of xml bundles for the given typevoidinitBundleMenu(int bundleType, JMenu bundleMenu) Initialize the bundle menuprotected voidinstantiateFromBundle(Hashtable ht, boolean fromCollab, LoadBundleDialog loadDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) The given Hashtable contains the objects taht were saved in the xml bundle file.instantiateFromTemplate(String templateFile) Create the DisplayControl from the bundle in the given templateFilevoidloadB64Bundle(String base64Bundle) This converts the given base 64 encoded xml bundle into an xml String and loads it in.make category widgetmakeDataSourceFromXml(String dataSourceXml) This creates a new data source from the xml encoded representation of a persisted data source.voidmoveBundle(SavedBundle bundle, List categories, int bundleType) Move the bundle to the given category areavoidmoveCategory(List fromCategories, List toCategories, int bundleType) Move the bundle categoryvoidmoveOrCopyBundle(SavedBundle bundle, List categories, int bundleType, boolean move) Move or copy the bundle to the given category area, depending on the given argument.booleanopen(SavedBundle bundle) Open the given bundlebooleanopen(SavedBundle bundle, boolean askToRemove) Open the given bundlevoidrename(SavedBundle bundle, int bundleType) Rename the bundlevoidsaveDataSource(DataSource dataSource) voidsaveDisplayControl(DisplayControl displayControl) Write out the given display controlvoidsaveDisplayControl(DisplayControl displayControl, File file) Write out the given display control to te given filevoidsaveDisplayControlFavorite(DisplayControl displayControl, String templateName) Prompt the user for a name and write out the given display control as a bundle into the user's .unidata/idv/displaytemplates directory.voidsetAddWindows(boolean bl) create window in the ISL offscreen modevoidSet the last xidv filename for doing saves/saveas.voidsetFileMapping(List ids, List files) Define one or more file mappings.static ListstringToCategories(String category) Retur a list of categories from the given stringvoidwritePrototype(Object object) Save off the given object as a prototypeMethods inherited from class ucar.unidata.idv.IdvManager
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDoneMethods inherited from class ucar.unidata.ui.WindowHolder
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
-
Field Details
-
PROP_BUNDLEPATH
The macro for the bundle path in data paths- See Also:
-
PROP_ZIDVPATH
The macro for the zidv path in data paths- See Also:
-
PROP_TIMESLIST
property id- See Also:
-
PROP_DRIVERTIMESTART
property id- See Also:
-
PROP_DRIVERTIMEEND
property id- See Also:
-
PROP_GEOSELECTION
- See Also:
-
PROP_ENSLIST
property id for ensemble list- See Also:
-
CAT_GENERAL
Category name- See Also:
-
CAT_TOOLBAR
Category name- See Also:
-
BUNDLES_ALL
public static final int BUNDLES_ALLThe type to specify all bundles- See Also:
-
BUNDLES_FAVORITES
public static final int BUNDLES_FAVORITESThe type to specify the "Favorites" bundles- See Also:
-
BUNDLES_DISPLAY
public static final int BUNDLES_DISPLAYThe type to specify the display templates- See Also:
-
BUNDLES_DATA
public static final int BUNDLES_DATAThe type to specify the data- See Also:
-
CATEGORY_SEPARATOR
The separator to use when displaying categories- See Also:
-
CATEGORY_SEPARATOR_XML
The separator used in XML- See Also:
-
bundleIdvVersion
_more_
-
-
Constructor Details
-
IdvPersistenceManager
The ctor- Parameters:
idv- The IDV
-
-
Method Details
-
getControlDescriptors
Create and add into the list the specicalControlDescriptors that use the display templates.- Parameters:
l- List of control descriptors to add to
-
setFileMapping
Define one or more file mappings. The ids is a list of Strings that are used to identify a data source. The files is a list of Lists of filenames, one list for each corresponding data source id. This gets used when we unpersist data sources. If we have any file mappings we pass these onto the data source so they can change their actual file- Parameters:
ids- List of String idsfiles- List of lists of filenames
-
clearFileMapping
public void clearFileMapping()Clear any filemappings. -
setAddWindows
public void setAddWindows(boolean bl) create window in the ISL offscreen mode -
addFileMapping
Add a file mapping. See above.- Parameters:
identifier- Id use to identify a data sourcefiles- List of files (or urls).
-
getFileAccessory
Create, if needed, and return te GUI panel to put into the file dialog when saving a file.- Returns:
- The file accessory panel
-
categoriesToString
Utility to convert a list of categories into a single string to show the user.- Parameters:
cats- List of categories - String.- Returns:
- String representation
-
stringToCategories
Retur a list of categories from the given string- Parameters:
category- The string representation of the categories- Returns:
- List of (String) categories
-
fileToCategories
The given filename is a full path under the given root. This method prunes the root path from the filepath and splits the filepath into a list of categories.- Parameters:
root- File rootfilename- File path to split- Returns:
- List of (String) categories
-
getBundleXml
Make the bundles xml- Parameters:
bundles- List of saved bundleincludeCategoryInUrl- Should we add the category to the file name- Returns:
- bundles.xml
-
getXmlBundles
get list of xml bundles for the given type- Parameters:
type- bundle type- Returns:
- list of bundles
-
getFavorites
Create, if needed, and return the list ofSavedBundles- Returns:
- List of saved bundles
-
getCurrentFileName
Get the last xidv filename for doing saves/saveas.- Returns:
- The last xidv file name
-
setCurrentFileName
Set the last xidv filename for doing saves/saveas.- Parameters:
f- The filename
-
doSaveAs
public void doSaveAs()Have the user select an xidv filename and write the current application state to it. This also sets the current file name and adds the file to the history list. -
doSaveAs
This api is called from the ISL to generate the zidv file using the export tag with what equals zidv and filename -
moveCategory
Move the bundle category- Parameters:
fromCategories- The category to movetoCategories- Where to move tobundleType- What type are we dealing with
-
export
Export the bundle- Parameters:
bundle- The bundlebundleType- What type
-
rename
Rename the bundle- Parameters:
bundle- The bundlebundleType- What type
-
copyBundle
Copy the bundle to the given category area- Parameters:
bundle- The bundlecategories- The category locationbundleType- What type
-
moveBundle
Move the bundle to the given category area- Parameters:
bundle- The bundlecategories- The category locationbundleType- What type
-
moveOrCopyBundle
Move or copy the bundle to the given category area, depending on the given argument.- Parameters:
bundle- The bundlecategories- The category locationbundleType- What typemove- Move or copy
-
makeCategoryBox
make category widget- Returns:
- box
-
doImport
Import the given file as the given bundle type- Parameters:
bundleType- What typefile- The filecategory- The category
-
getFavoritesCategories
get categories- Returns:
- categories
-
doSaveAsFavorite
public void doSaveAsFavorite()Have the user select an xidv filename for their favorites -
doSave
public void doSave()Save the current state off to the current xidv filename -
doSaveAsDefault
public void doSaveAsDefault()Called from the menu command to save the current state as the default bundle -
doOpenDefault
public void doOpenDefault()Called from the menu command to open the default bundle -
doSave
Save the current state into the specified filename- Parameters:
filename- bundle file name to write to. If this ends in ".jnlp" then we base 64 encode the bundle and wrap it in a jnlp file.- Returns:
- Was this save successful
-
getJnlpBundle
A utility to create a jnlp file from the given bundle- Parameters:
xml- The bundle xml- Returns:
- The jnlp file xml
-
getJnlpBundle
A utility to create a jnlp file from the given bundle- Parameters:
xml- The bundle xmlembedBundle- Embed the b64 encoded bundle right in the jnlpextraArgs- extra jnlp args- Returns:
- The jnlp file xml
-
doSave
Save the current state into the specified filename- Parameters:
filename- bundle file name to write to. If this ends in ".jnlp" then we base 64 encode the bundle and wrap it in a jnlp file.usePersistenceManager- If true then we use the persistence manager to determine what is to be saved.- Returns:
- Was this save successful
-
doSave
Save the current state into the specified filename- Parameters:
filename- bundle file name to write to. If this ends in ".jnlp" then we base 64 encode the bundle and wrap it in a jnlp file.usePersistenceManager- If true then we use the persistence manager to determine what is to be saved.fromIsl- If this api is invoked from the ISL script and save a zidv bundle it will call the nogui api to save all display data- Returns:
- Was this save successful
-
getBundleXml
This creates an xml encoded hashtable that contains the application state.- Parameters:
formatXml- Should the result be formatted (i.e., new lines and indents for easy reading).- Returns:
- The xml encoded application state
- Throws:
Exception- the exception
-
getBundleXml
This creates an xml encoded hashtable that contains the application state.- Parameters:
formatXml- Should the result be formatted (i.e., new lines and indents for easy reading).usePersistenceManager- If true then use the persistence manager to decide what is saved- Returns:
- The xml encoded application state
- Throws:
Exception- the exception
-
instantiateFromTemplate
Create the DisplayControl from the bundle in the given templateFile- Parameters:
templateFile- File path to the template- Returns:
- The instantiated DisplayControl
-
getAllCategories
Get a list of all of the categories for the given bundleType- Parameters:
bundleType- What type of bundle (e.g., favorites)- Returns:
- List of (String) categories
-
getBundleTitle
Get the title to use for the given bundle type- Parameters:
bundleType- The type of bundle (e.g., favorites)- Returns:
- The title
-
getBundleDirectory
Get the directory that holds the given bundle type- Parameters:
bundleType- The type of bundle (e.g., favorites)- Returns:
- The directory
-
getBundles
Get the list ofSavedBundles- Parameters:
bundleType- The type of bundle (e.g., favorites)- Returns:
- List of bundles
-
initBundleMenu
Initialize the bundle menu- Parameters:
bundleType- The type of bundle (e.g., favorites)bundleMenu- The menu
-
getWritableBundles
Get the list ofSavedBundles that are writable- Parameters:
bundleType- The type of bundle (e.g., favorites)- Returns:
- List of writable bundles
-
saveDataSource
- Parameters:
dataSource- data source to save
-
saveDisplayControlFavorite
Prompt the user for a name and write out the given display control as a bundle into the user's .unidata/idv/displaytemplates directory.- Parameters:
displayControl- The display control to writetemplateName- Possibly null initial name for the template
-
saveDisplayControl
Write out the given display control- Parameters:
displayControl- The display control to write
-
saveDisplayControl
Write out the given display control to te given file- Parameters:
displayControl- The display control to writefile- The file to write to
-
getLocalBundles
Create, if needed, and return the list of locally savedSavedBundles- Returns:
- List of saved bundles
-
getDataSourceBundles
Get list of data soruce bundles- Returns:
- data source bundle list
-
getDisplayTemplates
Get the list of display templates. This is a list of String file paths- Returns:
- List of display template
-
open
Open the given bundle- Parameters:
bundle- The bundle to open- Returns:
- success
-
open
Open the given bundle- Parameters:
bundle- bundleaskToRemove- ask- Returns:
- success
-
deleteBundle
Remove the given template- Parameters:
templateFile- The template file to remove
-
deleteBundleCategory
Delete the directory and all of its contents that the given category represents.- Parameters:
bundleType- The type of bundle (e.g., favorites)category- The category (really a directory path)
-
addBundleCategory
Add the directory- Parameters:
bundleType- The type of bundle (e.g., favorites)category- The category (really a directory path)- Returns:
- true if the create was successfull. False if there already is a category with that name
-
getDataSourcesToPersist
Get the data sources we should persist- Returns:
- Data sources to persist
-
addToBundle
protected boolean addToBundle(Hashtable data, boolean usePersistenceManager, List displayControls) throws Exception This method adds into the given hashtable the data sources, display controls, view managers and extra gui state for later persistence.- Parameters:
data- The table to put things intousePersistenceManager- Should we use the settings of this managerdisplayControls- The display controls to add- Returns:
- If user is ok
- Throws:
Exception- When something bad happens
-
addToBundle
protected boolean addToBundle(Hashtable data, List dataSources, List displayControls, List viewManagers, String jython) Add the given state, if non null, to the bundle hashtable- Parameters:
data- Holds the bundle statedataSources- List of data sources to adddisplayControls- List of displays to addviewManagers- List of view managers to addjython- jython to add- Returns:
- If user is ok
-
loadB64Bundle
This converts the given base 64 encoded xml bundle into an xml String and loads it in. It prints out UI messages and shows the wait cursor.- Parameters:
base64Bundle- The base64 encoded xml bundle
-
decodeBase64Bundle
This does the actual work of converting the given base 64 encoded bundle xml into a String and loading it in.- Parameters:
base64Bundle- The base64 encoded xml bundle
-
decodeJnlpFile
Decode the jnlp file- Parameters:
filename- the name of the file
-
extractBundleFromJnlp
This reads in the jnlp xml from the given filename. It extracts from the "arguments" section of the xml the -b64bundle values. This is the base 64 encoded xml bundle. It then loads in the bundle.- Parameters:
filename- The name of the jnlp file.- Returns:
- the bundle
-
decodeXmlFile
Read in the contents of the given xmlFile and evaluate the xml- Parameters:
xmlFile- The bundle filecheckToRemove- Should check the user preference to remove all/show dialog or not.- Returns:
- success
-
decodeXmlFile
Read in the contents of the given xmlFile and evaluate the xml- Parameters:
xmlFile- filecheckToRemove- check to removeletUserChangeData- Set the 'user changes data flag' on decoding- Returns:
- everything cool
-
decodeXmlFile
Read in the contents of the given xmlFile and evaluate the xml- Parameters:
xmlFile- The bundle filecheckToRemove- Should check the user preference to remove all/show dialog or not.bundleProperties- set of properties- Returns:
- success
-
decodeXmlFile
Read in the contents of the given xmlFile and evaluate the xml- Parameters:
xmlFile- The bundle filelabel- If non-null ten use this as te load dialog labelcheckToRemove- Should check the user preference to remove all/show dialog or not.- Returns:
- success
-
decodeXmlFile
public boolean decodeXmlFile(String xmlFile, String label, boolean checkToRemove, Hashtable bundleProperties) Import the bundle file- Parameters:
xmlFile- file namelabel- description for dialogcheckToRemove- Should we ask the user about removing data/displaysbundleProperties- set of properties- Returns:
- success
-
decodeXmlFile
public boolean decodeXmlFile(String xmlFile, String label, boolean checkToRemove, boolean letUserChangeData, Hashtable bundleProperties) decode the xml- Parameters:
xmlFile- filelabel- labelcheckToRemove- check to removeletUserChangeData- if true then ask user to change data pathsbundleProperties- set of properties- Returns:
- everything cool
-
decodeXml
Using the XmlEncoder, decode the given xml string. This typically is a Hashtable, encoded by the doSave method, that holds a list of data sources, display controls, etc.This method wraps a call to decodeXmlInner, setting LOADINGXML flags, etc.
- Parameters:
xml- The bundle xmlfromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.label- The label to use in the dialogshowDialog- Should the dialog be shown
-
decodeXml
public void decodeXml(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) Using the XmlEncoder, decode the given xml string. This typically is a Hashtable, encoded by the doSave method, that holds a list of data sources, display controls, etc.This method wraps a call to decodeXmlInner, setting LOADINGXML flags, etc.
- Parameters:
xml- The bundle xmlfromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.xmlFile- The filename this came from. May be null.label- The label to use in the dialogshowDialog- Should the dialog be shownshouldMerge- Should we merge the windows/views in the bundle into the existing windowsbundleProperties- set of propertiesdidRemoveAll- Should we remove all data/displaysletUserChangeData- Should popup the data path dialog
-
decodeXmlInner
protected void decodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog) This does the real work of decoding an xml bundle.- Parameters:
xml- The xml bundlefromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.xmlFile- The filename where the xml came from - may be null.label- The label to show in the guishowDialog- Should the loadbundle dialog be shown
-
applyPropertiesToBundle
replace any macros in the bundle xml- Parameters:
xml- bundle xml- Returns:
- replaced bundle xml
-
decodeXmlInner
protected void decodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) This does the real work of decoding an xml bundle.- Parameters:
xml- The xml bundlefromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.xmlFile- The filename where the xml came from - may be null.label- The label to show in the guishowDialog- Should the loadbundle dialog be shownshouldMerge- Should we merge the windows/views in the bundle into the existing windowsbundleProperties- set of propertiesdidRemoveAll- Was remove all called before we decoded the xmlletUserChangeData- Should popup data path change dialog
-
changeData
change data- Parameters:
input- the input
-
changeState
n/a- Parameters:
dataSource- the data source- Returns:
- n/a
-
changeState
n/a- Parameters:
dataSource- the data sourceandReload- and reload the data- Returns:
- n/a
-
instantiateFromBundle
protected void instantiateFromBundle(Hashtable ht, boolean fromCollab, LoadBundleDialog loadDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) throws Exception The given Hashtable contains the objects taht were saved in the xml bundle file. The hashtable may contain a list of data sources, a list of display controls and a list of view managers. This method initializes these objects adn adds them into the current application state.- Parameters:
ht- Contains the unpersisted objectsfromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.loadDialog- The load bundle dialogshouldMerge- Should we merge the windows/views in the bundle into the existing windowsbundleProperties- set of propertiesdidRemoveAll- Was remove all called before we decoded the xmlletUserChangeData- Should popup data path change dialog- Throws:
Exception- the exception
-
makeDataSourceFromXml
This creates a new data source from the xml encoded representation of a persisted data source. It is used in the data source history mechanism.- Parameters:
dataSourceXml- The xml encoded data source representation- Returns:
- The results that hold the new data source.
-
getSaveViewState
public boolean getSaveViewState()Should the view state be saved- Returns:
- Save the view state
-
getSaveDisplays
public boolean getSaveDisplays()Should the displays be saved- Returns:
- Save the displays
-
getSaveDataSources
public boolean getSaveDataSources()Should the data sources be saved- Returns:
- Save the data sources
-
getSaveJython
public boolean getSaveJython()Should the jython be saved- Returns:
- Save the data sources
-
getSaveData
public boolean getSaveData()Should the visad data be saved- Returns:
- Save the visad data
-
getCurrentTemplateName
Get the CurrentTemplateName property.- Returns:
- The CurrentTemplateName
-
writePrototype
Save off the given object as a prototype- Specified by:
writePrototypein interfacePrototypeManager- Parameters:
object- Object to write as prototype
-
clearPrototype
Clear the prototype for the given class- Parameters:
c- class
-
getPrototype
Instantiate a new object for the given class. This will return null if there is not a prototype defined for the class- Specified by:
getPrototypein interfacePrototypeManager- Parameters:
c- class- Returns:
- new object or null
-
getBundleIdvVersion
Gets the bundle idv version.- Returns:
- the bundle idv version
-