001/*
002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Thomas Roger
018 */
019
020package org.nuxeo.search.ui.codec;
021
022import org.apache.commons.logging.Log;
023import org.apache.commons.logging.LogFactory;
024import org.nuxeo.ecm.platform.url.api.DocumentView;
025import org.nuxeo.ecm.platform.url.codec.DocumentPathCodec;
026
027/**
028 * Codec used for 'nxsearch' URLs.
029 *
030 * @since 6.0
031 */
032public class SearchCodec extends DocumentPathCodec {
033
034    private static final Log log = LogFactory.getLog(SearchCodec.class);
035
036    public static final String PREFIX = "nxsearch";
037
038    @Override
039    public String getPrefix() {
040        if (prefix != null) {
041            return prefix;
042        }
043        return PREFIX;
044    }
045
046    /**
047     * Never handle document views: this codec is useless on post requests.
048     */
049    @Override
050    public boolean handleDocumentView(DocumentView docView) {
051        return false;
052    }
053
054}