001/* 002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors. 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 * Anahide Tchertchian 016 */ 017 018package org.nuxeo.ecm.web.resources.api; 019 020import java.io.Serializable; 021import java.util.List; 022 023/** 024 * Typed Web resource (js, css, bundle). 025 * 026 * @since 7.3 027 */ 028public interface Resource extends Serializable { 029 030 /** 031 * Marker for Nuxeo web resources, used by URI locators. 032 */ 033 public static final String PREFIX = "nuxeo:"; 034 035 String getName(); 036 037 String getType(); 038 039 String getPath(); 040 041 String getURI(); 042 043 /** 044 * Returns an optional target to push resources to in the page. 045 * <p> 046 * Currently only useful to JSF resources. 047 * 048 * @since 7.10 049 */ 050 String getTarget(); 051 052 /** 053 * Names of the resource dependencies. 054 */ 055 List<String> getDependencies(); 056 057 /** 058 * Names of the resource processors, hooking features like flavor replacement on the resource. 059 */ 060 List<String> getProcessors(); 061 062 /** 063 * Returns true if resource can be minimized. 064 * <p> 065 * Returns true by default if not specified. 066 */ 067 boolean isShrinkable(); 068 069}