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.templates.impl;
18  
19  import java.util.ArrayList;
20  import java.util.List;
21  
22  import org.apache.commons.lang.StringUtils;
23  
24  /**
25   * @author benjaminmestrallet
26   */
27  public class TemplateConfig {
28  
29    private List<NodeType> nodeTypes = new ArrayList<NodeType>();
30    private List<Template> templates = new ArrayList<Template>();
31  
32    private List<NodeType> excludeRenderTemplateNodeTypes = new ArrayList<NodeType>();
33  
34    public List<NodeType> getNodeTypes() {   return this.nodeTypes; }
35    public void setNodeTypes(List<NodeType> s) {  this.nodeTypes = s; }
36  
37    public List<Template> getTemplates() {   return this.templates; }
38    public void setTemplates(List<Template> s) {  this.templates = s; }
39  
40    public List<NodeType> getExcludeRenderTemplateNodeTypes() {
41      return excludeRenderTemplateNodeTypes;
42    }
43  
44    public void setExcludeRenderTemplateNodeTypes(List<NodeType> excludeRenderTemplateNodeTypes) {
45      this.excludeRenderTemplateNodeTypes = excludeRenderTemplateNodeTypes;
46    }
47  
48    static public class Template {
49  
50      private String templateFile;
51      private String roles;
52  
53      public String[] getParsedRoles() { return StringUtils.split(this.roles, ";"); }
54  
55      public String getRoles() {return roles; }
56      public void setRoles(String roles) { this.roles = roles; }
57  
58      public String getTemplateFile() { return templateFile; }
59      public void setTemplateFile(String templateFile) { this.templateFile = templateFile; }
60    }
61  
62    static public class NodeType {
63  
64      private String nodetypeName;
65      private String label;
66      private boolean documentTemplate ;
67      private List referencedDialog;
68      private List referencedView;
69      private List referencedSkin;
70  
71      public NodeType(){
72        referencedDialog = new ArrayList();
73        referencedView = new ArrayList();
74        referencedSkin = new ArrayList();
75        documentTemplate = false ;
76      }
77  
78      public String getNodetypeName() { return nodetypeName ; }
79      public void setNodetypeName(String s) { nodetypeName = s ; }
80  
81      public String getLabel() { return label ; }
82      public void setLabel(String s) { label = s ; }
83  
84      public List getReferencedDialog() { return referencedDialog; }
85      public void setReferencedDialog(List referencedDialog) { this.referencedDialog = referencedDialog; }
86  
87      public List getReferencedView() { return referencedView; }
88      public void setReferencedView(List referencedView) { this.referencedView = referencedView; }
89  
90      public List getReferencedSkin() { return referencedSkin; }
91      public void setReferencedSkin(List referencedSkin) { this.referencedSkin = referencedSkin; }
92  
93      public boolean getDocumentTemplate() { return this.documentTemplate ; }
94      public void setDocumentTemplate( boolean b) { this.documentTemplate = b ; }
95    }
96  
97  }