Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
SkinExtension | 33 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.skinx; | |
21 | ||
22 | import java.util.Map; | |
23 | ||
24 | import org.xwiki.component.annotation.Role; | |
25 | ||
26 | /** | |
27 | * Allows a component to use a skin file (js or css), in the current page being rendered. | |
28 | * | |
29 | * @version $Id: 5132bf560cd181c973fc007c18c1201fe3ed1433 $ | |
30 | * @since 3.0M1 | |
31 | */ | |
32 | @Role | |
33 | public interface SkinExtension | |
34 | { | |
35 | /** | |
36 | * Mark a resource as used in the current result. A resource is registered only once per request, further calls will | |
37 | * not result in additional links, even if it is pulled with different parameters. | |
38 | * | |
39 | * @param resource The name of the resource to pull. | |
40 | */ | |
41 | void use(String resource); | |
42 | ||
43 | /** | |
44 | * Mark a skin extension document as used in the current result, together with some parameters. How the parameters | |
45 | * are used, depends on the type of resource being pulled. For example, JS and CSS extensions use the parameters in | |
46 | * the resulting URL, while Link extensions use the parameters as attributes of the link tag. A resource is | |
47 | * registered only once per request, further calls will not result in additional links, even if it is pulled with | |
48 | * different parameters. If more than one calls per request are made, the parameters used are the ones from the last | |
49 | * call (or none, if the last call did not specify any parameters). | |
50 | * <br> | |
51 | * TODO: document here the parameters that can be used and their meaning. | |
52 | * | |
53 | * @param resource The name of the resource to pull. | |
54 | * @param parameters The parameters for this resource. | |
55 | */ | |
56 | void use(String resource, Map<String, Object> parameters); | |
57 | } |