added lastConsentTermsOfUseDate
This commit is contained in:
parent
bd31f55685
commit
03dad9cb1e
|
@ -22,6 +22,9 @@ public class RepositorySnippet {
|
|||
private String consentTermsOfUse;
|
||||
private Date consentTermsOfUseDate;
|
||||
|
||||
private Date lastConsentTermsOfUseDate;
|
||||
private String eoscDatasourceType;
|
||||
|
||||
|
||||
private PiwikInfo piwikInfo;
|
||||
|
||||
|
@ -139,4 +142,20 @@ public class RepositorySnippet {
|
|||
public void setConsentTermsOfUseDate(Date consentTermsOfUseDate) {
|
||||
this.consentTermsOfUseDate = consentTermsOfUseDate;
|
||||
}
|
||||
|
||||
public Date getLastConsentTermsOfUseDate() {
|
||||
return lastConsentTermsOfUseDate;
|
||||
}
|
||||
|
||||
public void setLastConsentTermsOfUseDate(Date lastConsentTermsOfUseDate) {
|
||||
this.lastConsentTermsOfUseDate = lastConsentTermsOfUseDate;
|
||||
}
|
||||
|
||||
public String getEoscDatasourceType() {
|
||||
return eoscDatasourceType;
|
||||
}
|
||||
|
||||
public void setEoscDatasourceType(String eoscDatasourceType) {
|
||||
this.eoscDatasourceType = eoscDatasourceType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,16 @@ public class Converter {
|
|||
repository.setTypology(datasource.get("platform").toString());
|
||||
if (repository.getTypology().equals("null"))
|
||||
repository.setTypology("");
|
||||
|
||||
// // TODO: enable in future release
|
||||
// /* 07-04-2022 | "typology" -> "eoscDatasourceType" */
|
||||
// try { // FIXME: remove attemp to get typology if eoscDatasourceType fails
|
||||
// repository.setDatasourceClass(datasource.get("eoscDatasourceType").toString());
|
||||
// } catch (JSONException e) {
|
||||
// repository.setDatasourceClass(datasource.get("typology").toString());
|
||||
// }
|
||||
repository.setDatasourceClass(datasource.get("typology").toString());
|
||||
// <--
|
||||
|
||||
repository.setDateOfCollection(convertStringToDate(datasource.get("dateofcollection").toString()));
|
||||
repository.setActivationId(datasource.get("activationId").toString());
|
||||
|
@ -105,10 +114,13 @@ public class Converter {
|
|||
}
|
||||
|
||||
repository.setConsentTermsOfUse(convertStringToBoolean(datasource.get("consentTermsOfUse").toString()));
|
||||
repository.setConsentTermsOfUseDate(null);
|
||||
repository.setLastConsentTermsOfUseDate(null);
|
||||
try {
|
||||
repository.setConsentTermsOfUseDate(convertStringToDate(datasource.get("consentTermsOfUseDate").toString()));
|
||||
repository.setLastConsentTermsOfUseDate(convertStringToDate(datasource.get("lastConsentTermsOfUseDate").toString()));
|
||||
} catch (JSONException e) {
|
||||
repository.setConsentTermsOfUseDate(null);
|
||||
LOGGER.info("Error setting consentTermsOfUseDate date and lastConsentTermsOfUseDate", e);
|
||||
}
|
||||
repository.setFullTextDownload(convertStringToBoolean(datasource.get("fullTextDownload").toString()));
|
||||
|
||||
|
@ -216,7 +228,17 @@ public class Converter {
|
|||
repositoryInterface.setId(repositoryInterfaceObject.get("id").toString());
|
||||
repositoryInterface.setAccessProtocol(repositoryInterfaceObject.get("protocol").toString());
|
||||
repositoryInterface.setContentDescription(repositoryInterfaceObject.get("contentdescription").toString());
|
||||
|
||||
// /* 07-04-2022 | "typology" -> "eoscDatasourceType" */
|
||||
// // TODO: enable in future release
|
||||
// try { // FIXME: remove attemp to get typology if eoscDatasourceType fails
|
||||
// repositoryInterface.setTypology(repositoryInterfaceObject.get("eoscDatasourceType").toString());
|
||||
// } catch (JSONException e) {
|
||||
// repositoryInterface.setTypology(repositoryInterfaceObject.get("typology").toString());
|
||||
// }
|
||||
repositoryInterface.setTypology(repositoryInterfaceObject.get("typology").toString());
|
||||
// <--
|
||||
|
||||
repositoryInterface.setCompliance(repositoryInterfaceObject.get("compatibility").toString());
|
||||
repositoryInterface.setLastCollectionDate(repositoryInterfaceObject.get("lastCollectionDate").toString());
|
||||
|
||||
|
@ -268,7 +290,7 @@ public class Converter {
|
|||
* typology -> platform
|
||||
* datasource class -> typology
|
||||
* */
|
||||
repositoryMap.put("typology", repository.getDatasourceClass());
|
||||
// repositoryMap.put("eoscDatasourceType", repository.getDatasourceClass()); // TODO: enable in future release
|
||||
repositoryMap.put("platform", repository.getTypology());
|
||||
|
||||
repositoryMap.put("dateofvalidation", repository.getDateOfCollection() != null ? convertDateToString(repository.getDateOfCollection()) : "");
|
||||
|
@ -317,6 +339,7 @@ public class Converter {
|
|||
repositoryMap.put("consentTermsOfUse", repository.getConsentTermsOfUse());
|
||||
repositoryMap.put("fullTextDownload", repository.getFullTextDownload());
|
||||
repositoryMap.put("consentTermsOfUseDate", convertDateToString(repository.getConsentTermsOfUseDate()));
|
||||
repositoryMap.put("lastConsentTermsOfUseDate", convertDateToString(repository.getLastConsentTermsOfUseDate()));
|
||||
|
||||
return mapper.writeValueAsString(repositoryMap);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue