001/* 002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Martin Pernollet 018 */ 019 020package org.nuxeo.ecm.platform.groups.audit.service.acl; 021 022import java.util.HashMap; 023import java.util.Map; 024 025public class ReportLayout { 026 protected Map<String, Integer> userColumn; 027 028 protected Map<Pair<String, String>, Integer> userAclColumn; 029 030 public ReportLayout() { 031 reset(); 032 } 033 034 public void reset() { 035 userColumn = new HashMap<String, Integer>(); 036 userAclColumn = new HashMap<Pair<String, String>, Integer>(); 037 } 038 039 /** Store the user column */ 040 public void setUserColumn(int column, String userOrGroup) { 041 userColumn.put(userOrGroup, column); 042 } 043 044 /** Return the user column */ 045 public int getUserColumn(String user) { 046 return userColumn.get(user); 047 } 048 049 public void setUserAclColumn(int column, Pair<String, String> userAcl) { 050 userAclColumn.put(userAcl, column); 051 } 052 053 /** Return the user column */ 054 public int getUserAclColumn(Pair<String, String> userAcl) { 055 return userAclColumn.get(userAcl); 056 } 057}