Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
WikiTemplateManager | 36 | 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.wiki.template; | |
21 | ||
22 | import java.util.Collection; | |
23 | import java.util.List; | |
24 | ||
25 | import org.xwiki.component.annotation.Role; | |
26 | import org.xwiki.wiki.descriptor.WikiDescriptor; | |
27 | import org.xwiki.wiki.provisioning.WikiProvisioningJob; | |
28 | ||
29 | /** | |
30 | * Component in charge of managing wiki templates and creating new wiki from these templates. | |
31 | * | |
32 | * @version $Id: 8de8adb990d946cac01106c40c8f2d5df6b87cbe $ | |
33 | * @since 5.3M2 | |
34 | */ | |
35 | @Role | |
36 | public interface WikiTemplateManager | |
37 | { | |
38 | /** | |
39 | * Get the list of all wiki templates. | |
40 | * | |
41 | * @return list of wiki templates | |
42 | * @throws WikiTemplateManagerException if problems occur | |
43 | */ | |
44 | Collection<WikiDescriptor> getTemplates() throws WikiTemplateManagerException; | |
45 | ||
46 | /** | |
47 | * Set if the specified wiki is a template or not. | |
48 | * | |
49 | * @param wikiId the ID of the wiki to specify | |
50 | * @param value whether or not the wiki is a template | |
51 | * @throws WikiTemplateManagerException if problems occur | |
52 | */ | |
53 | void setTemplate(String wikiId, boolean value) throws WikiTemplateManagerException; | |
54 | ||
55 | /** | |
56 | * @param wikiId The id of the wiki to test | |
57 | * @return if the wiki is a template or not | |
58 | * @throws WikiTemplateManagerException if problems occur | |
59 | */ | |
60 | boolean isTemplate(String wikiId) throws WikiTemplateManagerException; | |
61 | ||
62 | /** | |
63 | * Create a new wiki from the specified template. | |
64 | * | |
65 | * @param newWikiId ID of the wiki to create | |
66 | * @param newWikiAlias Default alias of the wiki to create | |
67 | * @param templateId Id of the template to use | |
68 | * @param ownerId Id of the wiki owner | |
69 | * @param failOnExist fail if the wiki id is not available | |
70 | * @return the job that provisions the new wiki with the template content | |
71 | * @throws WikiTemplateManagerException if problems occur | |
72 | */ | |
73 | WikiProvisioningJob createWikiFromTemplate(String newWikiId, String newWikiAlias, String templateId, String ownerId, | |
74 | boolean failOnExist) throws WikiTemplateManagerException; | |
75 | ||
76 | /** | |
77 | * Apply a template to an existing wiki. | |
78 | * | |
79 | * @param wikiId if of the wiki on which the template will be installed | |
80 | * @param templateId id of the template to use | |
81 | * @return the job that provisions the wiki with the template content | |
82 | * @throws WikiTemplateManagerException if problems occur | |
83 | * | |
84 | * @since 5.4RC1 | |
85 | */ | |
86 | WikiProvisioningJob applyTemplate(String wikiId, String templateId) throws WikiTemplateManagerException; | |
87 | ||
88 | /** | |
89 | * Get the wiki provisioning job. | |
90 | * | |
91 | * @param jobId id of wiki provisioning job | |
92 | * @return the job | |
93 | * @throws WikiTemplateManagerException if problem occurs | |
94 | */ | |
95 | WikiProvisioningJob getWikiProvisioningJob(List<String> jobId) throws WikiTemplateManagerException; | |
96 | } |