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 Nov 5, 2018
2 parents 3691329 + c09a06a commit 9bc0a8f
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 1 deletion.
@@ -0,0 +1,70 @@
/*
* Copyright (c) 2010-2017 Evolveum
*
* Licensed 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 com.evolveum.midpoint.gui.impl.session;

import com.evolveum.midpoint.prism.query.ObjectPaging;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.web.component.search.Search;
import com.evolveum.midpoint.web.session.PageStorage;

/**
* @author skublik
*/
public class WorkItemsStorage implements PageStorage{

private static final long serialVersionUID = 1L;

private ObjectPaging workItemsPaging;

private Search search;

@Override
public Search getSearch() {
return search;
}

@Override
public void setSearch(Search search) {
this.search = search;
}

@Override
public ObjectPaging getPaging() {
return workItemsPaging;
}

@Override
public void setPaging(ObjectPaging workItemsPaging) {
this.workItemsPaging = workItemsPaging;
}

@Override
public String debugDump() {
return debugDump(0);
}

@Override
public String debugDump(int indent) {
StringBuilder sb = new StringBuilder();
DebugUtil.indentDebugDump(sb, indent);
sb.append("WorkItemsStorage\n");
DebugUtil.debugDumpWithLabelLn(sb, "workItemsPaging", workItemsPaging, indent+1);
DebugUtil.debugDumpWithLabel(sb, "search", search, indent+1);
return sb.toString();
}

}
Expand Up @@ -173,6 +173,7 @@ protected boolean isFooterVisible(long providerSize, int pageSize){
}
};
workItemsTable.setAdditionalBoxCssClasses("without-box-header-top-border");
workItemsTable.setCurrentPage(getSession().getSessionStorage().getWorkItemStorage().getPaging());
add(workItemsTable);
}

Expand Down
Expand Up @@ -21,6 +21,8 @@
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.model.api.WorkflowService;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.query.ObjectPaging;
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.result.OperationResultStatus;
import com.evolveum.midpoint.task.api.Task;
Expand Down Expand Up @@ -103,7 +105,15 @@ private void initLayout(IModel<PrismObject<UserType>> donorModel) {
add(mainForm);

WorkItemsPanel panel = new WorkItemsPanel(ID_WORK_ITEMS_PANEL,
new WorkItemDtoProvider(PageWorkItems.this, workItemsType, donorModel),
new WorkItemDtoProvider(PageWorkItems.this, workItemsType, donorModel) {

private static final long serialVersionUID = 1L;

@Override
protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
getSessionStorage().getWorkItemStorage().setPaging(paging);
}
},
UserProfileStorage.TableId.PAGE_WORK_ITEMS,
(int) getItemsPerPage(UserProfileStorage.TableId.PAGE_WORK_ITEMS),
WorkItemsPanel.View.FULL_LIST);
Expand Down
Expand Up @@ -22,6 +22,7 @@
import java.util.Map.Entry;

import com.evolveum.midpoint.gui.impl.session.ObjectTabStorage;
import com.evolveum.midpoint.gui.impl.session.WorkItemsStorage;
import com.evolveum.midpoint.util.DebugDumpable;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType;
Expand Down Expand Up @@ -60,6 +61,7 @@ public class SessionStorage implements Serializable, DebugDumpable {
public static final String KEY_ROLE_MEMEBER_PANEL = "roleMemberPanel";
public static final String KEY_ORG_MEMEBER_PANEL = "orgMemberPanel";
public static final String KEY_SERVICE_MEMEBER_PANEL = "serviceMemberPanel";
public static final String KEY_WORK_ITEMS = "workItems";

private static final String KEY_TASKS = "tasks";
private static final String KEY_CERT_CAMPAIGNS = "certCampaigns";
Expand Down Expand Up @@ -220,6 +222,12 @@ private String getContentStorageKey(ShadowKindType kind, String searchMode) {
}
}

public WorkItemsStorage getWorkItemStorage() {
if (pageStorageMap.get(KEY_WORK_ITEMS) == null) {
pageStorageMap.put(KEY_WORK_ITEMS, new WorkItemsStorage());
}
return (WorkItemsStorage)pageStorageMap.get(KEY_WORK_ITEMS);
}

public TasksStorage getTasks() {
if (pageStorageMap.get(KEY_TASKS) == null) {
Expand Down

0 comments on commit 9bc0a8f

Please sign in to comment.