WikiEngine.java |
1 /** 2 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved. 3 * 4 * This library is free software; you can redistribute it and/or modify it under 5 * the terms of the GNU Lesser General Public License as published by the Free 6 * Software Foundation; either version 2.1 of the License, or (at your option) 7 * any later version. 8 * 9 * This library is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 * details. 13 */ 14 15 package com.liferay.portlet.wiki.engines; 16 17 import com.liferay.portlet.wiki.PageContentException; 18 import com.liferay.portlet.wiki.model.WikiPage; 19 20 import java.util.Map; 21 22 import javax.portlet.PortletURL; 23 24 /** 25 * <a href="WikiEngine.java.html"><b><i>View Source</i></b></a> 26 * 27 * @author Jorge Ferrer 28 */ 29 public interface WikiEngine { 30 31 /** 32 * Convert the content of the given page to HTML using the portletURL to 33 * build links. 34 * 35 * @return HTML string 36 */ 37 public String convert(WikiPage page, PortletURL portletURL) 38 throws PageContentException; 39 40 /** 41 * Get a map with the links included in the given page. The key of each map 42 * entry is the title of the linked page. The value is a Boolean object that 43 * indicates if the linked page exists or not. 44 * 45 * @return a map of links 46 */ 47 public Map<String, Boolean> getOutgoingLinks(WikiPage page) 48 throws PageContentException; 49 50 /** 51 * Set the configuraton to support quick links to other wikis. The format of 52 * the configuration is specific to the wiki engine. 53 */ 54 public void setInterWikiConfiguration(String interWikiConfiguration); 55 56 /** 57 * Set the main wiki configuraiton as a String. The format of the 58 * configuration is specific to the wiki engine. 59 */ 60 public void setMainConfiguration(String mainConfiguration); 61 62 /** 63 * Validate the content of a wiki page for this engine. 64 * 65 * @return true if the content is valid 66 */ 67 public boolean validate(long nodeId, String content); 68 69 }