Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Apr 27, 2016
2 parents cc1905d + 502e0cf commit 228d66c
Show file tree
Hide file tree
Showing 33 changed files with 657 additions and 638 deletions.
Expand Up @@ -48,6 +48,11 @@ public class GuiStyleConstants {
public static final String CLASS_OBJECT_RESOURCE_BOX_CSS_CLASSES = "object-resource-box";
public static final String CLASS_OBJECT_RESOURCE_BOX_THIN_CSS_CLASSES = "object-resource-box-thin";

public static final String CLASS_OBJECT_SHADOW_ICON = "fa fa-eye";
public static final String CLASS_OBJECT_SHADOW_ICON_COLORED = CLASS_OBJECT_RESOURCE_ICON + " object-shadow-color";
public static final String CLASS_OBJECT_SHADOW_BOX_CSS_CLASSES = "object-shadow-box";
public static final String CLASS_OBJECT_SHADOW_BOX_THIN_CSS_CLASSES = "object-shadow-box-thin";

public static final String CLASS_OBJECT_TASK_ICON = "fa fa-tasks";
public static final String CLASS_OBJECT_TASK_ICON_COLORED = CLASS_OBJECT_TASK_ICON + " object-task-color";
public static final String CLASS_OBJECT_TASK_BOX_CSS_CLASSES = "object-task-box";
Expand Down
Expand Up @@ -34,6 +34,7 @@
import com.evolveum.midpoint.web.component.data.column.LinkColumn;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.page.admin.configuration.PageImportObject;
import com.evolveum.midpoint.web.session.UserProfileStorage.TableId;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;

/**
Expand All @@ -48,8 +49,8 @@ public abstract class MainObjectListPanel<T extends ObjectType> extends ObjectLi
private static final String ID_IMPORT_OBJECT = "importObject";
private static final String ID_BUTTON_BAR = "buttonBar";

public MainObjectListPanel(String id, Class<T> type, Collection<SelectorOptions<GetOperationOptions>> options, PageBase parentPage) {
super(id, type, options, parentPage);
public MainObjectListPanel(String id, Class<T> type, TableId tableId, Collection<SelectorOptions<GetOperationOptions>> options, PageBase parentPage) {
super(id, type, tableId, options, parentPage);
}

@Override
Expand Down
Expand Up @@ -47,25 +47,18 @@
import com.evolveum.midpoint.web.component.search.Search;
import com.evolveum.midpoint.web.component.search.SearchFactory;
import com.evolveum.midpoint.web.component.search.SearchFormPanel;
import com.evolveum.midpoint.web.component.search.SearchPanel;
import com.evolveum.midpoint.web.component.util.ListDataProvider2;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.page.admin.reports.PageReports;
import com.evolveum.midpoint.web.page.admin.resources.PageResources;
import com.evolveum.midpoint.web.page.admin.roles.PageRoles;
import com.evolveum.midpoint.web.page.admin.services.PageService;
import com.evolveum.midpoint.web.page.admin.services.PageServices;
import com.evolveum.midpoint.web.page.admin.users.PageUsers;
import com.evolveum.midpoint.web.session.PageStorage;
import com.evolveum.midpoint.web.session.SessionStorage;
import com.evolveum.midpoint.web.session.UserProfileStorage.TableId;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

/**
* @author katkav
Expand All @@ -88,11 +81,11 @@ public abstract class ObjectListPanel<T extends ObjectType> extends BasePanel<T>

private Collection<SelectorOptions<GetOperationOptions>> options;

private int pageSize = 10;

private boolean multiselect;

private TableId tableId;

private TableId tableId = TableId.TABLE_USERS;
private String addutionalBoxCssClasses;

public Class<T> getType() {
return type;
Expand All @@ -107,15 +100,26 @@ public Class<T> getType() {
storageMap.put(PageReports.class, SessionStorage.KEY_REPORTS);
storageMap.put(PageRoles.class, SessionStorage.KEY_ROLES);
storageMap.put(PageServices.class, SessionStorage.KEY_SERVICES);

}

public ObjectListPanel(String id, Class<T> type, Collection<SelectorOptions<GetOperationOptions>> options,

// private static Map<Class, TableId> tablePagingMap;

// static {
// tablePagingMap = new HashMap<Class, TableId>();
// tablePagingMap.put(PageResources.class, TableId.PAGE_RESOURCES_PANEL);
// tablePagingMap.put(PageReports.class, TableId.PAGE_REPORTS);
// tablePagingMap.put(PageRoles.class, TableId.TABLE_ROLES);
// tablePagingMap.put(PageServices.class, TableId.TABLE_SERVICES);
// tablePagingMap.put(PageUsers.class, TableId.TABLE_USERS);
// }

public ObjectListPanel(String id, Class<T> type, TableId tableId, Collection<SelectorOptions<GetOperationOptions>> options,
PageBase parentPage) {
super(id);
this.type = type;
this.parentPage = parentPage;
this.options = options;
this.tableId = tableId;
initLayout();
}

Expand All @@ -135,14 +139,6 @@ public void setProvider(BaseSortableDataProvider<SelectableBean<T>> provider) {
this.provider = provider;
}

public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}

public void setTableId(TableId tableId) {
this.tableId = tableId;
}

public List<T> getSelectedObjects() {
BaseSortableDataProvider<SelectableBean<T>> dataProvider = getDataProvider();
if (dataProvider instanceof ObjectDataProvider2) {
Expand All @@ -163,11 +159,10 @@ private void initLayout() {

@Override
public Search load() {
String storageKey = getStorageKey();// storageMap.get(parentPage.getClass());
String storageKey = getStorageKey();
Search search = null;
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap()
.get(storageKey);
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
search = storage.getSearch();
}
Expand All @@ -192,10 +187,9 @@ protected BaseSortableDataProvider<SelectableBean<T>> getProvider() {
parentPage, type) {
@Override
protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
String storageKey = getStorageKey();// storageMap.get(type);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap()
.get(storageKey);
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
storage.setPaging(paging);
}
Expand Down Expand Up @@ -232,8 +226,9 @@ private BoxedTablePanel<SelectableBean<T>> createTable() {
provider = getProvider();
provider.setQuery(getQuery());

// TableId tableId = tablePagingMap.get(parentPage.getClass());
BoxedTablePanel<SelectableBean<T>> table = new BoxedTablePanel<SelectableBean<T>>(ID_TABLE, provider,
columns, tableId, pageSize) {
columns, tableId, tableId == null ? 10 : parentPage.getSessionStorage().getUserProfile().getPagingSize(tableId)) {
private static final long serialVersionUID = 1L;

@Override
Expand All @@ -242,8 +237,8 @@ protected WebMarkupContainer createHeader(String headerId) {
}

@Override
protected String getBoxCssClasses() {
return ObjectListPanel.this.getBoxCssClasses();
public String getAdditionalBoxCssClasses() {
return ObjectListPanel.this.getAdditionalBoxCssClasses();
}

@Override
Expand All @@ -256,7 +251,7 @@ protected WebMarkupContainer createButtonToolbar(String id) {
table.setOutputMarkupId(true);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap().get(storageKey);
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
table.setCurrentPage(storage.getPaging());
}
Expand All @@ -265,8 +260,12 @@ protected WebMarkupContainer createButtonToolbar(String id) {
return table;
}

protected String getBoxCssClasses() {
return null;
public String getAdditionalBoxCssClasses() {
return addutionalBoxCssClasses;
}

public void setAdditionalBoxCssClasses(String boxCssClasses) {
this.addutionalBoxCssClasses = boxCssClasses;
}

/**
Expand All @@ -293,15 +292,20 @@ private String getStorageKey() {
return storageMap.get(parentPage.getClass());
}

private PageStorage getPageStorage(String storageKey){
PageStorage storage = getSession().getSessionStorage().getPageStorageMap().get(storageKey);
if (storage == null) {
storage = getSession().getSessionStorage().initPageStorage(storageKey);
}
return storage;
}

private void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
BaseSortableDataProvider<SelectableBean<T>> provider = getDataProvider();
provider.setQuery(query);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap().get(storageKey);
if (storage == null) {
storage = getSession().getSessionStorage().initPageStorage(storageKey);
}
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
storage.setSearch(searchModel.getObject());
storage.setPaging(null);
Expand Down Expand Up @@ -356,10 +360,7 @@ protected void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
private void saveSearchModel() {
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getSession().getSessionStorage().getPageStorageMap().get(storageKey);
if (storage == null) {
storage = getSession().getSessionStorage().initPageStorage(storageKey);
}
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
storage.setSearch(searchModel.getObject());
storage.setPaging(null);
Expand Down
Expand Up @@ -26,8 +26,8 @@
<wicket:message key="OperationResultPanel.showTask"/>
</a>
<div class="box-tools pull-right">
<div wicket:id="hideAll" class="btn btn-box-tool fa fa-compress"></div>
<div wicket:id="showAll" class="btn btn-box-tool fa fa-expand"></div>
<div wicket:id="showAll" class="btn btn-box-tool fa fa-plus"></div>
<div wicket:id="hideAll" class="btn btn-box-tool fa fa-minus"></div>
<div wicket:id="downloadXml" class="btn btn-box-tool fa fa-download"></div>
<div wicket:id="close" data-widget="remove" class="btn btn-box-tool fa fa-times"></div>
</div>
Expand Down

0 comments on commit 228d66c

Please sign in to comment.