1 /*
2 * Copyright (C) 2003-2008 eXo Platform SAS.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Affero General Public License
6 * as published by the Free Software Foundation; either version 3
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see<http://www.gnu.org/licenses/>.
16 */
17 package org.exoplatform.services.cms.lock.impl;
18
19 import java.util.ArrayList;
20 import java.util.Iterator;
21 import java.util.List;
22
23 import org.exoplatform.container.component.BaseComponentPlugin;
24 import org.exoplatform.container.xml.InitParams;
25 import org.exoplatform.container.xml.ObjectParameter;
26
27 /**
28 * Created by The eXo Platform SARL
29 * Author : Nguyen Anh Vu
30 * anhvurz90@gmail.com
31 * Dec 14, 2009
32 * 3:01:45 PM
33 */
34 public class LockGroupsOrUsersPlugin extends BaseComponentPlugin {
35
36 private InitParams params_;
37
38 public LockGroupsOrUsersPlugin(InitParams params) {
39 params_ = params;
40 }
41
42 /**
43 * Init tag permission in repository.
44 */
45 @SuppressWarnings("unchecked")
46 public List<String> initGroupsOrUsers() {
47 Iterator<ObjectParameter> it = params_.getObjectParamIterator();
48 LockGroupsOrUsersConfig lockGroupsOrUsersConfig;
49 while(it.hasNext()) {
50 lockGroupsOrUsersConfig = (LockGroupsOrUsersConfig)it.next().getObject();
51 return lockGroupsOrUsersConfig.getSettingLockList();
52 }
53 return new ArrayList<String>();
54 }
55 }