[CST-7756] added missing JavaDoc

This commit is contained in:
Mykhaylo
2023-02-03 12:14:28 +01:00
parent c297e49ed2
commit 4fd8eeebb8
6 changed files with 33 additions and 16 deletions

View File

@@ -85,7 +85,7 @@ public interface SubscriptionDAO extends GenericDAO<Subscription> {
* Return a paginated list of all subscriptions ordered by ID and resourceType
*
* @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 offset The position of the first result to return
* @return

View File

@@ -42,17 +42,22 @@ public interface SubscribeService {
throws Exception;
/**
* Subscribe an e-person to a collection. An e-mail will be sent every day a
* new item appears in the collection.
* Subscribe an EPerson to a dSpaceObject (Collection or Community). An e-mail will be sent every day a
* 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 AuthorizeException Exception indicating the current user of the context does not have permission
* to perform a particular action.
*/
public Subscription subscribe(Context context, EPerson eperson, DSpaceObject dSpaceObject,
List<SubscriptionParameter> subscriptionParameterList,
String type) throws SQLException, AuthorizeException;
List<SubscriptionParameter> subscriptionParameters,
String subscriptionType) throws SQLException, AuthorizeException;
/**
* Unsubscribe an e-person to a collection. Passing in <code>null</code>

View File

@@ -42,8 +42,8 @@ public class SubscriptionEmailNotificationConfiguration<T
public Options getOptions() {
if (Objects.isNull(options)) {
Options options = new Options();
options.addOption("f", "Frequency", true, "Subscription frequency."
+ " It can have value D stand for 'Day', W stand for 'Week' and M stand for 'Month'");
options.addOption("f", "Frequency", true,
"Subscription frequency. Valid values include: D (Day), W (Week) and M (Month)");
options.getOption("f").setRequired(true);
super.options = options;
}

View File

@@ -13,12 +13,25 @@ import org.dspace.core.Context;
import org.dspace.scripts.handler.DSpaceRunnableHandler;
/**
* Service interface class for the subscription e-mail notification services
*
* @author Mykhaylo Boychuk (mykhaylo.boychuk@4science.com)
*/
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();
}

View File

@@ -32,7 +32,7 @@ import org.springframework.security.core.Authentication;
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)
*/
@@ -74,7 +74,7 @@ public class SubscriptionRestPermissionEvaluatorPlugin extends RestObjectPermiss
}
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) {
log.error(e.getMessage(), e);
}

View File

@@ -51,7 +51,6 @@ import org.springframework.http.MediaType;
*/
public class SubscriptionRestRepositoryIT extends AbstractControllerIntegrationTest {
private Collection collection;
@Before