Groovy Documentation

services
Class SventonService

java.lang.Object
  services.SventonService

class SventonService

Class to interact with the Sventon repository browser.


Property Summary
static Map conf

Config

private def randomNumberGenerator

Random number generator used to generate session IDs.

def sandboxManager

Sandbox manager, autowired by grails.

def sventonJmxManager

The JMX MBean used to remote-control sventon, autowired.

 
Constructor Summary
SventonService()

 
Method Summary
String currentSventonSessionID()

Get the ID of the CowSventonSession corresponding to the current HTTP session.

def getSvnRepository(Wiki w, File wcPath, boolean refreshIfNecessary = false)

Returns an SvnRepository object for the root of the repository associated with the given working copy path in the given wiki, creating one in the database if necessary.

void grantPermission(String repository, String path)

Add a grant for the given repository and path to the current sventon session.

String historyLink(Wiki w, File pageFile, def redirectToYam)

Returns the sventon link to view the history of a given page in a wiki.

boolean isManagerAvailable()

Check whether the sventon remote controller is available.

void makeAdmin()

Make the current sventon session an admin session, with full access to the repositories.

void reInitSventon()

Remotely re-initialise sventon.

void refresh()

Update configuration and refresh sventon if possible.

def registerRootRepository(Wiki w)

Adds a repository definition to the database for the repository root from which the top-level directory of the given wiki was checked out.

void removeAllRepositories()

Remove all repositories from the current sventon configuration.

String sventonRelativeUrl(String path)

Given a path relative to the sventon web application, returns the path relative to the root of the web server for that sventon path, with the current session ID (if any) appended.

void updateConfig()

Update the sventon configuration, writing one repository definition for each known wiki area.

def withCowSventonSession(def callable)

Load or create a sventon session object for the current request, process it with the given closure and persist the session back to disk.

 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Property Detail

conf

static Map conf
Config


randomNumberGenerator

private def randomNumberGenerator
Random number generator used to generate session IDs.


sandboxManager

def sandboxManager
Sandbox manager, autowired by grails.


sventonJmxManager

def sventonJmxManager
The JMX MBean used to remote-control sventon, autowired.


 
Constructor Detail

SventonService

SventonService()


 
Method Detail

currentSventonSessionID

String currentSventonSessionID()
Get the ID of the CowSventonSession corresponding to the current HTTP session. If the current session does not have an associated CowSventonSession, a new random ID is created.


getSvnRepository

public def getSvnRepository(Wiki w, File wcPath, boolean refreshIfNecessary = false)
Returns an SvnRepository object for the root of the repository associated with the given working copy path in the given wiki, creating one in the database if necessary.
param:
w the Wiki
param:
wcPath the path within the wiki working copy
param:
refreshAsNecessary (default false) if it turns out to be necessary to create a new SvnRepository in the database and this parameter is true, refresh the sventon configuration.


grantPermission

void grantPermission(String repository, String path)
Add a grant for the given repository and path to the current sventon session.


historyLink

String historyLink(Wiki w, File pageFile, def redirectToYam)
Returns the sventon link to view the history of a given page in a wiki. The returned url includes the identifier for a sventon session which is configured to allow the necessary permissions to view this link.


isManagerAvailable

boolean isManagerAvailable()
Check whether the sventon remote controller is available.


makeAdmin

void makeAdmin()
Make the current sventon session an admin session, with full access to the repositories.


reInitSventon

void reInitSventon()
Remotely re-initialise sventon.


refresh

void refresh()
Update configuration and refresh sventon if possible.


registerRootRepository

public def registerRootRepository(Wiki w)
Adds a repository definition to the database for the repository root from which the top-level directory of the given wiki was checked out.


removeAllRepositories

void removeAllRepositories()
Remove all repositories from the current sventon configuration.


sventonRelativeUrl

String sventonRelativeUrl(String path)
Given a path relative to the sventon web application, returns the path relative to the root of the web server for that sventon path, with the current session ID (if any) appended. This is the URL to which we would redirect a user's browser.


updateConfig

void updateConfig()
Update the sventon configuration, writing one repository definition for each known wiki area.


withCowSventonSession

public def withCowSventonSession(def callable)
Load or create a sventon session object for the current request, process it with the given closure and persist the session back to disk.


 

Groovy Documentation