Package com.microstrategy.web.objects
Interface WebFolder
-
- All Superinterfaces:
KeyedObject
,WebDisplayUnit
,WebFeatures
,WebObjectInfo
,WebPromptSite
- All Known Implementing Classes:
WebSyncRecommendationFolder
,WebSyncSearchFolder
public interface WebFolder extends WebObjectInfo
The WebFolder interface represents a folder object, either in metadata or a volatile one. This interface is also used in answering an object prompt, and has methods for adding and removing objects from a folder collection. The WebFolder normally is read-only, except the WebFolder used as answer forWebObjectsPrompt
. This object cannot be directly instantiated, and must instead be obtained from interfaces such asWebObjectSource
orWebObjectsPrompt
.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
add(WebObjectInfo newObject)
Adds the givenWebObjectInfo
object to the folder collection.int
add(WebObjectInfo newObject, int beforeKey)
Adds the givenWebObjectInfo
object to the folder collection.int
add(WebObjectInfo newObject, WebObjectInfo beforeObject)
Adds the givenWebObjectInfo
object to the folder collection.void
checkObjectVisibility(FolderBean fb)
Removes from the folder shortcuts whose target is not in the list of requested types.void
checkObjectVisibility(FolderBean fb, boolean isSearch)
Removes from the folder shortcuts whose target is not in the list of requested types.Some extra filtering for searchvoid
clear()
Clears all objects from the folder collection.boolean
contains(WebObjectInfo object)
Returns true if the folder contains the given object, false if it does not.boolean
containsKey(int key)
Returns true if the folder contains an item by the given key, false if not.java.util.Enumeration
elements()
Returns a java.util.Enumeration object, which can be used to iterate through the folder.void
filterShortcuts(int[] types)
Removes from the folder shortcuts whose target is not in the list of requested types.WebFolder
findTypedObjects(int[] types)
Finds all objects in the folder which are of one of the given types or subtypes, and returns a folder containing those objects.WebObjectInfo
get(int index)
Returns the object in the collection with the given index.int
getBlockBegin()
Returns the current blockBegin setting, which is used for incremental fetch of folder contents.int
getBlockCount()
Returns the current blockCount setting, which is used for incremental fetch of folder contents.int
getChildCount()
Returns the child count, which is the total number of items in the collection.Tree<WebObjectInfo>
getChildrenInTree()
Returns child units in a tree structure.boolean
getDereferenceShorcuts()
Returns whether Shortcut objects are "dereferenced" in folder browsing requests.WebObjectFilter
getFilter()
int
getFolderType()
Returns the type of this folder, a value fromEnumDSSXMLFolderType
.boolean
getIsBrowsing()
read a flag to indicate whether we're browsing a folder Set only to get 'non-schedulable' flag on objectsWebObjectInfo
getItemByKey(int key)
Returns the object in the collection with the given key.int
getLevel()
Returns the current value of the level parameter.int
getOriginalChildCount()
In case some types of shortcuts objects will be filtered out from the objectCollection.int
getQuickSearchFlag()
WebFolder
getRoot()
Returns a folder object representing the root folder of the project.int
getStyle()
Returns the style in which the display XML of the folder will be output.SimpleList
getTypeRestrictions()
Returns a collection of Integers which represent the set of object types that can be contained in the folder.boolean
isEmpty()
Returns true if the folder object contains nothing, false if it is not empty.boolean
isNamedFolder(int folderName)
Returns whether this folder is the named folder.boolean
isNonSchedulable()
boolean
isReadOnly()
Returns true if this folder is a read-only object, false if it is read/write.boolean
isRoot()
Returns whether this object is the root folder.int
keyOf(WebObjectInfo object)
Returns the key of the given object, if it exists in the collection.SimpleList
objectTypes()
Returns a collection of Integers, which contains a non-repeating list of the types of objects which are contained in this folder.int
partialSubFolderCount()
Returns the number of sub-folders in the current folder, within the blockBegin and blockCount constraints.void
remove(int index)
Removes the object in the collection with the given index.void
remove(WebObjectInfo object)
Removes the given object from the folder collection.void
removeItemByKey(int key)
Removes the object in the collection with the given key.void
setBlockBegin(int blockBegin)
Sets the blockBegin setting, which is used for incremental fetch of folder contents.void
setBlockCount(int blockCount)
Sets the blockCount setting, which is used for incremental fetch of folder contents.void
setDereferenceShortcuts(boolean dereferenceShorcuts)
Sets whether Shorcuts objects are "dereferenced" in folder browsing requests.void
setFilter(WebObjectFilter value)
void
setIsBrowsing(boolean bf)
set a flag to indicate whether we're browsing a folder Set only to get 'non-schedulable' flag on objectsvoid
setLevel(int level)
Sets the value of the level parameter.void
setQuickSearchFlag(int qsr)
Read a QuickSearch flag returned in MetaDataSearch result xml node attribute and set to WebFolder objectvoid
setStyle(int style)
Sets the style in which the display XML of the folder will be output.int
size()
Returns the number of objects in the folder.int
subFolderCount()
Returns the number of sub-folders which exist in the current folder, regardless of blockCount.-
Methods inherited from interface com.microstrategy.utils.KeyedObject
_getObKey
-
Methods inherited from interface com.microstrategy.web.objects.WebDisplayUnit
addDetails, applyVisitor, canHighlight, getChildUnits, getDisplayName, getDisplayUnitType, hasDetails, highlightUnit, highlightUnit, isHighlighted, isObjectInfo, isSelected, setDisplayName, setSelected
-
Methods inherited from interface com.microstrategy.web.objects.WebFeatures
isFeatureAvailable, isFeatureAvailable
-
Methods inherited from interface com.microstrategy.web.objects.WebObjectInfo
buildShortObjectAttributes, buildShortXML, getAbbreviation, getAccessGranted, getAncestors, getCardStatus, getCertifiedInfo, getComments, getContainerDid, getContainerType, getCreationTime, getCreationTimeStamp, getDataSources, getDescription, getExtendedType, getFactory, getFlags, getIconPath, getID, getModificationTime, getModificationTimeStamp, getName, getNonSchedulable, getOtherNameTransCount, getOwner, getParent, getPreSaveAsFlags, getProjectId, getProjectName, getPropertyFlags, getPropertySetFilter, getPropertySets, getRecommendationInfo, getSecurity, getState, getSubType, getType, getVersionID, getViewMediaSettings, getVisualizationViewMode, getXML, getXML, hasOwner, isAncestorNamedFolder, isDirty, isEmbedded, isHidden, isNew, isPopulated, populate, populate, setAbbreviation, setComments, setDataSources, setDescription, setExtendedType, setFlags, setHidden, setIconPath, setName, setNonSchedulable, setPreSaveAsFlags, setPropertyFlags
-
Methods inherited from interface com.microstrategy.web.objects.WebPromptSite
getPromptInstances
-
-
-
-
Method Detail
-
getFolderType
int getFolderType()
Returns the type of this folder, a value fromEnumDSSXMLFolderType
.- Returns:
- The type of the current folder, if available.
-
getRoot
WebFolder getRoot() throws WebObjectsException
Returns a folder object representing the root folder of the project.- Returns:
- A populated WebFolder object, representing the root folder of the hierarchy.
- Throws:
WebObjectsException
- Signals an error while trying to obtain the root folder.
-
getChildCount
int getChildCount()
Returns the child count, which is the total number of items in the collection.- Returns:
- The child count of the folder.
-
getOriginalChildCount
int getOriginalChildCount()
In case some types of shortcuts objects will be filtered out from the objectCollection. This function will return the total count received before filtering.- Returns:
- The original child count of the folder.
-
subFolderCount
int subFolderCount()
Returns the number of sub-folders which exist in the current folder, regardless of blockCount.- Returns:
- A count of the sub-folders of the current folder.
-
partialSubFolderCount
int partialSubFolderCount()
Returns the number of sub-folders in the current folder, within the blockBegin and blockCount constraints.- Returns:
- A count of the sub-folders of the current folder.
-
findTypedObjects
WebFolder findTypedObjects(int[] types)
Finds all objects in the folder which are of one of the given types or subtypes, and returns a folder containing those objects. NOTE: If the intent is to populate the folder with only a certain set of object types, consider usinggetTypeRestrictions()
before populating.- Parameters:
types
- An array of integers which describe the types or subtypes of objects to return from the folder. The values in the array must be values one ofEnumDSSXMLObjectTypes
orEnumDSSXMLObjectSubTypes
.- Returns:
- A
WebFolder
that contains all of the objects in the folder which are of one of the types passed in.
-
objectTypes
SimpleList objectTypes()
Returns a collection of Integers, which contains a non-repeating list of the types of objects which are contained in this folder. The object types come fromEnumDSSXMLObjectTypes
.- Returns:
- A
SimpleList
, containing the types of objects contained in the folder.
-
getDereferenceShorcuts
boolean getDereferenceShorcuts()
Returns whether Shortcut objects are "dereferenced" in folder browsing requests. If 'true' then the Shortcut object is replaced with the object it refers to in the folder contents. By default, Shortcut objects are NOT dereferenced.- Returns:
- Whether a Shorcut object is replaced with its target object.
- Since:
- MicroStrategy Web 8.0.2
-
setDereferenceShortcuts
void setDereferenceShortcuts(boolean dereferenceShorcuts)
Sets whether Shorcuts objects are "dereferenced" in folder browsing requests. If 'true' then the Shorcut object is replaced with the object it refers to in the folder contents.- Parameters:
dereferenceShorcuts
- Whether to dereference shortcut objects or not.- Since:
- MicroStrategy Web 8.0.2
-
getTypeRestrictions
SimpleList getTypeRestrictions()
Returns a collection of Integers which represent the set of object types that can be contained in the folder. This collection is modified by the caller to specify a set of "type restrictions". If no types are added, then there are no restrictions.- Returns:
- A
SimpleList
containing the types of objects that can be included in the contents of the folder when it is populated by the Intelligence Server. - Since:
- MicroStrategy Web 8.0.2
- See Also:
setDereferenceShortcuts(boolean)
-
getBlockBegin
int getBlockBegin()
Returns the current blockBegin setting, which is used for incremental fetch of folder contents. This value tells the index of the first object in the folder to be retrieved. This value is usually used in conjunction with blockCount.- Returns:
- The current blockBegin setting.
- See Also:
setBlockBegin(int)
-
setBlockBegin
void setBlockBegin(int blockBegin)
Sets the blockBegin setting, which is used for incremental fetch of folder contents. This value tells the index of the first object in the folder to be retrieved. This value is usually used in conjunction with blockCount.- Parameters:
blockBegin
- The blockBegin setting to be used upon populating the folder from the Intelligence Server.- See Also:
getBlockBegin()
-
getBlockCount
int getBlockCount()
Returns the current blockCount setting, which is used for incremental fetch of folder contents. This value tells the number of objects in the folder to be retrieved. This value is usually used in conjunction with blockBegin.- Returns:
- The current blockCount setting.
- See Also:
setBlockCount(int)
-
setBlockCount
void setBlockCount(int blockCount)
Sets the blockCount setting, which is used for incremental fetch of folder contents. This value tells the number of objects in the folder to be retrieved. This value is usually used in conjunction with blockBegin.- Parameters:
blockCount
- The blockCount setting to be used upon populating the folder from the Intelligence Server.- See Also:
getBlockCount()
-
getLevel
int getLevel()
Returns the current value of the level parameter. It is used upon populating the folder's contents. As of MicroStrategy 7.2, this has no effect.- Returns:
- The current level setting.
- See Also:
setLevel(int)
-
setLevel
void setLevel(int level)
Sets the value of the level parameter. It is used upon populating the folder's contents. As of MicroStrategy 7.2, this has no effect.- Parameters:
level
- The new level setting.- See Also:
getLevel()
-
isReadOnly
boolean isReadOnly()
Returns true if this folder is a read-only object, false if it is read/write.- Returns:
- The read-only status of this folder.
-
add
int add(WebObjectInfo newObject) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Adds the givenWebObjectInfo
object to the folder collection.- Parameters:
newObject
- An object which implements theWebObjectInfo
interface.- Returns:
- The key into the folder of the added object.
- Throws:
java.lang.UnsupportedOperationException
- Thrown if the folder object is marked as read-only.java.lang.IllegalArgumentException
- Thrown if there is an error when adding the object to the collection.
-
add
int add(WebObjectInfo newObject, int beforeKey) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Adds the givenWebObjectInfo
object to the folder collection.- Parameters:
newObject
- An object which implements theWebObjectInfo
interface.beforeKey
- The key of an object which this object should be inserted before in the list.- Returns:
- The key into the folder of the added object.
- Throws:
java.lang.UnsupportedOperationException
- Thrown if the folder object is marked as read-onlyjava.lang.IllegalArgumentException
- Thrown if there is an error when adding the object to the collection, for example, if the key given does not exist..
-
add
int add(WebObjectInfo newObject, WebObjectInfo beforeObject) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Adds the givenWebObjectInfo
object to the folder collection.- Parameters:
newObject
- An object which implements theWebObjectInfo
interface.beforeObject
- The object already in the folder to place the new object before.- Returns:
- The key into the folder of the added object.
- Throws:
java.lang.UnsupportedOperationException
- Thrown if the folder object is marked as read-onlyjava.lang.IllegalArgumentException
- Thrown if there is an error when adding the object to the collection, for example, if the beforeObject given does not exist..
-
get
WebObjectInfo get(int index) throws java.lang.IndexOutOfBoundsException
Returns the object in the collection with the given index.- Parameters:
index
- The index into the collection of the desired item.- Returns:
- The
WebObjectInfo
object with the given index in the collection. - Throws:
java.lang.IndexOutOfBoundsException
- Thrown if the given index is out of the bounds of the collection.
-
getItemByKey
WebObjectInfo getItemByKey(int key) throws java.lang.IllegalArgumentException
Returns the object in the collection with the given key.- Parameters:
key
- The key into the collection of the desired item.- Returns:
- The
WebObjectInfo
object with the given key in the collection. - Throws:
java.lang.IllegalArgumentException
- Thrown if the given key is not found in the collection.
-
remove
void remove(int index) throws java.lang.UnsupportedOperationException, java.lang.IndexOutOfBoundsException
Removes the object in the collection with the given index.- Parameters:
index
- The index of the item to be removed.- Throws:
java.lang.IndexOutOfBoundsException
- Thrown if the given index is out of the bounds of the collection.java.lang.UnsupportedOperationException
- Thrown if the folder object is read-only.
-
removeItemByKey
void removeItemByKey(int key) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Removes the object in the collection with the given key.- Parameters:
key
- The key into the collection of the item to be removed.- Throws:
java.lang.IllegalArgumentException
- Thrown if the given key is not found in the collection.java.lang.UnsupportedOperationException
- Thrown if the folder object is read-only.
-
remove
void remove(WebObjectInfo object) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
Removes the given object from the folder collection. Returns true if the operation succeeded.- Parameters:
object
- The object to be removed from the collection.- Throws:
java.lang.IllegalArgumentException
- Thrown if the given object is not found in the collection.java.lang.UnsupportedOperationException
- Thrown if the folder object is read-only.
-
clear
void clear() throws java.lang.UnsupportedOperationException
Clears all objects from the folder collection.- Throws:
java.lang.UnsupportedOperationException
- Thrown if the folder object is marked as read-only.
-
isEmpty
boolean isEmpty()
Returns true if the folder object contains nothing, false if it is not empty.- Returns:
- Whether the folder is empty.
-
size
int size()
Returns the number of objects in the folder.- Returns:
- The number of objects in the folder collection.
-
containsKey
boolean containsKey(int key)
Returns true if the folder contains an item by the given key, false if not.- Parameters:
key
- The key to search for in the folder collection.- Returns:
- True if the collection contains the key, false if it does not.
-
contains
boolean contains(WebObjectInfo object)
Returns true if the folder contains the given object, false if it does not.- Parameters:
object
- TheWebObjectInfo
object to search for in the folder.- Returns:
- True if the collection contains the value, false if it does not.
-
keyOf
int keyOf(WebObjectInfo object) throws java.lang.IllegalArgumentException
Returns the key of the given object, if it exists in the collection.- Parameters:
object
- TheWebObjectInfo
object to search for in the folder.- Returns:
- The key of the object.
- Throws:
java.lang.IllegalArgumentException
- Thrown if the object does not exist in the collection.
-
elements
java.util.Enumeration elements()
Returns a java.util.Enumeration object, which can be used to iterate through the folder. This Enumeration containsWebObjectInfo
objects.- Returns:
- An Enumeration containing all the objects in the folder.
-
isRoot
boolean isRoot() throws WebObjectsException
Returns whether this object is the root folder. Note that if the ancestor information is not available for this object, or if this object is the root folder, a call to the Intelligence Server will be necessary.- Returns:
- True if this object is the root folder, false otherwise.
- Throws:
WebObjectsException
- Signals an inability to contact the Intelligence Server or to retrieve whether this is the root folder.
-
isNamedFolder
boolean isNamedFolder(int folderName) throws WebObjectsException
Returns whether this folder is the named folder. Note that if the named folder ID cannot be determined(because of an error from the Intelligence Server), this method will return false and log a warning.- Parameters:
folderName
- An Enumeration inEnumDSSXMLFolderNames
- Returns:
- true if this folder the named folder, false otherwise.
- Throws:
WebObjectsException
- This will not be thrown - this declaration is kept for backward compatibility.
-
getStyle
int getStyle()
Returns the style in which the display XML of the folder will be output.- Returns:
- The current display style of the folder, from
EnumWebFolderDisplayStyle
. - See Also:
setStyle(int)
-
setStyle
void setStyle(int style)
Sets the style in which the display XML of the folder will be output.- Parameters:
style
- The display style to use for the folder, which should be a value fromEnumWebFolderDisplayStyle
.- See Also:
getStyle()
-
setFilter
void setFilter(WebObjectFilter value)
- Since:
- MicroStrategy Web 9.0.0
-
getFilter
WebObjectFilter getFilter()
- Since:
- MicroStrategy Web 9.0.0
-
getChildrenInTree
Tree<WebObjectInfo> getChildrenInTree()
Returns child units in a tree structure. Currently, when perform a search, and set its settingWebSearch.setGettingTreeInfo(boolean)
to true, then the results would bring back data with its browsing tree structure. Only in this case, this method would return the tree. In all other cases, it would returnnull
.- Returns:
- A
Tree
to represent the search results with its browsing tree structure, ornull
.
-
setQuickSearchFlag
void setQuickSearchFlag(int qsr)
Read a QuickSearch flag returned in MetaDataSearch result xml node attribute and set to WebFolder object- Parameters:
qsr
-
-
getQuickSearchFlag
int getQuickSearchFlag()
- Returns:
- Integer flag value either 0 or 1
-
isNonSchedulable
boolean isNonSchedulable()
- Returns:
- boolean flag indicates the trigger folder is Non-Schedulable.
-
filterShortcuts
void filterShortcuts(int[] types)
Removes from the folder shortcuts whose target is not in the list of requested types.- Parameters:
types
- a list of desirable types.
-
checkObjectVisibility
void checkObjectVisibility(FolderBean fb)
Removes from the folder shortcuts whose target is not in the list of requested types.- Parameters:
types
- a list of desirable types.
-
checkObjectVisibility
void checkObjectVisibility(FolderBean fb, boolean isSearch)
Removes from the folder shortcuts whose target is not in the list of requested types.Some extra filtering for search- Parameters:
types
- a list of desirable types.
-
getIsBrowsing
boolean getIsBrowsing()
read a flag to indicate whether we're browsing a folder Set only to get 'non-schedulable' flag on objects- Returns:
-
setIsBrowsing
void setIsBrowsing(boolean bf)
set a flag to indicate whether we're browsing a folder Set only to get 'non-schedulable' flag on objects
-
-