View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.locator;
18  
19  /***
20   * LocatorDescriptor
21   *
22   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
23   * @version $Id: LocatorDescriptor.java 516448 2007-03-09 16:25:47Z ate $
24   */
25  public interface LocatorDescriptor
26  {
27      public final static String PARAM_TYPE               = "type";    
28      public final static String PARAM_MEDIA_TYPE         = "media-type";
29      public final static String PARAM_NAME               = "name";
30      public final static String PARAM_LANGUAGE           = "language";
31      public final static String PARAM_COUNTRY            = "country";    
32      public final static String TYPE_EMAIL               = "emails";
33      public final static String TYPE_PORTLET             = "portlets";
34      
35    
36      /*
37       * Gets the unique template locator string, which is a combination of the params
38       * The string must follow the one the sequences below, where bracketed items are optional:
39       *
40       *   template/<templateType>/[media-type/<mediaType>]/[language/<language>]/[country/<country>]]/name/<templateName
41       *
42       * @return The template locator as a string
43       */
44      String toString();
45  
46      /*
47       * Gets the path locator string, which is a combination of the params without the name tags.
48       * The string must follow the one the sequences below, where bracketed items are optional:
49       *
50       *   <templateType>/[<mediaType>]/[<language>]/[<country>]]/<templateName>
51       *
52       * @return The template locator path
53       */
54      String toPath();
55      
56      /*
57       * Gets the template type parameter for this template.
58       * Any value is valid if there the service supports it.
59       * Known values are email, portlet.
60       *
61       * @return The template type parameter for this template.
62       */
63      String getType();
64  
65      /*
66       * Sets the template type parameter for this template.
67       * Any value is valid if there the service supports it.
68       * Known values are email, portlet.
69       *
70       * @param The template type parameter for this template.
71       */
72      void setType(String type);
73  
74      /*
75       * Gets the resource name parameter for this template.
76       *
77       * @return The resource name parameter for this template.
78       */
79      String getName();
80  
81      /*
82       * Sets the resource name parameter for this template.
83       *
84       * @param name The resource name parameter for this template.
85       */
86      void setName(String name);
87  
88      /*
89       * Gets the media type parameter for this template.
90       * Media types are values such as html, wml, xml ...
91       * TODO: support for 2 or more media types
92       * 
93       * @return The media type parameter for this template.
94       */
95       String getMediaType();
96  
97      /*
98       * Sets the media type parameter for this template.
99       * Media types are values such as html, wml, xml ...
100      * TODO: support for 2 or more media types
101      *
102      * @param mediaType The media type parameter for this template.
103      */
104      void setMediaType(String mediaType);
105 
106     /*
107      * Gets the language parameter for this template.
108      * Language values are ISO-639 standard language abbreviations
109      * en, fr, de, ...
110      *
111      * @return The language parameter for this template.
112      */
113      String getLanguage();
114 
115     /*
116      * Sets the language parameter for this template.
117      * Language values are ISO-639 standard language abbreviations
118      * en, fr, de, ...
119      *
120      * @param language The language parameter for this template.
121      */
122      void setLanguage(String language);
123 
124     /*
125      * Gets the country code parameter for this template.
126      * Country code values are ISO-3166 standard country code abbreviations.
127      * GB, US, FR, CA, DE, ...
128      *
129      * @return The country code parameter for this template.
130      */
131      String getCountry();
132 
133     /*
134      * Sets the country code parameter for this template.
135      * Country code values are ISO-3166 standard country code abbreviations.
136      * GB, US, FR, CA, DE, ...
137      *
138      * @param country The country code parameter for this template.
139      */
140      void setCountry(String country);
141 
142  
143     /***
144      * @see Object#clone
145      * @return an instance copy of this object
146      */
147      Object clone() throws java.lang.CloneNotSupportedException;
148     
149 }