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 2019/10/25 10:23:40 UTC
[syncope] branch master updated: [SYNCOPE-1501] Allow filtering for
explore resource (#134)
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/master by this push:
new 5d6eb7c [SYNCOPE-1501] Allow filtering for explore resource (#134)
5d6eb7c is described below
commit 5d6eb7c9605c29b1a3bde4d85389a5368331ac08
Author: Federico Palmitesta <fe...@gmail.com>
AuthorDate: Fri Oct 25 12:05:00 2019 +0200
[SYNCOPE-1501] Allow filtering for explore resource (#134)
---
.../console/panels/ConnObjectListViewPanel.java | 120 +++++++++++++++++++--
.../syncope/client/console/panels/ConnObjects.java | 6 +-
.../panels/search/ConnObjectSearchPanel.java | 113 +++++++++++++++++++
.../client/console/rest/ResourceRestClient.java | 14 +--
.../console/panels/ConnObjectListViewPanel.html | 1 +
.../search/ConnObjectListViewPanel.properties | 17 +++
.../search/ConnObjectListViewPanel_it.properties | 17 +++
.../search/ConnObjectListViewPanel_ja.properties | 17 +++
.../ConnObjectListViewPanel_pt_BR.properties | 17 +++
.../search/ConnObjectListViewPanel_ru.properties | 18 ++++
.../console/panels/search/AbstractSearchPanel.java | 18 ----
.../panels/search/AnyObjectSearchPanel.java | 17 +++
.../console/panels/search/GroupSearchPanel.java | 18 ++++
.../console/panels/search/SearchClausePanel.java | 3 +-
14 files changed, 361 insertions(+), 35 deletions(-)
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.java
index e49c0e1..31ee2df 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.java
@@ -19,45 +19,118 @@
package org.apache.syncope.client.console.panels;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Optional;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.client.console.commons.ConnIdSpecialName;
import org.apache.syncope.client.console.panels.ListViewPanel.ListViewReload;
+import org.apache.syncope.client.console.panels.search.AbstractSearchPanel;
+import org.apache.syncope.client.console.panels.search.ConnObjectSearchPanel;
+import org.apache.syncope.client.console.panels.search.SearchClause;
+import org.apache.syncope.client.console.panels.search.SearchClausePanel;
+import org.apache.syncope.client.console.panels.search.SearchUtils;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
import org.apache.syncope.client.console.rest.ResourceRestClient;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.CollectionPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.client.ui.commons.wicket.markup.html.bootstrap.tabs.Accordion;
import org.apache.syncope.common.lib.Attr;
import org.apache.syncope.common.lib.to.ConnObjectTO;
import org.apache.syncope.common.lib.types.IdMEntitlement;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.wicket.Component;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
+import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
+import org.apache.wicket.extensions.markup.html.tabs.ITab;
+import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.model.util.ListModel;
public abstract class ConnObjectListViewPanel extends Panel {
private static final long serialVersionUID = 4986172040062752781L;
+ private final AnyTypeRestClient anyTypeRestClient = new AnyTypeRestClient();
+
private static final int SIZE = 10;
private String nextPageCookie;
+ private AbstractSearchPanel searchPanel;
+
+ private WebMarkupContainer arrows;
+
+ private String anyType;
+
+ private ResourceTO resource;
+
protected ConnObjectListViewPanel(
final String id,
- final String resource,
+ final ResourceTO resource,
final String anyType,
final PageReference pageRef) {
super(id);
- final List<ConnObjectTO> listOfItems = reloadItems(resource, anyType, null);
+ this.anyType = anyType;
+ this.resource = resource;
+
+ final Model<Integer> model = Model.of(-1);
+ final StringResourceModel res = new StringResourceModel("search.result", this, new Model<>(anyType));
+
+ final Accordion accordion = new Accordion("accordionPanel",
+ Collections.<ITab>singletonList(new AbstractTab(res) {
+
+ private static final long serialVersionUID = 1037272333056449377L;
+
+ @Override
+ public WebMarkupContainer getPanel(final String panelId) {
+ searchPanel = getSearchPanel(panelId, anyType);
+ return searchPanel;
+ }
+
+ }), model) {
+
+ private static final long serialVersionUID = 6581261306163L;
+
+ @Override
+ protected Component newTitle(final String markupId, final ITab tab, final Accordion.State state) {
+ return new AjaxLink<Integer>(markupId) {
+
+ private static final long serialVersionUID = 6584438659172L;
+
+ @Override
+ protected void onComponentTag(final ComponentTag tag) {
+ super.onComponentTag(tag);
+ tag.put("style", "color: #337ab7");
+ }
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ model.setObject(model.getObject() == 0 ? -1 : 0);
+ }
+ }.setBody(res);
+ }
+ };
+ accordion.setOutputMarkupId(true);
+ add(accordion.setEnabled(true).setVisible(true));
+
+ final List<ConnObjectTO> listOfItems = reloadItems(resource.getKey(), anyType, null, null);
final ListViewPanel.Builder<ConnObjectTO> builder = new ListViewPanel.Builder<ConnObjectTO>(
ConnObjectTO.class, pageRef) {
@@ -95,7 +168,7 @@ public abstract class ConnObjectListViewPanel extends Panel {
add(builder.build("objs"));
- final WebMarkupContainer arrows = new WebMarkupContainer("arrows");
+ arrows = new WebMarkupContainer("arrows");
add(arrows.setOutputMarkupId(true));
arrows.add(new AjaxLink<Serializable>("next") {
@@ -104,7 +177,7 @@ public abstract class ConnObjectListViewPanel extends Panel {
@Override
public void onClick(final AjaxRequestTarget target) {
- final List<ConnObjectTO> listOfItems = reloadItems(resource, anyType, nextPageCookie);
+ final List<ConnObjectTO> listOfItems = reloadItems(resource.getKey(), anyType, nextPageCookie, null);
target.add(arrows);
send(ConnObjectListViewPanel.this, Broadcast.DEPTH, new ListViewReload<>(listOfItems, target));
}
@@ -116,20 +189,55 @@ public abstract class ConnObjectListViewPanel extends Panel {
});
}
+ @Override
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof SearchClausePanel.SearchEvent) {
+ this.nextPageCookie = null;
+ final AjaxRequestTarget target = SearchClausePanel.SearchEvent.class.cast(event.getPayload()).getTarget();
+ List<ConnObjectTO> listOfItems = reloadItems(resource.getKey(), anyType, null, SearchUtils.buildFIQL(
+ ConnObjectListViewPanel.this.searchPanel.getModel().getObject(),
+ SyncopeClient.getConnObjectTOFiqlSearchConditionBuilder(),
+ ConnObjectListViewPanel.this.searchPanel.getAvailableSchemaTypes()));
+ target.add(arrows);
+ send(ConnObjectListViewPanel.this, Broadcast.DEPTH, new ListViewReload<>(listOfItems, target));
+ } else {
+ super.onEvent(event);
+ }
+ }
+
protected abstract void viewConnObject(ConnObjectTO connObjectTO, AjaxRequestTarget target);
private List<ConnObjectTO> reloadItems(
final String resource,
final String anyType,
- final String cookie) {
+ final String cookie,
+ final String fiql) {
Pair<String, List<ConnObjectTO>> items = ResourceRestClient.listConnObjects(resource,
anyType,
SIZE,
cookie,
- new SortParam<>(ConnIdSpecialName.UID, true));
+ new SortParam<>(ConnIdSpecialName.UID, true),
+ fiql);
nextPageCookie = items.getLeft();
return items.getRight();
}
+
+ private AbstractSearchPanel getSearchPanel(final String id, final String anyType) {
+ final List<SearchClause> clauses = new ArrayList<>();
+ final SearchClause clause = new SearchClause();
+ clauses.add(clause);
+
+ clause.setComparator(SearchClause.Comparator.EQUALS);
+ clause.setType(SearchClause.Type.ATTRIBUTE);
+ clause.setProperty("");
+
+ AnyTypeKind anyTypeKind = anyType.equals(SyncopeConstants.REALM_ANYTYPE)
+ ? AnyTypeKind.ANY_OBJECT
+ : anyTypeRestClient.read(anyType).getKind();
+
+ return new ConnObjectSearchPanel.Builder(resource, anyTypeKind, anyType,
+ new ListModel<>(clauses)).required(true).enableSearch().build(id);
+ }
}
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java
index d31441a..ff43a10 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java
@@ -83,7 +83,7 @@ public class ConnObjects extends Panel implements ModalPanel {
};
connObjects.setFirstLevel(new NextableConnObjectDirectoryPanel(
- connObjects, resource.getKey(), anyTypes.getField().getModelObject(), pageRef));
+ connObjects, resource, anyTypes.getField().getModelObject(), pageRef));
connObjects.setOutputMarkupId(true);
add(connObjects);
@@ -94,7 +94,7 @@ public class ConnObjects extends Panel implements ModalPanel {
@Override
protected void onUpdate(final AjaxRequestTarget target) {
connObjects.setFirstLevel(new NextableConnObjectDirectoryPanel(
- connObjects, resource.getKey(), anyTypes.getField().getModelObject(), pageRef));
+ connObjects, resource, anyTypes.getField().getModelObject(), pageRef));
target.add(connObjects);
}
});
@@ -106,7 +106,7 @@ public class ConnObjects extends Panel implements ModalPanel {
NextableConnObjectDirectoryPanel(
final MultilevelPanel multiLevelPanelRef,
- final String resource,
+ final ResourceTO resource,
final String anyType,
final PageReference pageRef) {
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/search/ConnObjectSearchPanel.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/search/ConnObjectSearchPanel.java
new file mode 100644
index 0000000..54142ab
--- /dev/null
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/panels/search/ConnObjectSearchPanel.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.panels.search;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+
+public class ConnObjectSearchPanel extends AbstractSearchPanel {
+
+ private static final long serialVersionUID = 21020550706646L;
+
+ private final ConnectorRestClient connectorRestClient = new ConnectorRestClient();
+
+ protected final ResourceTO resource;
+
+ public static class Builder extends AbstractSearchPanel.Builder<ConnObjectSearchPanel> {
+
+ private static final long serialVersionUID = 6308997285778809578L;
+
+ protected final ResourceTO resource;
+
+ private final AnyTypeKind anyType;
+
+ private final String typeName;
+
+ public Builder(final ResourceTO resource, final AnyTypeKind anyType, final String type,
+ final IModel<List<SearchClause>> model) {
+ super(model);
+ this.resource = resource;
+ this.anyType = anyType;
+ this.typeName = type;
+ }
+
+ @Override
+ public ConnObjectSearchPanel build(final String id) {
+ return new ConnObjectSearchPanel(id, anyType, typeName, this);
+ }
+ }
+
+ protected ConnObjectSearchPanel(final String id, final AnyTypeKind kind, final Builder builder) {
+ super(id, kind, builder);
+ this.resource = builder.resource;
+ }
+
+ protected ConnObjectSearchPanel(final String id, final AnyTypeKind kind, final String type, final Builder builder) {
+ super(id, kind, type, builder);
+ this.resource = builder.resource;
+ }
+
+ @Override
+ protected void populate() {
+ this.types = new LoadableDetachableModel<List<SearchClause.Type>>() {
+
+ private static final long serialVersionUID = 22668815812716L;
+
+ @Override
+ protected List<SearchClause.Type> load() {
+ return Collections.singletonList(SearchClause.Type.ATTRIBUTE);
+ }
+ };
+
+ this.dnames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 2989042618372L;
+
+ @Override
+ protected List<String> load() {
+ return Collections.emptyList();
+ }
+ };
+
+ this.anames = new LoadableDetachableModel<Map<String, PlainSchemaTO>>() {
+
+ private static final long serialVersionUID = 3002350300761L;
+
+ @Override
+ protected Map<String, PlainSchemaTO> load() {
+ return connectorRestClient.buildObjectClassInfo(
+ connectorRestClient.read(resource.getConnector()), false).stream().
+ map(ConnIdObjectClassTO::getAttributes).
+ flatMap(List::stream).
+ collect(Collectors.toMap(PlainSchemaTO::getKey, Function.identity(),
+ (schema1, schema2) -> schema1));
+ }
+ };
+ }
+}
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
index ff5e201..4174391 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
@@ -56,16 +56,18 @@ public class ResourceRestClient extends BaseRestClient {
}
public static Pair<String, List<ConnObjectTO>> listConnObjects(
- final String resource,
- final String anyTypeKey,
- final int size,
- final String pagedResultCookie,
- final SortParam<String> sort) {
+ final String resource,
+ final String anyTypeKey,
+ final int size,
+ final String pagedResultCookie,
+ final SortParam<String> sort,
+ final String fiql) {
ConnObjectTOQuery.Builder builder = new ConnObjectTOQuery.Builder().
pagedResultsCookie(pagedResultCookie).
size(size).
- orderBy(toOrderBy(sort));
+ orderBy(toOrderBy(sort)).
+ fiql(fiql);
final List<ConnObjectTO> result = new ArrayList<>();
String nextPageResultCookie = null;
diff --git a/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html
index d0dad1e..b3a7578 100644
--- a/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html
+++ b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html
@@ -18,6 +18,7 @@ under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
+ <div wicket:id="accordionPanel"></div>
<span wicket:id="objs"/>
<div wicket:id="arrows">
<a href="#" class="btn btn-primary btn-circle btn-lg pull-right" wicket:id="next"><i class="fa fa-chevron-right"></i></a>
diff --git a/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel.properties b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel.properties
new file mode 100644
index 0000000..711315b
--- /dev/null
+++ b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+search.result=Search
diff --git a/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_it.properties b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_it.properties
new file mode 100644
index 0000000..c43b35a
--- /dev/null
+++ b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_it.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+search.result=Ricerca
diff --git a/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_ja.properties b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_ja.properties
new file mode 100644
index 0000000..7c64468
--- /dev/null
+++ b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_ja.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+search.result=\u691c\u7d22
diff --git a/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_pt_BR.properties b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_pt_BR.properties
new file mode 100644
index 0000000..711315b
--- /dev/null
+++ b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_pt_BR.properties
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+search.result=Search
diff --git a/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_ru.properties b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_ru.properties
new file mode 100644
index 0000000..33a3c75
--- /dev/null
+++ b/client/idm/console/src/main/resources/org/apache/syncope/client/console/panels/search/ConnObjectListViewPanel_ru.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+search.result=\u041f\u043e\u0438\u0441\u043a \u0434\u043b\u044f
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java
index f2cc570..547d8a3 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java
@@ -21,21 +21,15 @@ package org.apache.syncope.client.console.panels.search;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.client.console.SyncopeWebApplication;
import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.rest.AnyTypeRestClient;
import org.apache.syncope.client.console.rest.GroupRestClient;
-import org.apache.syncope.client.console.rest.SchemaRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.search.SearchableFields;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.syncope.common.lib.types.IdRepoEntitlement;
import org.apache.wicket.event.IEventSink;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -173,18 +167,6 @@ public abstract class AbstractSearchPanel extends Panel {
}
};
- anames = new LoadableDetachableModel<Map<String, PlainSchemaTO>>() {
-
- private static final long serialVersionUID = 5275935387613157437L;
-
- @Override
- protected Map<String, PlainSchemaTO> load() {
- return SchemaRestClient.<PlainSchemaTO>getSchemas(
- SchemaType.PLAIN, null, AnyTypeRestClient.read(type).getClasses().toArray(new String[] {})).
- stream().collect(Collectors.toMap(SchemaTO::getKey, Function.identity()));
- }
- };
-
resourceNames = new LoadableDetachableModel<List<String>>() {
private static final long serialVersionUID = 5275935387613157437L;
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSearchPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSearchPanel.java
index 75c03ac..d88e83b 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSearchPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSearchPanel.java
@@ -21,10 +21,15 @@ package org.apache.syncope.client.console.panels.search;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.function.Function;
import java.util.stream.Collectors;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
@@ -88,6 +93,18 @@ public class AnyObjectSearchPanel extends AbstractSearchPanel {
null).stream().collect(Collectors.toMap(GroupTO::getKey, GroupTO::getName));
}
};
+
+ this.anames = new LoadableDetachableModel<Map<String, PlainSchemaTO>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected Map<String, PlainSchemaTO> load() {
+ return SchemaRestClient.<PlainSchemaTO>getSchemas(
+ SchemaType.PLAIN, null, AnyTypeRestClient.read(type).getClasses().toArray(new String[] {})).
+ stream().collect(Collectors.toMap(schema -> schema.getKey(), Function.identity()));
+ }
+ };
}
protected List<SearchClause.Type> getAvailableTypes() {
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java
index 91ed318..77f2029 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java
@@ -22,7 +22,13 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
@@ -75,5 +81,17 @@ public final class GroupSearchPanel extends AbstractSearchPanel {
return Collections.<String, String>emptyMap();
}
};
+
+ this.anames = new LoadableDetachableModel<Map<String, PlainSchemaTO>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected Map<String, PlainSchemaTO> load() {
+ return SchemaRestClient.<PlainSchemaTO>getSchemas(
+ SchemaType.PLAIN, null, AnyTypeRestClient.read(type).getClasses().toArray(new String[] {})).
+ stream().collect(Collectors.toMap(schema -> schema.getKey(), Function.identity()));
+ }
+ };
}
}
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
index 5d93645..b1dae46 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
@@ -206,8 +206,7 @@ public class SearchClausePanel extends FieldPanel<SearchClause> {
if (anames != null && anames.getObject() != null && !anames.getObject().isEmpty()) {
names.addAll(anames.getObject().keySet());
}
- Collections.sort(names);
- return names;
+ return names.stream().sorted().collect(Collectors.toList());
case GROUP_MEMBERSHIP:
final List<String> groups = groupInfo.getLeft().getObject().values().