1    /*
2     * Copyright 2009 :torweg free software group
3     *
4     * This program is free software: you can redistribute it and/or modify
5     * it under the terms of the GNU General Public License as published by
6     * the Free Software Foundation, either version 3 of the License, or
7     * (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    */
18   package org.torweg.pulse.component.statistics.view;
19   
20   import java.util.Set;
21   
22   import javax.xml.bind.annotation.XmlAccessOrder;
23   import javax.xml.bind.annotation.XmlAccessType;
24   import javax.xml.bind.annotation.XmlAccessorOrder;
25   import javax.xml.bind.annotation.XmlAccessorType;
26   import javax.xml.bind.annotation.XmlAttribute;
27   import javax.xml.bind.annotation.XmlElement;
28   import javax.xml.bind.annotation.XmlElementWrapper;
29   import javax.xml.bind.annotation.XmlRootElement;
30   
31   /**
32    * The {@code Configuration} for the {@code WestPanelController}.
33    * 
34    * @author Daniel Dietz
35    * @version $Revision: 1568 $
36    */
37   @XmlRootElement(name = "west-panel-controller-configuration")
38   @XmlAccessorOrder(XmlAccessOrder.UNDEFINED)
39   @XmlAccessorType(XmlAccessType.FIELD)
40   public final class WestPanelControllerConfiguration extends
41           AbstractStatisticsViewControllerConfiguration {
42   
43       /**
44        * The serialVersionUID.
45        */
46       private static final long serialVersionUID = 7302694297347816249L;
47   
48       /**
49        * The initialisation views.
50        */
51       @XmlElementWrapper(name = "init-views")
52       @XmlElement(name = "init-view")
53       private Set<InitView> initViews;
54   
55       /**
56        * Default constructor.
57        */
58       @Deprecated
59       protected WestPanelControllerConfiguration() {
60           super();
61       }
62   
63       /**
64        * Returns the initialisation views.
65        * 
66        * @return the <tt>initViews</tt>
67        */
68       public Set<InitView> getInitViews() {
69           return this.initViews;
70       }
71   
72       /**
73        * Sets the {@code InitView}s.
74        * 
75        * @param views
76        *            the {@code InitView}s
77        */
78       protected void setInitViews(final Set<InitView> views) {
79           this.initViews = views;
80       }
81   
82       /**
83        * Defines an initialisation view for the statistics by mapping an
84        * identifier string to an action-name representing an "initView" of an
85        * {@code AbstractStatisticsViewController}. These
86        * {@code InitView}s represent the available functions for the
87        * statistics west panel of the pulse website administration UI.
88        * 
89        * @author Daniel Dietz
90        * @version $Revision: 1568 $
91        */
92       @XmlRootElement(name = "init-view")
93       @XmlAccessorOrder(XmlAccessOrder.UNDEFINED)
94       @XmlAccessorType(XmlAccessType.FIELD)
95       protected static final class InitView {
96   
97           /**
98            * The position.
99            */
100          @XmlAttribute(name = "position")
101          private int position;
102  
103          /**
104           * The identifier.
105           */
106          @XmlElement(name = "identifier")
107          private String identifier;
108  
109          /**
110           * The command-name.
111           */
112          @XmlElement(name = "command-name")
113          private String commandName;
114  
115          /**
116           * Default constructor.
117           */
118          @Deprecated
119          protected InitView() {
120              super();
121          }
122  
123          /**
124           * Returns the position.
125           * 
126           * @return the <tt>position</tt>
127           */
128          public int getPosition() {
129              return this.position;
130          }
131  
132          /**
133           * Returns the command-name.
134           * 
135           * @return the <tt>commandName</tt>
136           */
137          public String getCommandName() {
138              return this.commandName;
139          }
140  
141          /**
142           * Returns the identifier.
143           * 
144           * @return the <tt>identifier</tt>
145           */
146          public String getIdentifier() {
147              return this.identifier;
148          }
149  
150      }
151  
152  }
153