View Javadoc
1   /**
2    * This file Copyright (c) 2008-2015 Magnolia International
3    * Ltd.  (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10   * This file is distributed in the hope that it will be
11   * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12   * implied warranty of MERCHANTABILITY or FITNESS FOR A
13   * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14   * Redistribution, except as permitted by whichever of the GPL
15   * or MNA you select, is prohibited.
16   *
17   * 1. For the GPL license (GPL), you can redistribute and/or
18   * modify this file under the terms of the GNU General
19   * Public License, Version 3, as published by the Free Software
20   * Foundation.  You should have received a copy of the GNU
21   * General Public License, Version 3 along with this program;
22   * if not, write to the Free Software Foundation, Inc., 51
23   * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24   *
25   * 2. For the Magnolia Network Agreement (MNA), this file
26   * and the accompanying materials are made available under the
27   * terms of the MNA which accompanies this distribution, and
28   * is available at http://www.magnolia-cms.com/mna.html
29   *
30   * Any modifications to this file must keep this entire header
31   * intact.
32   *
33   */
34  package info.magnolia.module.templatingkit.templates;
35  
36  import info.magnolia.rendering.template.AreaDefinition;
37  import info.magnolia.rendering.template.TemplateAvailability;
38  import info.magnolia.rendering.template.configured.ConfiguredAreaDefinition;
39  
40  import com.google.inject.Inject;
41  
42  /**
43   * MainAreaIntro renderable definition. Defines as example the dialog and shows property.
44   */
45  public class MainAreaIntro extends ConfiguredAreaDefinition {
46      private String dialog;
47  
48      /**
49       * If empty no extra div will be rendered in the intro.
50       */
51      private String divID;
52  
53      private Boolean showTOC;
54      private Boolean showAuthorDate;
55      private Boolean showAbstract;
56      private Boolean showTextFeatures;
57      private Boolean showCategories;
58      private Boolean showImage;
59  
60      private AreaDefinition infoBlock;
61  
62      @Inject
63      public MainAreaIntro(TemplateAvailability templateAvailability) {
64          super(templateAvailability);
65      }
66  
67      /**
68       * Needed by CglibProxyFactory.
69       */
70      public MainAreaIntro() {
71          // no-op
72      }
73  
74      public Boolean getShowTOC() {
75          return showTOC;
76      }
77  
78      public void setShowTOC(Boolean showTOC) {
79          this.showTOC = showTOC;
80      }
81  
82      public Boolean getShowAuthorDate() {
83          return showAuthorDate;
84      }
85  
86      public void setShowAuthorDate(Boolean showAuthorDate) {
87          this.showAuthorDate = showAuthorDate;
88      }
89  
90      public Boolean getShowAbstract() {
91          return showAbstract;
92      }
93  
94      public void setShowAbstract(Boolean showAbstract) {
95          this.showAbstract = showAbstract;
96      }
97  
98      public Boolean getShowTextFeatures() {
99          return showTextFeatures;
100     }
101 
102     public void setShowTextFeatures(Boolean showTextFeatures) {
103         this.showTextFeatures = showTextFeatures;
104     }
105 
106     public Boolean getShowCategories() {
107         return showCategories;
108     }
109 
110     public void setShowCategories(Boolean showCategories) {
111         this.showCategories = showCategories;
112     }
113 
114     @Override
115     public String getDialog() {
116         return this.dialog;
117     }
118 
119     @Override
120     public void setDialog(String dialog) {
121         this.dialog = dialog;
122     }
123 
124     public AreaDefinition getInfoBlock() {
125         return this.getAreas().get("infoBlock");
126     }
127 
128     public String getDivID() {
129         return this.divID;
130     }
131 
132     public void setDivID(String divID) {
133         this.divID = divID;
134     }
135 
136     public Boolean getShowImage() {
137         return showImage;
138     }
139 
140     public void setShowImage(Boolean showImage) {
141         this.showImage = showImage;
142     }
143 
144 }