Skip to content

Commit

Permalink
Version 6.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
seitenbau-govdata committed Mar 25, 2024
1 parent 94da9f1 commit ecf80a5
Show file tree
Hide file tree
Showing 113 changed files with 528 additions and 256 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v6.7.0 2024-03-26

* Improvements to CSS
* The search filter for high-value datasets now is based on a boolean flag `has_hvd`
from the Elasticsearch index
* Updates spring dependency with important security fix

## v6.6.1 2024-02-29

* Updates maven dependencies with important security fixes
Expand Down
2 changes: 1 addition & 1 deletion Layout20-80-layouttpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>Layout20-80-layouttpl</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion boxes-portlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>boxes-portlet</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion categories-grid-portlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>categories-grid-portlet</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion entities/entities-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.fhg.fokus.odp</groupId>
<artifactId>entities</artifactId>
<version>6.6.1</version>
<version>6.7.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion entities/entities-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.fhg.fokus.odp</groupId>
<artifactId>entities</artifactId>
<version>6.6.1</version>
<version>6.7.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion entities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<groupId>de.fhg.fokus.odp</groupId>
<artifactId>entities</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gd-blogs-service-override/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.seitenbau.govdata.odp</groupId>
<artifactId>od-platform</artifactId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<groupId>de.seitenbau.blogs.service.override</groupId>
<artifactId>gd-blogs-service-override</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gd-captcha-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.seitenbau.govdata.odp</groupId>
<artifactId>od-platform</artifactId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<groupId>de.seitenbau.govdata.gd-captcha-api</groupId>
<artifactId>gd-captcha-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gd-captcha-fragment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>gd-captcha-fragment</artifactId>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion gd-comment-taglib-fragment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>gd-comment-taglib-fragment</artifactId>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion gd-developers-corner-portlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>gd-developers-corner-portlet</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion gd-edit-portlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.seitenbau.govdata.odp</groupId>
<artifactId>od-platform</artifactId>
<version>6.6.1</version>
<version>6.7.0</version>
<!-- <relativePath>../GovData</relativePath> -->
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public class EditController

private static final String DEFAULT_LICENCE = "http://dcat-ap.de/def/licenses/dl-by-de/2.0";

private static final String HVD_APPLICABLE_LEGISLATION = "http://data.europa.eu/eli/reg_impl/2023/138/oj";

private static final String MESSAGE = "message";

private static final String MESSAGE_TYPE = "messageType";
Expand Down Expand Up @@ -515,7 +517,8 @@ private EditForm loadDataset(User ckanuser, String metadataName) throws OpenData
formatDate(resource.getIssued()),
formatDate(resource.getModified()),
resource.getPlannedAvailability(),
resource.getAvailability()));
resource.getAvailability(),
resource.isHvd()));
}
if (resources.isEmpty()) // make sure there is at least one row!
{
Expand All @@ -533,6 +536,8 @@ private EditForm loadDataset(User ckanuser, String metadataName) throws OpenData
form.setGeocodingText(listToString(metadata, MetadataListExtraFields.GEOCODING_TEXT));
form.setLegalbasisText(listToString(metadata, MetadataListExtraFields.LEGALBASIS_TEXT));

form.setHvd_categories(metadata.getExtraList(MetadataListExtraFields.HVD_CATEGORY));

form.setTitle(metadata.getTitle());

form.setUrl(metadata.getUrl());
Expand Down Expand Up @@ -690,6 +695,19 @@ else if (!hideContributorId)
metadata.setExtraList(MetadataListExtraFields.LEGALBASIS_TEXT,
listFromString(form.getLegalbasisText()));

List<String> hvdcategories = form.getHvd_categories();
if (hvdcategories != null && !hvdcategories.isEmpty())
{
metadata.setExtraList(MetadataListExtraFields.HVD_CATEGORY, hvdcategories);
metadata.setExtraList(MetadataListExtraFields.APPLICABLE_LEGISLATION,
listFromString(HVD_APPLICABLE_LEGISLATION));
}
else if (metadata.isHvd())
{
metadata.setExtraList(MetadataListExtraFields.HVD_CATEGORY, Collections.emptyList());
metadata.setExtraList(MetadataListExtraFields.APPLICABLE_LEGISLATION, Collections.emptyList());
}

Date fromDate = DateUtil.parseDateString(form.getTemporalCoverageFrom());
Date untilDate = DateUtil.parseDateString(form.getTemporalCoverageUntil());
metadata.setTemporalCoverageFrom(fromDate);
Expand Down Expand Up @@ -729,7 +747,11 @@ else if (!hideContributorId)
resourceImpl.setLicenseAttributionByText(res.getLicenseAttributionByText());
resourceImpl.setPlannedAvailability(convertBlankStringToNull(res.getPlannedAvailability()));
resourceImpl.setAvailability(convertBlankStringToNull(res.getAvailability()));

if (res.isHvd())
{
resourceImpl
.setApplicableLegislation(listFromString(HVD_APPLICABLE_LEGISLATION));
}
if (form.isNewDataset() && resourceImpl.getIssued() == null)
{
// set creation date for new resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public class EditForm implements Serializable
@Categories(message="{categories}")
private List<String> categories;

private List<String> hvd_categories;

@NotEmpty(message="{resources}")
@Valid
private List<Resource> resources;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ public class Resource implements Serializable

@URL
private String availability;

private boolean isHvd;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ od.editform.availability.available=(available) Daten sind f
od.editform.availability.stable=(stable) Daten werden langfristig erhältlich bleiben.
od.editform.availability.op_datpro=(op_datpro) Vorläufige Daten.

od.datasets_metadata_hvd_categories=Hochwertige Datensatzkategorien
od.hvd.checkboxlabel=Hochwertiger Datensatz
od.hvd.category.label.met=Meteorologie
od.hvd.category.label.cco=Unternehmen und Eigentümerschaft von Unternehmen
od.hvd.category.label.geo=Georaum
od.hvd.category.label.mob=Mobilität
od.hvd.category.label.eoe=Erdbeobachtung und Umwelt
od.hvd.category.label.sta=Statistik

od.editform.policiticalgeocodingleveluri.international=(international) internationale Ebene
od.editform.policiticalgeocodingleveluri.european=(european) EU-Ebene
od.editform.policiticalgeocodingleveluri.federal=(federal) Bundesebene
Expand Down
15 changes: 15 additions & 0 deletions gd-edit-portlet/src/main/webapp/WEB-INF/html/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ <h1 th:text="#{'od.editform.title.edit'}" th:unless="*{isNewDataset()}"></h1>
</td>
</tr>

<tr class="highfield">
<th th:text="#{'od.datasets_metadata_hvd_categories'}"></th>
<td>
<fieldset class="multiboxarea">
<legend class="offscreen" aria-labelledby="hvd_categories_error">[[#{'od.datasets_metadata_hvd_categories'}]]</legend>
<div class="checkboxitem" th:each="hvdCat : ${T(de.seitenbau.govdata.odp.registry.ckan.HVDCategory).values()}">
<input class="offscreen" type="checkbox" th:field="*{hvd_categories}" th:value="${hvdCat.uri}" />
<label class="checkbox" th:for="${#ids.prev('hvd_categories')}" th:text="#{'od.hvd.category.label.' + ${#strings.toLowerCase(hvdCat)}}"></label>
</div>
</fieldset>
<div id="hvd_categories_error" class="validation-error" th:if="${#fields.hasErrors('categories')}" th:errors="*{hvd_categories}"></div>
<div id="hvd_categories_error" th:unless="${#fields.hasErrors('hvd_categories')}"></div>
</td>
</tr>

<tr>
<th><label for="tags" id="tags_label">[[#{'od.tags.name'}]]</label></th>
<td>
Expand Down
10 changes: 10 additions & 0 deletions gd-edit-portlet/src/main/webapp/WEB-INF/html/fragments.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,16 @@
</div>
</div>

<div class="css-row">
<label th:id="${idp}+'_hvd_label'" th:for="${idp}+'.hvd'">[[#{'od.hvd.checkboxlabel'}]]</label>
<div class="multiboxarea">
<div class="checkboxitem singleitem">
<input class="offscreen" type="checkbox" th:field="*{hvd}" th:id="${idp}+'.hvd'"/>
<label class="checkbox" th:for="${idp}+'.hvd'" th:text="#{'od.hvd.checkboxlabel'}"></label>
</div>
</div>
</div>

<!--/* [hidden] fields */-->
<!--/* id */-->
<input type="hidden" th:field="*{id}"/>
Expand Down
2 changes: 1 addition & 1 deletion gd-login-web-fragment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>gd-login-web-fragment</artifactId>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion gd-metadata-quality-portlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>od-platform</artifactId>
<groupId>de.seitenbau.govdata.odp</groupId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>gd-metadata-quality-portlet</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion gd-search-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.seitenbau.govdata.odp</groupId>
<artifactId>od-platform</artifactId>
<version>6.6.1</version>
<version>6.7.0</version>
</parent>
<artifactId>gd-search-common</artifactId>
<name>GovData search common</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ public class SearchServiceElasticsearchImpl implements SearchService
@Inject
private FilterUtil filterUtil;

private String[] highValueDatasetTags;

@Autowired
private SearchHitMapper searchHitMapper;

Expand Down Expand Up @@ -460,7 +458,11 @@ else if (bundle.getHidePrivateDatasets())
buildBoolFilterFacet(agsResult, SearchConsts.FACET_HAS_DATA_SERVICE));

activeFilterMap.put(SearchConsts.FACET_HIGH_VALUE_DATASET,
buildBoolFilterFacet(agsResult, SearchConsts.FACET_IS_HIGH_VALUE_DATASET));
buildBoolFilterFacet(agsResult, SearchConsts.FACET_HAS_HIGH_VALUE_DATASET));

activeFilterMap.put(SearchConsts.FACET_HIGH_VALUE_DATASET_CATEGORIES,
buildListFacet(SearchConsts.FACET_HIGH_VALUE_DATASET_CATEGORIES,
agsResult.get(SearchConsts.FACET_HIGH_VALUE_DATASET_CATEGORIES)));

activeFilterMap.put(
SearchConsts.FACET_SOURCEPORTAL,
Expand Down Expand Up @@ -1053,12 +1055,15 @@ private List<AggregationBuilder> buildAggregations()
QueryBuilders.termQuery(ESFieldConsts.BOOL_FACET_MAP.get(SearchConsts.FACET_HAS_DATA_SERVICE),
"true"))));

if (ArrayUtils.isNotEmpty(highValueDatasetTags))
{
aggregations.add(AggregationBuilders.filter(SearchConsts.FACET_IS_HIGH_VALUE_DATASET,
QueryBuilders.termsQuery(ESFieldConsts.FACET_MAP.get(SearchConsts.FACET_TAGS),
highValueDatasetTags)));
}
aggregations.add(AggregationBuilders
.filter(SearchConsts.FACET_HAS_HIGH_VALUE_DATASET, QueryBuilders.boolQuery().must(
QueryBuilders.termQuery(
ESFieldConsts.BOOL_FACET_MAP.get(SearchConsts.FACET_HAS_HIGH_VALUE_DATASET),
"true"))));

aggregations.add(AggregationBuilders
.terms(SearchConsts.FACET_HIGH_VALUE_DATASET_CATEGORIES)
.field(ESFieldConsts.FACET_MAP.get(SearchConsts.FACET_HIGH_VALUE_DATASET_CATEGORIES)));

aggregations.add(AggregationBuilders
.terms(SearchConsts.FACET_LICENCE)
Expand Down Expand Up @@ -1397,16 +1402,4 @@ public void setMinutesKeepAliveScroll(int minutesKeepAliveScroll)
{
this.minutesKeepAliveScroll = minutesKeepAliveScroll;
}

/**
* Setzt welche Tags einen Datensatz als High-Value-Dataset beschreiben.
*
* @param highValueDatasetTags die Tags, z.B. "hvd,highvaluedataset".
*/
@Value("${elasticsearch.high.value.dataset.tags}")
public void setHighValueDatasetTags(String highValueDatasetTags)
{
this.highValueDatasetTags =
StringUtils.stripAll(StringUtils.splitByWholeSeparator(highValueDatasetTags, ","));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ public abstract class ESFieldConsts
*/
public static final String HAS_DATASERVICE = "metadata.has_data_service";

/**
* Key for field HAS_HVD in search index.
*/
public static final String HAS_HVD = "metadata.has_hvd";

/**
* Key for field HVD_CATEGORY_LIST in search index..
*/
public static final String HVD_CATEGORIES = "metadata.hvd_categories.keyword";

/**
* Key for field TEMPORAL_START in search index.
*/
Expand Down Expand Up @@ -202,6 +212,7 @@ public abstract class ESFieldConsts
facetMapBuilder.put(SearchConsts.FACET_SHOWCASE_TYPE, FIELD_SHOWCASE_TYPES_VALUE);
facetMapBuilder.put(SearchConsts.FACET_LICENCE, FIELD_METADATA_RESOURCES_LICENSES);
facetMapBuilder.put(SearchConsts.FACET_SOURCEPORTAL, SearchConsts.FIELD_OWNER_ORG);
facetMapBuilder.put(SearchConsts.FACET_HIGH_VALUE_DATASET_CATEGORIES, HVD_CATEGORIES);
FACET_MAP = Collections.unmodifiableMap(facetMapBuilder);

Map<String, String> extSearchMapBuilder = new HashMap<>();
Expand All @@ -215,6 +226,7 @@ public abstract class ESFieldConsts
boolFacetMapBuilder.put(SearchConsts.FACET_HAS_OPEN, HAS_OPEN);
boolFacetMapBuilder.put(SearchConsts.FACET_HAS_CLOSED, HAS_CLOSED);
boolFacetMapBuilder.put(SearchConsts.FACET_HAS_DATA_SERVICE, HAS_DATASERVICE);
boolFacetMapBuilder.put(SearchConsts.FACET_HAS_HIGH_VALUE_DATASET, HAS_HVD);
BOOL_FACET_MAP = Collections.unmodifiableMap(boolFacetMapBuilder);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ else if (SearchConsts.TYPE_SHOWCASE.equals(type))
.usedDatasets(searchHit.getUsedDatasets())
.releaseDate(searchHit.getReleaseDate())
.allShowcaseTypes(mapShowcaseTypes(searchHit.getAllShowcaseTypes()))
.hasHvd(searchHit.getHasHvd())
.build();

return hitViewModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public class HitViewModel

private List<ShowcaseTypeEnum> allShowcaseTypes;

private Boolean hasHvd;

public boolean isCkanMetadata()
{
return StringUtils.equals(source, SearchConsts.SOURCE_CKAN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ else if (StringUtils.equals(searchHit.getIndex(), showcaseIndexName))
.platforms(getFieldValueAsStringList(metadata, "platforms"))
.usedDatasets(getFieldValueAsStringList(metadata, "used_datasets"))
.allShowcaseTypes(showcaseTypes)
.hasHvd((Boolean) metadata.get("has_hvd"))
.build();

logger.trace(method + "End");
Expand Down
Loading

0 comments on commit ecf80a5

Please sign in to comment.