ucar.unidata.idv
Class SavedBundle

java.lang.Object
  extended by ucar.unidata.idv.SavedBundle

public class SavedBundle
extends Object

An object to handle a saved bundle.

Version:
$Revision
Author:
IDV development team

Field Summary
static String ATTR_CATEGORY
          Xml attribute name for the category
static String ATTR_NAME
          Xml attribute name for the name
static String ATTR_TYPE
          xml attr
static String ATTR_URL
          Xml attribute name for the url
static String TAG_BUNDLE
          Xml tag name for the bundle element
static String TAG_BUNDLES
          Xml tag name for the bundles element
static int TYPE_DATA
          The type to specify the data
static int TYPE_DISPLAY
          The type to specify the display templates
static int TYPE_FAVORITE
          The type to specify the "Favorites" bundles
static String VALUE_DATA
          type of saved bundle
static String VALUE_DISPLAY
          type of saved bundle
static String VALUE_FAVORITE
          type of saved bundle
 
Constructor Summary
SavedBundle(Element node, String dirRoot, IdvResourceManager resourceManager, boolean local)
          Create the saved bundle object
SavedBundle(String url, String name, List categories)
          Create the saved bundle object
SavedBundle(String url, String name, List categories, boolean local)
          ctor
SavedBundle(String url, String name, List categories, Object prototype, boolean local)
          Create the saved bundle object
 
Method Summary
 List getCategories()
          Get the Category property.
 String getCategorizedName()
          Get the name to use with the categories as a prefix
 String getLabel()
          Full label
 boolean getLocal()
          Get the Local property.
 String getName()
          Get the Name property.
 Object getPrototype()
          Get the prototype - may be null.
 int getType()
          Get the Type property.
 String getUrl()
          Get the Url property.
static List processBundleXml(Element root, String dirRoot, IdvResourceManager resourceManager, boolean local)
          Utility that created a list of SavedBundle objects from the document at the given xml path
 void setCategories(List value)
          Set the Category property.
 void setLocal(boolean value)
          Set the Local property.
 void setName(String value)
          Set the Name property.
 void setType(int value)
          Set the Type property.
protected  void setUniquePrefix(String p)
          set the unique prefix
 void setUrl(String value)
          Set the Url property.
 String toString()
          Override toString.
 void toXml(Document doc, Element root)
          Write out the xml that defines this SavedBundle.
 void toXml(Document doc, Element root, boolean includeCategoryInUrl)
          Write out the xml that defines this SavedBundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_FAVORITE

public static final int TYPE_FAVORITE
The type to specify the "Favorites" bundles

See Also:
Constant Field Values

TYPE_DISPLAY

public static final int TYPE_DISPLAY
The type to specify the display templates

See Also:
Constant Field Values

TYPE_DATA

public static final int TYPE_DATA
The type to specify the data

See Also:
Constant Field Values

VALUE_FAVORITE

public static final String VALUE_FAVORITE
type of saved bundle

See Also:
Constant Field Values

VALUE_DATA

public static final String VALUE_DATA
type of saved bundle

See Also:
Constant Field Values

VALUE_DISPLAY

public static final String VALUE_DISPLAY
type of saved bundle

See Also:
Constant Field Values

TAG_BUNDLES

public static final String TAG_BUNDLES
Xml tag name for the bundles element

See Also:
Constant Field Values

TAG_BUNDLE

public static final String TAG_BUNDLE
Xml tag name for the bundle element

See Also:
Constant Field Values

ATTR_URL

public static final String ATTR_URL
Xml attribute name for the url

See Also:
Constant Field Values

ATTR_NAME

public static final String ATTR_NAME
Xml attribute name for the name

See Also:
Constant Field Values

ATTR_CATEGORY

public static final String ATTR_CATEGORY
Xml attribute name for the category

See Also:
Constant Field Values

ATTR_TYPE

public static final String ATTR_TYPE
xml attr

See Also:
Constant Field Values
Constructor Detail

SavedBundle

public SavedBundle(Element node,
                   String dirRoot,
                   IdvResourceManager resourceManager,
                   boolean local)
Create the saved bundle object

Parameters:
node - The xml node that defines this object
dirRoot - The directory root
resourceManager - Reference to the resource manager so we add the sitepath, etc., macros into the url
local - Is it a local file

SavedBundle

public SavedBundle(String url,
                   String name,
                   List categories)
Create the saved bundle object

Parameters:
url - The url
name - The name
categories - List of (String) categories.

SavedBundle

public SavedBundle(String url,
                   String name,
                   List categories,
                   boolean local)
ctor

Parameters:
url - the url path
name - name
categories - categories
local - is it a local file

SavedBundle

public SavedBundle(String url,
                   String name,
                   List categories,
                   Object prototype,
                   boolean local)
Create the saved bundle object

Parameters:
url - The url
name - The name
categories - List of (String) categories.
prototype - The object this bundle represents - may be null.
local - is it a local file
Method Detail

toXml

public void toXml(Document doc,
                  Element root)
Write out the xml that defines this SavedBundle. Note: this writes out the url as just the file name, not the full path

Parameters:
doc - The document to create the xml with
root - The xml root

toXml

public void toXml(Document doc,
                  Element root,
                  boolean includeCategoryInUrl)
Write out the xml that defines this SavedBundle. Note: this writes out the url as just the file name, not the full path

Parameters:
doc - The document to create the xml with
root - The xml root
includeCategoryInUrl - Should the category be included in the url

setUniquePrefix

protected void setUniquePrefix(String p)
set the unique prefix

Parameters:
p - prefix

getCategorizedName

public String getCategorizedName()
Get the name to use with the categories as a prefix

Returns:
categorized name

processBundleXml

public static List processBundleXml(Element root,
                                    String dirRoot,
                                    IdvResourceManager resourceManager,
                                    boolean local)
Utility that created a list of SavedBundle objects from the document at the given xml path

Parameters:
root - Root of the bundles xml doc.
dirRoot - The directory root
resourceManager - The resource manager
local - is it a local file
Returns:
List of SavedBundle objects

setUrl

public void setUrl(String value)
Set the Url property.

Parameters:
value - The new value for Url

getUrl

public String getUrl()
Get the Url property.

Returns:
The Url

setName

public void setName(String value)
Set the Name property.

Parameters:
value - The new value for Name

getName

public String getName()
Get the Name property.

Returns:
The Name

setCategories

public void setCategories(List value)
Set the Category property.

Parameters:
value - The new value for Category

getCategories

public List getCategories()
Get the Category property.

Returns:
The Category

getPrototype

public Object getPrototype()
Get the prototype - may be null.

Returns:
The prototype

getLabel

public String getLabel()
Full label

Returns:
The name.

toString

public String toString()
Override toString.

Overrides:
toString in class Object
Returns:
The name.

setType

public void setType(int value)
Set the Type property.

Parameters:
value - The new value for Type

getType

public int getType()
Get the Type property.

Returns:
The Type

setLocal

public void setLocal(boolean value)
Set the Local property.

Parameters:
value - The new value for Local

getLocal

public boolean getLocal()
Get the Local property.

Returns:
The Local