001: /**
002: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
003: *
004: * This program is free software; you can redistribute it and/or modify
005: * it under the terms of the latest version of the GNU Lesser General
006: * Public License as published by the Free Software Foundation;
007: *
008: * This program is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: * GNU Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public License
014: * along with this program (LICENSE.txt); if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: */package org.jamwiki;
017:
018: import java.util.Collection;
019: import java.util.LinkedHashMap;
020: import java.util.List;
021: import java.util.Locale;
022: import java.util.Vector;
023: import org.apache.commons.lang.StringUtils;
024: import org.jamwiki.model.Category;
025: import org.jamwiki.model.RecentChange;
026: import org.jamwiki.model.Role;
027: import org.jamwiki.model.RoleMap;
028: import org.jamwiki.model.Topic;
029: import org.jamwiki.model.TopicVersion;
030: import org.jamwiki.model.VirtualWiki;
031: import org.jamwiki.model.Watchlist;
032: import org.jamwiki.model.WikiFile;
033: import org.jamwiki.model.WikiFileVersion;
034: import org.jamwiki.model.WikiGroup;
035: import org.jamwiki.model.WikiUser;
036: import org.jamwiki.model.WikiUserInfo;
037: import org.jamwiki.utils.Pagination;
038: import org.jamwiki.utils.WikiLogger;
039:
040: /**
041: *
042: */
043: public class TestDataHandler implements DataHandler {
044:
045: private static final WikiLogger logger = WikiLogger
046: .getLogger(TestDataHandler.class.getName());
047:
048: /**
049: *
050: */
051: public boolean canMoveTopic(Topic fromTopic, String destination)
052: throws Exception {
053: throw new UnsupportedOperationException();
054: }
055:
056: /**
057: *
058: */
059: public void deleteTopic(Topic topic, TopicVersion topicVersion,
060: boolean userVisible, Object transactionObject)
061: throws Exception {
062: throw new UnsupportedOperationException();
063: }
064:
065: /**
066: *
067: */
068: public List getAllCategories(String virtualWiki,
069: Pagination pagination) throws Exception {
070: throw new UnsupportedOperationException();
071: }
072:
073: /**
074: *
075: */
076: public List getAllRoles() throws Exception {
077: throw new UnsupportedOperationException();
078: }
079:
080: /**
081: *
082: */
083: public List getAllTopicNames(String virtualWiki) throws Exception {
084: throw new UnsupportedOperationException();
085: }
086:
087: /**
088: *
089: */
090: public List getAllWikiFileVersions(String virtualWiki,
091: String topicName, boolean descending) throws Exception {
092: throw new UnsupportedOperationException();
093: }
094:
095: /**
096: *
097: */
098: public List getRecentChanges(String virtualWiki,
099: Pagination pagination, boolean descending) throws Exception {
100: throw new UnsupportedOperationException();
101: }
102:
103: /**
104: *
105: */
106: public List getRecentChanges(String virtualWiki, String topicName,
107: Pagination pagination, boolean descending) throws Exception {
108: throw new UnsupportedOperationException();
109: }
110:
111: /**
112: *
113: */
114: public Collection getRoleMapByLogin(String loginFragment)
115: throws Exception {
116: throw new UnsupportedOperationException();
117: }
118:
119: /**
120: *
121: */
122: public Collection getRoleMapByRole(String roleName)
123: throws Exception {
124: throw new UnsupportedOperationException();
125: }
126:
127: /**
128: *
129: */
130: public Role[] getRoleMapGroup(String groupName) throws Exception {
131: throw new UnsupportedOperationException();
132: }
133:
134: /**
135: *
136: */
137: public Collection getRoleMapGroups() throws Exception {
138: throw new UnsupportedOperationException();
139: }
140:
141: /**
142: *
143: */
144: public Role[] getRoleMapUser(String login) throws Exception {
145: throw new UnsupportedOperationException();
146: }
147:
148: /**
149: *
150: */
151: public List getTopicsAdmin(String virtualWiki, Pagination pagination)
152: throws Exception {
153: throw new UnsupportedOperationException();
154: }
155:
156: /**
157: *
158: */
159: public List getUserContributions(String virtualWiki,
160: String userString, Pagination pagination, boolean descending)
161: throws Exception {
162: throw new UnsupportedOperationException();
163: }
164:
165: /**
166: *
167: */
168: public List getVirtualWikiList(Object transactionObject)
169: throws Exception {
170: throw new UnsupportedOperationException();
171: }
172:
173: /**
174: *
175: */
176: public Watchlist getWatchlist(String virtualWiki, int userId)
177: throws Exception {
178: throw new UnsupportedOperationException();
179: }
180:
181: /**
182: *
183: */
184: public List getWatchlist(String virtualWiki, int userId,
185: Pagination pagination) throws Exception {
186: throw new UnsupportedOperationException();
187: }
188:
189: /**
190: *
191: */
192: public List lookupCategoryTopics(String virtualWiki,
193: String categoryName) throws Exception {
194: throw new UnsupportedOperationException();
195: }
196:
197: /**
198: *
199: */
200: public Topic lookupTopic(String virtualWiki, String topicName,
201: boolean deleteOK, Object transactionObject)
202: throws Exception {
203: String content = TestFileUtil.retrieveFileContent(
204: TestFileUtil.TEST_TOPICS_DIR, topicName);
205: if (content == null) {
206: return null;
207: }
208: Topic topic = new Topic();
209: topic.setName(topicName);
210: topic.setVirtualWiki(virtualWiki);
211: topic.setTopicContent(content);
212: return topic;
213: }
214:
215: /**
216: *
217: */
218: public int lookupTopicCount(String virtualWiki) throws Exception {
219: throw new UnsupportedOperationException();
220: }
221:
222: /**
223: *
224: */
225: public List lookupTopicByType(String virtualWiki, int topicType,
226: Pagination pagination) throws Exception {
227: throw new UnsupportedOperationException();
228: }
229:
230: /**
231: *
232: */
233: public TopicVersion lookupTopicVersion(int topicVersionId,
234: Object transactionObject) throws Exception {
235: throw new UnsupportedOperationException();
236: }
237:
238: /**
239: *
240: */
241: public VirtualWiki lookupVirtualWiki(String virtualWikiName)
242: throws Exception {
243: throw new UnsupportedOperationException();
244: }
245:
246: /**
247: *
248: */
249: public WikiFile lookupWikiFile(String virtualWiki, String topicName)
250: throws Exception {
251: throw new UnsupportedOperationException();
252: }
253:
254: /**
255: *
256: */
257: public int lookupWikiFileCount(String virtualWiki) throws Exception {
258: throw new UnsupportedOperationException();
259: }
260:
261: /**
262: *
263: */
264: public WikiUser lookupWikiUser(int userId, Object transactionObject)
265: throws Exception {
266: throw new UnsupportedOperationException();
267: }
268:
269: /**
270: *
271: */
272: public WikiUser lookupWikiUser(String username,
273: Object transactionObject) throws Exception {
274: throw new UnsupportedOperationException();
275: }
276:
277: /**
278: *
279: */
280: public int lookupWikiUserCount() throws Exception {
281: throw new UnsupportedOperationException();
282: }
283:
284: /**
285: *
286: */
287: public List lookupWikiUsers(Pagination pagination) throws Exception {
288: throw new UnsupportedOperationException();
289: }
290:
291: /**
292: *
293: */
294: public void moveTopic(Topic fromTopic, TopicVersion fromVersion,
295: String destination, Object transactionObject)
296: throws Exception {
297: throw new UnsupportedOperationException();
298: }
299:
300: /**
301: *
302: */
303: public void reloadRecentChanges(Object transactionObject)
304: throws Exception {
305: throw new UnsupportedOperationException();
306: }
307:
308: /**
309: *
310: */
311: public void setup(Locale locale, WikiUser user) throws Exception {
312: throw new UnsupportedOperationException();
313: }
314:
315: /**
316: *
317: */
318: public void setupSpecialPages(Locale locale, WikiUser user,
319: VirtualWiki virtualWiki, Object transactionObject)
320: throws Exception {
321: throw new UnsupportedOperationException();
322: }
323:
324: /**
325: *
326: */
327: public void undeleteTopic(Topic topic, TopicVersion topicVersion,
328: boolean userVisible, Object transactionObject)
329: throws Exception {
330: throw new UnsupportedOperationException();
331: }
332:
333: /**
334: *
335: */
336: public void updateSpecialPage(Locale locale, String virtualWiki,
337: String topicName, WikiUser user, String ipAddress,
338: Object transactionObject) throws Exception {
339: throw new UnsupportedOperationException();
340: }
341:
342: /**
343: *
344: */
345: public void writeFile(WikiFile wikiFile,
346: WikiFileVersion wikiFileVersion, Object transactionObject)
347: throws Exception {
348: throw new UnsupportedOperationException();
349: }
350:
351: /**
352: *
353: */
354: public void writeRole(Role role, Object transactionObject,
355: boolean update) throws Exception {
356: throw new UnsupportedOperationException();
357: }
358:
359: /**
360: *
361: */
362: public void writeRoleMapGroup(int groupId, List roles,
363: Object transactionObject) throws Exception {
364: throw new UnsupportedOperationException();
365: }
366:
367: /**
368: *
369: */
370: public void writeRoleMapUser(int userId, List roles,
371: Object transactionObject) throws Exception {
372: throw new UnsupportedOperationException();
373: }
374:
375: /**
376: *
377: */
378: public void writeTopic(Topic topic, TopicVersion topicVersion,
379: LinkedHashMap categories, Vector links,
380: boolean userVisible, Object transactionObject)
381: throws Exception {
382: throw new UnsupportedOperationException();
383: }
384:
385: /**
386: *
387: */
388: public void writeVirtualWiki(VirtualWiki virtualWiki,
389: Object transactionObject) throws Exception {
390: throw new UnsupportedOperationException();
391: }
392:
393: /**
394: *
395: */
396: public void writeWatchlistEntry(Watchlist watchlist,
397: String virtualWiki, String topicName, int userId,
398: Object transactionObject) throws Exception {
399: throw new UnsupportedOperationException();
400: }
401:
402: /**
403: *
404: */
405: public void writeWikiGroup(WikiGroup group, Object transactionObject)
406: throws Exception {
407: throw new UnsupportedOperationException();
408: }
409:
410: /**
411: *
412: */
413: public void writeWikiUser(WikiUser user, WikiUserInfo userInfo,
414: Object transactionObject) throws Exception {
415: throw new UnsupportedOperationException();
416: }
417: }
|