1 package org.apache.turbine.services.urlmapper;
2
3
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 */
22
23 import org.apache.fulcrum.parser.ParameterParser;
24 import org.apache.turbine.services.Service;
25 import org.apache.turbine.util.uri.TurbineURI;
26
27 /**
28 * The URL mapper service provides methods to map a set of parameters to a
29 * simplified URL and vice-versa. This service was inspired by the
30 * Liferay Friendly URL Mapper.
31 *
32 * A mapper valve and a link pull tool are provided for easy application.
33 *
34 * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
35 */
36 public interface URLMapperService extends Service
37 {
38 /**
39 * The service identifier.
40 */
41 String SERVICE_NAME = "URLMapperService";
42
43 /**
44 * Map a set of parameters (contained in TurbineURI PathInfo and QueryData)
45 * to a TurbineURI
46 *
47 * @param uri the URI to be modified (with setScriptName())
48 */
49 void mapToURL(TurbineURI uri);
50
51 /**
52 * Map a simplified URL to a set of parameters
53 *
54 * @param url the URL
55 * @param pp a ParameterParser to use for parameter mangling
56 */
57 void mapFromURL(String url, ParameterParser pp);
58 }