Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
MandatoryDocumentInitializer | 38 | 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 com.xpn.xwiki.doc; | |
21 | ||
22 | import org.xwiki.component.annotation.Role; | |
23 | import org.xwiki.model.reference.EntityReference; | |
24 | ||
25 | /** | |
26 | * Provide a document that should be initialized at startup and when creating a new wiki. | |
27 | * <p> | |
28 | * The role hint should be the local (or absolute if it's supposed to be used only for a specific wiki) reference of the | |
29 | * document so that I can easily be found. | |
30 | * <p> | |
31 | * An additional {@link javax.annotation.Priority Priority} annotation can be added to affect the order in which the | |
32 | * initializer will be executed when a wiki is initialized. If not specified, {@value #DEFAULT_PRIORITY} will be | |
33 | * assumed. | |
34 | * | |
35 | * @version $Id: c2de25b76d1a8d03186aa41ab7b7c33e322d1203 $ | |
36 | */ | |
37 | @Role | |
38 | public interface MandatoryDocumentInitializer | |
39 | { | |
40 | /** | |
41 | * Default priority with which a document initializer will be executed along side other document initializers. | |
42 | * | |
43 | * @since 7.0RC1 | |
44 | */ | |
45 | int DEFAULT_PRIORITY = 1000; | |
46 | ||
47 | /** | |
48 | * @return the reference of the document to update. Can be either local or absolute depending if the document is | |
49 | * associated to a specific wiki or not | |
50 | */ | |
51 | EntityReference getDocumentReference(); | |
52 | ||
53 | /** | |
54 | * Update the provided document according to the need. | |
55 | * | |
56 | * @param document the existing document to update | |
57 | * @return true if the document has been modified, false otherwise | |
58 | */ | |
59 | boolean updateDocument(XWikiDocument document); | |
60 | } |