Commit 7ceb6911 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Fixed columns display

parent f54cddee
...@@ -42,12 +42,12 @@ import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink; ...@@ -42,12 +42,12 @@ import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel; import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel; import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.springframework.util.ReflectionUtils;
public class ChoreographyDirectoryPanel extends GroupDirectoryPanel { public class ChoreographyDirectoryPanel extends GroupDirectoryPanel {
...@@ -76,8 +76,9 @@ public class ChoreographyDirectoryPanel extends GroupDirectoryPanel { ...@@ -76,8 +76,9 @@ public class ChoreographyDirectoryPanel extends GroupDirectoryPanel {
protected List<IColumn<GroupTO, String>> getColumns() { protected List<IColumn<GroupTO, String>> getColumns() {
final List<IColumn<GroupTO, String>> columns = new ArrayList<>(); final List<IColumn<GroupTO, String>> columns = new ArrayList<>();
columns.add(new AttrColumn<>("id", SchemaType.PLAIN)); addPropertyColumn("key", ReflectionUtils.findField(GroupTO.class, "key"), columns);
columns.add(new PropertyColumn<>(new ResourceModel("name", "Name"), "Name", "name")); addPropertyColumn("name", ReflectionUtils.findField(GroupTO.class, "name"), columns);
columns.add(new AttrColumn<>("description", SchemaType.PLAIN)); columns.add(new AttrColumn<>("description", SchemaType.PLAIN));
columns.add(new AbstractColumn<GroupTO, String>(new ResourceModel("", "Enactment Engine")) { columns.add(new AbstractColumn<GroupTO, String>(new ResourceModel("", "Enactment Engine")) {
...@@ -90,7 +91,7 @@ public class ChoreographyDirectoryPanel extends GroupDirectoryPanel { ...@@ -90,7 +91,7 @@ public class ChoreographyDirectoryPanel extends GroupDirectoryPanel {
model.getObject().getPlainAttrMap().get("id").getValues().iterator().next()) model.getObject().getPlainAttrMap().get("id").getValues().iterator().next())
.getName(); .getName();
} catch (Exception e) { } catch (Exception e) {
eeName = "Not found"; eeName = "Not assigned";
} finally { } finally {
Label label = new Label(componentId, eeName); Label label = new Label(componentId, eeName);
item.add(label); item.add(label);
......
...@@ -18,7 +18,6 @@ package org.apache.syncope.client.console.panels; ...@@ -18,7 +18,6 @@ package org.apache.syncope.client.console.panels;
import eu.chorevolution.idm.common.to.ChoreographyTO; import eu.chorevolution.idm.common.to.ChoreographyTO;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.pages.ChoreographyPage; import org.apache.syncope.client.console.pages.ChoreographyPage;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn; import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
import org.apache.syncope.common.lib.search.AnyObjectFiqlSearchConditionBuilder; import org.apache.syncope.common.lib.search.AnyObjectFiqlSearchConditionBuilder;
...@@ -58,11 +57,8 @@ public class ChoreographyServiceDirectoryPanel extends AnyObjectDirectoryPanel { ...@@ -58,11 +57,8 @@ public class ChoreographyServiceDirectoryPanel extends AnyObjectDirectoryPanel {
protected List<IColumn<AnyObjectTO, String>> getColumns() { protected List<IColumn<AnyObjectTO, String>> getColumns() {
final List<IColumn<AnyObjectTO, String>> columns = new ArrayList<>(); final List<IColumn<AnyObjectTO, String>> columns = new ArrayList<>();
for (String name : prefMan.getList( addPropertyColumn("key", ReflectionUtils.findField(AnyObjectTO.class, "key"), columns);
getRequest(), String.format(Constants.PREF_ANY_OBJECT_DETAILS_VIEW, type))) { addPropertyColumn("name", ReflectionUtils.findField(AnyObjectTO.class, "name"), columns);
addPropertyColumn(name, ReflectionUtils.findField(AnyObjectTO.class, name), columns);
}
columns.add(new AttrColumn<>("Service Location", SchemaType.PLAIN)); columns.add(new AttrColumn<>("Service Location", SchemaType.PLAIN));
......
...@@ -20,7 +20,6 @@ import java.io.Serializable; ...@@ -20,7 +20,6 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.syncope.client.console.commons.AnyDataProvider; import org.apache.syncope.client.console.commons.AnyDataProvider;
import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.commons.EnactmentEngineDataProvider; import org.apache.syncope.client.console.commons.EnactmentEngineDataProvider;
import org.apache.syncope.client.console.pages.EnactmentEngineDetailPage; import org.apache.syncope.client.console.pages.EnactmentEngineDetailPage;
import org.apache.syncope.client.console.pages.EnactmentEnginePage; import org.apache.syncope.client.console.pages.EnactmentEnginePage;
...@@ -71,12 +70,8 @@ public class EnactmentEngineDirectoryPanel extends AnyObjectDirectoryPanel { ...@@ -71,12 +70,8 @@ public class EnactmentEngineDirectoryPanel extends AnyObjectDirectoryPanel {
protected List<IColumn<AnyObjectTO, String>> getColumns() { protected List<IColumn<AnyObjectTO, String>> getColumns() {
final List<IColumn<AnyObjectTO, String>> columns = new ArrayList<>(); final List<IColumn<AnyObjectTO, String>> columns = new ArrayList<>();
//Same implementation of AnyObjectDirectoryPanel addPropertyColumn("key", ReflectionUtils.findField(AnyObjectTO.class, "key"), columns);
for (String name : prefMan.getList( addPropertyColumn("name", ReflectionUtils.findField(AnyObjectTO.class, "name"), columns);
getRequest(), String.format(Constants.PREF_ANY_OBJECT_DETAILS_VIEW, type))) {
addPropertyColumn(name, ReflectionUtils.findField(AnyObjectTO.class, name), columns);
}
columns.add(new AbstractColumn<AnyObjectTO, String>(new ResourceModel("", "Base URL")) { columns.add(new AbstractColumn<AnyObjectTO, String>(new ResourceModel("", "Base URL")) {
@Override @Override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment