1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.internal.configuration

File RenderingConfigClassDocumentConfigurationSource.java

 

Coverage histogram

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

Code metrics

0
3
3
1
74
33
3
1
1
3
1

Classes

Class Line # Actions
RenderingConfigClassDocumentConfigurationSource 41 3 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    package org.xwiki.rendering.internal.configuration;
21   
22    import javax.inject.Named;
23    import javax.inject.Singleton;
24   
25    import org.xwiki.component.annotation.Component;
26    import org.xwiki.configuration.internal.AbstractDocumentConfigurationSource;
27    import org.xwiki.model.reference.DocumentReference;
28    import org.xwiki.model.reference.LocalDocumentReference;
29   
30    /**
31    * Provides configuration from the {@code Rendering.RenderingConfigClass} document in the current wiki.
32    * If the {@code Rendering.RenderingConfigClass} xobject exists in the {@code Rendering.RenderingConfig} document then
33    * always use configuration values from it and if it doesn't then use the passed default value.
34    *
35    * @version $Id: 21cd7cde5ab05e048aea514b630e588addaf1dd5 $
36    * @since 8.2M1
37    */
38    @Component
39    @Named("rendering")
40    @Singleton
 
41    public class RenderingConfigClassDocumentConfigurationSource extends AbstractDocumentConfigurationSource
42    {
43    private static final String RENDERING_SPACE = "Rendering";
44   
45    /**
46    * The local reference of the {@code Rendering.RenderingConfigClass} xclass.
47    */
48    private static final LocalDocumentReference CLASS_REFERENCE =
49    new LocalDocumentReference(RENDERING_SPACE, "RenderingConfigClass");
50   
51    /**
52    * The local reference of the {@code Rendering.RenderingConfig} document.
53    */
54    private static final LocalDocumentReference DOC_REFERENCE =
55    new LocalDocumentReference(RENDERING_SPACE, "RenderingConfig");
56   
 
57  540 toggle @Override
58    protected String getCacheId()
59    {
60  540 return "configuration.document.rendering";
61    }
62   
 
63  10 toggle @Override
64    protected DocumentReference getDocumentReference()
65    {
66  10 return new DocumentReference(DOC_REFERENCE, getCurrentWikiReference());
67    }
68   
 
69  47 toggle @Override
70    protected LocalDocumentReference getClassReference()
71    {
72  47 return CLASS_REFERENCE;
73    }
74    }