Skip to content

Commit

Permalink
Merge pull request #16 from dbmdz/3.1.0-RC1
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
stefan-it authored Jan 23, 2019
2 parents 0130c43 + d9b3b44 commit 66cc21d
Show file tree
Hide file tree
Showing 44 changed files with 190 additions and 227 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ script:
- mvn clean install
after_success:
- bash <(curl -s https://codecov.io/bash)
- if [[ "$PROJECT_VERSION" == *SNAPSHOT ]]; then mvn deploy -B -DskipTests=true --settings settings.xml; fi
- if [[ "$PROJECT_VERSION" == *SNAPSHOT ]]; then curl -X POST -F token=$TRIGGER_TOKEN -F ref=master -F "variables[PROJECT_VERSION]=$PROJECT_VERSION" $TRIGGER_URL; fi
- if [[ "$PROJECT_VERSION" == *SNAPSHOT ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then mvn deploy -B -DskipTests=true --settings settings.xml; fi
- if [[ "$PROJECT_VERSION" == *SNAPSHOT ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then curl -X POST -F token=$TRIGGER_TOKEN -F ref=master -F "variables[PROJECT_VERSION]=$PROJECT_VERSION" $TRIGGER_URL; fi
deploy:
provider: releases
api_key:
Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-admin/dc-cudami-admin-backend-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-admin</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Admin (Backend API)</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import de.digitalcollections.model.api.paging.PageResponse;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public interface IdentifiableRepository<I extends Identifiable> {
Expand All @@ -25,7 +24,9 @@ default I findOne(UUID uuid, Locale locale) {
I identifiable = findOne(uuid);
// TODO maybe a better solution to just get locale specific fields directly from database instead of removing it here?
identifiable.getLabel().getTranslations().removeIf((Translation translation) -> !translation.getLocale().equals(locale));
identifiable.getDescription().getLocalizedStructuredContent().entrySet().removeIf((Map.Entry entry) -> !entry.getKey().equals(locale));
if (identifiable.getDescription() != null && identifiable.getDescription().getLocalizedStructuredContent() != null) {
identifiable.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(locale));
}
return identifiable;
}

Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-admin/dc-cudami-admin-backend-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-admin</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Admin (Backend IMPL REST)</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ protected FindParams getFindParams(PageRequest pageRequest) {
Sorting sorting = pageRequest.getSorting();
Iterator<Order> iterator = sorting.iterator();

// FIXME add support for multiple sort fields
String sortField = "";
String sortDirection = "";
String nullHandling = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package de.digitalcollections.cudami.admin.backend.impl.repository.identifiable.entity;

import de.digitalcollections.cudami.admin.backend.impl.repository.identifiable.*;
import de.digitalcollections.cudami.admin.backend.api.repository.identifiable.entity.EntityRepository;
import de.digitalcollections.cudami.admin.backend.impl.repository.identifiable.IdentifiableRepositoryImpl;
import de.digitalcollections.cudami.admin.backend.impl.repository.identifiable.IdentifiableRepositoryImpl.FindParams;
import de.digitalcollections.model.api.identifiable.entity.Entity;
import de.digitalcollections.model.api.paging.PageRequest;
import de.digitalcollections.model.api.paging.PageResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public PageResponse<UserImpl> find(PageRequest pageRequest) {
Sorting sorting = pageRequest.getSorting();
Iterator<Order> iterator = sorting.iterator();

// FIXME add support for multiple sort fields
String sortField = "";
String sortDirection = "";
String nullHandling = "";
Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-admin/dc-cudami-admin-business/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-admin</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Admin (Business)</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import de.digitalcollections.cudami.admin.backend.api.repository.identifiable.entity.WebsiteRepository;
import de.digitalcollections.cudami.admin.backend.api.repository.identifiable.entity.parts.ContentNodeRepository;
import de.digitalcollections.cudami.admin.backend.api.repository.identifiable.entity.parts.WebpageRepository;
import de.digitalcollections.cudami.admin.backend.api.repository.identifiable.resource.CudamiFileResourceRepository;
import de.digitalcollections.cudami.admin.backend.api.repository.security.UserRepository;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import de.digitalcollections.cudami.admin.backend.api.repository.identifiable.resource.CudamiFileResourceRepository;

/**
* Mock the backend.
Expand All @@ -25,7 +25,7 @@ public class SpringConfigBackendForTest {
public ArticleRepository articleRepository() {
return Mockito.mock(ArticleRepository.class);
}

@Bean
@Qualifier("identifiableRepositoryImpl")
public IdentifiableRepository identifiableRepositoryImpl() {
Expand Down
57 changes: 0 additions & 57 deletions dc-cudami-admin/dc-cudami-admin-webapp/nbactions.xml

This file was deleted.

2 changes: 1 addition & 1 deletion dc-cudami-admin/dc-cudami-admin-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-admin</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Admin (Webapp)</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public String adminUser(Model model) {
}

@RequestMapping(value = "/setup/adminUser", method = RequestMethod.POST)
public String adminUser(@RequestParam("pwd1") String password1, @RequestParam("pwd2") String password2, @ModelAttribute(name = "user") @Valid UserImpl user, BindingResult results, Model model, SessionStatus status, RedirectAttributes redirectAttributes) {
public String adminUser(@RequestParam("pwd1") String password1, @RequestParam("pwd2") String password2, @ModelAttribute(name = "user") @Valid UserImpl user, BindingResult results,
Model model, SessionStatus status, RedirectAttributes redirectAttributes) {
verifyBinding(results);
if (results.hasErrors()) {
return "users/create";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public String list(Model model, @PageableDefault(sort = {"label"}, size = 25) Pa
public String create(Model model) {
Locale defaultLocale = localeService.getDefault();
List<Locale> locales = localeService.findAll().stream()
.filter(locale -> !(defaultLocale.equals(locale) || locale.getDisplayName().isEmpty()))
.sorted(Comparator.comparing(locale -> locale.getDisplayName(LocaleContextHolder.getLocale())))
.collect(Collectors.toList());
.filter(locale -> !(defaultLocale.equals(locale) || locale.getDisplayName().isEmpty()))
.sorted(Comparator.comparing(locale -> locale.getDisplayName(LocaleContextHolder.getLocale())))
.collect(Collectors.toList());

model.addAttribute("defaultLocale", defaultLocale);
model.addAttribute("fileresource", cudamiFileResourceService.create());
Expand All @@ -96,7 +96,6 @@ public String create(Model model) {
}

// FIXME: add proper error and validation handling (using results and feedbackmessages)
// FIXME: make a step by step resource adding assistant: https://commons.wikimedia.org/wiki/Special:UploadWizard
@PostMapping("/fileresources/new")
public String create(@ModelAttribute @Valid FileResourceImpl fileResource, BindingResult results, @RequestParam("file") MultipartFile file, RedirectAttributes redirectAttributes) {
FileResource managedFileResource;
Expand Down Expand Up @@ -160,9 +159,9 @@ public String edit(@PathVariable UUID uuid, Model model, RedirectAttributes redi
HashSet<Locale> availableLocales = (HashSet<Locale>) fileresource.getLabel().getLocales();
Set<String> availableLocaleTags = availableLocales.stream().map(Locale::toLanguageTag).collect(Collectors.toSet());
List<Locale> locales = localeService.findAll().stream()
.filter(locale -> !(availableLocaleTags.contains(locale.toLanguageTag()) || locale.getDisplayName().isEmpty()))
.sorted(Comparator.comparing(locale -> locale.getDisplayName(LocaleContextHolder.getLocale())))
.collect(Collectors.toList());
.filter(locale -> !(availableLocaleTags.contains(locale.toLanguageTag()) || locale.getDisplayName().isEmpty()))
.sorted(Comparator.comparing(locale -> locale.getDisplayName(LocaleContextHolder.getLocale())))
.collect(Collectors.toList());

model.addAttribute("fileresource", fileresource);
model.addAttribute("availableLocales", availableLocales);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public String edit(@PathVariable UUID uuid, Model model) {
}

@RequestMapping(value = "/users/{uuid}/edit", method = RequestMethod.POST)
public String edit(@PathVariable UUID uuid, @RequestParam("pwd1") String password1, @RequestParam("pwd2") String password2, @ModelAttribute @Valid UserImpl user, BindingResult results, Model model, SessionStatus status, RedirectAttributes redirectAttributes) {
public String edit(@PathVariable UUID uuid, @RequestParam("pwd1") String password1, @RequestParam("pwd2") String password2, @ModelAttribute @Valid UserImpl user, BindingResult results,
Model model, SessionStatus status, RedirectAttributes redirectAttributes) {
verifyBinding(results);
if (results.hasErrors()) {
return "users/edit";
Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Admin</name>
Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-client/dc-cudami-client-openfeign/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-client</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Client (OpenFeign)</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@

public interface CudamiBackend extends CommonCudamiBackend {

@RequestLine("GET /latest/locales")
@RequestLine("GET /v2/locales")
List<Locale> getAllLocales();

@RequestLine("GET /latest/locales/default")
@RequestLine("GET /v2/locales/default")
Locale getDefaultLocale();

@RequestLine("GET /latest/webpages/{uuid}")
@RequestLine("GET /v2/webpages/{uuid}")
Webpage getWebpage(@Param("uuid") String uuid);

@RequestLine("GET /latest/webpages/{uuid}?pLocale={locale}")
@RequestLine("GET /v2/webpages/{uuid}?pLocale={locale}")
Webpage getWebpage(@Param("locale") Locale locale, @Param("uuid") String uuid);

@RequestLine("GET /latest/websites/{uuid}")
@RequestLine("GET /V2/websites/{uuid}")
Website getWebsite(@Param("uuid") String uuid);

}
2 changes: 1 addition & 1 deletion dc-cudami-client/dc-cudami-client-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-client</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Client (Spring)</name>
Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Client</name>
Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-server/dc-cudami-server-backend-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-server</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Server (Backend API)</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import de.digitalcollections.model.api.paging.PageResponse;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public interface IdentifiableRepository<I extends Identifiable> {
Expand All @@ -23,7 +22,9 @@ default I findOne(UUID uuid, Locale locale) {
I identifiable = findOne(uuid);
// TODO maybe a better solution to just get locale specific fields directly from database instead of removing it here?
identifiable.getLabel().getTranslations().removeIf((Translation translation) -> !translation.getLocale().equals(locale));
identifiable.getDescription().getLocalizedStructuredContent().entrySet().removeIf((Map.Entry entry) -> !entry.getKey().equals(locale));
if (identifiable.getDescription() != null && identifiable.getDescription().getLocalizedStructuredContent() != null) {
identifiable.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(locale));
}
return identifiable;
}

Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-server/dc-cudami-server-backend-inmemory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-server</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Server (Backend IMPL InMemory)</name>
Expand Down
2 changes: 1 addition & 1 deletion dc-cudami-server/dc-cudami-server-backend-jdbi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.digitalcollections.cudami</groupId>
<artifactId>dc-cudami-server</artifactId>
<version>3.1.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>

<name>DigitalCollections: cudami Server (Backend IMPL JDBI PostgreSql)</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ private void addOrderBy(PageRequest pageRequest, StringBuilder query, String[] a
if (sorting != null) {
Iterator<Order> iterator = sorting.iterator();
if (iterator.hasNext()) {
// FIXME just supporting one field sorting until now
Order order = iterator.next();
sortField = order.getProperty();
if (sortField != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ public A findOne(UUID uuid, Locale locale) {
// TODO maybe a better solution to just get locale specific fields directly from database instead of removing it here?
// iterate over all localized fields and remove all texts that are not matching the requested locale:
article.getLabel().getTranslations().removeIf(translation -> !translation.getLocale().equals(fLocale));
article.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(fLocale));
article.getText().getLocalizedStructuredContent().entrySet().removeIf((Map.Entry entry) -> !entry.getKey().equals(fLocale));
if (article.getDescription() != null && article.getDescription().getLocalizedStructuredContent() != null) {
article.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(fLocale));
}
if (article.getText() != null && article.getText().getLocalizedStructuredContent() != null) {
article.getText().getLocalizedStructuredContent().entrySet().removeIf((Map.Entry entry) -> !entry.getKey().equals(fLocale));
}
return article;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public C findOne(UUID uuid, Locale locale) {
// TODO maybe a better solution to just get locale specific fields directly from database instead of removing it here?
// iterate over all localized fields and remove all texts that are not matching the requested locale:
contentNode.getLabel().getTranslations().removeIf(translation -> !translation.getLocale().equals(fLocale));
contentNode.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(fLocale));
if (contentNode.getDescription() != null && contentNode.getDescription().getLocalizedStructuredContent() != null) {
contentNode.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(fLocale));
}
return contentNode;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ public W findOne(UUID uuid, Locale locale) {
// TODO maybe a better solution to just get locale specific fields directly from database instead of removing it here?
// iterate over all localized fields and remove all texts that are not matching the requested locale:
webpage.getLabel().getTranslations().removeIf(translation -> !translation.getLocale().equals(fLocale));
webpage.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(fLocale));
webpage.getText().getLocalizedStructuredContent().entrySet().removeIf((Map.Entry entry) -> !entry.getKey().equals(fLocale));
if (webpage.getDescription() != null && webpage.getDescription().getLocalizedStructuredContent() != null) {
webpage.getDescription().getLocalizedStructuredContent().entrySet().removeIf(entry -> !entry.getKey().equals(fLocale));
}
if (webpage.getText() != null && webpage.getText().getLocalizedStructuredContent() != null) {
webpage.getText().getLocalizedStructuredContent().entrySet().removeIf((Map.Entry entry) -> !entry.getKey().equals(fLocale));
}
return webpage;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import de.digitalcollections.cudami.server.backend.impl.jdbi.AbstractPagingAndSortingRepositoryImpl;
import de.digitalcollections.model.api.paging.PageRequest;
import de.digitalcollections.model.api.paging.PageResponse;
import de.digitalcollections.model.impl.paging.PageResponseImpl;
import de.digitalcollections.model.api.security.enums.Role;
import de.digitalcollections.model.impl.paging.PageResponseImpl;
import de.digitalcollections.model.impl.security.UserImpl;
import java.util.List;
import java.util.UUID;
Expand Down
Loading

0 comments on commit 66cc21d

Please sign in to comment.