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

File WikiComponentBridge.java

 

Code metrics

0
0
0
1
125
25
0
-
-
0
-

Classes

Class Line # Actions
WikiComponentBridge 41 0 - 0 0
-1.0 -
 

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.component.wiki.internal.bridge;
21   
22    import java.lang.reflect.Type;
23    import java.util.List;
24    import java.util.Map;
25   
26    import org.xwiki.component.annotation.Role;
27    import org.xwiki.component.descriptor.ComponentDescriptor;
28    import org.xwiki.component.wiki.WikiComponentException;
29    import org.xwiki.component.wiki.WikiComponentScope;
30    import org.xwiki.model.reference.DocumentReference;
31    import org.xwiki.rendering.block.XDOM;
32    import org.xwiki.rendering.syntax.Syntax;
33   
34    /**
35    * A bridge allowing to isolate the {@link org.xwiki.component.wiki.WikiComponentManager} from the old model.
36    *
37    * @version $Id: d58e6c3e7ec81944ff22a301112826fbf31a1747 $
38    * @since 4.3M2
39    */
40    @Role
 
41    public interface WikiComponentBridge
42    {
43    /**
44    * Get the syntax of a document.
45    *
46    * @param reference a reference to a document holding a component
47    * @return the syntax of the given document
48    * @throws WikiComponentException if the document can't be retrieved
49    */
50    Syntax getSyntax(DocumentReference reference) throws WikiComponentException;
51   
52    /**
53    * Get a reference to the author of a document.
54    *
55    * @param reference a reference to a document holding a component
56    * @return a reference to the author of the given document
57    * @throws WikiComponentException if the document can't be retrieved
58    */
59    DocumentReference getAuthorReference(DocumentReference reference) throws WikiComponentException;
60   
61    /**
62    * Get the role {@link Type} of a wiki component.
63    *
64    * @param reference a reference to a document holding a component
65    * @return the role {@link Type} of the wiki component.
66    * @throws WikiComponentException if the document can't be retrieved or if it doesn't contain a component definition
67    */
68    Type getRoleType(DocumentReference reference) throws WikiComponentException;
69   
70    /**
71    * Get the role hint of a wiki component.
72    *
73    * @param reference a reference to a document holding a component
74    * @return the role hint of the wiki component.
75    * @throws WikiComponentException if the document can't be retrieved or if it doesn't contain a component definition
76    */
77    String getRoleHint(DocumentReference reference) throws WikiComponentException;
78   
79    /**
80    * Get the scope of a wiki component.
81    *
82    * @param reference a reference to a document holding a component
83    * @return the scope of the wiki component
84    * @throws WikiComponentException if the document can't be retrieved or if it doesn't contain a component definition
85    */
86    WikiComponentScope getScope(DocumentReference reference) throws WikiComponentException;
87   
88    /**
89    * @param reference a reference to a document holding a wiki component
90    * @return the map of component handled methods/method body
91    * @throws WikiComponentException if the document can't be retrieved or if it doesn't contain a component definition
92    */
93    Map<String, XDOM> getHandledMethods(DocumentReference reference) throws WikiComponentException;
94   
95    /**
96    * The array of interfaces declared by a wiki component, if some interfaces can't be found by the
97    * {@link ClassLoader} they will be filtered out and a warning will be displayed in the log.
98    *
99    * @param reference a reference to a document holding a component
100    * @return the array of interfaces declared by the wiki component
101    * @throws WikiComponentException if the document can't be retrieved or if it doesn't contain a component definition
102    */
103    List<Class< ? >> getDeclaredInterfaces(DocumentReference reference) throws WikiComponentException;
104   
105    /**
106    * Retrieve the Map of dependencies declared by the wiki component, if some dependencies can't be found by the
107    * {@link ClassLoader} they will be filtered out a warning will be displayed in the log.
108    *
109    * @param reference a reference to a document holding a component
110    * @return the Map of dependencies declared by the wiki component
111    * @throws WikiComponentException if the document can't be retrieved or if it doesn't contain a component definition
112    */
113    Map<String, ComponentDescriptor> getDependencies(DocumentReference reference) throws WikiComponentException;
114   
115    /**
116    * Determine if the document has been saved by a user with programming rights.
117    *
118    * @param reference a reference to a document
119    * @return true if the document has been saved by a user with programming rights, false otherwise
120    * @throws WikiComponentException if the document can't be retrieved
121    * @deprecated since 6.2M1, use {@link org.xwiki.security.authorization.ContextualAuthorizationManager} instead
122    */
123    @Deprecated
124    boolean hasProgrammingRights(DocumentReference reference) throws WikiComponentException;
125    }