View Javadoc

1   /**
2    * Copyright (C) 2005-2009 Alfresco Software Limited.
3    *
4    * This file is part of the Spring Surf Extension project.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *  http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.springframework.extensions.webscripts.jsf;
20  
21  import javax.faces.component.UIComponent;
22  
23  import org.springframework.extensions.webscripts.ui.common.tag.BaseComponentTag;
24  
25  /**
26   * JSF tag class for the UIWebScript component.
27   * 
28   * @author Kevin Roast
29   */
30  public class WebScriptTag extends BaseComponentTag
31  {
32     /**
33      * @see javax.faces.webapp.UIComponentTag#getComponentType()
34      */
35     @Override
36     public String getComponentType()
37     {
38        return "org.alfresco.faces.WebScript";
39     }
40  
41     /**
42      * @see javax.faces.webapp.UIComponentTag#getRendererType()
43      */
44     @Override
45     public String getRendererType()
46     {
47        // the component is self renderering
48        return null;
49     }
50     
51     /**
52      * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
53      */
54     protected void setProperties(UIComponent component)
55     {
56        super.setProperties(component);
57        setStringProperty(component, "scriptUrl", this.scriptUrl);
58        setStringProperty(component, "context", this.context);
59     }
60     
61     /**
62      * @see javax.servlet.jsp.tagext.Tag#release()
63      */
64     public void release()
65     {
66        super.release();
67        this.scriptUrl = null;
68        this.context = null;
69     }
70     
71     /**
72      * Set the script service Url
73      *
74      * @param scriptUrl     the script service Url
75      */
76     public void setScriptUrl(String scriptUrl)
77     {
78        this.scriptUrl = scriptUrl;
79     }
80     
81     /**
82      * Set the script context
83      *
84      * @param context     the script context
85      */
86     public void setContext(String context)
87     {
88        this.context = context;
89     }
90  
91  
92     /** the script context */
93     private String context;
94  
95     /** the scriptUrl */
96     private String scriptUrl;
97  }