KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > web > talk > jspbeans > ChatUnregisteredAppletTag


1 /*
2  * ChatScriptTag.java
3  *
4  * Created on April 4, 2004, 8:42 AM
5  */

6
7 package com.quikj.application.web.talk.jspbeans;
8
9 import javax.servlet.http.*;
10 import javax.servlet.jsp.*;
11 import java.io.*;
12
13 /**
14  *
15  * @author amit
16  */

17 public class ChatUnregisteredAppletTag extends javax.servlet.jsp.tagext.TagSupport JavaDoc
18 {
19     
20     /** Holds value of property clientType. */
21     private String JavaDoc clientType = "JAVA";
22     
23     /** Holds value of property width. */
24     private String JavaDoc width = "95";
25     
26     /** Holds value of property height. */
27     private String JavaDoc height = "65";
28     
29     /** Holds value of property port. */
30     private String JavaDoc port = "8087";
31     
32     /** Holds value of property plugin. */
33     private String JavaDoc plugin = "2";
34     
35     /** Holds value of property codebase. */
36     private String JavaDoc codebase;
37     
38     /** Holds value of property image. */
39     private String JavaDoc image = "/aceapp/icons/chat.jpg";
40     
41     /** Holds value of property button. */
42     private String JavaDoc button = "QUIK";
43     
44     /** Holds value of property called. */
45     private String JavaDoc called;
46     
47     /** Holds value of property info. */
48     private String JavaDoc info = "no";
49     
50     /** Holds value of property buzz. */
51     private String JavaDoc buzz = "/aceapp/audio/doorbell.au";
52     
53     /** Holds value of property chime. */
54     private String JavaDoc chime = "/aceapp/audio/chime.au";
55     
56     /** Holds value of property openOnInit. */
57     private String JavaDoc openOnInit = "no";
58     
59     /** Holds value of property language. */
60     private String JavaDoc language = "English";
61     
62     /** Holds value of property caption. */
63     private String JavaDoc caption = "Ace Operator Contact Center";
64     
65     /** Holds value of property logo. */
66     private String JavaDoc logo = "/aceapp/icons/chat2.jpg";
67     
68     /** Holds value of property displaySessionInfo. */
69     private String JavaDoc displaySessionInfo = "yes";
70     
71     private String JavaDoc allowSendBuzz = "yes";
72     
73     private String JavaDoc allowSendWebPage = "yes";
74     
75  
76     /** Creates a new instance of ChatScriptTag */
77     public ChatUnregisteredAppletTag()
78     {
79     }
80     
81     public int doStartTag()
82     {
83         try
84         {
85             JspWriter out = pageContext.getOut();
86             HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
87             String JavaDoc context = request.getContextPath();
88             ContactCenterCustomerProperty customer
89             = (ContactCenterCustomerProperty)request.getAttribute("customerProperty");
90             ContactCenterUnrestrictedAccessForm form
91             = (ContactCenterUnrestrictedAccessForm)request.getAttribute("formBean");
92             
93             out.println("<applet"
94             + " archive=\""
95             + context + "/aceapp/applets/TalkClient.jar,"
96             + context + "/aceapp/applets/AceClient.jar,"
97             + context + "/aceapp/applets/AceClientBeans.jar,"
98             + context + "/aceapp/applets/PluginAppTalkMessaging.jar,"
99             + context + "/aceapp/applets/nanoxml-2.2.1.jar,"
100             + context + "/aceapp/applets/jdes.jar,"
101             + context + "/aceapp/applets/MessageBoxClient.jar,"
102             + context + "/aceapp/applets/TalkWhiteBoardApp.jar,"
103             + context + "/aceapp/applets/TalkTextBoardApp.jar\"");
104             
105             out.println (" code=\"com.quikj.application.web.talk.client.TalkApplet.class\"");
106             out.println (" width=\"" + width
107             + "\" height=\"" + height
108             + "\" name=\"chat_applet\"");
109             
110             if (codebase != null)
111             {
112                 out.println (" codebase=\"" + codebase + "\"");
113             }
114             
115             if (clientType.equals("HTML") == true)
116             {
117                 out.println (" MAYSCRIPT");
118             }
119             out.println (">");
120             
121             out.println ("<param name=\"port\" value=\"" + port + "\">");
122             out.println ("<param name=\"plugin\" value=\"" + plugin + "\">");
123           
124             if (image.length() > 0)
125             {
126                 if (image.startsWith("/") == true)
127                 {
128                     image = context + image;
129                 }
130                 
131                 out.println("<param name=\"image\" value=\"" + image + "\">");
132             }
133             
134             if (button.length() > 0)
135             {
136                 out.println ("<param name=\"button\" value=\"" + button + "\">");
137             }
138             
139             out.println ("<param name=\"unregistered\" value=\"yes\">");
140             
141             if ((called.equals("@config") == true) && (customer != null))
142             {
143                 called = customer.getOperator();
144             }
145             out.println("<param name=\"called\" value=\""
146             + called + "\">");
147             
148             if ((info.equals("@config") == true) && (form != null))
149             {
150                 info = form.getInfo();
151             }
152             out.println("<param name=\"info\" value=\"" +
153             info + "\">");
154             
155             if (buzz.startsWith("/") == true)
156             {
157                 buzz = context + buzz;
158             }
159             out.println ("<param name=\"buzz\" value=\""
160             + buzz + "\">");
161             
162             if (chime.startsWith("/") == true)
163             {
164                 chime = context + chime;
165             }
166             out.println ("<param name=\"chime\" value=\""
167             + chime + "\">");
168             
169             if (clientType.equals("HTML") == true)
170             {
171                 openOnInit="yes";
172             }
173             out.println ("<param name=\"open-on-init\" value=\""
174             + openOnInit + "\">");
175             
176             
177             if ((language.equals("@config") == true) && (customer != null))
178             {
179                 language = customer.getLanguage();
180             }
181             out.println ("<param name=\"language\" value=\""
182             + language + "\">");
183             
184             out.println("<param name=\"caption\" value=\""
185             + caption + "\">");
186             
187             if (logo.startsWith("/") == true)
188             {
189                 logo = context + logo;
190             }
191             out.println ("<param name=\"logo\" value=\""
192             + logo + "\">");
193             
194             out.println("<param name=\"display-session-info\" value=\""
195             + displaySessionInfo + "\">");
196     
197             out.println("<param name=\"allow-send-buzz\" value=\""
198                     + allowSendBuzz + "\">");
199             
200             out.println("<param name=\"allow-send-webpage\" value=\""
201                     + allowSendWebPage + "\">");
202             
203             out.println ("<param name=\"client-type\" value=\""
204             + clientType + "\">");
205             
206         }
207         catch (IOException ex)
208         {
209             return SKIP_PAGE;
210         }
211         
212         return EVAL_BODY_INCLUDE;
213     }
214     
215     public int doEndTag()
216     {
217         try
218         {
219             JspWriter out = pageContext.getOut();
220             out.println ("</applet>");
221         }
222         catch (IOException ex)
223         {
224             return SKIP_PAGE;
225         }
226         return EVAL_PAGE;
227     }
228     
229     /** Getter for property clientType.
230      * @return Value of property clientType.
231      *
232      */

233     public String JavaDoc getClientType()
234     {
235         return this.clientType;
236     }
237     
238     /** Setter for property clientType.
239      * @param clientType New value of property clientType.
240      *
241      */

242     public void setClientType(String JavaDoc clientType)
243     {
244         this.clientType = clientType;
245     }
246     
247     /** Getter for property width.
248      * @return Value of property width.
249      *
250      */

251     public String JavaDoc getWidth()
252     {
253         return this.width;
254     }
255     
256     /** Setter for property width.
257      * @param width New value of property width.
258      *
259      */

260     public void setWidth(String JavaDoc width)
261     {
262         this.width = width;
263     }
264     
265     /** Getter for property height.
266      * @return Value of property height.
267      *
268      */

269     public String JavaDoc getHeight()
270     {
271         return this.height;
272     }
273     
274     /** Setter for property height.
275      * @param height New value of property height.
276      *
277      */

278     public void setHeight(String JavaDoc height)
279     {
280         this.height = height;
281     }
282     
283     /** Getter for property port.
284      * @return Value of property port.
285      *
286      */

287     public String JavaDoc getPort()
288     {
289         return this.port;
290     }
291     
292     /** Setter for property port.
293      * @param port New value of property port.
294      *
295      */

296     public void setPort(String JavaDoc port)
297     {
298         this.port = port;
299     }
300     
301     /** Getter for property plugin.
302      * @return Value of property plugin.
303      *
304      */

305     public String JavaDoc getPlugin()
306     {
307         return this.plugin;
308     }
309     
310     /** Setter for property plugin.
311      * @param plugin New value of property plugin.
312      *
313      */

314     public void setPlugin(String JavaDoc plugin)
315     {
316         this.plugin = plugin;
317     }
318     
319     /** Getter for property codebase.
320      * @return Value of property codebase.
321      *
322      */

323     public String JavaDoc getCodebase()
324     {
325         return this.codebase;
326     }
327     
328     /** Setter for property codebase.
329      * @param codebase New value of property codebase.
330      *
331      */

332     public void setCodebase(String JavaDoc codebase)
333     {
334         this.codebase = codebase;
335     }
336     
337     /** Getter for property image.
338      * @return Value of property image.
339      *
340      */

341     public String JavaDoc getImage()
342     {
343         return this.image;
344     }
345     
346     /** Setter for property image.
347      * @param image New value of property image.
348      *
349      */

350     public void setImage(String JavaDoc image)
351     {
352         this.image = image;
353     }
354     
355     /** Getter for property button.
356      * @return Value of property button.
357      *
358      */

359     public String JavaDoc getButton()
360     {
361         return this.button;
362     }
363     
364     /** Setter for property button.
365      * @param button New value of property button.
366      *
367      */

368     public void setButton(String JavaDoc button)
369     {
370         this.button = button;
371     }
372     
373     /** Getter for property called.
374      * @return Value of property called.
375      *
376      */

377     public String JavaDoc getCalled()
378     {
379         return this.called;
380     }
381     
382     /** Setter for property called.
383      * @param called New value of property called.
384      *
385      */

386     public void setCalled(String JavaDoc called)
387     {
388         this.called = called;
389     }
390     
391     /** Getter for property info.
392      * @return Value of property info.
393      *
394      */

395     public String JavaDoc getInfo()
396     {
397         return this.info;
398     }
399     
400     /** Setter for property info.
401      * @param info New value of property info.
402      *
403      */

404     public void setInfo(String JavaDoc info)
405     {
406         this.info = info;
407     }
408     
409     /** Getter for property buzz.
410      * @return Value of property buzz.
411      *
412      */

413     public String JavaDoc getBuzz()
414     {
415         return this.buzz;
416     }
417     
418     /** Setter for property buzz.
419      * @param buzz New value of property buzz.
420      *
421      */

422     public void setBuzz(String JavaDoc buzz)
423     {
424         this.buzz = buzz;
425     }
426     
427     /** Getter for property chime.
428      * @return Value of property chime.
429      *
430      */

431     public String JavaDoc getChime()
432     {
433         return this.chime;
434     }
435     
436     /** Setter for property chime.
437      * @param chime New value of property chime.
438      *
439      */

440     public void setChime(String JavaDoc chime)
441     {
442         this.chime = chime;
443     }
444     
445     /** Getter for property openOnInit.
446      * @return Value of property openOnInit.
447      *
448      */

449     public String JavaDoc getOpenOnInit()
450     {
451         return this.openOnInit;
452     }
453     
454     /** Setter for property openOnInit.
455      * @param openOnInit New value of property openOnInit.
456      *
457      */

458     public void setOpenOnInit(String JavaDoc openOnInit)
459     {
460         this.openOnInit = openOnInit;
461     }
462     
463     /** Getter for property language.
464      * @return Value of property language.
465      *
466      */

467     public String JavaDoc getLanguage()
468     {
469         return this.language;
470     }
471     
472     /** Setter for property language.
473      * @param language New value of property language.
474      *
475      */

476     public void setLanguage(String JavaDoc language)
477     {
478         this.language = language;
479     }
480     
481     /** Getter for property caption.
482      * @return Value of property caption.
483      *
484      */

485     public String JavaDoc getCaption()
486     {
487         return this.caption;
488     }
489     
490     /** Setter for property caption.
491      * @param caption New value of property caption.
492      *
493      */

494     public void setCaption(String JavaDoc caption)
495     {
496         this.caption = caption;
497     }
498     
499     /** Getter for property logo.
500      * @return Value of property logo.
501      *
502      */

503     public String JavaDoc getLogo()
504     {
505         return this.logo;
506     }
507     
508     /** Setter for property logo.
509      * @param logo New value of property logo.
510      *
511      */

512     public void setLogo(String JavaDoc logo)
513     {
514         this.logo = logo;
515     }
516     
517     /** Getter for property displaySessionInfo.
518      * @return Value of property displaySessionInfo.
519      *
520      */

521     public String JavaDoc getDisplaySessionInfo()
522     {
523         return this.displaySessionInfo;
524     }
525     
526     /** Setter for property displaySessionInfo.
527      * @param displaySessionInfo New value of property displaySessionInfo.
528      *
529      */

530     public void setDisplaySessionInfo(String JavaDoc displaySessionInfo)
531     {
532         this.displaySessionInfo = displaySessionInfo;
533     }
534  
535     /**
536      * @return Returns the allowSendBuzz.
537      */

538     public String JavaDoc getAllowSendBuzz()
539     {
540         return allowSendBuzz;
541     }
542     /**
543      * @param allowSendBuzz The allowSendBuzz to set.
544      */

545     public void setAllowSendBuzz(String JavaDoc allowSendBuzz)
546     {
547         this.allowSendBuzz = allowSendBuzz;
548     }
549     /**
550      * @return Returns the allowSendWebPage.
551      */

552     public String JavaDoc getAllowSendWebPage()
553     {
554         return allowSendWebPage;
555     }
556     /**
557      * @param allowSendWebPage The allowSendWebPage to set.
558      */

559     public void setAllowSendWebPage(String JavaDoc allowSendWebPage)
560     {
561         this.allowSendWebPage = allowSendWebPage;
562     }
563     
564 }
565
Popular Tags