Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Commit

Permalink
minor modifications for #298
Browse files Browse the repository at this point in the history
  • Loading branch information
seustachi committed Jan 14, 2015
1 parent de23416 commit df9aa90
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ public HdxPackageUpdateMetadataDTO() {
// When the METADATA was updated the last time
private String last_metadata_update_date;

// sourceName
// Organization name
private String dataset_source;

private String dataset_source_short_name;

// sourceCode
private String dataset_source_code;
private String source_code;

// indicator type name
private String indicator_type;
Expand All @@ -37,7 +39,7 @@ public HdxPackageUpdateMetadataDTO() {
// range of the data, format : 11/02/2014-11/20/2014
private String dataset_date;

private String dataset_summary;
private String description;
private String methodology;
private String more_info;
private String terms_of_use;
Expand Down Expand Up @@ -85,12 +87,20 @@ public void setDataset_source(final String dataset_source) {
this.dataset_source = dataset_source;
}

public String getDataset_source_code() {
return dataset_source_code;
public String getDataset_source_short_name() {
return dataset_source_short_name;
}

public void setDataset_source_short_name(final String dataset_source_short_name) {
this.dataset_source_short_name = dataset_source_short_name;
}

public String getSource_code() {
return source_code;
}

public void setDataset_source_code(final String dataset_source_code) {
this.dataset_source_code = dataset_source_code;
public void setSource_code(final String source_code) {
this.source_code = source_code;
}

public String getIndicator_type() {
Expand All @@ -117,12 +127,12 @@ public void setDataset_date(final String dataset_date) {
this.dataset_date = dataset_date;
}

public String getDataset_summary() {
return dataset_summary;
public String getDescription() {
return description;
}

public void setDataset_summary(final String dataset_summary) {
this.dataset_summary = dataset_summary;
public void setDescription(final String description) {
this.description = description;
}

public String getMethodology() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ private HdxPackageUpdateMetadataDTO convertDataSerieToCuratedDataset(final DataS
dto.setDataset_date(String.format("%s-%s", minDate, maxDate));
}

dto.setDataset_source(source.getName().getDefaultValue());
dto.setDataset_source_code(source.getCode());
dto.setDataset_summary(dataSerieMetadataDAO.getDataSerieMetadataByIndicatorTypeCodeAndSourceCodeAndEntryKey(indType.getCode(), source.getCode(), MetadataName.DATASET_SUMMARY).getEntryValue()
dto.setDataset_source(source.getOrganization().getFullName().getDefaultValue());
dto.setDataset_source_short_name(source.getOrganization().getShortName().getDefaultValue());
dto.setSource_code(source.getCode());
dto.setDescription(dataSerieMetadataDAO.getDataSerieMetadataByIndicatorTypeCodeAndSourceCodeAndEntryKey(indType.getCode(), source.getCode(), MetadataName.DATASET_SUMMARY).getEntryValue()
.getDefaultValue());
dto.setIndicator_type(indType.getName().getDefaultValue());
dto.setIndicator_type_code(indType.getCode());
Expand All @@ -120,7 +121,8 @@ private HdxPackageUpdateMetadataDTO convertDataSerieToCuratedDataset(final DataS
dto.setMethodology(getMetadataAsString(indType.getCode(), source.getCode(), MetadataName.METHODOLOGY));
dto.setMore_info(getMetadataAsString(indType.getCode(), source.getCode(), MetadataName.MORE_INFO));
dto.setTerms_of_use(getMetadataAsString(indType.getCode(), source.getCode(), MetadataName.TERMS_OF_USE));
dto.setValidation_notes_and_comments(getMetadataAsString(indType.getCode(), source.getCode(), MetadataName.VALIDATION_NOTES));
// this is not send to ckan anymore
// dto.setValidation_notes_and_comments(getMetadataAsString(indType.getCode(), source.getCode(), MetadataName.VALIDATION_NOTES));

final List<String> listCountryCodesForDataSerie = curatedDataService.listCountryCodesForDataSerie(indType.getCode(), source.getCode());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public void testGson() throws IOException {
dto.setId("The uuid of the ckan dataset");
dto.setName("The name of the ckan dataset");
dto.setDataset_date("11/02/2014-11/20/2014");
dto.setDataset_source("The dataset source");
dto.setDataset_source_code("WFP");
dto.setDataset_summary("the summary");
dto.setDataset_source("The organization name");
dto.setDataset_source_short_name("The organization short name");
dto.setDescription("the dataset summary");
dto.setSource_code("WFP");
dto.setIndicator_type("the name of the indicator type");
dto.setIndicator_type_code("PVX040");
dto.setLast_data_update_date("2001-09-09T03:46:40.000000");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"The uuid of the ckan dataset","name":"The name of the ckan dataset","last_data_update_date":"2001-09-09T03:46:40.000000","last_metadata_update_date":"2001-09-09T03:46:40.000000","dataset_source":"The dataset source","dataset_source_code":"WFP","indicator_type":"the name of the indicator type","indicator_type_code":"PVX040","dataset_date":"11/02/2014-11/20/2014","dataset_summary":"the summary","methodology":"the methodology","more_info":"more info","terms_of_use":"terms of use","validation_notes_and_comments":"Notes and comments","groups":[{"id":"world"},{"id":"USA"}]}
{"id":"The uuid of the ckan dataset","name":"The name of the ckan dataset","last_data_update_date":"2001-09-09T03:46:40.000000","last_metadata_update_date":"2001-09-09T03:46:40.000000","dataset_source":"The organization name","dataset_source_short_name":"The organization short name","source_code":"WFP","indicator_type":"the name of the indicator type","indicator_type_code":"PVX040","dataset_date":"11/02/2014-11/20/2014","description":"the dataset summary","methodology":"the methodology","more_info":"more info","terms_of_use":"terms of use","validation_notes_and_comments":"Notes and comments","groups":[{"id":"world"},{"id":"USA"}]}

0 comments on commit df9aa90

Please sign in to comment.