Skip to content

Commit

Permalink
#187 fix taxonomy resolver and sorting for taxonomies
Browse files Browse the repository at this point in the history
Thorsten Marx committed Mar 15, 2024
1 parent b99c409 commit 89cdac3
Showing 19 changed files with 38 additions and 21 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,10 @@ see wiki for more information: [wiki](https://github.com/thmarx/cms/wiki)

# changelog

## 4.15.1

* **BUGFIX** TaxonomyResolver does not set total of items correctly [#187](https://github.com/thmarx/cms/issues/187)

## 4.15.0

* **FEATURE** Cache ResourceBundles in messages [#185](https://github.com/thmarx/cms/issues/185)
2 changes: 1 addition & 1 deletion cms-api/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-api</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion cms-content/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-content</artifactId>
<packaging>jar</packaging>
Original file line number Diff line number Diff line change
@@ -101,6 +101,7 @@ public Optional<TaxonomyResponse> getTaxonomyResponse(final RequestContext conte
return contentNodeMapper.toListNode(node, context);
}).filter(node -> node != null).toList();
resultPage.setItems(nodes);
resultPage.setTotal(contentPage.getTotal());
} else {
meta.put(Constants.MetaFields.TITLE, taxonomy.getTitle());
}
2 changes: 1 addition & 1 deletion cms-extensions/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-extensions</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion cms-filesystem/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-filesystem</artifactId>
<packaging>jar</packaging>
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
import com.github.thmarx.cms.api.utils.MapUtil;
import com.github.thmarx.cms.filesystem.FileSystem;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -84,11 +85,18 @@ public Set<String> values(Taxonomy taxonomy) {

@Override
public List<ContentNode> withValue(final Taxonomy taxonomy, final Object value) {
List<ContentNode> nodes = null;
List<ContentNode> nodes = Collections.emptyList();
if (taxonomy.isArray()) {
nodes = fileSystem.query((node, index) -> node).whereContains(taxonomy.getField(), value).get();
nodes = fileSystem
.query((node, index) -> node).whereContains(taxonomy.getField(), value)
.orderby("title").asc()
.get();
} else {
nodes = fileSystem.query((node, index) -> node).where(taxonomy.getField(), value).get();
nodes = fileSystem
.query((node, index) -> node)
.where(taxonomy.getField(), value)
.orderby("title").asc()
.get();
}

return nodes;
@@ -98,10 +106,14 @@ public List<ContentNode> withValue(final Taxonomy taxonomy, final Object value)
public Page<ContentNode> withValue(Taxonomy taxonomy, Object value, long page, long size) {

if (taxonomy.isArray()) {
return fileSystem.query((node, index) -> node).whereContains(taxonomy.getField(), value)
return fileSystem.query((node, index) -> node)
.whereContains(taxonomy.getField(), value)
.orderby("title").asc()
.page(page, size);
} else {
return fileSystem.query((node, index) -> node).where(taxonomy.getField(), value)
return fileSystem.query((node, index) -> node)
.where(taxonomy.getField(), value)
.orderby("title").asc()
.page(page, size);
}
}
2 changes: 1 addition & 1 deletion cms-git/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-git</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion cms-markdown/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-markdown</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion cms-media/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-media</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion cms-sandbox/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-sandbox</artifactId>
<packaging>pom</packaging>
2 changes: 1 addition & 1 deletion cms-server/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-server</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion cms-template/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>cms-template</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion modules-framework/api/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms.module.framework</groupId>
<artifactId>module-framework</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>modules-api</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion modules-framework/manager/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms.module.framework</groupId>
<artifactId>module-framework</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>modules-manager</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion modules-framework/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<groupId>com.github.thmarx.cms.module.framework</groupId>
<artifactId>module-framework</artifactId>
2 changes: 1 addition & 1 deletion modules/example-module/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms.modules</groupId>
<artifactId>cms-modules</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<artifactId>example-module</artifactId>
<packaging>jar</packaging>
2 changes: 1 addition & 1 deletion modules/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<parent>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
</parent>
<groupId>com.github.thmarx.cms.modules</groupId>
<artifactId>cms-modules</artifactId>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.thmarx.cms</groupId>
<artifactId>cms-parent</artifactId>
<version>4.15.0</version>
<version>4.15.1</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

0 comments on commit 89cdac3

Please sign in to comment.