***  This class is subject to change   ***

com.sas.iquery.metadata.business
Interface MapFolder

All Superinterfaces:
NamedObjectInterface
All Known Implementing Classes:

public interface MapFolder
extends NamedObjectInterface, com.sas.iquery.metadata.business.ExtendedAttributes

A folder used for organizing business items within an InformationMap.


Method Summary
 void addBusinessItem(BusinessItem item)
          Adds the specified item to this MapFolder and removes it from any MapFolder it was contained in.
 Map copyFolderItems(List listOfFolderItemsToCopy)
          Copies the list of FolderItems to this folder.
 void deleteBusinessItem(BusinessItem item)
          Removes the specified item from this folder and deletes the item from the underlying BusinessModel.
 void deleteSubfolder(MapFolder subfolder)
          Removes the specified subfolder.
 void deleteSubfolder(String subfolderLabel)
          Finds the specified subfolder and removes it from this folder.
 String getDescription()
          Returns a description for this object.
 String getDisplayPath()
          Returns the information map folders path from the root information map folder.
 List getItems()
          Returns all business items contained within this folder.
 List getItems(Class itemClass)
          Returns all business items that are instances of the specified class contained within this folder.
 String getLabel()
          Returns a label for this object.
 MapFolder getParent()
          Returns the parent MapFolder object to this folder.
 MapFolder getSubfolder(String name)
          Returns the subfolder with the give name or null if no subfolder exist.
 List getSubfolders()
          Returns all the subfolders for this folder.
 boolean isValidLabel(String label)
          Checks if a label name is valid A null label or a label containing forward slash (/) or backward slash (\) is not valid
 void moveTo(int index)
          Reorder this MapFolder based on the specified index.
 void moveTo(int index, MapFolder newParent)
          Re-order this MapFolder under the specified folder.
 void moveTo(MapFolder newParent)
          Re-parents this MapFolder under the specified folder.
 MapFolder newSubfolder()
          Creates a new MapFolder object and places it into this MapFolder.
 void removeBusinessItem(BusinessItem item)
          Removes this item from this folder and leaves the item in the underlying BusinessModel
 void setDescription(String description)
          Sets the description for this object.
 void setItems(List items)
          Set business items in this folder with the given list.
 void setLabel(String label)
          Sets the label for this object.
 

Method Detail

newSubfolder

public MapFolder newSubfolder()
Creates a new MapFolder object and places it into this MapFolder. MapFolders are not considered business items and are not part of the business model.
Returns:
The new MapFolder object.

addBusinessItem

public void addBusinessItem(BusinessItem item)
                     throws MetadataException
Adds the specified item to this MapFolder and removes it from any MapFolder it was contained in. The specified business item must exist in the underlying BusinessModel.
Parameters:
item - The BusinessItem to be added
Throws:
MetadataException - if the operation could not be performed.

deleteBusinessItem

public void deleteBusinessItem(BusinessItem item)
                        throws MetadataException
Removes the specified item from this folder and deletes the item from the underlying BusinessModel. Deleting a business item also deletes (from the business model) any business items that is dependent on the specified business item and removes them from their folders. Once a business item object has been deleted from its business model, it may not be added back.
Parameters:
item - The business item to be deleted
Throws:
IllegalArgumentException - is thrown if the specified business item is null
MetadataException - when this operation could not be performed (for example, if the business item is involved in a recursive definition you cannot remove it until the recursively-defined loop is broken).

removeBusinessItem

public void removeBusinessItem(BusinessItem item)
Removes this item from this folder and leaves the item in the underlying BusinessModel
Parameters:
item - The business item to be removed.
Throws:
IllegalArgumentException - is thrown if the specified business item is null

deleteSubfolder

public void deleteSubfolder(String subfolderLabel)
                     throws MetadataNotDeletableException
Finds the specified subfolder and removes it from this folder. This operation only succeeds when the specified subfolder has no items in it.
Parameters:
subfolderLabel - the label of the subfolder to be removed.
Throws:
MetadataNotDeletableException - Can not delete folder

deleteSubfolder

public void deleteSubfolder(MapFolder subfolder)
                     throws MetadataNotDeletableException
Removes the specified subfolder. This operation only succeeds when the specified subfolder has no items in it. If the specified subfolder is not a subfolder of this folder nothing happens
Parameters:
subfolder - The subfolder to be removed
Throws:
MetadataNotDeletableException - Can not delete folder

getDisplayPath

public String getDisplayPath()
Returns the information map folders path from the root information map folder. Null is returned if the information map folder is not contained within a information map. The path returned is not guaranteed to be unique since information map folder labels are not guaranteed to be unique.

All paths to an information map folder within information maps are made up of a "/" character followed repeatedly by folder names and "/" characters until the calling information map folder is reached.

Returns:
String the path to the information map folder or null

moveTo

public void moveTo(MapFolder newParent)
            throws MetadataException
Re-parents this MapFolder under the specified folder.
Parameters:
newParent - The new parent of this MapFolder
Throws:
MetadataException - if this folder is the root folder or if trying to parent this folder is specified as its parent.

moveTo

public void moveTo(int index,
                   MapFolder newParent)
            throws MetadataException
Re-order this MapFolder under the specified folder.
Parameters:
index - index at which this MapFolder is to be inserted under the new parent.
newParent - The new parent of this MapFolder
Throws:
MetadataException - if this folder is the root folder or if trying to parent this folder is specified as its parent.

moveTo

public void moveTo(int index)
            throws MetadataException
Reorder this MapFolder based on the specified index.
Parameters:
index - index at which this MapFolder is to be moved to under the current parent.
Throws:
MetadataException - if this folder is the root folder or if trying to parent this folder is specified as its parent.

getItems

public List getItems()
Returns all business items contained within this folder.
Returns:
a List of business items (possibly empty, never null)

getItems

public List getItems(Class itemClass)
Returns all business items that are instances of the specified class contained within this folder.
Parameters:
itemClass - The class of business items to return
Returns:
a List of business items (possibly empty, never null)

setItems

public void setItems(List items)
              throws MetadataException
Set business items in this folder with the given list. The existing items in the folder will be replaced with this list. The ordering of elements in this list will be preserved for this folder Every element in the given list must be a BusinessItem. If any failures are encountered, an exception will be thrown and the items in this folder will not be changed
Parameters:
items - the list of business items to be set on this folder
Throws:
IllegalArgumentException - if this is not a valid list
MetadataException - if the operation could not be performed.

getParent

public MapFolder getParent()
Returns the parent MapFolder object to this folder.
Returns:
the parent MapFolder object to this folder or null if this is the root MapFolder object.

getSubfolder

public MapFolder getSubfolder(String name)
Returns the subfolder with the give name or null if no subfolder exist.
Parameters:
name - the name of the subfolder to be returned
Returns:
the MapFolder with the give name or null.

getSubfolders

public List getSubfolders()
Returns all the subfolders for this folder.
Returns:
The list of this folders subfolders

getLabel

public String getLabel()
Returns a label for this object.
Specified by:
getLabel in interface NamedObjectInterface
Returns:
String A label. May be null.

setLabel

public void setLabel(String label)
              throws MetadataException
Sets the label for this object.
Parameters:
label - the string to use as the label.
Throws:
MetadataException - if this is not a valid label
See Also:
isValidLabel(String)

isValidLabel

public boolean isValidLabel(String label)
Checks if a label name is valid A null label or a label containing forward slash (/) or backward slash (\) is not valid
Parameters:
label - the string to use as the label.
Returns:
true if this is a valid label false otherwise

getDescription

public String getDescription()
Returns a description for this object. A description is intended to be a longer worded phrase than the name itself.
Specified by:
getDescription in interface NamedObjectInterface
Returns:
A description.. May be null.

setDescription

public void setDescription(String description)
Sets the description for this object.
Parameters:
description - the string to use as the description. Specifying null is allowed.

copyFolderItems

public Map copyFolderItems(List listOfFolderItemsToCopy)
                    throws MetadataException
Copies the list of FolderItems to this folder. If the folder items reference other folder items in the list or in children of folders being copied in the list then those references in the updated to the copied items.
Parameters:
listOfFolderItemsToCopy - Items to copy to this folder.
Returns:
Map a hashmap of original objects and their copies
Throws:
MetadataException - if this is the root folder, if trying to parent this folder to itself, or if the new parent doesn't exist.

***  This class is subject to change   ***




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 16:03:59