View Javadoc

1   package org.apache.turbine.services.pull.tools;
2   
3   
4   /*
5    * Copyright 2001-2004 The Apache Software Foundation.
6    *
7    * Licensed under the Apache License, Version 2.0 (the "License")
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  
21  import org.apache.turbine.services.pull.ApplicationTool;
22  
23  /***
24   * This class allows one to specify paths in the setPage method 
25   * using '/' slash as opposed to the ',' used in TemplateLink.
26   * It is less efficient as the '/' are converted to ',' to avoid
27   * problems parsing the pathinfo after conversion in a web server. 
28   * 
29   * It is recommended that projects standardize on using the ',' 
30   * separator and use TemplateLink.  But this class is available for
31   * those who do not mind the inefficiency.
32   *
33   * <p>
34   *
35   * This is an application pull tool for the template system. You should <b>not</b>
36   * use it in a normal application!
37   *
38   * @deprecated Use {@link org.apache.turbine.services.pull.tools.TemplateLink} instead and fix up your template references.
39   *
40   * @author <a href="jmcnally@collab.net">John D. McNally</a>
41   * @version $Id: TemplateLinkWithSlash.java 222043 2004-12-06 17:47:33Z painter $
42   */
43  public class TemplateLinkWithSlash
44      extends TemplateLink
45      implements ApplicationTool
46  
47  {
48      /***
49       * Default constructor
50       * <p>
51       * The init method must be called before use.
52       */
53      public TemplateLinkWithSlash()
54      {
55          super();
56      }
57      
58      /***
59       * Sets the template variable used by the Template Service.
60       * This method allows slashes '/' as the path separator.
61       *
62       * @param t A String with the template name.
63       * @return A TemplateLink.
64       */
65      public TemplateLink setPage(String template)
66      {
67          super.setPage( template.replace('/', ',') );
68          return this;
69      }
70  }
71  
72