com.xpn.xwiki.wysiwyg.client
Class WikiServiceAsyncCacheProxy

java.lang.Object
  extended by com.xpn.xwiki.wysiwyg.client.WikiServiceAsyncCacheProxy
All Implemented Interfaces:
WikiServiceAsync

public class WikiServiceAsyncCacheProxy
extends java.lang.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: WikiServiceAsyncCacheProxy.java 25780 2009-12-14 09:41:47Z mflorea $

Constructor Summary
WikiServiceAsyncCacheProxy(WikiServiceAsync service)
          Creates a new cache proxy for the given service.
 
Method Summary
 void getAttachment(java.lang.String wikiName, java.lang.String spaceName, java.lang.String pageName, java.lang.String attachmentName, com.google.gwt.user.client.rpc.AsyncCallback<Attachment> async)
          Returns attachment information from the passed parameters, testing if the passed attachment exists.
 void getAttachments(java.lang.String wikiName, java.lang.String spaceName, java.lang.String pageName, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Attachment>> async)
          Returns all the attachments from the referred page.
 void getImageAttachments(java.lang.String wikiName, java.lang.String spaceName, java.lang.String pageName, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Attachment>> async)
          Returns all the image attachments from the referred page.
 void getMatchingPages(java.lang.String keyword, int start, int count, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<WikiPage>> async)
          
 void getPageLink(java.lang.String wikiName, java.lang.String spaceName, java.lang.String pageName, java.lang.String revision, java.lang.String anchor, com.google.gwt.user.client.rpc.AsyncCallback<LinkConfig> async)
          Creates a page link (URL, reference) from the given parameters.
 void getPageNames(java.lang.String wikiName, java.lang.String spaceName, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<java.lang.String>> async)
          Returns the list of the page names from a given space and a given wiki.
 void getRecentlyModifiedPages(int start, int count, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<WikiPage>> async)
          
 void getSpaceNames(java.lang.String wikiName, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<java.lang.String>> async)
          Returns a list of all spaces names in the specified wiki.
 void getVirtualWikiNames(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<java.lang.String>> async)
          Returns a list containing the names of all wikis.
 void isMultiWiki(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
          Check if the current wiki is part of a multiwiki (i.e.
 
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(java.lang.String wikiName,
                         java.lang.String spaceName,
                         com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<java.lang.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 this should use the current wiki.
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(int start,
                                     int count,
                                     com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<WikiPage>> async)

Specified by:
getRecentlyModifiedPages in interface WikiServiceAsync
Parameters:
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(java.lang.String keyword,
                             int start,
                             int count,
                             com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<WikiPage>> async)

Specified by:
getMatchingPages in interface WikiServiceAsync
Parameters:
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(java.lang.String wikiName,
                          com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<java.lang.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<java.util.List<java.lang.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<java.lang.Boolean> async)
Check if the current wiki is part of a multiwiki (i.e. this is a virtual wiki).

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

getPageLink

public void getPageLink(java.lang.String wikiName,
                        java.lang.String spaceName,
                        java.lang.String pageName,
                        java.lang.String revision,
                        java.lang.String anchor,
                        com.google.gwt.user.client.rpc.AsyncCallback<LinkConfig> async)
Creates a page link (URL, reference) from the given parameters. None of them are mandatory, if one misses, it is replaced with a default value.

Specified by:
getPageLink in interface WikiServiceAsync
Parameters:
wikiName - the name of the wiki to which to link
spaceName - the name of the space of the page. If this parameter is missing, it is replaced with the space of the current document in the context.
pageName - the name of the page to which to link to. If it's missing, it is replaced with "WebHome".
revision - the value for the page revision to which to link to. If this is missing, the link is made to the latest revision, the default view action for the document.
anchor - the name of the anchor type.
async - object used for asynchronous communication between server and client.
See Also:
WikiServiceAsync.getPageLink(String, String, String, String, String, AsyncCallback)

getAttachment

public void getAttachment(java.lang.String wikiName,
                          java.lang.String spaceName,
                          java.lang.String pageName,
                          java.lang.String attachmentName,
                          com.google.gwt.user.client.rpc.AsyncCallback<Attachment> async)
Returns attachment information from the passed parameters, testing if the passed attachment exists. Note that the attachmentName name will be cleaned to match the attachment names cleaning rules, and the attachment reference and URL will be generated with the cleaned name. This function will be used as a method to test the correct upload of a file to a page.

Specified by:
getAttachment in interface WikiServiceAsync
Parameters:
wikiName - the name of the wiki of the page the file is attached to
spaceName - the name of the space of the page the file is attached to
pageName - the name of the page the file is attached to
attachmentName - the uncleaned name of the attachment, which is to be cleaned on the server
async - object used for asynchronous communication between server and client, to return, on success, an Attachment containing the reference and the URL of the attachment, or null in case the attachment was not found
See Also:
WikiServiceAsync.getAttachment(String, String, String, String, AsyncCallback)

getImageAttachments

public void getImageAttachments(java.lang.String wikiName,
                                java.lang.String spaceName,
                                java.lang.String pageName,
                                com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Attachment>> async)
Returns all the image attachments from the referred page.

Specified by:
getImageAttachments in interface WikiServiceAsync
Parameters:
wikiName - the name of the wiki to get images from
spaceName - the name of the space to get image attachments from
pageName - the name of the page to get image attachments from
async - object used for asynchronous communication between server and client.
See Also:
WikiServiceAsync.getImageAttachments(String, String, String, AsyncCallback)

getAttachments

public void getAttachments(java.lang.String wikiName,
                           java.lang.String spaceName,
                           java.lang.String pageName,
                           com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<Attachment>> async)
Returns all the attachments from the referred page.

Specified by:
getAttachments in interface WikiServiceAsync
Parameters:
wikiName - the name of the wiki to get attachments from
spaceName - the name of the space to get attachments from
pageName - the name of the page to get attachments from
async - object used for asynchronous communication between server and client.
See Also:
WikiServiceAsync.getAttachments(String, String, String, AsyncCallback)


Copyright © 2004-2010 XWiki. All Rights Reserved.