4Suite™ API Documentation

# ► Module Ft.Server.Server.Xslt.Repository

XSLT and XPath extensions supporting the 4SS repository API
Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: CreateSessionElement, LoginElement, RollbackElement, SessionDataElement, TextReindexRepositoryElement, TextSearchRepositoryElement |  |  |  | Functions: DeleteSessionData, GetAllDocumentDefinitionPaths, GetCurrentUser, GetCurrentUserName, GetUserOrGroupByName, HasSession, HashString, NormalizeUri, RepoPathToUriFunc, SessionData, SessionInvalidate, UriToRepoPath |  |  |  | Fields: ExtElements, ExtFunctions, FTSERVER_NAMESPACE, RESERVED_NAMESPACE, SCORE_NS

## Classes

class CreateSessionElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
Create a new repository session. This allows implicit log in on all requests, and the management of persistent state data.

### Methods

instantiate(self, context, processor)

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltElement

__init__, __str__, appendChild, expandQName, insertChild, parseAVT, parseExpression, parsePattern, processChildren, splitQName

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltNode

idle, isLastChild, isPseudoNode, pprint, prime, setup

### Fields

content = <Ft.Xml.Xslt.ContentInfo.Atom instance>
Empty is the content model for childless elements
legalAttrs = {'key': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'ttl': <Ft.Xml.Xslt.AttributeInfo.NumberAvt instance>}

### Fields

class LoginElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
Log in a user and create a new repository session accordingly, establishing a session for the logged in user with implicit log in on all subsequent requests from that agent until timeout. Sessions also support the management of persistent state data. When the repo session eventually times out, the user is redirected to timeout-redirect on the next request.

### Methods

instantiate(self, context, processor)

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltElement

__init__, __str__, appendChild, expandQName, insertChild, parseAVT, parseExpression, parsePattern, processChildren, splitQName

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltNode

idle, isLastChild, isPseudoNode, pprint, prime, setup

### Fields

content = <Ft.Xml.Xslt.ContentInfo.Atom instance>
Empty is the content model for childless elements
legalAttrs = {'failure-redirect': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'password': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'success-redirect': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'timeout-redirect': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'ttl': <Ft.Xml.Xslt.AttributeInfo.NumberAvt instance>, 'user': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>}

### Fields

class RollbackElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
Abort the current transaction (governing the current XSLT operation) which will undo all repository operations

### Methods

instantiate(self, context, processor)

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltElement

__init__, __str__, appendChild, expandQName, insertChild, parseAVT, parseExpression, parsePattern, processChildren, splitQName

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltNode

idle, isLastChild, isPseudoNode, pprint, prime, setup

### Fields

content = <Ft.Xml.Xslt.ContentInfo.Atom instance>
Empty is the content model for childless elements
legalAttrs = {}

### Fields

class SessionDataElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
Sets a key/value pair in the data for the current session data, for persistence in the user agent If the "value" attribute is used, the resulting string is the session entry value. If this attribute is omitted, a node set is the resulting value, whose sole entry is the root node of the result tree fragment from instantiating the template that makes up the content of this element.

### Methods

instantiate(self, context, processor)

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltElement

__init__, __str__, appendChild, expandQName, insertChild, parseAVT, parseExpression, parsePattern, processChildren, splitQName

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltNode

idle, isLastChild, isPseudoNode, pprint, prime, setup

### Fields

content = <Ft.Xml.Xslt.ContentInfo.Rep instance>
Template is the set of text, instructions or result-elements
legalAttrs = {'key': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'value': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>}

### Fields

class TextReindexRepositoryElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
Trigger a re-indexing for full-text in the repository (Requires SWISH-E as supporting software)

### Methods

instantiate(self, context, processor)

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltElement

__init__, __str__, appendChild, expandQName, insertChild, parseAVT, parseExpression, parsePattern, processChildren, splitQName

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltNode

idle, isLastChild, isPseudoNode, pprint, prime, setup

### Fields

content = <Ft.Xml.Xslt.ContentInfo.Atom instance>
Empty is the content model for childless elements
legalAttrs = {}

### Fields

class TextSearchRepositoryElement(Ft.Xml.Xslt.StylesheetTree.XsltElement)
Invoke the full-text search to find text in the repository (Requires SWISH-E as supporting software)

### Methods

instantiate(self, context, processor)

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltElement

__init__, __str__, appendChild, expandQName, insertChild, parseAVT, parseExpression, parsePattern, processChildren, splitQName

### Methods inherited from class Ft.Xml.Xslt.StylesheetTree.XsltNode

idle, isLastChild, isPseudoNode, pprint, prime, setup

### Fields

content = <Ft.Xml.Xslt.ContentInfo.Atom instance>
Empty is the content model for childless elements
legalAttrs = {'query': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>}

### Fields

## Functions

DeleteSessionData(context, key)
Delete one of the key/value pairs stored in the session data
GetAllDocumentDefinitionPaths(context, path=None)
Get the resource (path) given a user or group name
GetCurrentUser(context)
Get the resource (path) for the current user
GetCurrentUserName(context)
Get the name (not the resource) of the current user
GetUserOrGroupByName(context, name)
Given a user name, return the user resource path
HasSession(context)
See if this connection is in a session
HashString(context, rawString)
Return a hash for a string DEPRECATED - use f:sha-hash()
NormalizeUri(context, uri, base=None)
Resolve a relative URI against a given base, in effect just turning it into a proper repository URI (ftss://...) if no base is given for a relative path
RepoPathToUriFunc(context, path)
Convert a full repository URI e.g. ("ftss:///spam/eggs") to a repository path (e.g. "/spam/eggs")
SessionData(context, key)
Session data is stored under a session ID (a UUID string) and takes the form of zero or more key-value pairs. Each key is a unique string, and each value is either a string or a node-set.
This XSLT extension function coerces the given key to its string-value
and returns from the current session the node-set that is associated with
that key. If the key does not exist in the current session, or if there is
no current session, then an empty node-set is returned. There is no way to
distinguish between an empty node-set as an indication of such an error and
an empty node-set as the legitimate value for the given key.
SessionInvalidate(context)
Destroy the current session
UriToRepoPath(context, uri)
Convert a repository path (e.g. "/spam/eggs") to a proper repository URI e.g. ("ftss:///spam/eggs")

## Fields

ExtElements = {('http://xmlns.4suite.org/4ss/score', 'create-session'): <class Ft.Server.Server.Xslt.Repository.CreateSessionElement>, ('http://xmlns.4suite.org/4ss/score', 'login'): <class Ft.Server.Server.Xslt.Repository.LoginElement>, ('http://xmlns.4suite.org/4ss/score', 'repo-text-reindex'): <class Ft.Server.Server.Xslt.Repository.TextReindexRepositoryElement>, ('http://xmlns.4suite.org/4ss/score', 'repo-text-search'): <class Ft.Server.Server.Xslt.Repository.TextSearchRepositoryElement>, ('http://xmlns.4suite.org/4ss/score', 'rollback'): <class Ft.Server.Server.Xslt.Repository.RollbackElement>, ('http://xmlns.4suite.org/4ss/score', 'session-data'): <class Ft.Server.Server.Xslt.Repository.SessionDataElement>}
ExtFunctions = {('http://xmlns.4suite.org/4ss/score', 'delete-session-data'): <function DeleteSessionData>, ('http://xmlns.4suite.org/4ss/score', 'get-all-document-definition-paths'): <function GetAllDocumentDefinitionPaths>, ('http://xmlns.4suite.org/4ss/score', 'get-current-user'): <function GetCurrentUser>, ('http://xmlns.4suite.org/4ss/score', 'get-current-username'): <function GetCurrentUserName>, ('http://xmlns.4suite.org/4ss/score', 'get-user-name'): <function _GetUserName>, ('http://xmlns.4suite.org/4ss/score', 'get-user-or-group'): <function GetUserOrGroupByName>, ('http://xmlns.4suite.org/4ss/score', 'has-session'): <function HasSession>, ('http://xmlns.4suite.org/4ss/score', 'hash-string'): <function HashString>, ('http://xmlns.4suite.org/4ss/score', 'normalize-uri'): <function NormalizeUri>, ('http://xmlns.4suite.org/4ss/score', 'repo-path-to-uri'): <function RepoPathToUriFunc>, ...}
FTSERVER_NAMESPACE = 'http://xmlns.4suite.org/reserved'
RESERVED_NAMESPACE = 'http://xmlns.4suite.org/reserved'
SCORE_NS = 'http://xmlns.4suite.org/4ss/score'