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.impl;
18
19 import java.util.HashMap;
20 import java.util.Map;
21
22 import org.exoplatform.container.component.ComponentPlugin;
23 import org.picocontainer.Startable;
24
25 /**
26 * Created by The eXo Platform SARL
27 * Author : Dang Van Minh
28 * minh.dang@exoplatform.com
29 * Apr 27, 2009
30 * 9:14:45 AM
31 */
32 public class DMSConfiguration implements Startable {
33 private Map<String, DMSRepositoryConfiguration> dmsConfigMap_ = new HashMap<String, DMSRepositoryConfiguration>();
34 private DMSRepositoryConfiguration dmsConfig;
35
36 /**
37 * Get DMS configuration with current repository.
38 * @return
39 */
40 public DMSRepositoryConfiguration getConfig() {
41 return dmsConfig;
42
43 }
44
45 /**
46 * This method will add more plugin.
47 * @param plugin
48 */
49 public void addPlugin(ComponentPlugin plugin) {
50 if (plugin instanceof DMSRepositoryConfiguration) {
51 dmsConfig = (DMSRepositoryConfiguration)plugin;
52 }
53 }
54
55 /**
56 * This method will create new repository
57 * @param plugin plugin name
58 */
59 public void initNewRepo(DMSRepositoryConfiguration plugin) {
60 dmsConfig = plugin;
61 }
62
63 public void start() {
64 }
65
66 public void stop() {
67 }
68
69 public Map<String, DMSRepositoryConfiguration> getDmsConfigMap() {
70 return dmsConfigMap_;
71 }
72
73 }