1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.portal.kernel.util.StringPool;
18  import com.liferay.portal.kernel.util.Validator;
19  import com.liferay.taglib.util.IncludeTag;
20  
21  import javax.servlet.http.HttpServletRequest;
22  
23  /**
24   * <a href="FlashTag.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   */
28  public class FlashTag extends IncludeTag {
29  
30      public void setAlign(String align) {
31          if (Validator.isNotNull(align)) {
32              _align = align;
33          }
34      }
35  
36      public void setAllowFullScreen(String allowFullScreen) {
37          if (Validator.isNotNull(allowFullScreen)) {
38              _allowFullScreen = allowFullScreen;
39          }
40      }
41  
42      public void setAllowScriptAccess(String allowScriptAccess) {
43          if (Validator.isNotNull(allowScriptAccess)) {
44              _allowScriptAccess = allowScriptAccess;
45          }
46      }
47  
48      public void setBase(String base) {
49          if (Validator.isNotNull(base)) {
50              _base = base;
51          }
52      }
53  
54      public void setBgcolor(String bgcolor) {
55          if (Validator.isNotNull(bgcolor)) {
56              _bgcolor = bgcolor;
57          }
58      }
59  
60      public void setDevicefont(String devicefont) {
61          if (Validator.isNotNull(devicefont)) {
62              _devicefont = devicefont;
63          }
64      }
65  
66      public void setFlashvars(String flashvars) {
67          if (Validator.isNotNull(flashvars)) {
68              _flashvars = flashvars;
69          }
70      }
71  
72      public void setHeight(String height) {
73          if (Validator.isNotNull(height)) {
74              _height = height;
75          }
76      }
77  
78      public void setId(String id) {
79          if (Validator.isNotNull(id)) {
80              _id = id;
81          }
82      }
83  
84      public void setLoop(String loop) {
85          if (Validator.isNotNull(loop)) {
86              _loop = loop;
87          }
88      }
89  
90      public void setMenu(String menu) {
91          if (Validator.isNotNull(menu)) {
92              _menu = menu;
93          }
94      }
95  
96      public void setMovie(String movie) {
97          _movie = movie;
98      }
99  
100     public void setPlay(String play) {
101         if (Validator.isNotNull(play)) {
102             _play = play;
103         }
104     }
105 
106     public void setQuality(String quality) {
107         if (Validator.isNotNull(quality)) {
108             _quality = quality;
109         }
110     }
111 
112     public void setSalign(String salign) {
113         if (Validator.isNotNull(salign)) {
114             _salign = salign;
115         }
116     }
117 
118     public void setScale(String scale) {
119         if (Validator.isNotNull(scale)) {
120             _scale = scale;
121         }
122     }
123 
124     public void setSwliveconnect(String swliveconnect) {
125         if (Validator.isNotNull(swliveconnect)) {
126             _swliveconnect = swliveconnect;
127         }
128     }
129 
130     public void setVersion(String version) {
131         if (Validator.isNotNull(version)) {
132             _version = version;
133         }
134     }
135 
136     public void setWidth(String width) {
137         if (Validator.isNotNull(width)) {
138             _width = width;
139         }
140     }
141 
142     public void setWmode(String wmode) {
143         if (Validator.isNotNull(wmode)) {
144             _wmode = wmode;
145         }
146     }
147 
148     protected void cleanUp() {
149         _align = "left";
150         _allowFullScreen = Boolean.FALSE.toString();
151         _allowScriptAccess = "sameDomain";
152         _base = StringPool.PERIOD;
153         _bgcolor = "#FFFFFF";
154         _devicefont = Boolean.TRUE.toString();
155         _flashvars = StringPool.BLANK;
156         _height = "500";
157         _id = StringPool.BLANK;
158         _loop = Boolean.TRUE.toString();
159         _menu = Boolean.FALSE.toString();
160         _movie = StringPool.BLANK;
161         _play = Boolean.FALSE.toString();
162         _quality = "best";
163         _salign = StringPool.BLANK;
164         _scale = "showall";
165         _swliveconnect = Boolean.FALSE.toString();
166         _version = "7";
167         _width = "100%";
168         _wmode = "opaque";
169     }
170 
171     protected String getPage() {
172         return _PAGE;
173     }
174 
175     protected void setAttributes(HttpServletRequest request) {
176         request.setAttribute("liferay-ui:flash:align", _align);
177         request.setAttribute(
178             "liferay-ui:flash:allowFullScreen", _allowFullScreen);
179         request.setAttribute(
180             "liferay-ui:flash:allowScriptAccess", _allowScriptAccess);
181         request.setAttribute("liferay-ui:flash:base", _base);
182         request.setAttribute("liferay-ui:flash:bgcolor", _bgcolor);
183         request.setAttribute("liferay-ui:flash:devicefont", _devicefont);
184         request.setAttribute("liferay-ui:flash:flashvars", _flashvars);
185         request.setAttribute("liferay-ui:flash:height", _height);
186         request.setAttribute("liferay-ui:flash:id", _id);
187         request.setAttribute("liferay-ui:flash:loop", _loop);
188         request.setAttribute("liferay-ui:flash:menu", _menu);
189         request.setAttribute("liferay-ui:flash:movie", _movie);
190         request.setAttribute("liferay-ui:flash:play", _play);
191         request.setAttribute("liferay-ui:flash:quality", _quality);
192         request.setAttribute("liferay-ui:flash:salign", _salign);
193         request.setAttribute("liferay-ui:flash:scale", _scale);
194         request.setAttribute("liferay-ui:flash:swliveconnect", _swliveconnect);
195         request.setAttribute("liferay-ui:flash:version", _version);
196         request.setAttribute("liferay-ui:flash:width", _width);
197         request.setAttribute("liferay-ui:flash:wmode", _wmode);
198     }
199 
200     private static final String _PAGE = "/html/taglib/ui/flash/page.jsp";
201 
202     private String _align = "left";
203     private String _allowFullScreen = Boolean.FALSE.toString();
204     private String _allowScriptAccess = "sameDomain";
205     private String _base = StringPool.PERIOD;
206     private String _bgcolor = "#FFFFFF";
207     private String _devicefont = Boolean.TRUE.toString();
208     private String _flashvars = StringPool.BLANK;
209     private String _height = "500";
210     private String _id = StringPool.BLANK;
211     private String _loop = Boolean.TRUE.toString();
212     private String _menu = Boolean.FALSE.toString();
213     private String _movie = StringPool.BLANK;
214     private String _play = Boolean.FALSE.toString();
215     private String _quality = "best";
216     private String _salign = StringPool.BLANK;
217     private String _scale = "showall";
218     private String _swliveconnect = Boolean.FALSE.toString();
219     private String _version = "7";
220     private String _width = "100%";
221     private String _wmode = "opaque";
222 
223 }