View Javadoc

1   package org.apache.turbine.services.pull.tools;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation.
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  /***
20   * This is exactly the same thing as TemplateLink but it returns a
21   * relative link on toString(). Everything else is identical. This class is
22   * here for legacy purposes if you used the old org.apache.turbine.util.template.RelativeLink
23   * class and have lots of templates which you don't want to rewrite.
24   *
25   * <p>
26   * For new Code please use TemplateLink and get a relative Link with $link.RelativeLink and
27   * the URI without resetting the query_data and path_info with $link.RelativeURI
28   *
29   * <p>
30   *
31   * This is an application pull tool for the template system. You should <b>not</b>
32   * use it in a normal application!
33   *
34   * @deprecated Use {@link org.apache.turbine.services.pull.tools.TemplateLink} with the
35   * {@link org.apache.turbine.services.pull.tools.TemplateLink#getRelativeLink} method.
36   *
37   * @author <a href="jmcnally@collab.net">John D. McNally</a>
38   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
39   * @version $Id: RelativeTemplateLink.java 264148 2005-08-29 14:21:04Z henning $
40   */
41  public class RelativeTemplateLink
42      extends TemplateLink
43  {
44      /***
45       * Default constructor
46       * <p>
47       * The init method must be called before use.
48       */
49      public RelativeTemplateLink()
50      {
51          super();
52      }
53  
54      /***
55       * Returns the URI. After rendering the URI, it clears the
56       * pathInfo and QueryString portions of the TemplateURI. Equivalent
57       * to the getRelativeLink() method of this class.
58       *
59       * @return A String with the URI in the form
60       * /Turbine/template/index.wm/hello/world
61       */
62      public String toString()
63      {
64          return getRelativeLink();
65      }
66  }