mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
[CST-7756] added missing JavaDoc
This commit is contained in:
@@ -85,7 +85,7 @@ public interface SubscriptionDAO extends GenericDAO<Subscription> {
|
|||||||
* Return a paginated list of all subscriptions ordered by ID and resourceType
|
* Return a paginated list of all subscriptions ordered by ID and resourceType
|
||||||
*
|
*
|
||||||
* @param context DSpace context object
|
* @param context DSpace context object
|
||||||
* @param resourceType Could be Item, Collection or Community
|
* @param resourceType Could be Collection or Community
|
||||||
* @param limit Paging limit
|
* @param limit Paging limit
|
||||||
* @param offset The position of the first result to return
|
* @param offset The position of the first result to return
|
||||||
* @return
|
* @return
|
||||||
|
@@ -42,17 +42,22 @@ public interface SubscribeService {
|
|||||||
throws Exception;
|
throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribe an e-person to a collection. An e-mail will be sent every day a
|
* Subscribe an EPerson to a dSpaceObject (Collection or Community). An e-mail will be sent every day a
|
||||||
* new item appears in the collection.
|
* new item appears in the Collection or Community.
|
||||||
*
|
*
|
||||||
* @param context DSpace context
|
* @param context DSpace context object
|
||||||
|
* @param eperson EPerson to subscribe
|
||||||
|
* @param dSpaceObject DSpaceObject to subscribe
|
||||||
|
* @param subscriptionParameters list of @SubscriptionParameter
|
||||||
|
* @param subscriptionType Currently supported only "content"
|
||||||
|
* @return
|
||||||
* @throws SQLException An exception that provides information on a database access error or other errors.
|
* @throws SQLException An exception that provides information on a database access error or other errors.
|
||||||
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
|
||||||
* to perform a particular action.
|
* to perform a particular action.
|
||||||
*/
|
*/
|
||||||
public Subscription subscribe(Context context, EPerson eperson, DSpaceObject dSpaceObject,
|
public Subscription subscribe(Context context, EPerson eperson, DSpaceObject dSpaceObject,
|
||||||
List<SubscriptionParameter> subscriptionParameterList,
|
List<SubscriptionParameter> subscriptionParameters,
|
||||||
String type) throws SQLException, AuthorizeException;
|
String subscriptionType) throws SQLException, AuthorizeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsubscribe an e-person to a collection. Passing in <code>null</code>
|
* Unsubscribe an e-person to a collection. Passing in <code>null</code>
|
||||||
|
@@ -42,8 +42,8 @@ public class SubscriptionEmailNotificationConfiguration<T
|
|||||||
public Options getOptions() {
|
public Options getOptions() {
|
||||||
if (Objects.isNull(options)) {
|
if (Objects.isNull(options)) {
|
||||||
Options options = new Options();
|
Options options = new Options();
|
||||||
options.addOption("f", "Frequency", true, "Subscription frequency."
|
options.addOption("f", "Frequency", true,
|
||||||
+ " It can have value D stand for 'Day', W stand for 'Week' and M stand for 'Month'");
|
"Subscription frequency. Valid values include: D (Day), W (Week) and M (Month)");
|
||||||
options.getOption("f").setRequired(true);
|
options.getOption("f").setRequired(true);
|
||||||
super.options = options;
|
super.options = options;
|
||||||
}
|
}
|
||||||
|
@@ -13,12 +13,25 @@ import org.dspace.core.Context;
|
|||||||
import org.dspace.scripts.handler.DSpaceRunnableHandler;
|
import org.dspace.scripts.handler.DSpaceRunnableHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Service interface class for the subscription e-mail notification services
|
||||||
|
*
|
||||||
* @author Mykhaylo Boychuk (mykhaylo.boychuk@4science.com)
|
* @author Mykhaylo Boychuk (mykhaylo.boychuk@4science.com)
|
||||||
*/
|
*/
|
||||||
public interface SubscriptionEmailNotificationService {
|
public interface SubscriptionEmailNotificationService {
|
||||||
|
|
||||||
public void perform(Context context, DSpaceRunnableHandler handler, String type, String frequency);
|
/**
|
||||||
|
* Performs sending of e-mails to subscribers by frequency value and SubscriptionType
|
||||||
|
*
|
||||||
|
* @param context DSpace context object
|
||||||
|
* @param handler Applicable DSpaceRunnableHandler
|
||||||
|
* @param subscriptionType Currently supported only "content"
|
||||||
|
* @param frequency Valid values include: D (Day), W (Week) and M (Month)
|
||||||
|
*/
|
||||||
|
public void perform(Context context, DSpaceRunnableHandler handler, String subscriptionType, String frequency);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns a set of supported SubscriptionTypes
|
||||||
|
*/
|
||||||
public Set<String> getSupportedSubscriptionTypes();
|
public Set<String> getSupportedSubscriptionTypes();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ import org.springframework.security.core.Authentication;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RestPermissionEvaluatorPlugin}
|
* {@link RestPermissionEvaluatorPlugin} class that evaluate READ, WRITE and DELETE permissions over a Subscription
|
||||||
*
|
*
|
||||||
* @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com)
|
* @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com)
|
||||||
*/
|
*/
|
||||||
@@ -74,7 +74,7 @@ public class SubscriptionRestPermissionEvaluatorPlugin extends RestObjectPermiss
|
|||||||
}
|
}
|
||||||
|
|
||||||
Subscription subscription = subscribeService.findById(context, Integer.parseInt(targetId.toString()));
|
Subscription subscription = subscribeService.findById(context, Integer.parseInt(targetId.toString()));
|
||||||
return Objects.nonNull(subscription) ? currentUser.equals(subscription.getEPerson()) : true;
|
return Objects.nonNull(subscription) ? currentUser.equals(subscription.getEPerson()) : false;
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,6 @@ import org.springframework.http.MediaType;
|
|||||||
*/
|
*/
|
||||||
public class SubscriptionRestRepositoryIT extends AbstractControllerIntegrationTest {
|
public class SubscriptionRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||||
|
|
||||||
|
|
||||||
private Collection collection;
|
private Collection collection;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
Reference in New Issue
Block a user