Package com.microstrategy.web.beans
Interface SubscriptionBean
-
- All Superinterfaces:
EnumWebPersistableState
,Persistable
,RequestPersistable
,Transformable
,WebBean
,WebComponent
public interface SubscriptionBean extends WebBean
This bean represents a Narrowcast subscription. This helps you to manage subscriptions to reports and documents that will be delivered as- a File
- a Print job
- creating new subscripitions by defining appropriate content,address, trigger and personalization
- edit an existing subscription by initializing this bean with an appropriate id
- delete an existing subscription
WebBeanFactory.newSubscriptionBean()
Once created, the bean needs to associated with a content, a trigger and an address before it can be saved The content is defined using a valid report/document. This is set usingsetContent(String, int)
. The trigger to be used with this subscription is defined usingsetTriggerID(String)
. The address to be used with this subscription is defined by adding a new address ID to the list retrieved usinggetAddresses()
.- Since:
- MicroStrategy Web 7.3.1 or earlier
- See Also:
ScheduleBean
-
-
Field Summary
-
Fields inherited from interface com.microstrategy.utils.serialization.EnumWebPersistableState
BARE_MINIMAL_STATE_INFO, MAXIMAL_STATE_INFO, MINIMAL_STATE_INFO, TYPICAL_STATE_INFO
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
cancel()
sets the bean state to cancelvoid
delete()
This method deletes the subscription that the bean was initialized with using the setSubscriptionID method.SimpleList
getAddresses()
Returns an editable list.java.lang.String
getAddressValues()
java.lang.String
getAddressValuesDeviceID()
SimpleList
getAvailableAddresses()
Returns a non-editable list of available addresses that are valid for this subscription that the user can pick from.SimpleList
getAvailableDevices()
Returns a list of available devices that the user can pick from This is a list of devices that are relevant for the content defined usingsetContent(String, int)
So it is important to set the delivery mode and set the content before retrieving this listSimpleList
getAvailableLocations()
Returns a list of availableWebSubscriptionDevice
andWebSubscriptionAddress
objects.SimpleList
getAvailableMobileDevices()
Returns a list of available devices that the user can pick from for the Applciation type on the Alerts editorSimpleList
getAvailableTriggers()
Returns a list of available triggers that the user can pick from This is a list of triggers that are relevant for the content defined usingsetContent(String, int)
So it is important to set the delivery mode and set the content before retrieving this listWebSubscriptionContent
getContent()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.java.lang.String
getCustomMessage()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.WebSubscriptionDeliveryModeProperties
getDeliveryMode()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.int
getEditMode()
Returns the edit mode.java.lang.String
getLocationKey()
Retrieves location key of subscription.WebSubscriptionNotification
getNotification()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.PromptsBean
getPromptsBean()
returns the embeddedPromptsBean
.WebEventHandler
getPromptsEventHandler()
Deprecated.WebSubscription
getSubscription()
Returns the subscription objectjava.lang.String
getSubscriptionID()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.ObjectBean
getTarget()
retrieves the object (report or document) for which this subscription is created Returns null if no content was setjava.lang.String
getTriggerID()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.int
getViewMode()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.boolean
isDiffContentForAlertSelected()
Indicate if user's about to select a different object for alertsboolean
isPersonalized()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.boolean
isSendNowSet()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.boolean
isTriggerNonSchedulable()
return whether the trigger is nonSchedulable.void
reprompt()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.void
save()
This method saves all the required subscriptions for the specified content, trigger and the list of addresses Once the save method completes, the list of addresses is reset.void
setAddressValues(java.lang.String values, java.lang.String deviceID)
This presents an alternative to creating addresses viagetAddresses()
.void
setContent(ObjectBean ob)
You can also set an object bean on the SubscriptionBean.void
setContent(java.lang.String objectID, int type)
Defines the content of the subscription.void
setCustomMessage(java.lang.String message)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.void
setDeliveryMode(int deliveryMode)
Sets the device group to one of the enumerations defined inEnumWebSubscriptionDeliveryMode
.void
setIsDiffContentForAlertSelected(boolean selected)
void
setLocationKey(java.lang.String key)
Sets location key of subscription.void
setPromptsEventHandler(WebEventHandler promptsEventHandler)
Deprecated.setting the prompt event handler usingWebComponent.setWebEventHandler(WebEventHandler)
should cover this case.void
setSendNow(boolean sendNow)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.void
setSubscriptionID(java.lang.String subscriptionID)
Deprecated.usesetSubscriptionID(String, int)
instead.void
setSubscriptionID(java.lang.String subscriptionID, int editMode)
sets the subscriptionID to be used for this subscriptionvoid
setTriggerID(java.lang.String triggerID)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.void
setViewMode(int mode)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.-
Methods inherited from interface com.microstrategy.utils.serialization.Persistable
restoreState, restoreState, saveState, saveState, saveState, saveState
-
Methods inherited from interface com.microstrategy.web.beans.RequestPersistable
restoreStateFromRequest, restoreStateFromRequest
-
Methods inherited from interface com.microstrategy.web.beans.Transformable
addTransform, addTransformByClass, addTransformByStyle, addTransformByStyle, clearTransforms, getBeanContext, getMessageString, getMyTransformInstances, getTransformInstance, getTransformInstance, getTransformInstances, getType, hasTransform, hasTransform, invalidateTransformCache, setBeanContext, transform, transform
-
Methods inherited from interface com.microstrategy.web.beans.WebBean
getDocument, getErrorInfo, getSessionInfo, isStale, setSessionInfo, setStale
-
Methods inherited from interface com.microstrategy.web.beans.WebComponent
addChild, addChildStateInfo, addChildStateInfo, collectData, collectMinimalData, generateOutput, getBeanContext, getChild, getChild, getChildByClass, getChildByType, getChildCount, getChildrenByClass, getDefaultStateLevel, getFeaturesManager, getMaximumStateLevel, getName, getOutputFormat, getParent, getPath, getPersistMode, getRenderingFilter, getRoot, getTargetBean, getTargetBeanPath, getWebEvent, getWebEvent, getWebEventHandler, getXMLStatus, handleRequest, hasChanged, hasJustOpened, initBean, invalidateChildrenState, isBeanContextEmpty, isFeatureAvailable, prepareForReuse, removeChild, removeChild, searchChild, setBeanContext, setBeanContext, setChanged, setChanged, setDefaultStateLevel, setFeaturesManager, setName, setOutputFormat, setParent, setPersistMode, setRenderingFilter, setTargetBean, setTargetBeanPath, setWebEventHandler
-
-
-
-
Method Detail
-
setSubscriptionID
@Deprecated void setSubscriptionID(java.lang.String subscriptionID) throws WebBeanException
Deprecated.usesetSubscriptionID(String, int)
instead.sets the subscriptionID to be used for this subscription.- Parameters:
subscriptionID
- to be set- Throws:
WebBeanException
- thrown if the argument provided does not correspond to an existing subscription- See Also:
getSubscriptionID()
-
setSubscriptionID
void setSubscriptionID(java.lang.String subscriptionID, int editMode) throws WebBeanException
sets the subscriptionID to be used for this subscription- Parameters:
subscriptionID
- to be seteditMode
- the edit mode. should be a value fromEnumWebSubscriptionEditModes
- Throws:
WebBeanException
- thrown if the argument provided does not correspond to an existing subscription- See Also:
getSubscriptionID()
,getEditMode()
-
getEditMode
int getEditMode()
Returns the edit mode.- Returns:
- edit mode
- Throws:
WebBeanException
- if an error occurred on Server while retrieving the subscription object.- See Also:
setSubscriptionID(String, int)
-
getSubscription
WebSubscription getSubscription() throws WebBeanException
Returns the subscription object- Returns:
- subscription object
- Throws:
WebBeanException
- if an error occurred on Server while retrieving the subscription object.- Since:
- MicroStrategy Web 9.0.0
-
getPromptsBean
PromptsBean getPromptsBean()
returns the embeddedPromptsBean
. The returnedPromptsBean
is empty if this subscription does not have contain any prompts.- Returns:
- the embedded
PromptsBean
.
-
getAddresses
SimpleList getAddresses()
Returns an editable list. This is a convenience mechanism for the user to create multiple subscriptions at once whensave()
on this bean is called, subscriptions are created for each of the addresses that are a part of this list. The list is cleared after a successful completion the save() call. If the bean is initialized using thesetSubscriptionID(String)
method, then the list is prepopulted with the address ID that the subscription (represented by the ID set) corresponds to.- Returns:
- an editable
SimpleList
of addressIDs. Each element is of type String
-
save
void save() throws WebBeanException
This method saves all the required subscriptions for the specified content, trigger and the list of addresses Once the save method completes, the list of addresses is reset. In other words, the getAddresses call would return an empty list- Throws:
WebBeanException
- thrown if error occurs
-
delete
void delete() throws WebBeanException
This method deletes the subscription that the bean was initialized with using the setSubscriptionID method. If the bean was not initialized in this way, then this call has no effect.- Throws:
WebBeanException
- thrown if error occurs
-
setContent
void setContent(java.lang.String objectID, int type) throws WebBeanException
Defines the content of the subscription.- Parameters:
objectID
- ID of the objecttype
- indicates whether it's a report or a document -- value fromEnumDSSXMLObjectTypes
- Throws:
WebBeanException
- thrown if error occurs- See Also:
WebSubscriptionContent
,WebSubscriptionContentReport
,WebSubscriptionContentDocument
-
setContent
void setContent(ObjectBean ob) throws WebBeanException
You can also set an object bean on the SubscriptionBean. The object bean can be either aReportBean
,DocumentBean
or aRWBean
. By setting the object bean, the underlyingWebSubscription
object is created and initialized with the instance from the object bean- Parameters:
ob
-- Throws:
WebBeanException
-
getAvailableAddresses
SimpleList getAvailableAddresses() throws WebBeanException
Returns a non-editable list of available addresses that are valid for this subscription that the user can pick from.- Returns:
- a
SimpleList
of objects which can be cast to {WebSubscriptionAddress
} - Throws:
WebBeanException
- thrown if error occurs
-
getAvailableTriggers
SimpleList getAvailableTriggers() throws WebBeanException
Returns a list of available triggers that the user can pick from This is a list of triggers that are relevant for the content defined usingsetContent(String, int)
So it is important to set the delivery mode and set the content before retrieving this list- Returns:
- a
SimpleList
of objects which can be cast to {WebSubscriptionTrigger
} - Throws:
WebBeanException
- thrown if error occurs- See Also:
WebSubscriptionTrigger
-
isTriggerNonSchedulable
boolean isTriggerNonSchedulable() throws WebBeanException
return whether the trigger is nonSchedulable.- Throws:
WebBeanException
-
getAvailableDevices
SimpleList getAvailableDevices() throws WebBeanException
Returns a list of available devices that the user can pick from This is a list of devices that are relevant for the content defined usingsetContent(String, int)
So it is important to set the delivery mode and set the content before retrieving this list- Returns:
- a
SimpleList
of objects which can be cast to {WebSubscriptionDevice
} - Throws:
WebBeanException
- thrown if error occurs- See Also:
WebSubscriptionDevice
-
getAvailableMobileDevices
SimpleList getAvailableMobileDevices() throws WebBeanException
Returns a list of available devices that the user can pick from for the Applciation type on the Alerts editor- Returns:
- a
SimpleList
of objects which can be cast to {WebSubscriptionDevice
} - Throws:
WebBeanException
- thrown if error occurs- See Also:
WebSubscriptionDevice
-
cancel
void cancel()
sets the bean state to cancel
-
setDeliveryMode
void setDeliveryMode(int deliveryMode)
Sets the device group to one of the enumerations defined inEnumWebSubscriptionDeliveryMode
.- Parameters:
deliveryMode
- the delivery mode.- Since:
- MicroStrategy Web 7.5.1
-
getAvailableLocations
SimpleList getAvailableLocations() throws WebBeanException
Returns a list of availableWebSubscriptionDevice
andWebSubscriptionAddress
objects. Applicable to device groupsEnumWebSubscriptionDeliveryMode.SUBSCRIPTION_DELIVERY_MODE_FILE
andEnumWebSubscriptionDeliveryMode.SUBSCRIPTION_DELIVERY_MODE_PRINT
only.- Returns:
- collection of file and print locations (device and addresses)
- Throws:
WebBeanException
- if there is a problem retrieving the available locations.- Since:
- MicroStrategy Web 7.5.1
- See Also:
WebSubscriptionLocation
-
setLocationKey
void setLocationKey(java.lang.String key)
Sets location key of subscription. This provides a way to abstract a address and a device into a single concept The client can use a device (for instance in the case of print subscriptions) or an address and get the corresponding key to set on this subscription.- Parameters:
key
- the location key.- Since:
- MicroStrategy Web 7.5.1
- See Also:
WebSubscriptionLocation
-
getLocationKey
java.lang.String getLocationKey()
Retrieves location key of subscription.- Returns:
- the location key.
- Since:
- MicroStrategy Web 7.5.1
- See Also:
setLocationKey(String)
,WebSubscriptionLocation
-
getTarget
ObjectBean getTarget() throws WebBeanException
retrieves the object (report or document) for which this subscription is created Returns null if no content was set- Returns:
- the object bean.
- Throws:
WebBeanException
- Since:
- MicroStrategy Web 8.0.0
-
setAddressValues
void setAddressValues(java.lang.String values, java.lang.String deviceID)
This presents an alternative to creating addresses viagetAddresses()
.- Parameters:
values
- existing or new address values.deviceID
- device under which new addresses are created.- Since:
- MicroStrategy Web 8.0.1
-
getAddressValues
java.lang.String getAddressValues()
- Since:
- MicroStrategy Web 8.0.1
- See Also:
setAddressValues(String, String)
-
getAddressValuesDeviceID
java.lang.String getAddressValuesDeviceID()
- Since:
- MicroStrategy Web 8.0.1
- See Also:
setAddressValues(String, String)
-
getContent
@Deprecated WebSubscriptionContent getContent() throws WebBeanException
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Retrieves the associatedWebSubscriptionContent
object The content is an abstraction that represents the underlying data that will be delivered. Content is fully defined by associating a report/document object with it.- Returns:
- the
WebSubscriptionContent
object - Throws:
WebBeanException
- thrown if the content can not be retrieved.- See Also:
setContent(String, int)
,WebSubscriptionContent
-
getSubscriptionID
@Deprecated java.lang.String getSubscriptionID()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.retrieves the subscriptionID. SubscriptionID is the ID of the underlying subscription object The underlying subscription object cannot be retrieved using this bean. The subscriptionID is typically retrieved from a subscription object that is returned as a part of a list of subscriptions The list of subscriptions can be retrieved using the SubscriptionFolderBean- Returns:
- the subscriptionID
- See Also:
SubscriptionFolderBean
-
setTriggerID
@Deprecated void setTriggerID(java.lang.String triggerID)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.sets the triggerID to be used for this subscription. The trigger is the object that defines when (and how often) the subscription will be delivered The list of triggers available for this subscription can be retrieved usinggetAvailableTriggers()
. You can useWebSubscriptionComponent.getID()
for retrieving the trigger ID- Parameters:
triggerID
- to be set- See Also:
WebSubscriptionTrigger
-
getTriggerID
@Deprecated java.lang.String getTriggerID()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.retrieves the triggerID. The trigger is the object that defines when (and how often) the subscription contents will be delivered- Returns:
- the triggerID
- See Also:
setTriggerID(String)
,WebSubscriptionTrigger
-
isPersonalized
@Deprecated boolean isPersonalized() throws WebBeanException
Deprecated.Use the subscription object (getSubscription()
) from bean instead.returns true indicating whether the subscription is personalized This means that the content (report or document) used for this subscription was prompted- Returns:
- true if the subscription is personalized
- Throws:
WebBeanException
- thrown if error occurs
-
setSendNow
@Deprecated void setSendNow(boolean sendNow)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Specifies that after making the subscription, a one-time delivery of the content should be done right away to the addresses to which the subscriptions are saved.- Parameters:
sendNow
- boolean indicating that a one-time delivery should be done right away after saving
-
isSendNowSet
@Deprecated boolean isSendNowSet()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Returns true if the preview of the subscription will be sent.- Returns:
- boolean indicating whether the preview for the subscription will be sent
- See Also:
setSendNow(boolean)
-
getViewMode
@Deprecated int getViewMode()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Only relevant in the case of a report subscription. indicates whether the view mode is grid, graph or both possible values fromEnumWebReportViewMode
- Returns:
- the report view mode.
-
setViewMode
@Deprecated void setViewMode(int mode)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Only relevant in the case of a report subscription. indicates whether the view mode is grid, graph or both- Parameters:
mode
- one of the possible values fromEnumWebReportViewMode
-
setCustomMessage
@Deprecated void setCustomMessage(java.lang.String message)
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Defines a message that will be added to the subscription This is typically sent as an attachment to the actual content being delivered.- Parameters:
message
- the message text that should be included with the subscription delivered
-
getCustomMessage
@Deprecated java.lang.String getCustomMessage()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Returns the custom message that is defined- Returns:
- The custom message set by the user
- See Also:
setCustomMessage(String)
-
getDeliveryMode
@Deprecated WebSubscriptionDeliveryModeProperties getDeliveryMode()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Returns one of the delivery modes defined inEnumWebSubscriptionDeliveryMode
. If previously unspecified withsetDeliveryMode(int)
, this will return the default valueEnumWebSubscriptionDeliveryMode.SUBSCRIPTION_DELIVERY_MODE_EMAIL
.- Returns:
- the delivery mode.
- Since:
- MicroStrategy Web 7.5.1
-
getNotification
@Deprecated WebSubscriptionNotification getNotification()
Deprecated.Use the subscription object (getSubscription()
) from bean instead.This allows the user to define properties that will be used to configure delivery confirmation.- Returns:
- the notification object.
- Since:
- MicroStrategy Web 8.0.0
-
reprompt
@Deprecated void reprompt() throws WebBeanException
Deprecated.Use the subscription object (getSubscription()
) from bean instead.Reopens the answered prompts, if there is any, contained in this SubscriptionBean.- Throws:
WebBeanException
- thrown if error occurs when refreshing.- Since:
- MicroStrategy Web 8.0.0
-
getPromptsEventHandler
@Deprecated WebEventHandler getPromptsEventHandler()
Deprecated.Gets the prompts event handler that is associated with the underlying promptsbean. This is just a convenience method. The result of this is the same as this.getPromptsBean().getWebEventHandler()- Returns:
- the prompts event handler
- See Also:
getPromptsBean()
-
setPromptsEventHandler
@Deprecated void setPromptsEventHandler(WebEventHandler promptsEventHandler)
Deprecated.setting the prompt event handler usingWebComponent.setWebEventHandler(WebEventHandler)
should cover this case.Sets the prompts event handler of the underlying prompts bean. This is just a convenience method. The effect of this is the same as doing this.getPromptsBean().setWebEventHandler(promptsEventHandler)- Parameters:
promptsEventHandler
- of the underlying prompts bean.
-
isDiffContentForAlertSelected
boolean isDiffContentForAlertSelected()
Indicate if user's about to select a different object for alerts- Returns:
- if user's about to select a differernt object for alerts
-
setIsDiffContentForAlertSelected
void setIsDiffContentForAlertSelected(boolean selected)
- Parameters:
selected
-- See Also:
isDiffContentForAlertSelected()
-
-