***  This interface is subject to change.  ***

com.sas.iquery.metadata.business
Interface MapFolder

All Superinterfaces:
com.sas.iquery.metadata.business.ExtendedAttributes, LocalizableModelObject, LocalizableNamedObjectInterface, com.sas.util.LocalizableToStringInterface, NamedObjectInterface

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

A folder used for organizing business items within an InformationMap.


Field Summary
 
Fields inherited from interface com.sas.iquery.metadata.business.LocalizableModelObject
EVENT_LOCALIZABLE_DESCRIPTIONS_CHANGED, EVENT_LOCALIZABLE_LABELS_CHANGED
 
Method Summary
 void addBusinessItem(BusinessItem item)
          Adds the specified item to this MapFolder and removes it from any MapFolder it was contained in.
 java.util.Map copyFolderItems(java.util.List listOfFolderItemsToCopy)
          Copies the list of FolderItems to this folder.
 java.util.List<BusinessItem> 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(java.lang.String subfolderLabel)
          Finds the specified subfolder and removes it from this folder.
 java.lang.String getDescription()
          Returns a description for this object.
 java.lang.String getDisplayPath()
          Returns the information map folders path from the root information map folder.
 java.util.List<BusinessItem> getItems()
          Returns all business items contained within this folder.
<T extends BusinessItem>
java.util.List<T>
getItems(java.lang.Class<T> itemClass)
          Returns all business items that are instances of the specified class contained within this folder.
 java.lang.String getLabel()
          Returns a label for this object.
 MapFolder getParent()
          Returns the parent MapFolder object to this folder.
 MapFolder getSubfolder(java.lang.String name)
          Returns the subfolder with the give name or null if no subfolder exist.
 java.util.List getSubfolders()
          Returns all the subfolders for this folder.
 boolean isEmpty()
          Returns true if this folder contains no subfolders, items, and does not have extended attributes.
 boolean isValidLabel(java.lang.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(java.lang.String description)
          Sets the description for this object.
 void setItems(java.util.List<BusinessItem> items)
          Set business items in this folder with the given list.
 void setLabel(java.lang.String label)
          Sets the label for this object.
 
Methods inherited from interface com.sas.iquery.metadata.business.LocalizableModelObject
getLocalizableProperties, getLocalizationPrependKey, setDescription, setDescriptions, setLabel, setLabels, setLocalizableProperties
 
Methods inherited from interface com.sas.iquery.metadata.LocalizableNamedObjectInterface
getDescription, getDescriptions, getLabel, getLabels
 

Method Detail

newSubfolder

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

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

java.util.List<BusinessItem> 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
Returns:
a list of business items (other than the specified business item) removed as part of this operation.
Throws:
java.lang.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

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:
java.lang.IllegalArgumentException - is thrown if the specified business item is null

deleteSubfolder

void deleteSubfolder(java.lang.String subfolderLabel)
                     throws com.sas.iquery.metadata.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:
com.sas.iquery.metadata.MetadataNotDeletableException - Can not delete folder

deleteSubfolder

void deleteSubfolder(MapFolder subfolder)
                     throws com.sas.iquery.metadata.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:
com.sas.iquery.metadata.MetadataNotDeletableException - Can not delete folder

getDisplayPath

java.lang.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

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

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

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

java.util.List<BusinessItem> getItems()
Returns all business items contained within this folder.

Returns:
a List of business items (possibly empty, never null)

getItems

<T extends BusinessItem> java.util.List<T> getItems(java.lang.Class<T> 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

void setItems(java.util.List<BusinessItem> 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:
java.lang.IllegalArgumentException - if this is not a valid list
MetadataException - if the operation could not be performed.

getParent

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

MapFolder getSubfolder(java.lang.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

java.util.List getSubfolders()
Returns all the subfolders for this folder.

Returns:
The list of this folders subfolders

getLabel

java.lang.String getLabel()
Returns a label for this object.

Specified by:
getLabel in interface NamedObjectInterface
Returns:
String A label. May be null.

setLabel

void setLabel(java.lang.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

boolean isValidLabel(java.lang.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

java.lang.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

void setDescription(java.lang.String description)
Sets the description for this object.

Parameters:
description - the string to use as the description. Specifying null is allowed.

copyFolderItems

java.util.Map copyFolderItems(java.util.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.

isEmpty

boolean isEmpty()
Returns true if this folder contains no subfolders, items, and does not have extended attributes. Otherwise false

Returns:
true if folder is empty.

***  This interface is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.