View Javadoc
1   /*
2    * Copyright (C) 2003-2007 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.actions.impl;
18  
19  import java.util.ArrayList;
20  import java.util.HashMap;
21  import java.util.List;
22  import java.util.Map;
23  
24  import org.apache.commons.lang.StringUtils;
25  
26  public class ActionConfig {
27  
28    private boolean autoCreatedInNewRepository ;
29    private String repository;
30    private String workspace;
31    private List actions = new ArrayList(5);
32  
33    public List getActions() { return actions; }
34    public void setActions(List actions) { this.actions = actions; }
35  
36    public boolean getAutoCreatedInNewRepository() { return this.autoCreatedInNewRepository ; }
37    public void setAutoCreatedInNewRepository(boolean isAuto) { this.autoCreatedInNewRepository = isAuto ; }
38  
39    public String getRepository() { return repository; }
40    public void setRepository(String repository) { this.repository = repository; }
41  
42    public String getWorkspace() { return workspace; }
43    public void setWorkspace(String workspace) { this.workspace = workspace; }
44  
45    static public class Mixin {
46      private String name;
47      private String properties;
48  
49      public String getProperties() { return properties; }
50      public void setProperties(String properties) { this.properties = properties; }
51  
52      public Map<String, String> getParsedProperties() {
53        Map<String, String> propMap = new HashMap<String, String>();
54        String[] props = StringUtils.split(this.properties, ";");
55        for (int i = 0; i < props.length; i++) {
56          String prop = props[i];
57          String[] couple = StringUtils.split(prop, "=");
58          propMap.put(couple[0], couple[1]);
59        }
60        return propMap;
61      }
62  
63  
64      public String getName() {
65        return name;
66      }
67      public void setName(String name) {
68        this.name = name;
69      }
70  
71    }
72  
73    static public class TaxonomyAction {
74      private String name;
75      private String type;
76      private String description;
77      private String homePath;
78      private String targetWspace;
79      private String targetPath;
80      private List<String> lifecyclePhase = new ArrayList<String>();
81      private String roles;
82      private List<String> affectedNodeTypes;
83      private List mixins = new ArrayList(10);
84  
85      public String getDescription() {
86        return description;
87      }
88  
89      public void setDescription(String description) {
90        this.description = description;
91      }
92  
93      public String getHomePath() {
94        return homePath;
95      }
96  
97      public void setHomePath(String homePath) {
98        this.homePath = homePath;
99      }
100 
101     public List<String> getLifecyclePhase() {
102       return lifecyclePhase;
103     }
104 
105     public void setLifecyclePhase(List<String> lifecyclePhase) {
106       this.lifecyclePhase = lifecyclePhase;
107     }
108 
109     public List getMixins() {
110       return mixins;
111     }
112 
113     public void setMixins(List mixins) {
114       this.mixins = mixins;
115     }
116 
117     public String getName() {
118       return name;
119     }
120 
121     public void setName(String name) {
122       this.name = name;
123     }
124 
125     public String getRoles() {
126       return roles;
127     }
128 
129     public void setRoles(String roles) {
130       this.roles = roles;
131     }
132 
133     public String getTargetPath() {
134       return targetPath;
135     }
136 
137     public void setTargetPath(String targetPath) {
138       this.targetPath = targetPath;
139     }
140 
141     public String getTargetWspace() {
142       return targetWspace;
143     }
144 
145     public void setTargetWspace(String targetWspace) {
146       this.targetWspace = targetWspace;
147     }
148 
149     public String getType() {
150       return type;
151     }
152 
153     public void setType(String type) {
154       this.type = type;
155     }
156 
157     public List<String> getAffectedNodeTypes() {
158       return affectedNodeTypes;
159     }
160     public void setAffectedNodeTypes(List<String> affectedNodeTypes) {
161       this.affectedNodeTypes = affectedNodeTypes;
162     }
163 
164   }
165 
166   static public class Action {
167     private String name;
168     private String type;
169     private String description;
170     private String srcWorkspace;
171     private String srcPath;
172     private boolean isDeep = true;
173     private List<String> uuid;
174     private List<String> nodeTypeName;
175     private List<String> lifecyclePhase;
176     private String roles;
177     private String variables;
178     private List<String> affectedNodeTypes;
179     private List mixins = new ArrayList(10);
180 
181     public String getType() { return type; }
182     public void setType(String type) { this.type = type; }
183 
184     public String getVariables() { return variables; }
185     public void setVariables(String variables) { this.variables = variables; }
186 
187     public String getDescription() { return description; }
188     public void setDescription(String description) { this.description = description; }
189 
190     public String getName() { return name; }
191     public void setName(String name) { this.name = name; }
192 
193     public String getSrcPath() { return srcPath; }
194     public void setSrcPath(String srcPath) { this.srcPath = srcPath; }
195 
196     public String getSrcWorkspace() { return srcWorkspace; }
197     public void setSrcWorkspace(String srcWorkspace) { this.srcWorkspace = srcWorkspace; }
198 
199     public boolean isDeep() { return isDeep; }
200     public void setDeep(boolean isDeep) { this.isDeep = isDeep; }
201 
202     public List<String> getUuid() { return uuid; }
203     public void setUuid(List<String> uuid) { this.uuid = uuid; }
204 
205     public List<String> getNodeTypeName() { return nodeTypeName; }
206     public void setNodeTypeName(List<String> nodeTypeName) { this.nodeTypeName = nodeTypeName; }
207 
208     public List<String> getLifecyclePhase() { return lifecyclePhase; }
209     public void setLifecyclePhase(List<String> lifecyclePhase) { this.lifecyclePhase = lifecyclePhase; }
210 
211     public String getRoles() { return roles; }
212     public void setRoles(String roles) { this.roles = roles; }
213 
214     public List getMixins() { return mixins; }
215     public void setMixins(List mixins) { this.mixins = mixins; }
216 
217     public List<String> getAffectedNodeTypes() {
218       return affectedNodeTypes;
219     }
220 
221     public void setAffectedNodeTypes(List<String> affectedNodeTypes) {
222       this.affectedNodeTypes = affectedNodeTypes;
223     }
224   }
225 
226 }