001/* 002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl-2.1.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Thomas Roger 016 */ 017 018package org.nuxeo.search.ui.codec; 019 020import org.apache.commons.logging.Log; 021import org.apache.commons.logging.LogFactory; 022import org.nuxeo.ecm.platform.url.api.DocumentView; 023import org.nuxeo.ecm.platform.url.codec.DocumentPathCodec; 024 025/** 026 * Codec used for 'nxsearch' URLs. 027 * 028 * @since 6.0 029 */ 030public class SearchCodec extends DocumentPathCodec { 031 032 private static final Log log = LogFactory.getLog(SearchCodec.class); 033 034 public static final String PREFIX = "nxsearch"; 035 036 @Override 037 public String getPrefix() { 038 if (prefix != null) { 039 return prefix; 040 } 041 return PREFIX; 042 } 043 044 /** 045 * Never handle document views: this codec is useless on post requests. 046 */ 047 @Override 048 public boolean handleDocumentView(DocumentView docView) { 049 return false; 050 } 051 052}