Add transactional to makeFinalize on DMP and remove jackson parsing when depositing to zenodo
This commit is contained in:
parent
4eb15da95a
commit
38cd336bc9
|
@ -7,6 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
|
@ -28,6 +29,7 @@ public class DatabaseService<T extends DataEntity> {
|
|||
return this.databaseCtx.getQueryable(tClass);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public T createOrUpdate(T item, Class<T> tClass) {
|
||||
return this.databaseCtx.createOrUpdate(item, tClass);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import javax.persistence.criteria.Join;
|
||||
import javax.persistence.criteria.JoinType;
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -106,6 +107,7 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public DMP createOrUpdate(DMP item) {
|
||||
return this.getDatabaseService().createOrUpdate(item, DMP.class);
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
|
@ -1034,6 +1035,7 @@ public class DataManagementPlanManager {
|
|||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void makeFinalize(UUID id, Principal principal, DatasetsToBeFinalized datasetsToBeFinalized) throws Exception {
|
||||
DMP dmp = this.apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(id);
|
||||
if (!isUserOwnerOfDmp(dmp, principal))
|
||||
|
@ -2093,10 +2095,10 @@ public class DataManagementPlanManager {
|
|||
}
|
||||
dataBuilder.append(" }\n").append("}");
|
||||
createData = dataBuilder.toString();
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
/*ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
|
||||
JsonNode createDataJSON = mapper.readTree(createData);
|
||||
HttpEntity<JsonNode> request = new HttpEntity<>(createDataJSON, headers);
|
||||
JsonNode createDataJSON = mapper.readTree(createData);*/
|
||||
HttpEntity<String> request = new HttpEntity<>(createData, headers);
|
||||
Map createResponse = null;
|
||||
LinkedHashMap<String, String> links = null;
|
||||
String previousDOI = this.getPreviousDOI(dmp.getGroupId(), dmp.getId());
|
||||
|
|
Loading…
Reference in New Issue