XSLT extension elements and functions supporting the 4SS repository API

Copyright 2004 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/
Destroy the current session
unknown
unknown
Get the user name given the path to a user resource. If the path is invalid or does not give a user object, '' is returned.
unknown
Get an RTF that is as a live version of the document function. NOTE: This does not work like document(), where document() caches RTFs and always returns the same one per the spec, as-dom will return the latest in the repo.
unknown
Returns, as a node-set of 'path' elements, the full paths to all user resources that are members of the specified group
unknown
Get the size of the resource
unknown
unknown
Given an ftss URI, returns a URI reference. The reference will be relative to the HTTP handler's document root.
unknown
Query if the system has a resource specified by the path
unknown
Gets property data associated with a user
unknown
unknown
Verify that the testAclIdent is in the acl list specified by the acl key for this object.
unknown
Return a hash for a string DEPRECATED - use f:sha-hash()
unknown
Get the name of the resource.
unknown
unknown
Given a user name, return the user resource path
unknown
Runs a conatins on the repository model, which matches patterns among the triples in the model. You provide whichever of the subject, predicate and object you'd like to match, and use the frdf:any() function as a wildcard. The return value is a boolean indicating whether or not a matching statement exists.
unknown
Get the URI that this resource references
unknown
Delete one of the key/value pairs stored in the session data
unknown
Erases property data associated with a user
unknown
Get the resource (path) given a user or group name
unknown
Perform a Versa Query as a function, return a node-set representing the outside list.
unknown
Get the IMT of a resource
unknown
unknown
unknown
Get the parent container of this resource
unknown
Convert a full repository URI e.g. ("ftss:///spam/eggs") to a repository path (e.g. "/spam/eggs")
unknown
Get the date the resource was last modified
unknown
unknown
Get the name (not the resource) of the current user
unknown
unknown
unknown
Get a list of alias objects that reference this object
unknown
unknown
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.
unknown
unknown
Sets property data associated with a user
unknown
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
unknown
Get the date the resource was created
unknown
Get the owner of the resource
unknown
Get the string content of this resource as a raw Unicode object

path - the repository path to the object to retrieve encoding - the encoding to use in converting the content to Unicode
unknown
Runs a complete on the repository model, which matches patterns among the triples in the model. You provide whichever of the subject, predicate and object you'd like to match, and use the frdf:any() function as a wildcard. The return value is a generated node set which has one or more "Statement" elements, each with 5 children: "Subject", "Predicate", "Object", "StatementUri", "Scope" which represent the respective components of the RDF statement.

for example:

frdf:complete("http://spam.com", frdf:any(), frdf:any())

would return all statements with "http://spam.com" as the subjects.
unknown
Get the string meta data of this resource
unknown
Convert a repository path (e.g. "/spam/eggs") to a proper repository URI e.g. ("ftss:///spam/eggs")
unknown
Get the resource (path) for the current user
unknown
Get the full path into the system, resolving aliases if needed
unknown
Get the string content of this resource as an XPath string object

path - the repository path to the object to retrieve encoding - the encoding to use in converting the content to Unicode
unknown
Given a repo path, returns a repo path that is relative to the HTTP handler's document root, if possible. Otherwise, returns the given path unchanged.
unknown
unknown
Get the resource type of the resource
unknown
Gets the names of properties associated with a user
unknown
See if this connection is in a session
unknown
unknown
fhttp:get-query-args() returns a node-set consisting of one 'requestParameters' element, containing one child element for each item in the HTTP request parameters, a.k.a. the query arguments (typically HTML form data).

The HTTP server will have already decoded the parameters and made them available to the XSLT processor; this function merely provides access to that data as a node-set. The parameter name becomes the element name, and the value is the element's content. If there are multiple parameters with the same name, they'll manifest as separate elements.
unknown
Creates a new group with the specified path. A group is a set of users and other groups.
The path for the new group
The base-uri to use for relative path
Change the namespace mapping of this doc def.
The path of the document definition
A whitespace-separated list of namespace prefixes to remove.
Adds statements to the repository model. The subject, predicates and objects can be strings or node sets node sets are converted to a list of strings by taking the string value of each item. String values are treated a list with one string. The cartesian product of statements that come from the list of subject, predicate and object strings are all added to the model using the given scope and statement URI.
The statement uri
The object
The predicate
The subject
The scope of the statement
The type (or xml:lang) of the object
Removes statements to the repository model. The subject, predicates and objects can be strings or node sets node sets are converted to a list of strings by taking the string value of each item. String values are treated a list with one string. The cartesian product of statements that come from the list of subject, predicate and object strings and that match the given scope and statement URI are all removed from the model.
Indicates the method for matching the value of the subject argument
The statement uri
Indicates the method for matching the value of the predicate argument
The object
Indicates the method for matching the value of the scope argument
The predicate
The subject
Indicates the method for matching the value of the statement URI argument
Indicates the method for matching the value of the object argument
The scope of the statement
The type (or xml:lang) of the object
Changes the password of the specified user resource.
The new password. If not specified, will remove the password for this user.
The path of the user
Set the string content of the resource with the given path, document definition and type. The output of the body of the element makes up the content of the resulting document, either literally or as a result of the contained XSLT instructions (according to the literal-content attribute). All the attributes available on the xsl:output instruction are also allowed on this element, in order to control the creation of the content. If the resource is a document whose definition specifies a full text index, then the content is re-indexed
/template/
Deprecated - use literal-content now
If yes, treat the content literally, i.e. do not execute any XSLT instructions or extensions
The path of the resource to modify
The base to use for relative paths
Creates a new uri reference resource. A URI reference resource is a special object that references an external URI (which can be a file) and loads its contents whenever the resource is requested. It behaves in some ways similar to a soft link in UNIX.
The path for the new uri-reference
The source uri of the resource being referenced
The internet media-type (MIME content-type)
The base to use for relative path
Change the rdf mapping of this doc def.
The path of the document definition
The predicate to add.
The object to add.
Is the object a resource?
The subject to add.
The URI to use for the response redirect.
Remove a document definition from a document definition's base defs.
The path of the document
The document definition to use
Create a new user in the system
The name of the user to create
The initial password for new user
The base path to be used for creating this user. If not specified, uses the path of the source document.
Adds a user or group to the specified group
The path of the group to which to add this member.
The path of the new member (user or group) to add to this group.
Create a new repository session. This allows implicit log in on all requests, and the management of persistent state data.
The session key to use. If omitted, a session key is generated for you.
The time to live for the session. If omitted, the driver default is used (usually 15 minutes)
Deserializes an RDF document into statements, and removes any statements in the given scope with matching triple values.

The content of the frdf:deserialize-and-remove element is a template for the RDF/XML source from which the statements are parsed.
/template/
The path of the RDF resource in the repository
The base to use for relative paths
Delete this resource
The path of the resource to delete
Trigger a re-indexing for full-text in the repository (Requires SWISH-E as supporting software)
Allows XML content to be updated with the XUpdate protocol

The content of the fcore:xupdate element is a template for the XUpdate document source.
/template/
The path of the resource to apply XUpdate to
Creates a document with the given path, document definition and type. The output of the body of the element makes up the content of the resulting document. All the attributes available on the xsl:output instruction are also allowed on this element, in order to control the generation of the document. If the document type is not specified, and the internet media type of the source is XML, the type will be inferred from the content, if possible. If path is an empty string, then a UUID will be generated for the file name, which will be placed in the container that holds the source document of the transform. If the document definition specifies a full text index, then the content is indexed

The content of the fcore:create-document element is a template; this is instantiated to create a sequence of nodes; a root node is created with this sequence of nodes as its children; the tree with this root node represents the subsidiary result document.
/template/
The document definition to use
Specifies the internet media type for the new resource
The base to use for relative paths
(deprecated: see media-type)
The path for the new document
Specifies the resource type to create
Execute a Versa query and assign the result to a Versa variable, for use in further queries. The variable becomes bound in the Versa context for the current stylesheet invokation, and thus will be defined on all Versa queries performed subsequently, through <frdf:versa-query> or <frdf:versa-assign>.

The content of the frdf:versa-assign element is a template for the extra namespace mappings for the query (see /ftss/dashboard/NsMappings.xml for an example of the xml format).

For example, if you have the following:

<frdf:versa-assign query="type(rdfs:Class)" name="classes"/>

You can later execute

<frdf:versa-query query="$classes - rdfs:label -> *"/>
/template/
The Versa query string
Name of the Versa variable to which to assign results of this query
Narrow the versa query to the given scope
Execute a Versa query and put the results in serialized XML form to the XSLT processor output.

The content of the frdf:versa-query element is a template for the extra namespace mappings for the query (see /ftss/dashboard/NsMappings.xml for an example of the xml format).

The form of the Versa output is as documented in http://rdfinference.org/versa-xml.
/template/
The query string
Narrow the versa query to the given scope
Add access for an given identifer and level to the ACL of a resource
The access level or type. The built-in ACL levels are "read" | "write" | "write user model" | "execute" | "delete" | "change owner" | "change permissions"
The path of the resource where to add the ACL. If not given, the source document is used.
The ACL identifier (a user or group identifier)
Allow or deny this type of access
Change the rdf mapping of this doc def.
The path of the document definition
The predicate to add.
The object to add.
The subject to add.
Mark a resource as temporary
The path of the resource to mark as temporary. Defaults to current.
The time in seconds from now that the resource is to live.
Reset the ACL for a resource, and then optionally add access for an given identifer and level to the ACL of a resource
The access level or type. The built-in ACL levels are "read" | "write" | "write user model" | "execute" | "delete" | "change owner" | "change permissions"
The path of the resource where to set the ACL. If not given, the source document is used.
The ACL identifier (user or group)
Allow or deny this type of access
Creates a raw file resource, using the specified path and internet media type. The output of the body of the element makes up the content of the resulting document. All the attributes available on the xsl:output instruction are also allowed on this element, in order to control the generation of the document.

In order to set the IMT, use the media-type attribute The default is text/plain There is also a special value for the method attribute method="binary" is equivalent to method="text" and encoding="latin-1" (to simulate the binary byte stream)
/template/
Specifies the internet media type for the new resource
Specifies whether or not to assume the child argument is a string
The path for the new raw file
The base to use for relative paths
Set the username of a user resource.
The path of the user
The new name
This extension element uses GraphViz to generate a diagram of a given resource, a set of resources in a particular scope, or of the entire system model. It adds an HTML imagemap (a chunk of text that can be placed in a MAP element) to the result tree, and has the side effect of generating in the repository an SVG or JPEG image resource representing the corresponding diagram.

output-path specifies the repo path of the diagram to generate. If the resource exists already, its content will be overwritten.

If provided, resourcePath must to refer to either a specific resource in the system model or an RDF document in the repository. If it refers to an RDF document, then all RDF statements with that document's URI as their scope will be graphed. If the resourcePath refers to any other kind of resource, then only statements about it will be graphed. If no resourcePath is specified, then the entire system model will be graphed.

The image map text placed in the result tree uses the uriFormat string to generate (by appying the uris of all resources against this string) the links for all resources in the image. imagemap information is generated and returned only if the uriFormat string is specified.

Most RDF graphs are width heavy and the visualizer can be told to rotate the image 90 degrees which can be helpful far larger graphs (which could great widths). This is specified by the rotate attribute. If present, the graph is rotated, otherwise it isn't.

The max-arcs attribute specifies the maximum number of arcs. If the graph requires more arcs, then nothing will be generated at all.

This element can also take a versa query result as its child nodes. In this case, all the resources in the result are graphed and resource-path is ignored.
/template/
Whether to rotate the graph image by 90 degrees.
Whether to render RDF documents asscoped mini-graphs
The name of the diagram resource to be created
generate an svg diagram?
The maximum number of arcs to allow
A resource in the repository to graph
The directory in which 'graphViz' executable is located.
The ID to use for the image-map
A format string to use for the image-map links. Every uri in the graph is applied against this string.
The location in repository of a namespace mapping document to use for retrieving additional namespaces to truncate predicate names with
Change the creation params of a document definition.

The content of the fcore:set-creation-params element is a template for the new creation params in serialized format.
/template/
The path for the new document
Invoke the full-text search to find text in the repository (Requires SWISH-E as supporting software)
The string to search for
Change the namespace mapping of this doc def.
The path of the document definition
The prefix to add.
The uri to add.
Change the owner of a resource
The path to the new owner
The path of the resource to change the IMT of. If not given, the source document is used.
Invoke an XML-RPC server at a remote URI (Requires Python 2.2 or above) There are 5 attributes, p1, p2... which are used for the positional arguments to the remote method [this will be made less kludgy soon] Each one is an expression which follows the following conversion rules from the XPath data model:

string -> string number -> floating-point number boolean -> boolean node set -> array of strings

You can also coerce the value to a certain type by using an attribute of the form t1, t2,... corresponding to the pN attribute with one of the following string values:

INT DOUBLE STRING BOOLEAN

The return value is converted into an XML fragment representation, which is sent to output.

string -> <String>[value]</String> floating-point number -> <Double>[value]</Double> boolean -> boolean <Boolean>["true" or "false"]</Boolean> array -> <Array>[sequence of child elements as above, according to array elements]</Array>

An example of an array:

<Array> <String>a string</String> <Float>123.4</Float> <Int>1234</Int> <String>another string</String> </Array>

This means that in order to access a remote method

obj.spam('eggs', 3)

On a remote server at

http://spam.com/xmlrpcserver

And save the result of XSLT variable "monty", you can use the following XSLT snippet:

<xsl:variable name="monty"> <futil:xml-rpc-invoke uri="http://spam.com/xmlrpcserver" method="obj.spam" p1="'eggs'" p2="3" t2="INT"/> </xsl:variable>

No type coercion is used for p1 because XSLT string are generally unambiguous in converting to XML-RPC. However, the second param could be integer or double, so it is coerced (default is double).

Beware that if an array is returned, you might need to use the exslt:node-set function to convert from result tree fragment to node set.
The second parameter for the remote server
The third parameter for the remote server
The first parameter for the remote server
The fourth parameter for the remote server
The fifth parameter for the remote server
Optional type spec for the The fourth parameter
Optional type spec for the The fifth parameter
Optional type spec for the The second parameter
The URI of the remote server
Optional type spec for the first parameter
Optional type spec for the The third parameter
The method name to be invoked
Abort the current transaction (governing the current XSLT operation) which will undo all repository operations
Creates a container, if createParents is true then all its parents along the path are created (if they dont exist). createParents defaults to false if not set. The base-path attribute is the base to use for the new containers path, if relative. If not specified it uses the path of the source document.
The path for the new container
The base to use for relative path
Create any parent containers of the specified container that do not already exist.
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.
/template/
A string value for the session datum
The session key to use
Change the IMT of a resource
The path of the resource to change the IMT of. Defaults to current.
The new IMT
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.
A URI to redirect to if the login fails. Defaults to the current page.
A URI to redirect to if the login succeeds. Defaults to the current page.
The 4Suite user name
The time to live (in seconds) for the session. If omitted, the driver default is used (usually 15 minutes)
A URI to redirect to for requests after the session eventually times out. Defaults to the current page.
The 4Suite user password
Remove the ACL from a resource
The access level or type. The built-in ACL levels are "read" | "write" | "write user model" | "execute" | "delete" | "change owner" | "change permissions"
The path of the resource where to add the ACL. If not given, the source document is used.
The ACL identifier (user or group)
Indicates the method for matching the value of the subject argument
The statement uri
Indicates the method for matching the value of the predicate argument
The object
Indicates the method for matching the value of the scope argument
The predicate
The subject
Indicates the method for matching the value of the statement URI argument
Indicates the method for matching the value of the object argument
The scope of the statement
The type (or xml:lang) of the object
Removes a user or group from the specified group
The path of the group to which to remove this member.
The path of the member (user or group) to remove from this group.
Add a new document definition to a document definition's base defs.
The path of the document
The document definition to use
Deserializes an RDF document into statements, and adds them to a scope

The content of the frdf:deserialize-and-add element is a template for the RDF/XML source from which the statements are parsed.
/template/
The path of the RDF resource in the repository
The base to use for relative paths
Adds an alias for this resource to the repository.
The path of the resource to add an alias too. Defaults to current.
The document definition to use for the new alias
The path of the new alias
Change the Document Definition of a XML document
The path of the resource to change the IMT of. Defaults to current.
The new Document Definition
Change what a URI reference references.
The path of the document
The new URI
Remove an alias for this resource from the repository.
The path of the resource to add an alias to. Defaults to current.
The path of the new alias
Set the inheritance ACL of a resource
The access level or type. The built-in ACL levels are "read" | "write" | "write user model" | "execute" | "delete" | "change owner" | "change permissions"
The path of the resource where to set the ACL. If not given, the source document is used.