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
    • Email
    • a File
    • a Print job
    The important functionality this bean provides is:
    • 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
    This bean can be created using 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 using setContent(String, int). The trigger to be used with this subscription is defined using setTriggerID(String). The address to be used with this subscription is defined by adding a new address ID to the list retrieved using getAddresses().
    Since:
    MicroStrategy Web 7.3.1 or earlier
    See Also:
    ScheduleBean
    • Method Detail

      • 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 embedded PromptsBean. The returned PromptsBean 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 when save() 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 the setSubscriptionID(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
      • cancel

        void cancel()
        sets the bean state to cancel
      • setDeliveryMode

        void setDeliveryMode​(int deliveryMode)
        Sets the device group to one of the enumerations defined in EnumWebSubscriptionDeliveryMode.
        Parameters:
        deliveryMode - the delivery mode.
        Since:
        MicroStrategy Web 7.5.1
      • 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
      • 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 via getAddresses().
        Parameters:
        values - existing or new address values.
        deviceID - device under which new addresses are created.
        Since:
        MicroStrategy Web 8.0.1
      • getSubscriptionID

        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

        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 using getAvailableTriggers(). You can use WebSubscriptionComponent.getID() for retrieving the trigger ID
        Parameters:
        triggerID - to be set
        See Also:
        WebSubscriptionTrigger
      • getTriggerID

        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

        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

        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

        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

        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 from EnumWebReportViewMode
        Returns:
        the report view mode.
      • setViewMode

        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 from EnumWebReportViewMode
      • setCustomMessage

        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

        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)
      • getNotification

        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

        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

        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

        void setPromptsEventHandler​(WebEventHandler promptsEventHandler)
        Deprecated.
        setting the prompt event handler using WebComponent.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()