Skip to content

Commit

Permalink
Merge pull request IQSS#7333 from IQSS/7310-datasetpage-ldjson-error
Browse files Browse the repository at this point in the history
Fix for the json LD export error in the dataset page
  • Loading branch information
kcondon authored Oct 19, 2020
2 parents 769819f + 0c4fccc commit 3a2f2cc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ public void findFileMetadataOptimizedExperimental(Dataset owner, DatasetVersion

int i = 0;

List<Object[]> dataTableResults = em.createNativeQuery("SELECT t0.ID, t0.DATAFILE_ID, t0.UNF, t0.CASEQUANTITY, t0.VARQUANTITY, t0.ORIGINALFILEFORMAT, t0.ORIGINALFILESIZE FROM dataTable t0, dataFile t1, dvObject t2 WHERE ((t0.DATAFILE_ID = t1.ID) AND (t1.ID = t2.ID) AND (t2.OWNER_ID = " + owner.getId() + ")) ORDER BY t0.ID").getResultList();
List<Object[]> dataTableResults = em.createNativeQuery("SELECT t0.ID, t0.DATAFILE_ID, t0.UNF, t0.CASEQUANTITY, t0.VARQUANTITY, t0.ORIGINALFILEFORMAT, t0.ORIGINALFILESIZE, t0.ORIGINALFILENAME FROM dataTable t0, dataFile t1, dvObject t2 WHERE ((t0.DATAFILE_ID = t1.ID) AND (t1.ID = t2.ID) AND (t2.OWNER_ID = " + owner.getId() + ")) ORDER BY t0.ID").getResultList();

for (Object[] result : dataTableResults) {
DataTable dataTable = new DataTable();
Expand All @@ -596,6 +596,8 @@ public void findFileMetadataOptimizedExperimental(Dataset owner, DatasetVersion

dataTable.setOriginalFileSize((Long)result[6]);

dataTable.setOriginalFileName((String)result[7]);

dataTables.add(dataTable);
datatableMap.put(fileId, i++);

Expand Down Expand Up @@ -856,8 +858,10 @@ private List<FileMetadata> retrieveFileMetadataForVersion(Dataset dataset, Datas

fileMetadata.setDatasetVersion(version);

//fileMetadata.setDataFile(dataset.getFiles().get(file_list_id));
// Link the FileMetadata object to the DataFile:
fileMetadata.setDataFile(dataFiles.get(file_list_id));
// ... and the DataFile back to the FileMetadata:
fileMetadata.getDataFile().getFileMetadatas().add(fileMetadata);

String description = (String) result[2];

Expand Down

0 comments on commit 3a2f2cc

Please sign in to comment.