1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.plugin.skinx

File SkinFileExtensionPluginApi.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
5
3
1
76
22
3
0.6
1.67
3
1

Classes

Class Line # Actions
SkinFileExtensionPluginApi 35 5 0% 3 0
1.0100%
 

Contributing tests

No tests hitting this source file were found.

Source view

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   
21    package com.xpn.xwiki.plugin.skinx;
22   
23    import java.util.HashMap;
24    import java.util.Map;
25   
26    import com.xpn.xwiki.XWikiContext;
27   
28    /**
29    * API for the SkinExtension Plugin.
30    *
31    * @see com.xpn.xwiki.plugin.PluginApi
32    * @see SkinExtensionPluginApi
33    * @version $Id: 2ab98e4a5eb11a57f56541ca9ef13e2ec6080e50 $
34    */
 
35    public class SkinFileExtensionPluginApi extends SkinExtensionPluginApi
36    {
37    /**
38    * XWiki Plugin API constructor.
39    *
40    * @param plugin The wrapped plugin.
41    * @param context The current request context.
42    * @see com.xpn.xwiki.plugin.PluginApi#PluginApi(com.xpn.xwiki.plugin.XWikiPluginInterface, XWikiContext)
43    */
 
44  15968 toggle public SkinFileExtensionPluginApi(AbstractSkinExtensionPlugin plugin, XWikiContext context)
45    {
46  15967 super(plugin, context);
47    }
48   
49    /**
50    * Mark a resource as used in the current result. A resource is registered only once per request, further calls will
51    * not result in additional links, even if it is pulled with different parameters.
52    *
53    * @param resource The name of the resource to pull.
54    * @see AbstractSkinExtensionPlugin#use(String, XWikiContext)
55    */
 
56  1174 toggle @Override
57    public void use(String resource)
58    {
59  1174 this.use(resource, false);
60    }
61   
62    /**
63    * Mark a resource as used in the current result. A resource is registered only once per request, further calls will
64    * not result in additional links, even if it is pulled with different parameters.
65    *
66    * @param resource The name of the resource to pull.
67    * @param forceSkinAction True if the resource should be pulled by the 'skin' action.
68    * @see AbstractSkinExtensionPlugin#use(String, XWikiContext)
69    */
 
70  8920 toggle public void use(String resource, boolean forceSkinAction)
71    {
72  8920 Map<String, Object> parameters = new HashMap<String, Object>();
73  8920 parameters.put("forceSkinAction", forceSkinAction);
74  8920 this.getProtectedPlugin().use(resource, parameters, getXWikiContext());
75    }
76    }