| Class | Line # | Actions | |||||
|---|---|---|---|---|---|---|---|
| WikiModel | 37 | 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.rendering.wiki; | |
| 21 | ||
| 22 | import java.util.Map; | |
| 23 | ||
| 24 | import org.xwiki.component.annotation.Role; | |
| 25 | import org.xwiki.rendering.listener.reference.ResourceReference; | |
| 26 | ||
| 27 | /** | |
| 28 | * Bridge between the Rendering module and a Wiki Model. Contains wiki APIs required by Rendering classes such as | |
| 29 | * Renderers. For example the XHTML Link Renderer needs to know if a wiki document exists in order to know how to | |
| 30 | * generate the HTML (in order to display a question mark for non existing documents) and it also needs to get the URL | |
| 31 | * pointing the wiki document. | |
| 32 | * | |
| 33 | * @version $Id: 67dd3e99987389de6c31e9fbf1bbb1a4eb2a30b7 $ | |
| 34 | * @since 2.0M1 | |
| 35 | */ | |
| 36 | @Role | |
| 37 | public interface WikiModel | |
| 38 | { | |
| 39 | /** | |
| 40 | * @param linkReference the reference to the link resource | |
| 41 | * @return the URL to the link resource (the resource could be a document, a URL, a path, etc) | |
| 42 | * @since 2.5RC1 | |
| 43 | */ | |
| 44 | String getLinkURL(ResourceReference linkReference); | |
| 45 | ||
| 46 | /** | |
| 47 | * @param imageReference the reference to the image resource | |
| 48 | * @param parameters the optional parameters passed to the image reference (width, height, etc) | |
| 49 | * @return the URL to the image resource (the resource could be an attacment in a document, an icon, etc) | |
| 50 | * @since 2.5RC1 | |
| 51 | */ | |
| 52 | String getImageURL(ResourceReference imageReference, Map<String, String> parameters); | |
| 53 | ||
| 54 | /** | |
| 55 | * @param resourceReference the reference pointing to a wiki document | |
| 56 | * @return true if the wiki document exists and can be viewed or false otherwise | |
| 57 | */ | |
| 58 | boolean isDocumentAvailable(ResourceReference resourceReference); | |
| 59 | ||
| 60 | /** | |
| 61 | * @param resourceReference the reference pointing to a wiki document | |
| 62 | * @return the URL to view the specified wiki document | |
| 63 | */ | |
| 64 | String getDocumentViewURL(ResourceReference resourceReference); | |
| 65 | ||
| 66 | /** | |
| 67 | * @param resourceReference the reference pointing to a wiki document | |
| 68 | * @return the URL to edit the specified wiki document | |
| 69 | */ | |
| 70 | String getDocumentEditURL(ResourceReference resourceReference); | |
| 71 | } |