You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2017/05/09 06:30:39 UTC
[1/2] syncope git commit: [SYNCOPE-1077] Missing order by
implementation
Repository: syncope
Updated Branches:
refs/heads/2_0_X 5756a270f -> b83656d7d
refs/heads/master a5e868bf8 -> 648c45461
[SYNCOPE-1077] Missing order by implementation
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/b83656d7
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/b83656d7
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/b83656d7
Branch: refs/heads/2_0_X
Commit: b83656d7d2b459f3831073b752a97ea2ae023f6b
Parents: 5756a27
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue May 9 08:30:23 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue May 9 08:30:23 2017 +0200
----------------------------------------------------------------------
.../client/console/commons/ITabComponent.java | 19 -------------------
.../jpa/dao/ElasticsearchAnySearchDAO.java | 4 ++++
2 files changed, 4 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/b83656d7/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
index 1c43d8d..300487a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.client.console.commons;
-import java.util.Set;
import java.util.UUID;
import org.apache.wicket.Component;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
@@ -43,15 +42,6 @@ public abstract class ITabComponent extends Component implements ITab {
* @param title IModel used to represent the title of the tab. Must contain a string
* @param roles authorized roles
*/
- public ITabComponent(final IModel<String> title, final Set<String> roles) {
- this(title, roles.toArray(new String[roles.size()]));
- }
- /**
- * Constructor.
- *
- * @param title IModel used to represent the title of the tab. Must contain a string
- * @param roles authorized roles
- */
public ITabComponent(final IModel<String> title, final String... roles) {
super(UUID.randomUUID().toString());
this.title = title;
@@ -65,17 +55,11 @@ public abstract class ITabComponent extends Component implements ITab {
}
}
- /**
- * {@inheritDoc}
- */
@Override
public IModel<String> getTitle() {
return title;
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean isVisible() {
return true;
@@ -89,9 +73,6 @@ public abstract class ITabComponent extends Component implements ITab {
internalRenderComponent();
}
- /**
- * {@inheritDoc}
- */
@Override
public abstract WebMarkupContainer getPanel(final String panelId);
http://git-wip-us.apache.org/repos/asf/syncope/blob/b83656d7/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
----------------------------------------------------------------------
diff --git a/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java b/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
index 34651e1..d2beabc 100644
--- a/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
+++ b/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
@@ -56,6 +56,7 @@ import org.elasticsearch.index.query.MatchNoneQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
+import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.factory.annotation.Autowired;
/**
@@ -123,6 +124,9 @@ public class ElasticsearchAnySearchDAO extends AbstractAnySearchDAO {
SearchRequestBuilder builder = searchRequestBuilder(adminRealms, cond, kind).
setFrom(page <= 0 ? 0 : page - 1).
setSize(itemsPerPage < 0 ? elasticsearchUtils.getIndexMaxResultWindow() : itemsPerPage);
+ for (OrderByClause clause : orderBy) {
+ builder.addSort(clause.getField(), SortOrder.valueOf(clause.getDirection().name()));
+ }
return buildResult(
CollectionUtils.collect(Arrays.asList(builder.get().getHits().getHits()),
[2/2] syncope git commit: [SYNCOPE-1077] Missing order by
implementation
Posted by il...@apache.org.
[SYNCOPE-1077] Missing order by implementation
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/648c4546
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/648c4546
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/648c4546
Branch: refs/heads/master
Commit: 648c45461ad9636ebdd5ac27eb8aa9502c8b74c6
Parents: a5e868b
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue May 9 08:30:23 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue May 9 08:30:32 2017 +0200
----------------------------------------------------------------------
.../client/console/commons/ITabComponent.java | 19 -------------------
.../jpa/dao/ElasticsearchAnySearchDAO.java | 4 ++++
2 files changed, 4 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/648c4546/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
index 1c43d8d..300487a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/ITabComponent.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.client.console.commons;
-import java.util.Set;
import java.util.UUID;
import org.apache.wicket.Component;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
@@ -43,15 +42,6 @@ public abstract class ITabComponent extends Component implements ITab {
* @param title IModel used to represent the title of the tab. Must contain a string
* @param roles authorized roles
*/
- public ITabComponent(final IModel<String> title, final Set<String> roles) {
- this(title, roles.toArray(new String[roles.size()]));
- }
- /**
- * Constructor.
- *
- * @param title IModel used to represent the title of the tab. Must contain a string
- * @param roles authorized roles
- */
public ITabComponent(final IModel<String> title, final String... roles) {
super(UUID.randomUUID().toString());
this.title = title;
@@ -65,17 +55,11 @@ public abstract class ITabComponent extends Component implements ITab {
}
}
- /**
- * {@inheritDoc}
- */
@Override
public IModel<String> getTitle() {
return title;
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean isVisible() {
return true;
@@ -89,9 +73,6 @@ public abstract class ITabComponent extends Component implements ITab {
internalRenderComponent();
}
- /**
- * {@inheritDoc}
- */
@Override
public abstract WebMarkupContainer getPanel(final String panelId);
http://git-wip-us.apache.org/repos/asf/syncope/blob/648c4546/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
----------------------------------------------------------------------
diff --git a/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java b/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
index 34651e1..d2beabc 100644
--- a/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
+++ b/ext/elasticsearch/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/ElasticsearchAnySearchDAO.java
@@ -56,6 +56,7 @@ import org.elasticsearch.index.query.MatchNoneQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
+import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.factory.annotation.Autowired;
/**
@@ -123,6 +124,9 @@ public class ElasticsearchAnySearchDAO extends AbstractAnySearchDAO {
SearchRequestBuilder builder = searchRequestBuilder(adminRealms, cond, kind).
setFrom(page <= 0 ? 0 : page - 1).
setSize(itemsPerPage < 0 ? elasticsearchUtils.getIndexMaxResultWindow() : itemsPerPage);
+ for (OrderByClause clause : orderBy) {
+ builder.addSort(clause.getField(), SortOrder.valueOf(clause.getDirection().name()));
+ }
return buildResult(
CollectionUtils.collect(Arrays.asList(builder.get().getHits().getHits()),