public class

BeanHelper

extends Object
java.lang.Object
   ↳ com.microstrategy.web.app.utils.BeanHelper

Class Overview

This class contains some public utility methods that can be used for handling beans included on the application

Summary

Constants
String BLANK_REPORT_ID This constant is deprecated. Ask for the blankReportId configuration parameter instead
Public Constructors
BeanHelper()
Public Methods
static TransformInstance addStyle(Transformable bean, String style)
If necessary, adds a style from the style catalog to the bean.
static void checkSavePrivilege(ObjectBean bean, WebFolder folder)
Check whether current user has privileges to save the object in specific folder.
static void checkSavePrivilege(ObjectBean bean)
Check whether current user has privileges to save the object in current folder.
static void getBeanList(WebComponent root, int beanType, ArrayList componentList)
Inserts in the provided list all the beans that match the provided type
static String getEventOriginalSource(RequestKeys keySet, String eventID)
Searches a set of RequestKeys and returns the event source that matches the specified eventID
static int getFolderObjectSubTypeCount(FolderBean fb, int objectSubType)
Given the folder bean, get the number of objects on it according to the indicated object subtype
static int getFolderObjectTypeCount(FolderBean fb, int objectType)
Given the folder bean, get the number of objects on it according to the indicated object type
static int getInboxObjectCount(InboxBean ib)
Gets the number of messages available on the Inbox bean that was specified as an argument
static int getMaxSessionIdleTime(AppContext appContext, WebIServerSession session)
Returns max session idle time.
static String getNewObjectTypeName(BeanContext beanContext, WebObjectInfo obj)
static String getObjectTypeName(BeanContext beanContext, int type, int subType)
static String getObjectTypeName(BeanContext beanContext, WebObjectInfo obj)
Returns a localized string with the object type name
static String getReportPropertyValue(ReportBean rb, String propertyName)
Gets the value of the requested property from the bean that was passed as an argument
static StyleRequestContext getRequestContext(Transformable bean)
Creates and populates a new instance of a StyleRequestContext object.
static WebIServerSession getSession(Transformable bean)
Returns the current session associated with the corresponding bean.
static int getSubscriptionsCount(SubscriptionFolderBean sb)
Gets the number of subscriptions available on the Subscription Folder bean that was specified as an argument
static boolean ignoreOldStyle(ReportBean rb)
Determines if the style applied to the Report should be ignored or not
static boolean isDossier(WebObjectInfo objInfo)
Check whether a WebObjectInfo instance is has a Dossier ViewMedia type.
static boolean isObjectOnFolder(FolderBean fb, String objectID)
Determines if the given object id exists as adirect child of the folder bean that was passed as an argument
static void saveProjectIDInBrowserSetting(AppContext appCtx)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String BLANK_REPORT_ID

This constant is deprecated.
Ask for the blankReportId configuration parameter instead

Constant that represents the object Id of the blank template report

Constant Value: "05B202B9999F4C1AB960DA6208CADF3D"

Public Constructors

public BeanHelper ()

Public Methods

public static TransformInstance addStyle (Transformable bean, String style)

If necessary, adds a style from the style catalog to the bean. The transform instance is given as key the same name of the style.
If the BeanContext is of type AppContext, this method also sets debug flags based on values from the request keys and masks their values based on the debugFlagsMask parameter

public static void checkSavePrivilege (ObjectBean bean, WebFolder folder)

Check whether current user has privileges to save the object in specific folder.

Parameters
bean ObjectBean The bean of object we want to save.
folder WebFolder The folder we want to save the object in. If it is null, it means we save in current folder.

public static void checkSavePrivilege (ObjectBean bean)

Check whether current user has privileges to save the object in current folder.

Parameters
bean ObjectBean The bean of object we want to save.

public static void getBeanList (WebComponent root, int beanType, ArrayList componentList)

Inserts in the provided list all the beans that match the provided type

Parameters
root WebComponent root to start the search from
beanType Type of the bean to filter
componentList ArrayList to insert the filtered components

public static String getEventOriginalSource (RequestKeys keySet, String eventID)

Searches a set of RequestKeys and returns the event source that matches the specified eventID

Parameters
keySet RequestKeys to get source from
eventID String containing the eventID to get the source of
Returns
  • String containing the event source (path and event)

public static int getFolderObjectSubTypeCount (FolderBean fb, int objectSubType)

Given the folder bean, get the number of objects on it according to the indicated object subtype

Parameters
fb FolderBean instance to search on
objectSubType object subtype to search for
Returns
  • the number of objects in the folder that are of the indicated object subtype. Zero if none found or if a problem was found when handling the folder.

public static int getFolderObjectTypeCount (FolderBean fb, int objectType)

Given the folder bean, get the number of objects on it according to the indicated object type

Parameters
fb FolderBean instance to search on
objectType object type to search for
Returns
  • the number of objects in the folder that are of the indicated object type. Zero if none found or if a problem was found when handling the folder.

public static int getInboxObjectCount (InboxBean ib)

Gets the number of messages available on the Inbox bean that was specified as an argument

Parameters
ib InboxBean to search on
Returns
  • the number of messages on the bean. If an error happens while getting the count, returns zero.

public static int getMaxSessionIdleTime (AppContext appContext, WebIServerSession session)

Returns max session idle time.

Parameters
appContext AppContext application context object
session WebIServerSession IServer session
Returns
  • max session idle time

public static String getNewObjectTypeName (BeanContext beanContext, WebObjectInfo obj)

public static String getObjectTypeName (BeanContext beanContext, int type, int subType)

public static String getObjectTypeName (BeanContext beanContext, WebObjectInfo obj)

Returns a localized string with the object type name

Parameters
beanContext BeanContext
obj WebObjectInfo
Returns
  • String

public static String getReportPropertyValue (ReportBean rb, String propertyName)

Gets the value of the requested property from the bean that was passed as an argument

Parameters
rb ReportBean instance
propertyName Name of the property to search for
Returns
  • the value of the requested property

public static StyleRequestContext getRequestContext (Transformable bean)

Creates and populates a new instance of a StyleRequestContext object.

Returns

public static WebIServerSession getSession (Transformable bean)

Returns the current session associated with the corresponding bean. If the bean is an instance of a WebBean, then it will return the WebSessionInfo associated with it; otherwise, it will try to retrieve the active session from the WebAppSessionManager from the bean's AppContext.

Throws
WebAppConfigurationRuntimeException If the session cannot be retrieved.

public static int getSubscriptionsCount (SubscriptionFolderBean sb)

Gets the number of subscriptions available on the Subscription Folder bean that was specified as an argument

Parameters
sb SubscriptionFolderBean to search on
Returns
  • the number of subscriptions on the bean. If an error happens while getting the count, returns zero.

public static boolean ignoreOldStyle (ReportBean rb)

Determines if the style applied to the Report should be ignored or not

Parameters
rb ReportBean instance
Returns
  • True if the style should be ignored (new reports). Otherwise returns False

public static boolean isDossier (WebObjectInfo objInfo)

Check whether a WebObjectInfo instance is has a Dossier ViewMedia type.

Parameters
objInfo WebObjectInfo The object into instance we want to check
Returns
  • boolean tells whether the object is a Dossier.

public static boolean isObjectOnFolder (FolderBean fb, String objectID)

Determines if the given object id exists as adirect child of the folder bean that was passed as an argument

Parameters
fb FolderBean instance to search on
objectID DSSID of the object to search for
Returns
  • if the indicated objectID exsists on the folder. Returns false if there was any error generated while processing the folder.

public static void saveProjectIDInBrowserSetting (AppContext appCtx)