org.xwiki.gwt.wysiwyg.client.wiki
Interface WikiService

All Superinterfaces:
com.google.gwt.user.client.rpc.RemoteService

@Role
@RemoteServiceRelativePath(value="WikiService.gwtrpc")
public interface WikiService
extends com.google.gwt.user.client.rpc.RemoteService

The service interface used on the server.

NOTE: This component interface should be split in multiple domain specific interfaces. Don't add any more methods!

Version:
$Id$

Method Summary
 Attachment getAttachment(AttachmentReference attachmentReference)
          Returns information about the referenced attachment.
 List<Attachment> getAttachments(WikiPageReference documentReference)
          Returns all the attachments from the referred page.
 EntityConfig getEntityConfig(EntityReference origin, ResourceReference destination)
          Creates an entity link configuration object (URL, link reference) for a link with the specified origin and destination.
 List<Attachment> getImageAttachments(WikiPageReference documentReference)
          Returns all the image attachments from the referred page.
 List<WikiPage> getMatchingPages(String wikiName, String keyword, int start, int count)
           
 List<String> getPageNames(String wikiName, String spaceName)
           
 List<WikiPage> getRecentlyModifiedPages(String wikiName, int start, int count)
           
 List<String> getSpaceNames(String wikiName)
           
 String getUploadURL(WikiPageReference documentReference)
           
 List<String> getVirtualWikiNames()
           
 Boolean isMultiWiki()
          Checks if the editor is running in a multiwiki environment.
 ResourceReference parseLinkReference(String linkReference, EntityReference baseReference)
          Parses the given link reference and extracts a reference to the linked resource.
 

Method Detail

isMultiWiki

Boolean isMultiWiki()
Checks if the editor is running in a multiwiki environment.

Returns:
true if we are in a multiwiki environment, false otherwise

getVirtualWikiNames

List<String> getVirtualWikiNames()
Returns:
a list containing the names of all wikis

getSpaceNames

List<String> getSpaceNames(String wikiName)
Parameters:
wikiName - the name of the wiki to search for spaces. If this is null the current wiki will be used
Returns:
a list of all spaces names in the specified wiki

getPageNames

List<String> getPageNames(String wikiName,
                          String spaceName)
Parameters:
wikiName - the name of the wiki. Pass null if the current wiki should be used instead
spaceName - the name of the space
Returns:
the list of the page names from a given space and a given wiki

getRecentlyModifiedPages

List<WikiPage> getRecentlyModifiedPages(String wikiName,
                                        int start,
                                        int count)
Parameters:
wikiName - the name of the wiki where to look for modified pages
start - the start index of the list of pages to return
count - the number of pages to return
Returns:
the recently count modified pages of the current user from the specified wiki, starting from position start

getMatchingPages

List<WikiPage> getMatchingPages(String wikiName,
                                String keyword,
                                int start,
                                int count)
Parameters:
wikiName - the wiki where to run the search
start - the start index of the list of pages to return
count - the number of pages to return
keyword - the keyword to search the pages for
Returns:
the count pages whose full name or title match the keyword, starting from position start

getEntityConfig

EntityConfig getEntityConfig(EntityReference origin,
                             ResourceReference destination)
Creates an entity link configuration object (URL, link reference) for a link with the specified origin and destination. The link reference in the returned EntityConfig is relative to the link origin.

Parameters:
origin - the origin of the link
destination - the destination of the link
Returns:
the link configuration object that can be used to insert the link in the origin page

getAttachment

Attachment getAttachment(AttachmentReference attachmentReference)
Returns information about the referenced attachment.

Parameters:
attachmentReference - an attachment reference
Returns:
an Attachment containing the serialized reference and the access URL of the specified attachment, or null in case the attachment was not found

getImageAttachments

List<Attachment> getImageAttachments(WikiPageReference documentReference)
Returns all the image attachments from the referred page.

Parameters:
documentReference - a reference to the document to get the images from
Returns:
list of the image attachments

getAttachments

List<Attachment> getAttachments(WikiPageReference documentReference)
Returns all the attachments from the referred page.

Parameters:
documentReference - a reference to the document to get the attachments from
Returns:
list of the attachments

getUploadURL

String getUploadURL(WikiPageReference documentReference)
Parameters:
documentReference - a document reference
Returns:
the URL that can be used to upload an attachment to the specified document

parseLinkReference

ResourceReference parseLinkReference(String linkReference,
                                     EntityReference baseReference)
Parses the given link reference and extracts a reference to the linked resource. The returned resource reference is resolved relative to the given base entity reference.

Parameters:
linkReference - a serialized link reference
baseReference - the entity reference used to resolve the linked resource reference
Returns:
a reference to the linked resource


Copyright © 2004-2012 XWiki. All Rights Reserved.