001package org.apache.turbine.services.urlmapper;
002
003
004/*
005 * Licensed to the Apache Software Foundation (ASF) under one
006 * or more contributor license agreements.  See the NOTICE file
007 * distributed with this work for additional information
008 * regarding copyright ownership.  The ASF licenses this file
009 * to you under the Apache License, Version 2.0 (the
010 * "License"); you may not use this file except in compliance
011 * with the License.  You may obtain a copy of the License at
012 *
013 *   http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing,
016 * software distributed under the License is distributed on an
017 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
018 * KIND, either express or implied.  See the License for the
019 * specific language governing permissions and limitations
020 * under the License.
021 */
022
023import org.apache.fulcrum.parser.ParameterParser;
024import org.apache.turbine.services.Service;
025import org.apache.turbine.util.uri.TurbineURI;
026
027/**
028 * The URL mapper service provides methods to map a set of parameters to a
029 * simplified URL and vice-versa. This service was inspired by the
030 * Liferay Friendly URL Mapper.
031 *
032 * A mapper valve and a link pull tool are provided for easy application.
033 *
034 * @author <a href="mailto:tv@apache.org">Thomas Vandahl</a>
035 */
036public interface URLMapperService extends Service
037{
038    /**
039     * The service identifier.
040     */
041    String SERVICE_NAME = "URLMapperService";
042
043    /**
044     * Map a set of parameters (contained in TurbineURI PathInfo and QueryData)
045     * to a TurbineURI
046     *
047     * @param uri the URI to be modified (with setScriptName())
048     */
049    void mapToURL(TurbineURI uri);
050
051    /**
052     * Map a simplified URL to a set of parameters
053     *
054     * @param url the URL
055     * @param pp a ParameterParser to use for parameter mangling
056     */
057    void mapFromURL(String url, ParameterParser pp);
058}