Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
SheetBinder | 35 | 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.sheet; | |
21 | ||
22 | import java.util.List; | |
23 | ||
24 | import org.xwiki.bridge.DocumentModelBridge; | |
25 | import org.xwiki.component.annotation.Role; | |
26 | import org.xwiki.model.reference.DocumentReference; | |
27 | ||
28 | /** | |
29 | * The interface used to bind sheets to documents and classes. | |
30 | * | |
31 | * @version $Id: f32cf76cf14330b92987adb74397e46ac1c599ea $ | |
32 | * @since 3.2M3 | |
33 | */ | |
34 | @Role | |
35 | public interface SheetBinder | |
36 | { | |
37 | /** | |
38 | * Retrieves the list of sheets explicitly bound to a XWiki document. This method doesn't perform any checks on the | |
39 | * returned list of sheets. The returned list can contain duplicates, sheets that doesn't exist or sheets that only | |
40 | * some users have the right to view. | |
41 | * | |
42 | * @param document a XWiki document | |
43 | * @return the list of sheets explicitly bound to the given document | |
44 | */ | |
45 | List<DocumentReference> getSheets(DocumentModelBridge document); | |
46 | ||
47 | /** | |
48 | * Retrieves the list of XWiki documents explicitly bound to a given sheet. This method doesn't perform any checks | |
49 | * on the specified sheet: it may not even exist or it may not be viewable by the current user. This method simply | |
50 | * returns the list of documents that explicitly declare they're using the specified sheet. | |
51 | * | |
52 | * @param sheetReference a reference to a sheet | |
53 | * @return the list of XWiki documents explicitly bound to the specified sheet. | |
54 | */ | |
55 | List<DocumentReference> getDocuments(DocumentReference sheetReference); | |
56 | ||
57 | /** | |
58 | * Binds a sheet to a XWiki document. This method doesn't perform any checks on the specified sheet. The sheet may | |
59 | * not even exist or may not be viewable by all users. The changes are not persisted until the document is saved. | |
60 | * | |
61 | * @param document a XWiki document | |
62 | * @param sheetReference a reference to a sheet | |
63 | * @return {@code true} if the sheet was successfully bound to the given document, {@code false} otherwise (e.g. if | |
64 | * the specified sheet was already bound to the given document) | |
65 | */ | |
66 | boolean bind(DocumentModelBridge document, DocumentReference sheetReference); | |
67 | ||
68 | /** | |
69 | * Removes the binding between a sheet and a XWiki document. The changes are not persisted until the document is | |
70 | * saved. | |
71 | * | |
72 | * @param document a XWiki document | |
73 | * @param sheetReference a reference to a sheet | |
74 | * @return {@code true} if the sheet was successfully unbound from the given document, {@code false} otherwise (e.g. | |
75 | * if the specified sheet wasn't bound to the given document) | |
76 | */ | |
77 | boolean unbind(DocumentModelBridge document, DocumentReference sheetReference); | |
78 | } |