Daisy Open Source CMS

org.outerj.daisy.emailnotifier
Interface EmailSubscriptionManager


public interface EmailSubscriptionManager

Management of email notification subscriptions.

This is an optional repository extension component.

The EmailSubscriptionManager extension is obtained from the Repository as follows:

 subscriptionManager = (EmailSubscriptionManager)repository.getExtension("EmailSubscriptionManager");
 

In the remote repository API, the EmailSubscriptionManager extension can be registered as follows:

 RemoteRepositoryManager repositoryManager = ...;
 repositoryManager.registerExtension("EmailSubscriptionManager",
     new Packages.org.outerj.daisy.emailnotifier.clientimpl.RemoteEmailSubscriptionManagerProvider());
 


Field Summary
static String DOCUMENT_ID_WILDCARD
           
 
Method Summary
 void addDocumentSubscription(long userId, VariantKey variantKey)
           
 void addDocumentSubscription(VariantKey variantKey)
           
 void deleteAllSubscriptionsForCollection(long collectionId)
           
 void deleteAllSubscriptionsForDocument(String documentId)
          Deletes subscriptions for the specified document for all users (useful if eg the document variant has been deleted).
 void deleteAllSubscriptionsForDocumentVariant(VariantKey variantKey)
          Deletes subscriptions for the specified document variant for all users (useful if eg the document variant has been deleted).
 void deleteDocumentSubscription(long userId, VariantKey variantKey)
           
 void deleteDocumentSubscription(VariantKey variantKey)
           
 void deleteSubscription()
          Removes the subscription for the current user.
 void deleteSubscription(long userId)
          Deletes the subscription of another user.
 Subscribers getAllAclEventSubscribers()
           
 Subscribers getAllCollectionEventSubscribers()
           
 Subscribers getAllCommentEventSubscribers(String documentId, long branchId, long languageId, long[] collections)
           
 Subscribers getAllDocumentEventSubscribers(String documentId, long branchId, long languageId, long[] collections)
          Returns the users subscribed to changes for documents.
 Subscribers getAllSchemaEventSubscribers()
           
 Subscribers getAllUserEventSubscribers()
           
 Subscription getSubscription()
          Gets subscription information for the current user.
 Subscription getSubscription(long userId)
          Retrieves the subscription of another user.
 Subscriptions getSubscriptions()
          Get all available subscriptions.
 boolean isSubsribed(long userId, VariantKey variantKey)
           
 boolean isSubsribed(VariantKey variantKey)
          Checks if the user is subscribed to the specified document variant.
 

Field Detail

DOCUMENT_ID_WILDCARD

static final String DOCUMENT_ID_WILDCARD
See Also:
Constant Field Values
Method Detail

getSubscription

Subscription getSubscription()
                             throws RepositoryException
Gets subscription information for the current user. If the user doesn't have a subscription yet, this also returns a Subscription object.

Throws:
RepositoryException

getSubscription

Subscription getSubscription(long userId)
                             throws RepositoryException
Retrieves the subscription of another user. Only users acting as administrator can do this.

Throws:
RepositoryException

deleteSubscription

void deleteSubscription()
                        throws RepositoryException
Removes the subscription for the current user. If the user does not have a subscription, this method should silently return.

Throws:
RepositoryException

deleteSubscription

void deleteSubscription(long userId)
                        throws RepositoryException
Deletes the subscription of another user. Only users acting as administrator can do this. If the user does not have a subscription, this method should silently return.

Throws:
RepositoryException

getSubscriptions

Subscriptions getSubscriptions()
                               throws RepositoryException
Get all available subscriptions. Only users acting as administrator can do this.

Throws:
RepositoryException

addDocumentSubscription

void addDocumentSubscription(VariantKey variantKey)
                             throws RepositoryException
Parameters:
variantKey - documentId can be DOCUMENT_ID_WILDCARD (*), and the branchId and languageId components can be -1 to indicate "any document/branch/language".
Throws:
RepositoryException

addDocumentSubscription

void addDocumentSubscription(long userId,
                             VariantKey variantKey)
                             throws RepositoryException
Throws:
RepositoryException

isSubsribed

boolean isSubsribed(VariantKey variantKey)
                    throws RepositoryException
Checks if the user is subscribed to the specified document variant. This will only return true if an exact match for the subscription is found, thus -1 for branchId and/or languageId doesn't work as a wildcard.

Throws:
RepositoryException

isSubsribed

boolean isSubsribed(long userId,
                    VariantKey variantKey)
                    throws RepositoryException
Throws:
RepositoryException

deleteDocumentSubscription

void deleteDocumentSubscription(VariantKey variantKey)
                                throws RepositoryException
Throws:
RepositoryException

deleteDocumentSubscription

void deleteDocumentSubscription(long userId,
                                VariantKey variantKey)
                                throws RepositoryException
Throws:
RepositoryException

deleteAllSubscriptionsForDocumentVariant

void deleteAllSubscriptionsForDocumentVariant(VariantKey variantKey)
                                              throws RepositoryException
Deletes subscriptions for the specified document variant for all users (useful if eg the document variant has been deleted). Can only be done by users acting in the Administrator role.

Throws:
RepositoryException

deleteAllSubscriptionsForDocument

void deleteAllSubscriptionsForDocument(String documentId)
                                       throws RepositoryException
Deletes subscriptions for the specified document for all users (useful if eg the document variant has been deleted). Can only be done by users acting in the Administrator role.

Throws:
RepositoryException

deleteAllSubscriptionsForCollection

void deleteAllSubscriptionsForCollection(long collectionId)
                                         throws RepositoryException
Throws:
RepositoryException

getAllDocumentEventSubscribers

Subscribers getAllDocumentEventSubscribers(String documentId,
                                           long branchId,
                                           long languageId,
                                           long[] collections)
                                           throws RepositoryException
Returns the users subscribed to changes for documents.

Parameters:
documentId - the id of the document
branchId - can be -1 to specify 'whatever branch the subscription applies to'
languageId - can be -1 to specify 'whatever language the subscription applies to'
collections - the collections the document belongs to.
Throws:
RepositoryException

getAllUserEventSubscribers

Subscribers getAllUserEventSubscribers()
                                       throws RepositoryException
Throws:
RepositoryException

getAllCollectionEventSubscribers

Subscribers getAllCollectionEventSubscribers()
                                             throws RepositoryException
Throws:
RepositoryException

getAllSchemaEventSubscribers

Subscribers getAllSchemaEventSubscribers()
                                         throws RepositoryException
Throws:
RepositoryException

getAllAclEventSubscribers

Subscribers getAllAclEventSubscribers()
                                      throws RepositoryException
Throws:
RepositoryException

getAllCommentEventSubscribers

Subscribers getAllCommentEventSubscribers(String documentId,
                                          long branchId,
                                          long languageId,
                                          long[] collections)
                                          throws RepositoryException
Throws:
RepositoryException

Daisy Open Source CMS