Interface ISubscribableMechanics
- All Superinterfaces:
IComponent
,IInitializable
,IMechanics
,ISystemHandler
,IViewableMechanics
- All Known Subinterfaces:
IBasicMechanics
,IClipboardMechanics
,IContainerContentConstraintMechanics
,IContainerMechanics
,IContentMechanics
,IFolderMechanics
,ILinkMechanics
,ILocalePortletMechanics
,IPortalRulesMechanics
,IPortletMechanics
,IRuleMechanics
,IScheduleMechanics
,ISkinMechanics
,ITaskMechanics
,ITaskScheduleMechanics
,ITemplateMechanics
,ITopicMechanics
,IVersionableMechanics
,IXTypeMechanics
Mechanics for a subsbcribable item.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from interface com.webmethods.portal.mech.view.IViewableMechanics
COMMENTS_LINK_TYPE, CONTENT_LINK_TYPE, DEFAULT_ORDER, DEFAULT_PAGE_SIZE, DEFAULT_SORT, DETAILS_LINK_TYPE, LARGE_ICON_TYPE, LINK_TYPE, LINK_TYPE_COMMENTS, LINK_TYPE_CONTENT, LINK_TYPE_DETAILS, LINK_TYPE_EDIT, LINK_TYPE_HELP, LINK_TYPE_HELP_MAXIMIZED, LINK_TYPE_MAXIMIZED, LINK_TYPE_MINIMIZED, LINK_TYPE_PERMISSIONS, LINK_TYPE_PORTAL_CONTENT, LINK_TYPE_PORTLET_STANDALONE, LINK_TYPE_PROPERTIES, LINK_TYPE_RESTORED, LINK_TYPE_SUBSCRIPTIONS, LINK_TYPE_THUMBNAILS, LINK_TYPE_VERSIONS, PERMISSIONS_LINK_TYPE, PORTAL_CONTENT_LINK_TYPE, PROPERTIES_LINK_TYPE, PROPERTY_LINK_TARGET, PROPERTY_OWNER_NAME, PROPERTY_PARENT_NAME, PROPERTY_TOOLTIP, REFERENCE_ICON_TYPE, SUBSCRIPTIONS_LINK_TYPE, THUMBNAIL_ICON_TYPE, THUMBNAILS_LINK_TYPE, VERSIONS_LINK_TYPE
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canDeliverToPrincipal
(IURI principalURI, IURI targetURI, IThingID criteriaID, INotificationSourceEvent event) Determines if the notification could be delivered to the end user.boolean
canEditSubscription
(IURI itemId, IThingID userId) Returns true if the specified user can add, edit, or remove a subscription the the specified resource.boolean
canListSubscriptions
(IURI itemId, IThingID userId, Map<?, ?> capabilities) Returns true if the specified user can list the subscriptions to the specified resource.boolean
canViewSubscription
(IURI itemId, IThingID userId, Map<?, ?> capabilities, IThingID subscriberId) Returns true if the specified user can view specified principal's subscription to the specified resource.void
checkEditSubscription
(IURI itemId, IThingID userId) Throws aPortalAccessException
if the specified user cannot add, edit, or remove a subscription the the specified resource.void
checkListSubscriptions
(IURI itemId, IThingID userId, Map<?, ?> capabilities) Throws aPortalAccessException
if the specified user cannot list the subscriptions to the specified resource.void
checkViewSubscription
(IThingID pageId, IThingID userId, Map<?, ?> capabilities, IThingID subscriberId) Deprecated.void
checkViewSubscription
(IURI itemId, IThingID userId, Map<?, ?> capabilities, IThingID subscriberId) Throws aPortalAccessException
if the specified user cannot view specified principal's subscription to the specified resource.createAppCriteria
(IThingID appCriteriaFolderID, String criterionName, String criterionInfo, String operationName, int operationCode, String property) Create a criterion within the specified foldercreateAppCriteriaFolder
(String folderName, String layout, String description) Create a folder to contain a list of application criteriacreatePortletSubscription
(IThingID subscriberPortlet, IThingID source, ICriterion crit) Create a subscription for a portlet subscribercreatePortletSubscription
(IThingID subscriberPortlet, IThingID source, List<ICriterion> criteria) Create a subscription for a portlet subscribervoid
Disables the specified subscription.void
Disables the subscription for the specified resource to the specified principal.void
disableBySystem
(IThingID subscriptionId) Disables the specified subscription, and marks it as disabled by the system (rather than by the principal).void
disableBySystem
(IThingID itemId, IThingID subscriberId) Disables the subscription for the specified resource to the specified principal, and marks it as disabled by the system (rather than by the principal).void
Enables the specified subscription.void
Enables the subscription for the specified resource to the specified principal.void
fireGetAppCriteriaEvent
(String criteriaFolderName, IThingID userId, int status) Fires a get criterion eventvoid
fireGetSubscriptionEvent
(IThingID subscriptionId, IThingID userId, int status) Fires a getsubscription event.void
fireSetSubscriptionEvent
(IThingID subscriptionId, IThingID userId, int status) Fires a set subscribe event.void
fireUnsubscribeEvent
(IThingID subscriptionId, IThingID userId, int status) Fires a unsubscribe event.void
fireViewSubscriptionEvent
(IThingID subscriptionId, IThingID userId, int status) Fires a view subscription event.void
generateNotificationContent
(Writer content, String contentFormat, String contentType, IURI targetId, IThingID criteriaID, INotificationSourceEvent event, Locale locale) Generates notification content for the specified target resource, user, subscription, and event.generateNotificationHeaders
(String contentFormat, IURI targetId, IThingID criteriaID, INotificationSourceEvent event, Locale locale) Generates MIME headers for notification.getAppCriteria
(String criteriaFolderName) Get application criteria based on the name of the criteria foldergetGroupSubscription
(IThingID itemId, IThingID subscriberID, IThingID ownerID) Get a subscription for the specified subscriber on the specified resourcegetSubscription
(IThingID itemId, IThingID subscriberID) Get a subscription for the specified subscriber on the specified resourcelistSubscriptions
(IThingID pageId, int start, int length) Returns a page of subscriptions to the specified resource.listSubscriptions
(IThingID pageId, IThingID userId, int start, int length) Returns a page of subscriptions to the specified resource, filtered for the specified user.setGroupSubscription
(IThingID itemId, IThingID ownerId, IThingID groupId, int deliveryMethods, IThingIDList criteria) Set group subscriptionsetGroupSubscription
(IThingID itemId, IThingID ownerId, IThingID groupId, int deliveryMethods, IThingIDList criteria, boolean isRecursive) Set group subscriptionsetSubscription
(IThingID itemId, IThingID userId, int deliveryMethods, IThingIDList criteria) Throws aPortalAccessException
if the specified user cannot set a subscription the the specified resource.setSubscription
(IThingID itemId, IThingID userId, int deliveryMethods, IThingIDList criteria, boolean recursive) Creates a subscription for a thingvoid
unsubscribe
(IThingID subscriptionId) Unsubscribes the specified subscription IDvoid
unsubscribe
(IThingID itemId, IThingID subscriberId) Unsubscribes the specified principal from the specified resource for the specified rule.viewSubscription
(IURI itemId, IThingID subscriberId) Returns the standard view of a subscription for the specified subscriber to the specified resource.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.mech.view.IViewableMechanics
canView, checkView, createPagingCookie, fireViewEvent, getCss, getCss, getDefaultLinkType, getFormattedProperty, getHierachicalUri, getIcon, getIcon, getLink, getLink, getListProperty, getListPropertyHTML, getListPropertyJS, isEnabled, view, view
-
Field Details
-
HEADER_SUBJECT
- See Also:
-
HEADER_TO
- See Also:
-
HEADER_FROM
- See Also:
-
CONTENT_FORMAT_EMAIL
- See Also:
-
CONTENT_FORMAT_PORTAL_INBOX
- See Also:
-
CONTENT_FORMAT_EMAIL_DIGEST
- See Also:
-
CONTENT_FORMAT_PORTAL_INBOX_DIGEST
- See Also:
-
-
Method Details
-
canViewSubscription
boolean canViewSubscription(IURI itemId, IThingID userId, Map<?, ?> capabilities, IThingID subscriberId) throws PortalExceptionReturns true if the specified user can view specified principal's subscription to the specified resource.- Parameters:
itemId
- IURI of the resourceuserId
- ThingID of the viewercapabilities
- reservedsubscriberId
- ThingID of the subscriber- Returns:
- boolean
- Throws:
PortalException
-
checkViewSubscription
@Deprecated void checkViewSubscription(IThingID pageId, IThingID userId, Map<?, ?> capabilities, IThingID subscriberId) throws PortalException, PortalAccessExceptionDeprecated.Throws aPortalAccessException
if the specified user cannot view specified principal's subscription to the specified resource.- Parameters:
pageId
- reserveduserId
- ThingID of the viewercapabilities
- reservedsubscriberId
- ThingID of the subscriber- Throws:
PortalException
PortalAccessException
-
checkViewSubscription
void checkViewSubscription(IURI itemId, IThingID userId, Map<?, ?> capabilities, IThingID subscriberId) throws PortalException, PortalAccessExceptionThrows aPortalAccessException
if the specified user cannot view specified principal's subscription to the specified resource.- Parameters:
itemId
- IURI of the resourceuserId
- ThingID of the viewercapabilities
- reservedsubscriberId
- ThingID of the subscriber- Throws:
PortalException
PortalAccessException
-
canListSubscriptions
boolean canListSubscriptions(IURI itemId, IThingID userId, Map<?, ?> capabilities) throws PortalExceptionReturns true if the specified user can list the subscriptions to the specified resource.- Parameters:
itemId
- IURI of the resourceuserId
- ThingID of user to list subscriptionscapabilities
- reserved- Returns:
- boolean
- Throws:
PortalException
-
checkListSubscriptions
void checkListSubscriptions(IURI itemId, IThingID userId, Map<?, ?> capabilities) throws PortalException, PortalAccessExceptionThrows aPortalAccessException
if the specified user cannot list the subscriptions to the specified resource.- Parameters:
itemId
- IURI of the resourceuserId
- ThingID of the usercapabilities
- reserved- Throws:
PortalException
PortalAccessException
-
canEditSubscription
Returns true if the specified user can add, edit, or remove a subscription the the specified resource.- Parameters:
itemId
- IURI of the resourceuserId
- ThingID of the user- Throws:
PortalException
-
checkEditSubscription
void checkEditSubscription(IURI itemId, IThingID userId) throws PortalException, PortalAccessException Throws aPortalAccessException
if the specified user cannot add, edit, or remove a subscription the the specified resource.- Parameters:
itemId
- IURI of the resourceuserId
- ThingID of the user- Throws:
PortalException
PortalAccessException
-
fireGetSubscriptionEvent
void fireGetSubscriptionEvent(IThingID subscriptionId, IThingID userId, int status) throws PortalException Fires a getsubscription event.- Parameters:
subscriptionId
- Resource whose subscription was viewed.userId
- User who viewed the subscription.status
- Status of the event (sucessful, denied, error).- Throws:
PortalException
-
fireViewSubscriptionEvent
void fireViewSubscriptionEvent(IThingID subscriptionId, IThingID userId, int status) throws PortalException Fires a view subscription event.- Parameters:
subscriptionId
- Resource whose subscription was viewed.userId
- User who viewed the subscription.status
- Status of the event (sucessful, denied, error).- Throws:
PortalException
-
fireSetSubscriptionEvent
void fireSetSubscriptionEvent(IThingID subscriptionId, IThingID userId, int status) throws PortalException Fires a set subscribe event.- Parameters:
subscriptionId
-userId
- User adding or modifing the subscription.status
- Status of the event (sucessful, denied, error).- Throws:
PortalException
-
fireUnsubscribeEvent
void fireUnsubscribeEvent(IThingID subscriptionId, IThingID userId, int status) throws PortalException Fires a unsubscribe event.- Parameters:
subscriptionId
- Resource to which the subscription was removed.userId
- User removing the subscription.status
- Status of the event (sucessful, denied, error).- Throws:
PortalException
-
fireGetAppCriteriaEvent
void fireGetAppCriteriaEvent(String criteriaFolderName, IThingID userId, int status) throws PortalException Fires a get criterion event- Parameters:
criteriaFolderName
- The folder name that contains the criteriauserId
-status
-- Throws:
PortalException
-
createPortletSubscription
IThingID createPortletSubscription(IThingID subscriberPortlet, IThingID source, ICriterion crit) throws PortalException Create a subscription for a portlet subscriber- Parameters:
subscriberPortlet
-source
-crit
-- Returns:
- The subscription thingID
- Throws:
PortalException
-
createPortletSubscription
IThingID createPortletSubscription(IThingID subscriberPortlet, IThingID source, List<ICriterion> criteria) throws PortalException Create a subscription for a portlet subscriber- Parameters:
subscriberPortlet
-source
-criteria
- list ofICriterion
- Returns:
- The subscription thingID
- Throws:
PortalException
-
getSubscription
Get a subscription for the specified subscriber on the specified resource- Parameters:
itemId
- The resource thingIDsubscriberID
- The subscriber's thingID- Returns:
- IThingID of the subscriber's subscription, or null if nothing found.
- Throws:
PortalException
-
getGroupSubscription
IThingID getGroupSubscription(IThingID itemId, IThingID subscriberID, IThingID ownerID) throws PortalException Get a subscription for the specified subscriber on the specified resource- Parameters:
itemId
- The resource thingIDsubscriberID
- The subscriber's thingIDownerID
- The owner's thingID- Returns:
- IThingID of the subscriber's subscription, or null if nothing found.
- Throws:
PortalException
-
setSubscription
IThingID setSubscription(IThingID itemId, IThingID userId, int deliveryMethods, IThingIDList criteria) throws PortalException Throws aPortalAccessException
if the specified user cannot set a subscription the the specified resource.- Parameters:
itemId
- The resource to monitoruserId
- The user thingID to receive notificationsdeliveryMethods
- email or portalinboxcriteria
- A list of specified criteria thingID- Returns:
- subscription thingID
- Throws:
PortalException
-
setSubscription
IThingID setSubscription(IThingID itemId, IThingID userId, int deliveryMethods, IThingIDList criteria, boolean recursive) throws PortalException Creates a subscription for a thing- Parameters:
itemId
- source thing IDuserId
- subscriber thing IDdeliveryMethods
- what is delivery method for subscription. SeeISubscription
criteria
- list of subscription criteriasrecursive
- whether this is a recursive subscription- Returns:
- subscription thing ID
- Throws:
PortalException
-
setGroupSubscription
IThingID setGroupSubscription(IThingID itemId, IThingID ownerId, IThingID groupId, int deliveryMethods, IThingIDList criteria) throws PortalException Set group subscription- Parameters:
itemId
- The resource to monitorownerId
- The owner of the subscriptiongroupId
- The group to receive the notificationsdeliveryMethods
- Notification delivery methodscriteria
- criteria to match- Returns:
- subscription thingID
- Throws:
PortalException
-
setGroupSubscription
IThingID setGroupSubscription(IThingID itemId, IThingID ownerId, IThingID groupId, int deliveryMethods, IThingIDList criteria, boolean isRecursive) throws PortalException Set group subscription- Parameters:
itemId
- The resource to monitorownerId
- The owner of the subscriptiongroupId
- The group to receive the notificationsdeliveryMethods
- Notification delivery methodscriteria
- criteria to match- Returns:
- subscription thingID
- Throws:
PortalException
-
enable
Enables the subscription for the specified resource to the specified principal.- Parameters:
itemId
- Resource.subscriberId
- Principal.- Throws:
PortalException
-
enable
Enables the specified subscription.- Parameters:
subscriptionId
- Subscription to enable.- Throws:
PortalException
-
disable
Disables the subscription for the specified resource to the specified principal.- Parameters:
itemId
- Resource.subscriberId
- Principal.- Throws:
PortalException
-
disable
Disables the specified subscription.- Parameters:
subscriptionId
- Subscription to disable.- Throws:
PortalException
-
disableBySystem
Disables the subscription for the specified resource to the specified principal, and marks it as disabled by the system (rather than by the principal).- Parameters:
itemId
- Resource.subscriberId
- Principal.- Throws:
PortalException
-
disableBySystem
Disables the specified subscription, and marks it as disabled by the system (rather than by the principal).- Parameters:
subscriptionId
- Subscription to disable.- Throws:
PortalException
-
unsubscribe
Unsubscribes the specified principal from the specified resource for the specified rule.- Parameters:
itemId
- The resource to unsubscribe.subscriberId
- Principal to unsubscribe.- Throws:
PortalException
-
unsubscribe
Unsubscribes the specified subscription ID- Parameters:
subscriptionId
- The subscription thingID to unsubscribe.- Throws:
PortalException
-
viewSubscription
Returns the standard view of a subscription for the specified subscriber to the specified resource.- Parameters:
itemId
- Subsbcribed resource.subscriberId
- Principal whose subscription to view.- Returns:
- View of subscription or null if the subscriber does not have a subscription to the resource.
- Throws:
PortalException
-
listSubscriptions
Returns a page of subscriptions to the specified resource.- Parameters:
pageId
- page id.start
- List starting index (0 for first item).length
- List length (<1 for all items).- Returns:
- List of
IView
items, or an empty list. - Throws:
PortalException
-
listSubscriptions
IListView<IView> listSubscriptions(IThingID pageId, IThingID userId, int start, int length) throws PortalException Returns a page of subscriptions to the specified resource, filtered for the specified user.- Parameters:
pageId
- page id.userId
- User for which to filter.start
- List starting index (0 for first item).length
- List length (<1 for all items).- Returns:
- List of
IView
items, or an empty list. - Throws:
PortalException
-
createAppCriteriaFolder
IThingID createAppCriteriaFolder(String folderName, String layout, String description) throws PortalException Create a folder to contain a list of application criteria- Parameters:
folderName
- The name of the criteria folderlayout
- The rendering layout templatedescription
- The description of the criteria folder- Returns:
- The folder thingID
- Throws:
PortalException
-
createAppCriteria
IThingID createAppCriteria(IThingID appCriteriaFolderID, String criterionName, String criterionInfo, String operationName, int operationCode, String property) throws PortalException Create a criterion within the specified folder- Parameters:
appCriteriaFolderID
- The application criteria folder thingIDcriterionName
- The name of the criterioncriterionInfo
- The information field of the criterionoperationName
- The name of the criterion operationoperationCode
- The code of the criterion operationproperty
- The property of the criterion operation- Returns:
- The thingID of the created criterion
- Throws:
PortalException
-
getAppCriteria
Get application criteria based on the name of the criteria folder- Parameters:
criteriaFolderName
- The name of the criteria folder- Returns:
- A list of criteria thingID
- Throws:
PortalException
-
canDeliverToPrincipal
boolean canDeliverToPrincipal(IURI principalURI, IURI targetURI, IThingID criteriaID, INotificationSourceEvent event) throws PortalException Determines if the notification could be delivered to the end user. The default implementation just checks user permissions on the sources and other notification objects- Parameters:
principalURI
- user to deliver notification totargetURI
- target resource being notified aboutcriteriaID
- criteria ID being notified aboutevent
- notification source event- Returns:
- Throws:
PortalException
-
generateNotificationContent
void generateNotificationContent(Writer content, String contentFormat, String contentType, IURI targetId, IThingID criteriaID, INotificationSourceEvent event, Locale locale) throws PortalException Generates notification content for the specified target resource, user, subscription, and event.- Parameters:
content
- Output stream to which to write notification content.contentType
- Content media type. May include charset.targetId
- Resource about which to notify (ie notification generated because user subscribed to this resource).criteriaID
- ID of the criteria that matched for this subscription e.g. "item is added" or "item is updated" or "item is deleted"event
- about which to notify user.- Throws:
PortalException
-
generateNotificationHeaders
Map<String,String> generateNotificationHeaders(String contentFormat, IURI targetId, IThingID criteriaID, INotificationSourceEvent event, Locale locale) throws PortalException Generates MIME headers for notification. For example, may generate Subject, From, Reply-To, and Message-ID. Does not need to generate content headers (ie Content-Type, etc.). Headers names should be in canonical form (capitalized, with hyphens). Header values should not be encoded.- Parameters:
targetId
- Resource about which to notify (ie notification generated because user subscribed to this resource).criteriaID
- ID of the criteria that matched for this subscription e.g. "item is added" or "item is updated" or "item is deleted"event
- Event about which to notify user.- Throws:
PortalException
-
checkViewSubscription(IURI, IThingID, Map, IThingID)
instead