org.xwiki.gwt.wysiwyg.client.wiki
Class WikiServiceAsyncCacheProxy

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.wiki.WikiServiceAsyncCacheProxy
All Implemented Interfaces:
WikiServiceAsync

public class WikiServiceAsyncCacheProxy
extends Object
implements WikiServiceAsync

Cache proxy for WikiServiceAsync. This proxy is used to store on the client a set of values from the server that cannot change without server restart, therefore without the reload of the page that holds the reference to the WikiService.

Version:
$Id: 77902f2a5aa22f15ef6ef8842fb53229ad7081bf $

Constructor Summary
WikiServiceAsyncCacheProxy(WikiServiceAsync service)
          Creates a new cache proxy for the given service.
 
Method Summary
 void getAttachment(AttachmentReference attachmentReference, com.google.gwt.user.client.rpc.AsyncCallback<Attachment> async)
          Returns information about the referenced attachment.
 void getAttachments(WikiPageReference documentReference, com.google.gwt.user.client.rpc.AsyncCallback<List<Attachment>> async)
          Returns all the attachments from the referred page.
 void getEntityConfig(EntityReference base, ResourceReference target, com.google.gwt.user.client.rpc.AsyncCallback<EntityConfig> async)
          Creates an entity link configuration object (URL, reference) for a link with the specified origin and destination.
 void getImageAttachments(WikiPageReference documentReference, com.google.gwt.user.client.rpc.AsyncCallback<List<Attachment>> async)
          Returns all the image attachments from the referred page.
 void getMatchingPages(String wikiName, String keyword, int start, int count, com.google.gwt.user.client.rpc.AsyncCallback<List<WikiPage>> async)
          
 void getPageNames(String wikiName, String spaceName, com.google.gwt.user.client.rpc.AsyncCallback<List<String>> async)
          Returns the list of the page names from a given space and a given wiki.
 void getRecentlyModifiedPages(String wikiName, int start, int count, com.google.gwt.user.client.rpc.AsyncCallback<List<WikiPage>> async)
          
 void getSpaceNames(String wikiName, com.google.gwt.user.client.rpc.AsyncCallback<List<String>> async)
          Returns a list of all spaces names in the specified wiki.
 void getUploadURL(WikiPageReference documentReference, com.google.gwt.user.client.rpc.AsyncCallback<String> async)
          Returns the URL to be used to upload an attachment to the specified document.
 void getVirtualWikiNames(com.google.gwt.user.client.rpc.AsyncCallback<List<String>> async)
          Returns a list containing the names of all wikis.
 void isMultiWiki(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> async)
          Checks if the editor is running in a multiwiki environment.
 void parseLinkReference(String linkReference, EntityReference baseReference, com.google.gwt.user.client.rpc.AsyncCallback<ResourceReference> async)
          Parses the given link reference and extracts a reference to the linked resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiServiceAsyncCacheProxy

public WikiServiceAsyncCacheProxy(WikiServiceAsync service)
Creates a new cache proxy for the given service.

Parameters:
service - the service to be cached.
Method Detail

getPageNames

public void getPageNames(String wikiName,
                         String spaceName,
                         com.google.gwt.user.client.rpc.AsyncCallback<List<String>> async)
Returns the list of the page names from a given space and a given wiki.

Specified by:
getPageNames in interface WikiServiceAsync
Parameters:
wikiName - the name of the wiki. Pass null if the current wiki should be used instead
spaceName - the name of the space
async - object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.getPageNames(String, String, AsyncCallback)

getRecentlyModifiedPages

public void getRecentlyModifiedPages(String wikiName,
                                     int start,
                                     int count,
                                     com.google.gwt.user.client.rpc.AsyncCallback<List<WikiPage>> async)

Specified by:
getRecentlyModifiedPages in interface WikiServiceAsync
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
async - object used for asynchronous communication between server and client, to return on success the recently count modified pages of the current user, starting from position start

getMatchingPages

public void getMatchingPages(String wikiName,
                             String keyword,
                             int start,
                             int count,
                             com.google.gwt.user.client.rpc.AsyncCallback<List<WikiPage>> async)

Specified by:
getMatchingPages in interface WikiServiceAsync
Parameters:
wikiName - the wiki where to run the search
keyword - the keyword to search the pages for
start - the start index of the list of pages to return
count - the number of pages to return
async - object used for asynchronous communication between server and client, to return on success the count pages whose full name or title match the keyword, starting from position start

getSpaceNames

public void getSpaceNames(String wikiName,
                          com.google.gwt.user.client.rpc.AsyncCallback<List<String>> async)
Returns a list of all spaces names in the specified wiki.

Specified by:
getSpaceNames in interface WikiServiceAsync
Parameters:
wikiName - the name of the wiki to search for spaces. If this is null the current wiki will be used
async - object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.getSpaceNames(String, AsyncCallback)

getVirtualWikiNames

public void getVirtualWikiNames(com.google.gwt.user.client.rpc.AsyncCallback<List<String>> async)
Returns a list containing the names of all wikis.

Specified by:
getVirtualWikiNames in interface WikiServiceAsync
Parameters:
async - async object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.getVirtualWikiNames(AsyncCallback)

isMultiWiki

public void isMultiWiki(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> async)
Checks if the editor is running in a multiwiki environment.

Specified by:
isMultiWiki in interface WikiServiceAsync
Parameters:
async - object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.isMultiWiki(AsyncCallback)

getEntityConfig

public void getEntityConfig(EntityReference base,
                            ResourceReference target,
                            com.google.gwt.user.client.rpc.AsyncCallback<EntityConfig> async)
Creates an entity link configuration object (URL, reference) for a link with the specified origin and destination. The string serialization of the entity reference in the returned EntityConfig is relative to the link origin.

Specified by:
getEntityConfig in interface WikiServiceAsync
Parameters:
base - the origin of the link
target - the destination of the link
async - object used for asynchronous communication between server and client.
See Also:
WikiServiceAsync.getEntityConfig(EntityReference, ResourceReference, AsyncCallback)

getAttachment

public void getAttachment(AttachmentReference attachmentReference,
                          com.google.gwt.user.client.rpc.AsyncCallback<Attachment> async)
Returns information about the referenced attachment. Note that the EntityReference#getFileName() name will be cleaned to match the attachment names cleaning rules, and the returned attachment serialized reference and access URL will be generated with the cleaned name.

Specified by:
getAttachment in interface WikiServiceAsync
Parameters:
attachmentReference - an attachment reference
async - object used for asynchronous communication between server and client, to return, on success, an Attachment containing the serialized reference and the access URL of the specified attachment, or null in case the attachment was not found
See Also:
WikiServiceAsync.getAttachment(AttachmentReference, AsyncCallback)

getImageAttachments

public void getImageAttachments(WikiPageReference documentReference,
                                com.google.gwt.user.client.rpc.AsyncCallback<List<Attachment>> async)
Returns all the image attachments from the referred page.

Specified by:
getImageAttachments in interface WikiServiceAsync
Parameters:
documentReference - a reference to the document to get the images from
async - object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.getImageAttachments(WikiPageReference, AsyncCallback)

getAttachments

public void getAttachments(WikiPageReference documentReference,
                           com.google.gwt.user.client.rpc.AsyncCallback<List<Attachment>> async)
Returns all the attachments from the referred page.

Specified by:
getAttachments in interface WikiServiceAsync
Parameters:
documentReference - a reference to the document to get the attachments from
async - object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.getAttachments(WikiPageReference, AsyncCallback)

getUploadURL

public void getUploadURL(WikiPageReference documentReference,
                         com.google.gwt.user.client.rpc.AsyncCallback<String> async)
Returns the URL to be used to upload an attachment to the specified document.

Specified by:
getUploadURL in interface WikiServiceAsync
Parameters:
documentReference - the document for which to retrieve the upload URL
async - object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.getUploadURL(WikiPageReference, AsyncCallback)

parseLinkReference

public void parseLinkReference(String linkReference,
                               EntityReference baseReference,
                               com.google.gwt.user.client.rpc.AsyncCallback<ResourceReference> async)
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.

Specified by:
parseLinkReference in interface WikiServiceAsync
Parameters:
linkReference - a serialized link reference
baseReference - the entity reference used to resolve the linked resource reference
async - object used for asynchronous communication between server and client
See Also:
WikiServiceAsync.parseLinkReference(String, EntityReference, AsyncCallback)


Copyright © 2004–2014 XWiki. All rights reserved.