mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 06:23:10 +00:00
CST-12822 add offerType to NotifyRequestStatus object, adjust IT test and fix json response
This commit is contained in:
@@ -16,6 +16,7 @@ public class RequestStatus {
|
||||
|
||||
private String serviceName;
|
||||
private String serviceUrl;
|
||||
private String offerType;
|
||||
private NotifyRequestStatusEnum status;
|
||||
|
||||
public String getServiceName() {
|
||||
@@ -36,5 +37,11 @@ public class RequestStatus {
|
||||
public void setStatus(NotifyRequestStatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
public String getOfferType() {
|
||||
return offerType;
|
||||
}
|
||||
public void setOfferType(String offerType) {
|
||||
this.offerType = offerType;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -33,6 +33,7 @@ import org.dspace.app.ldn.model.RequestStatus;
|
||||
import org.dspace.app.ldn.model.Service;
|
||||
import org.dspace.app.ldn.processor.LDNProcessor;
|
||||
import org.dspace.app.ldn.service.LDNMessageService;
|
||||
import org.dspace.app.ldn.utility.LDNUtils;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.service.ItemService;
|
||||
@@ -41,6 +42,7 @@ import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of {@link LDNMessageService}
|
||||
*
|
||||
@@ -292,6 +294,7 @@ public class LDNMessageServiceImpl implements LDNMessageService {
|
||||
RequestStatus offer = new RequestStatus();
|
||||
offer.setServiceName(msg.getTarget() == null ? "Unknown Service" : msg.getTarget().getName());
|
||||
offer.setServiceUrl(msg.getTarget() == null ? "" : msg.getTarget().getUrl());
|
||||
offer.setOfferType(LDNUtils.getNotifyType(msg.getCoarNotifyType()));
|
||||
List<LDNMessageEntity> acks = ldnMessageDao.findAllRelatedMessagesByItem(
|
||||
context, msg, item, "Accept", "TentativeReject", "TentativeAccept", "Announce");
|
||||
if (acks == null || acks.isEmpty()) {
|
||||
|
@@ -80,4 +80,17 @@ public class LDNUtils {
|
||||
return resolverId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the coarNotifyType from the source code.
|
||||
*
|
||||
* @param coarNotifyType coar Notify Type to sanitize
|
||||
* @return String just the notify type
|
||||
*/
|
||||
public static String getNotifyType(String coarNotifyType) {
|
||||
String justNotifyType = coarNotifyType;
|
||||
justNotifyType = justNotifyType.substring(justNotifyType.lastIndexOf(":") + 1);
|
||||
justNotifyType = justNotifyType.replace("Action", "");
|
||||
return justNotifyType;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user