1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.platform.wiki.creationjob

File WikiCreationRequest.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
27
27
1
287
132
27
1
1
27
1

Classes

Class Line # Actions
WikiCreationRequest 35 27 0% 27 0
1.0100%
 

Contributing tests

This file is covered by 17 tests. .

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.platform.wiki.creationjob;
21   
22    import java.util.List;
23   
24    import org.xwiki.extension.ExtensionId;
25    import org.xwiki.job.AbstractRequest;
26    import org.xwiki.wiki.user.MembershipType;
27    import org.xwiki.wiki.user.UserScope;
28   
29    /**
30    * A wiki creation request containing all information about a wiki to create.
31    *
32    * @version $Id: bbbe90bbb26af6a3d690f05d8b2fc564be9252fe $
33    * @since 7.0M2
34    */
 
35    public class WikiCreationRequest extends AbstractRequest
36    {
37    private static final long serialVersionUID = -1887940302223327347L;
38   
39    private static final String PROPERTY_PREFIX = "wikicreationrequest.";
40   
41    private static final String PROPERTY_WIKI_ID = PROPERTY_PREFIX + "wikiId";
42   
43    private static final String PROPERTY_PRETTY_NAME = PROPERTY_PREFIX + "prettyName";
44   
45    private static final String PROPERTY_ALIAS = PROPERTY_PREFIX + "alias";
46   
47    private static final String PROPERTY_DESCRIPTION = PROPERTY_PREFIX + "description";
48   
49    private static final String PROPERTY_IS_TEMPLATE = PROPERTY_PREFIX + "isTemplate";
50   
51    private static final String PROPERTY_TEMPLATE_ID = PROPERTY_PREFIX + "templateId";
52   
53    private static final String PROPERTY_EXTENSION_ID = PROPERTY_PREFIX + "extensionId";
54   
55    private static final String PROPERTY_OWNER_ID = PROPERTY_PREFIX + "ownerId";
56   
57    private static final String PROPERTY_USER_SCOPE = PROPERTY_PREFIX + "userScope";
58   
59    private static final String PROPERTY_MEMBERSHIP_TYPE = PROPERTY_PREFIX + "membershipType";
60   
61    private static final String PROPERTY_MEMBERS = PROPERTY_PREFIX + "members";
62   
63    private static final String PROPERTY_FAIL_ON_EXISTS = PROPERTY_PREFIX + "failOnExist";
64   
65    private static final String PROPERTY_WIKI_SOURCE = PROPERTY_PREFIX + "wikiSource";
66   
67    /**
68    * @return id of the wiki to create
69    */
 
70  60 toggle public String getWikiId()
71    {
72  60 return getProperty(PROPERTY_WIKI_ID);
73    }
74   
75    /**
76    * @param wikiId id of the wiki to create
77    */
 
78  16 toggle public void setWikiId(String wikiId)
79    {
80  16 setProperty(PROPERTY_WIKI_ID, wikiId);
81    }
82   
83    /**
84    * @return pretty name of the wiki to create
85    */
 
86  6 toggle public String getPrettyName()
87    {
88  6 return getProperty(PROPERTY_PRETTY_NAME);
89    }
90   
91    /**
92    * @param prettyName pretty name of the wiki to create
93    */
 
94  4 toggle public void setPrettyName(String prettyName)
95    {
96  4 setProperty(PROPERTY_PRETTY_NAME, prettyName);
97    }
98   
99    /**
100    * @return default alias of the wiki to create
101    */
 
102  6 toggle public String getAlias()
103    {
104  6 return getProperty(PROPERTY_ALIAS);
105    }
106   
107    /**
108    * @param alias default alias of the wiki to create
109    */
 
110  5 toggle public void setAlias(String alias)
111    {
112  5 setProperty(PROPERTY_ALIAS, alias);
113    }
114   
115    /**
116    * @return the description field of the wiki to create
117    */
 
118  6 toggle public String getDescription()
119    {
120  6 return getProperty(PROPERTY_DESCRIPTION);
121    }
122   
123    /**
124    * @param description the description field of the wiki to create
125    */
 
126  4 toggle public void setDescription(String description)
127    {
128  4 setProperty(PROPERTY_DESCRIPTION, description);
129    }
130   
131    /**
132    * @return if the wiki to create will be a template or no
133    */
 
134  5 toggle public boolean isTemplate()
135    {
136  5 return getProperty(PROPERTY_IS_TEMPLATE);
137    }
138   
139    /**
140    * @param isTemplate if the wiki to create will be a template or no
141    */
 
142  5 toggle public void setTemplate(boolean isTemplate)
143    {
144  5 setProperty(PROPERTY_IS_TEMPLATE, isTemplate);
145    }
146   
147    /**
148    * @return id of the template used to fill the wiki to create
149    */
 
150  9 toggle public String getTemplateId()
151    {
152  9 return getProperty(PROPERTY_TEMPLATE_ID);
153    }
154   
155    /**
156    * Set the id of the template of the wiki to create. Do not forget to use setWikiSource() too.
157    * @param templateId id of the template used to fill the wiki to create
158    */
 
159  3 toggle public void setTemplateId(String templateId)
160    {
161  3 setProperty(PROPERTY_TEMPLATE_ID, templateId);
162    }
163   
164    /**
165    * @return id of the main extension of the wiki to create
166    */
 
167  12 toggle public ExtensionId getExtensionId()
168    {
169  12 return getProperty(PROPERTY_EXTENSION_ID);
170    }
171   
172    /**
173    * Set the id of the main extension of the wiki to create. Do not forget to use setWikiSource() too.
174    * @param extensionId id of the main extension of the wiki to create
175    */
 
176  4 toggle public void setExtensionId(ExtensionId extensionId)
177    {
178  4 setProperty(PROPERTY_EXTENSION_ID, extensionId);
179    }
180   
181    /**
182    * Set the id of the main extension of the wiki to create. Do not forget to use setWikiSource() too.
183    * @param extensionId id of the main extension of the wiki to create
184    * @param version version of the extension
185    */
 
186  3 toggle public void setExtensionId(String extensionId, String version)
187    {
188  3 setProperty(PROPERTY_EXTENSION_ID, new ExtensionId(extensionId, version));
189    }
190   
191    /**
192    * @return id of the owner of the wiki to create
193    */
 
194  11 toggle public String getOwnerId()
195    {
196  11 return getProperty(PROPERTY_OWNER_ID);
197    }
198   
199    /**
200    * @param ownerId id of the owner of the wiki to create
201    */
 
202  4 toggle public void setOwnerId(String ownerId)
203    {
204  4 setProperty(PROPERTY_OWNER_ID, ownerId);
205    }
206   
207    /**
208    * @return the user scope of the wiki to create
209    */
 
210  5 toggle public UserScope getUserScope()
211    {
212  5 return getProperty(PROPERTY_USER_SCOPE);
213    }
214   
215    /**
216    * @param userScope the user scope of the wiki to create
217    */
 
218  5 toggle public void setUserScope(UserScope userScope)
219    {
220  5 setProperty(PROPERTY_USER_SCOPE, userScope);
221    }
222   
223    /**
224    * @return the membership type of the wiki to create
225    */
 
226  5 toggle public MembershipType getMembershipType()
227    {
228  5 return getProperty(PROPERTY_MEMBERSHIP_TYPE);
229    }
230   
231    /**
232    * @param membershipType the membership type of the wiki to create
233    */
 
234  5 toggle public void setMembershipType(MembershipType membershipType)
235    {
236  5 setProperty(PROPERTY_MEMBERSHIP_TYPE, membershipType);
237    }
238   
239    /**
240    * @return the list of the members to add in the wiki to create
241    */
 
242  7 toggle public List<String> getMembers()
243    {
244  7 return getProperty(PROPERTY_MEMBERS);
245    }
246   
247    /**
248    * @param members the list of the members to add in the wiki to create
249    */
 
250  2 toggle public void setMembers(List<String> members)
251    {
252  2 setProperty(PROPERTY_MEMBERS, members);
253    }
254   
255    /**
256    * @return whether or not the wiki creation should fail if the database already exists
257    */
 
258  6 toggle public boolean isFailOnExist()
259    {
260  6 return getProperty(PROPERTY_FAIL_ON_EXISTS);
261    }
262   
263    /**
264    * @param failOnExist whether or not the wiki creation should fail if the database already exists
265    */
 
266  6 toggle public void setFailOnExist(boolean failOnExist)
267    {
268  6 setProperty(PROPERTY_FAIL_ON_EXISTS, failOnExist);
269    }
270   
271    /**
272    * @return source of the wiki to create
273    */
 
274  12 toggle public WikiSource getWikiSource()
275    {
276  12 return getProperty(PROPERTY_WIKI_SOURCE);
277    }
278   
279    /**
280    * @param wikiSource source of the wiki to create
281    */
 
282  8 toggle public void setWikiSource(WikiSource wikiSource)
283    {
284  8 setProperty(PROPERTY_WIKI_SOURCE, wikiSource);
285    }
286    }
287