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

File SecureQueryManager.java

 

Coverage histogram

../../../../img/srcFileCovDistChart5.png
74% of files have more coverage

Code metrics

0
2
2
1
67
27
2
1
1
2
1

Classes

Class Line # Actions
SecureQueryManager 40 2 0% 2 2
0.550%
 

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.query.internal;
21   
22    import javax.inject.Inject;
23    import javax.inject.Named;
24    import javax.inject.Singleton;
25   
26    import org.xwiki.component.annotation.Component;
27    import org.xwiki.query.Query;
28    import org.xwiki.query.QueryException;
29    import org.xwiki.query.QueryExecutorManager;
30   
31    /**
32    * QueryManager implementation to use in scripts (uses a secure {@link org.xwiki.query.QueryExecutorManager} which
33    * performs checks for rights).
34    *
35    * @version $Id: 64ae9db2997e318f3ab575f6713a506678c29589 $
36    */
37    @Component
38    @Named("secure")
39    @Singleton
 
40    public class SecureQueryManager extends AbstractQueryManager
41    {
42    /**
43    * {@link QueryExecutorManager} for execute Queries.
44    */
45    @Inject
46    @Named("secure")
47    protected QueryExecutorManager queryExecutorManager;
48   
 
49  844 toggle @Override
50    protected QueryExecutorManager getQueryExecutorManager()
51    {
52  844 return this.queryExecutorManager;
53    }
54   
55    /**
56    * @param statement XWQL statement
57    * @return Query
58    * @throws QueryException if any errors
59    * @see #createQuery(String, String)
60    * @deprecated it's now available from {@link org.xwiki.query.script.QueryManagerScriptService} since 2.4M2
61    */
 
62  0 toggle @Deprecated
63    public Query xwql(String statement) throws QueryException
64    {
65  0 return createQuery(statement, Query.XWQL);
66    }
67    }