View Javadoc

1   /**
2    * This file Copyright (c) 2008-2014 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   * @author pbracher
45   * @version $Id$
46   */
47  
48  public class MainAreaIntro extends ConfiguredAreaDefinition{
49      private String dialog;
50  
51      /**
52       * If empty no extra div will be rendered in the intro.
53       */
54      private String divID;
55  
56      private Boolean showTOC;
57      private Boolean showAuthorDate;
58      private Boolean showAbstract;
59      private Boolean showTextFeatures;
60      private Boolean showCategories;
61      private Boolean showImage;
62  
63      private AreaDefinition infoBlock;
64  
65      /**
66       * @deprecated use {@link #MainAreaIntro(TemplateAvailability templateAvailability)}
67       */
68      public MainAreaIntro() {
69      }
70  
71      @Inject
72      public MainAreaIntro(TemplateAvailability templateAvailability) {
73          super(templateAvailability);
74      }
75  
76      public Boolean getShowTOC() {
77          return showTOC;
78      }
79      public void setShowTOC(Boolean showTOC) {
80          this.showTOC = showTOC;
81      }
82      public Boolean getShowAuthorDate() {
83          return showAuthorDate;
84      }
85      public void setShowAuthorDate(Boolean showAuthorDate) {
86          this.showAuthorDate = showAuthorDate;
87      }
88      public Boolean getShowAbstract() {
89          return showAbstract;
90      }
91      public void setShowAbstract(Boolean showAbstract) {
92          this.showAbstract = showAbstract;
93      }
94      public Boolean getShowTextFeatures() {
95          return showTextFeatures;
96      }
97      public void setShowTextFeatures(Boolean showTextFeatures) {
98          this.showTextFeatures = showTextFeatures;
99      }
100     public Boolean getShowCategories() {
101         return showCategories;
102     }
103     public void setShowCategories(Boolean showCategories) {
104         this.showCategories = showCategories;
105     }
106 
107     @Override
108     public String getDialog() {
109         return this.dialog;
110     }
111 
112     @Override
113     public void setDialog(String dialog) {
114         this.dialog = dialog;
115     }
116 
117     public AreaDefinition getInfoBlock() {
118         return this.getAreas().get("infoBlock");
119     }
120 
121     /**
122      * @deprecated since 2.0
123      */
124     public void setInfoBlock(AreaDefinition infoBlock) {
125         this.getAreas().put("infoBlock", 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     public void setShowImage(Boolean showImage) {
140         this.showImage = showImage;
141     }
142 
143 }