`
vipivan
  • 浏览: 10519 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

Spring Webscripts Reference Documentation

 
阅读更多
[u][/u]Spring Webscripts Reference Documentation
Yong Qu
Michael Uzquiano
1.0.0-SNAPSHOT

Copyright (C) 2005-2009 Alfresco Software Limited.

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.


--------------------------------------------------------------------------------

I. Welcome to Spring Webscripts Project
II. Appendices
A. RESTful API Reference
A.1. Package Webscript Core
A.1.1. Resource Index
A.1.1.1. Web Script Web Scripts Home
A.1.1.2. Web Script Web Script Maintenance
A.1.1.3. Web Script All Web Scripts Index
A.1.1.4. Web Script Failed Web Scripts Index
A.1.1.5. Web Script Web Script Family Index
A.1.1.6. Web Script Web Script Lifecycle Index
A.1.1.7. Web Script Web Script Package Index
A.1.1.8. Web Script Web Script URI Index
A.1.2. Resource Javascript Debugger
A.1.2.1. Web Script Javascript Debugger
A.1.2.2. Web Script Javascript Debugger Maintenance
A.1.3. Resource Tools
A.1.3.1. Web Script Web Script Description
A.1.3.2. Web Script Display Web Script
A.1.3.3. Web Script Web Script Installer Form
A.1.3.4. Web Script Install Web Script
A.1.4. Resource Others
A.1.4.1. Web Script Web Script Package Documentation
B. JavaScript Root Object Reference
B.1. atom
B.2. jsonUtils
B.3. logger
B.4. remote
B.5. server
B.6. stringUtils
C. JavaScript API Reference
C.1. org.springframework.extensions.webscripts.ScriptLogger
C.2. org.springframework.extensions.webscripts.ScriptRemote
C.3. org.springframework.extensions.webscripts.ScriptRemoteConnector
C.4. org.springframework.extensions.webscripts.ScriptRenderContext
C.5. org.springframework.extensions.webscripts.ScriptSurf
C.6. org.springframework.extensions.webscripts.ScriptableUtils
C.7. org.springframework.extensions.webscripts.atom.AtomService
C.8. org.springframework.extensions.webscripts.json.JSONUtils
D. Template Root Object Reference
D.1. argreplace
D.2. atom
D.3. date
D.4. dateCompare
D.5. encodeuri
D.6. jsonUtils
D.7. server
D.8. stringUtils
D.9. xmldate
E. Template API Reference
E.1. org.springframework.extensions.webscripts.AbsoluteUrlMethod
E.2. org.springframework.extensions.webscripts.ArgReplaceMethod
E.3. org.springframework.extensions.webscripts.ClientUrlFunctionMethod
E.4. org.springframework.extensions.webscripts.DateCompareMethod
E.5. org.springframework.extensions.webscripts.FormatWriterMethod
E.6. org.springframework.extensions.webscripts.FreemarkerI18NMessageMethod
E.7. org.springframework.extensions.webscripts.ISO8601DateFormatMethod
E.8. org.springframework.extensions.webscripts.MessageMethod
E.9. org.springframework.extensions.webscripts.ScriptRenderContext
E.10. org.springframework.extensions.webscripts.ScriptSurf
E.11. org.springframework.extensions.webscripts.ScriptUrlMethod
E.12. org.springframework.extensions.webscripts.ScriptableUtils
E.13. org.springframework.extensions.webscripts.UrlEncodeMethod
E.14. org.springframework.extensions.webscripts.atom.AtomService
E.15. org.springframework.extensions.webscripts.json.JSONUtils
Part I. Welcome to Spring Webscripts Project
Welcome to Webscripts Project

Part II. Appendices
The final part of the reference guide provides appendices and background information that does not neatly belong within the other parts. The information is intended to be treated as a reference and not read consecutively.

Appendix A. RESTful API Reference
This document displays list of available Web Scripts of this project. Web Scripts are grouped in the heirachy of Package, Resource and Web Script.

Within each package, web Scripts that don't belong to any resource will be placed under the default 'Others' resource.

This project has total 15 web scripts.

A.1. Package Webscript Core
Package /org/springframework/extensions/webscripts

Core webscripts for index page, js debugger, installation etc.

A.1.1. Resource Index
Index related webscripts.

A.1.1.1. Web Script Web Scripts Home
Web Scripts Home

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/index.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/index.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/
/index

Life Cycle : internal

Multipart Processing : true

Negotiated Formats : undefined

A.1.1.2. Web Script Web Script Maintenance
Maintain index of Web Scripts

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/index.post

Kind : undefined

Method : POST

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/index.post.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/index?reset={reset?}
/?reset={reset?}

Life Cycle : internal

Multipart Processing : true

Negotiated Formats : undefined

A.1.1.3. Web Script All Web Scripts Index
Retrieve an index of all Web Scripts

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/indexall.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/indexall.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/index/all?package={package?}&url={url?}&family={family?}
/index/all.mediawiki?package={package?}&url={url?}&family={family?}

Life Cycle : internal

Multipart Processing : true

Negotiated Formats : undefined

A.1.1.4. Web Script Failed Web Scripts Index
Retrieve an index of all failed Web Scripts

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/indexfailures.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/indexfailures.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/index/failures

Life Cycle : internal

Multipart Processing : true

Negotiated Formats : undefined

A.1.1.5. Web Script Web Script Family Index
Provide an index of Web Scripts for the specified family

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/indexfamily.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/indexfamily.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/index/family/{family}

Life Cycle : internal

Multipart Processing : true

Negotiated Formats : undefined

A.1.1.6. Web Script Web Script Lifecycle Index
Provide an index of Web Scripts in the various lifecycle states
 
none   : This web script is not part of a lifecycle.
sample : This web script is a sample and is not intended for production use.
draft  : This method may be incomplete, experimental or still subject to change.
public_api : This method is part of the Alfresco public api and should be stable and well tested.
draft_public_api : This method is intended to eventually become part of the public api but is
                   incomplete or still subject to change.
deprecated : This method should be avoided.  It may be removed in future versions of Alfresco.
internal   : This script is for Alfresco use only. This script should not be relied upon between
             versions.It is likely to change.

 

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/indexlifecycle.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/indexlifecycle.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/index/lifecycle/{lifecycle}

Life Cycle : internal

Multipart Processing : true

Negotiated Formats : undefined

A.1.1.7. Web Script Web Script Package Index
Provide an index of Web Scripts for the specified Web Script package

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/indexpackage.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/indexpackage.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/index/package/{package}

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.1.8. Web Script Web Script URI Index
Provide an index of Web Scripts for the specified Web Script URI

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/indexuri.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/indexuri.get.desc.xml

Extensions : undefined

Familys : none

Format Style : argument

Default Format : html

URLs

/index/uri/{uri}

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.2. Resource Javascript Debugger
Webscripts for managing Javascript Debugger.

A.1.2.1. Web Script Javascript Debugger
Javascript Debugger

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/jsdebugger.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/jsdebugger.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/api/javascript/debugger

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.2.2. Web Script Javascript Debugger Maintenance
Javascript Debugger Maintenance

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/jsdebugger.post

Kind : undefined

Method : POST

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/jsdebugger.post.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/api/javascript/debugger?active={active?}

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.3. Resource Tools
Tools for Webscript inspection, display, installation etc.

A.1.3.1. Web Script Web Script Description
Retrieve description document for identified Web Script

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/scriptdescription.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/scriptdescription.get.desc.xml

Extensions : undefined

Familys : none

Format Style : argument

Default Format : html

URLs

/description/{serviceId}

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.3.2. Web Script Display Web Script
Full inspection of Web Script implementation - useful for diagnostics and download/upload

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/scriptdump.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/scriptdump.get.desc.xml

Extensions : undefined

Familys : none

Format Style : argument

Default Format : html

URLs

/script/{serviceId}

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.3.3. Web Script Web Script Installer Form
Web Script Installer Form

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/scriptinstall.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/scriptinstall.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/installer

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.3.4. Web Script Install Web Script
Install Web Script

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/scriptinstall.post

Kind : undefined

Method : POST

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/scriptinstall.post.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/installer

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

A.1.4. Resource Others
This is the resource for all Web Scripts which don't belong to any resouce.

A.1.4.1. Web Script Web Script Package Documentation
Provides reference documentation for the specified Web Script package

The Web script description document specifies the following options:

Id : org/springframework/extensions/webscripts/indexpackagedoc.get

Kind : undefined

Method : GET

Run As : undefined

Script Path : org/springframework/extensions/webscripts

Store Path : classpath:webscripts

Authentication : admin

Cache Public : false

Cache Must Validate : true

Never Cache : true

Transaction : required

Buffer Size : 4096

Transaction Required : required

Transaction Capability : readwrite

Web Script Descriptor : org/springframework/extensions/webscripts/indexpackagedoc.get.desc.xml

Extensions : undefined

Familys : none

Format Style : any

Default Format : html

URLs

/index/package/{package}/doc

Life Cycle : none

Multipart Processing : true

Negotiated Formats : undefined

Appendix B. JavaScript Root Object Reference
This document displays list of available JavaScript root objects that can be used in JavaScript templates. Root objects are listed in alphabetic order according to their names.

Each JavaScript root object in the following list is backed by a server-side java class respectively. Public methods of the java class are exposed as APIs for corresponding JavaScript root object.

For example

var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);
This project has total 6 JavaScript root objects.

B.1. atom
Java Class : org.springframework.extensions.webscripts.atom.AtomService

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of Atom related methods.


Sample Code :

//JavaScript Sample Code
var object = entry.getExtension(atom.names.cmis_object);
//Freemarker Sample Code
<#assign cmis_object=entry.getExtension(atom.names.cmis_object)>

Methods

Method : createEntry

Help :

Constructs an empty entry


Return : Empty entry

Method : getNames

Help :

Gets pre-configured Atom Extensions (QNames)


Return : map of QNames by alias

Method : createFeed

Help :

Constructs an empty feed


Return : Empty feed

Method : createQName

Help :

Creates a QName


Return : QName

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Uri string


Parameter : var1

Java Class : java.lang.String

Help :

Local name



Method : toMimeType

Help :

Establishs mimetype of atom content


Return : mimetype (or null, if it could not be established)

Parameters

Parameter : var0

Java Class : org.apache.abdera.model.Entry

Help :

Entry



Method : toAtom

Help :

Parses an Atom element


Return : Element

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom element



Method : toAtom

Help :

Parses an Atom element


Return : Element

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom element string



Method : toService

Help :

Parses an Atom service


Return : Atom servce

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom entry



Method : toService

Help :

Parses an Atom service


Return : Atom service

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom entry string



Method : toEntry

Help :

Parses an Atom Entry


Return : Entry

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom entry



Method : toEntry

Help :

Parses an Atom entry


Return : Entry

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom entry string



Method : toFeed

Help :

Parses an Atom feed


Return : Feed

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom feed



Method : toFeed

Help :

Parses an Atom feed


Return : Feed

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom feed string




B.2. jsonUtils
Java Class : org.springframework.extensions.webscripts.json.JSONUtils

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of JSON Utility methods.


Sample Code :

//JavaScript Sample Code
var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);

//Freemarker Template Sample Code
[
    <#list tags as tag>
        ${jsonUtils.encodeJSONString(tag)}<#if tag_has_next>,</#if>
    </#list>
]

Methods

Method : toObject

Help :

Takes a JSON string and converts it to a native java script object


Sample Code :

//JavaScript Sample Code
model.postCode = jsonUtils.toObject(json).postCode;

Return : the created native JS object that represents the JSON object

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

A valid json string



Method : toObject

Help :

Takes a JSON object and converts it to a native java script object


Sample Code :

//JavaScript Sample Code
model.postCode = jsonUtils.toObject(json).postCode;

Return : the created native object

Parameters

Parameter : var0

Java Class : org.json.JSONObject

Help :

The json object



Method : toJSONString

Help :

Converts a given JavaScript native object and converts it to the relevant JSON string.


Sample Code :

//JavaScript Sample Code
var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);

Return : JSON string

Parameters

Parameter : var0

Java Class : java.lang.Object

Help :

JavaScript object



Method : encodeJSONString

Help :

Encodes a JSON string value


Return : Encoded value

Parameters

Parameter : var0

Java Class : java.lang.Object

Help :

Value to encode




B.3. logger
Java Class : org.springframework.extensions.webscripts.ScriptLogger

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Provides functions to aid debugging of scripts.


Sample Code :

logger.log("Command Processor: isEmailed=" + isEmailed);

Methods

Method : log

Help :

Logs a message


Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Message to log



Method : warn

Help :

Logs a warning message


Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Message to log



Method : isLoggingEnabled

Help :

Returns true if logging is enabled.


Sample Code :

var loggerStatus = logger.isLogginEnabled();

Return : true if logging is enabled

Method : isWarnLoggingEnabled

Help :

Returns true if warn logging is enabled.


Sample Code :

var loggerStatus = logger.isWarnLogginEnabled();

Return : true if warn logging is enabled


B.4. remote
Java Class : org.springframework.extensions.webscripts.ScriptRemote

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Provides useful functions for working with endpoints, connectors and credentials.


Sample Code :

// get a connector to the Alfresco repository endpoint
var connector = remote.connect("alfresco");
// retrieve the web script index page
var indexHtml = connector.get("/index");

Methods

Method : connect

Help :

Constructs a remote connector to a default endpoint (if configured).
If a default endpoint is not configured, null will be returned.


Return : The remote client

Method : connect

Help :

Constructs a remote connector to a specific endpoint (if configured).
If a default endpoint is not configured, null will be returned.


Return : The remote client

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url



Method : call

Help :

Invoke a specific URI on the default endpoint


Return : The reponse

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url



Method : getEndpointIds

Help :

Returns a list of the application endpoint ids


Return : List of the application endpoint ids

Method : getEndpointName

Help :

Returns the name of an endpoint


Return : Endpoint name

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id



Method : getEndpointDescription

Help :

Returns the description of an endpoint


Return : Endpoint description

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id



Method : isEndpointPersistent

Help :

Checks if an endpoint is persistent or not


Return : True if the endpoint is persistent

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id



Method : getEndpointURL

Help :

Returns the configured URL for the given endpoint


Return : The endpoint url

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id




B.5. server
Java Class : org.springframework.extensions.webscripts.PresentationContainer$PresentationServerModel

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

B.6. stringUtils
Java Class : org.springframework.extensions.webscripts.ScriptableUtils

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of script utility methods for working with strings etc.


Sample Code :

//JavaScript Sample Code
model.biohtml = stringUtils.replaceLineBreaks(bio);

//Freemarker Template Sample Code
${stringUtils.stripUnsafeHTML(item.node.content)?substring(0, contentLength)}

Methods

Method : urlDecode

Help :

Decodes input URL string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : stripEncodeUnsafeHTML

Help :

Strips encode unsafe HTML tags from the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : stripUnsafeHTML

Help :

Strips unsafe HTML tags from the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : replaceLineBreaks

Help :

Replaces line breaks in the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : encodeHTML

Help :

Encodes input HTML string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : encodeJavaScript

Help :

Encodes input JavaScript string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : urlEncode

Help :

Encodes input string using URLEncoder


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : urlEncodeComponent

Help :

Encode input URL string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : parseXMLNodeModel

Help :

Converts an xml string to a freemarker node model


Return : Freemarker node model

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input XML string




Appendix C. JavaScript API Reference
This document displays list of available JavaScript APIs that can be used in JavaScript templates.

All JavaScript APIs are backed by server-side java classes. Public methods of the server-side java class are exposed as APIs for corresponding JavaScript object.

For example

var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);
This project has total 8 JavaScript objects.

C.1. org.springframework.extensions.webscripts.ScriptLogger
Java Class : org.springframework.extensions.webscripts.ScriptLogger

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Provides functions to aid debugging of scripts.


Sample Code :

logger.log("Command Processor: isEmailed=" + isEmailed);

Methods

Method : log

Help :

Logs a message


Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Message to log



Method : warn

Help :

Logs a warning message


Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Message to log



Method : isLoggingEnabled

Help :

Returns true if logging is enabled.


Sample Code :

var loggerStatus = logger.isLogginEnabled();

Return : true if logging is enabled

Method : isWarnLoggingEnabled

Help :

Returns true if warn logging is enabled.


Sample Code :

var loggerStatus = logger.isWarnLogginEnabled();

Return : true if warn logging is enabled


C.2. org.springframework.extensions.webscripts.ScriptRemote
Java Class : org.springframework.extensions.webscripts.ScriptRemote

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Provides useful functions for working with endpoints, connectors and credentials.


Sample Code :

// get a connector to the Alfresco repository endpoint
var connector = remote.connect("alfresco");
// retrieve the web script index page
var indexHtml = connector.get("/index");

Methods

Method : connect

Help :

Constructs a remote connector to a default endpoint (if configured).
If a default endpoint is not configured, null will be returned.


Return : The remote client

Method : connect

Help :

Constructs a remote connector to a specific endpoint (if configured).
If a default endpoint is not configured, null will be returned.


Return : The remote client

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url



Method : call

Help :

Invoke a specific URI on the default endpoint


Return : The reponse

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url



Method : getEndpointIds

Help :

Returns a list of the application endpoint ids


Return : List of the application endpoint ids

Method : getEndpointName

Help :

Returns the name of an endpoint


Return : Endpoint name

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id



Method : getEndpointDescription

Help :

Returns the description of an endpoint


Return : Endpoint description

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id



Method : isEndpointPersistent

Help :

Checks if an endpoint is persistent or not


Return : True if the endpoint is persistent

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id



Method : getEndpointURL

Help :

Returns the configured URL for the given endpoint


Return : The endpoint url

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint id




C.3. org.springframework.extensions.webscripts.ScriptRemoteConnector
Java Class : org.springframework.extensions.webscripts.ScriptRemoteConnector

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Describes a connector to a remote endpoint.


Sample Code :

// get a connector to the Alfresco repository endpoint
var connector = remote.connect("alfresco");
// retrieve the web script index page
var indexHtml = connector.get("/index");

Methods

Method : get

Help :

Invokes a GET request URI on the endpoint.


Return : Response object from the call

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url



Method : put

Help :

Invokes a URI on a remote service, passing the supplied body as a PUT request.


Return : Response object from the call

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url


Parameter : var1

Java Class : java.lang.String

Help :

Body of the PUT request.



Method : put

Help :

Invokes a URI on a remote service, passing the supplied body as a PUT request.


Return : Response object from the call

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url


Parameter : var1

Java Class : java.lang.String

Help :

Body of the PUT request.


Parameter : var2

Java Class : java.lang.String

Help :

Content mimetype of the request.



Method : getDescriptor

Help :

Returns the endpoint descriptor


Return : Endpoint descriptor

Method : post

Help :

Invokes a URI on a remote service, passing the supplied body as a POST request.


Return : Response object from the call

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url


Parameter : var1

Java Class : java.lang.String

Help :

Body of the POST request.



Method : post

Help :

Invokes a URI on a remote service, passing the supplied body as a POST request.


Return : Response object from the call

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url


Parameter : var1

Java Class : java.lang.String

Help :

Body of the POST request.


Parameter : var2

Java Class : java.lang.String

Help :

Content mimetype of the request body



Method : del

Help :

Invokes a URI on a remote service as DELETE request.
NOTE: the name of the method is 'del' not 'delete' so as to not
interfere with JavaScript Object.delete() method.


Return : Response object from the call

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url



Method : call

Help :

Invokes a URI on the endpoint via a GET request.


Return : Response object from the call

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Endpoint Url



Method : getEndpoint

Help :

Returns the endpoint string


Return : Endpoint


C.4. org.springframework.extensions.webscripts.ScriptRenderContext
Java Class : org.springframework.extensions.webscripts.ScriptRenderContext

Module Artifact Id : spring-surf

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-surf

Module Version : target

Java Doc : link

Help :

Render context for the current rendering object


Methods

Method : getResource

Help :

Gets the currently rendering content resource


Return : The currently rendering ScriptResource or null if none

Method : getId

Help :

Gets the id of the request context


Method : getParameters

Help :

A key/value map of parameters in the incoming request.


Method : getUser

Help :

Gets the user object.


Return : The ScriptUser for the current user or null if a user is not logged in.

Method : getTemplate

Help :

Gets the currently rendering template.


Return : The ScriptModelObject for the Template or null if a template is not being rendered.

Method : getPage

Help :

Gets the currently rendering page.


Return : The ScriptModelObject for the Page or null if a page is not being rendered.

Method : getFormatId

Help :

Gets the requested format id


Method : getThemeId

Help :

Gets the currently rendering theme id.


Method : getTheme

Help :

Gets the currently rendering theme.


Return : The ScriptModelObject for the Theme or null if a theme is not being rendered.

Method : getPageId

Help :

Gets the id of the currently rendering page.
Returns null if a page is not being rendered.


Method : getRootPage

Help :

Gets the root page for the site.


Return : The ScriptModelObject for the root page.

Method : getSiteConfiguration

Help :

Gets the site configuration.


Return : The ScriptModelObject for the site configuration or null if a site configuration is not set up.

Method : getLinkBuilder

Help :

Returns the ScriptLinkBuilder instance for the current request.


Method : getTemplateId

Help :

Gets the id of the currently rendering template.
Returns null if a template is not being rendered.


Method : getContentId

Help :

Gets the id of the currently rendering content resource


Return : The id of the content resource or null if none

Method : setThemeId

Help :

Sets the theme for the current user session by providing the theme id.


Parameters

Parameter : var0

Java Class : java.lang.String


Method : getAuthenticated

Help :

Returns whether the current user is authenticated.


Method : getExternalAuthentication

Help :

Returns whether the current user is externally authenticated.



C.5. org.springframework.extensions.webscripts.ScriptSurf
Java Class : org.springframework.extensions.webscripts.ScriptSurf

Module Artifact Id : spring-surf

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-surf

Module Version : target

Java Doc : link

Help :

Root-scoped Java object that represents the configuration of Spring Surf


Methods

Method : getLoginEnabled

Help :

Indicates whether Spring Surf has a non-default User Factory configured for it


Return : Whether a user factory is configured


C.6. org.springframework.extensions.webscripts.ScriptableUtils
Java Class : org.springframework.extensions.webscripts.ScriptableUtils

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of script utility methods for working with strings etc.


Sample Code :

//JavaScript Sample Code
model.biohtml = stringUtils.replaceLineBreaks(bio);

//Freemarker Template Sample Code
${stringUtils.stripUnsafeHTML(item.node.content)?substring(0, contentLength)}

Methods

Method : urlDecode

Help :

Decodes input URL string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : stripEncodeUnsafeHTML

Help :

Strips encode unsafe HTML tags from the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : stripUnsafeHTML

Help :

Strips unsafe HTML tags from the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : replaceLineBreaks

Help :

Replaces line breaks in the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : encodeHTML

Help :

Encodes input HTML string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : encodeJavaScript

Help :

Encodes input JavaScript string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : urlEncode

Help :

Encodes input string using URLEncoder


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : urlEncodeComponent

Help :

Encode input URL string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : parseXMLNodeModel

Help :

Converts an xml string to a freemarker node model


Return : Freemarker node model

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input XML string




C.7. org.springframework.extensions.webscripts.atom.AtomService
Java Class : org.springframework.extensions.webscripts.atom.AtomService

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of Atom related methods.


Sample Code :

//JavaScript Sample Code
var object = entry.getExtension(atom.names.cmis_object);
//Freemarker Sample Code
<#assign cmis_object=entry.getExtension(atom.names.cmis_object)>

Methods

Method : createEntry

Help :

Constructs an empty entry


Return : Empty entry

Method : getNames

Help :

Gets pre-configured Atom Extensions (QNames)


Return : map of QNames by alias

Method : createFeed

Help :

Constructs an empty feed


Return : Empty feed

Method : createQName

Help :

Creates a QName


Return : QName

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Uri string


Parameter : var1

Java Class : java.lang.String

Help :

Local name



Method : toMimeType

Help :

Establishs mimetype of atom content


Return : mimetype (or null, if it could not be established)

Parameters

Parameter : var0

Java Class : org.apache.abdera.model.Entry

Help :

Entry



Method : toAtom

Help :

Parses an Atom element


Return : Element

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom element



Method : toAtom

Help :

Parses an Atom element


Return : Element

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom element string



Method : toService

Help :

Parses an Atom service


Return : Atom servce

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom entry



Method : toService

Help :

Parses an Atom service


Return : Atom service

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom entry string



Method : toEntry

Help :

Parses an Atom Entry


Return : Entry

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom entry



Method : toEntry

Help :

Parses an Atom entry


Return : Entry

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom entry string



Method : toFeed

Help :

Parses an Atom feed


Return : Feed

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom feed



Method : toFeed

Help :

Parses an Atom feed


Return : Feed

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom feed string




C.8. org.springframework.extensions.webscripts.json.JSONUtils
Java Class : org.springframework.extensions.webscripts.json.JSONUtils

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of JSON Utility methods.


Sample Code :

//JavaScript Sample Code
var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);

//Freemarker Template Sample Code
[
    <#list tags as tag>
        ${jsonUtils.encodeJSONString(tag)}<#if tag_has_next>,</#if>
    </#list>
]

Methods

Method : toObject

Help :

Takes a JSON string and converts it to a native java script object


Sample Code :

//JavaScript Sample Code
model.postCode = jsonUtils.toObject(json).postCode;

Return : the created native JS object that represents the JSON object

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

A valid json string



Method : toObject

Help :

Takes a JSON object and converts it to a native java script object


Sample Code :

//JavaScript Sample Code
model.postCode = jsonUtils.toObject(json).postCode;

Return : the created native object

Parameters

Parameter : var0

Java Class : org.json.JSONObject

Help :

The json object



Method : toJSONString

Help :

Converts a given JavaScript native object and converts it to the relevant JSON string.


Sample Code :

//JavaScript Sample Code
var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);

Return : JSON string

Parameters

Parameter : var0

Java Class : java.lang.Object

Help :

JavaScript object



Method : encodeJSONString

Help :

Encodes a JSON string value


Return : Encoded value

Parameters

Parameter : var0

Java Class : java.lang.Object

Help :

Value to encode




Appendix D. Template Root Object Reference
This document displays list of available Template root objects that can be used in view templates. Root objects are listed in alphabetic order according to their names.

Each template root object in the following list is backed by a server-side java class respectively. Public methods of the server-side java class are exposed as APIs for corresponding Template root object.

For example

{
   "data":
   {
    "ticket":"${jsonUtils.encodeJSONString(ticket)}"
   }
}
This project has total 9 Template root objects.

D.1. argreplace
Java Class : org.springframework.extensions.webscripts.ArgReplaceMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Given a URL string and N named/value pairs, replace each URL argument with
respective name/value pair (if name matches existing URL argument), or add
name/value pair to URL (if name does not match existing URL argument).

Usage: argreplace(url.args, "skipCount", cursor.nextPage, ...)


Sample Code :

[#if cursor.hasFirstPage]
<link rel="first" href="${absurl(encodeuri(scripturl(argreplace(url.args, pageNo,
cursor.firstPage, pageSize, cursor.pageSize))))?xml}" type="${format.type}"/>
[/#if]

Methods

D.2. atom
Java Class : org.springframework.extensions.webscripts.atom.AtomService

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of Atom related methods.


Sample Code :

//JavaScript Sample Code
var object = entry.getExtension(atom.names.cmis_object);
//Freemarker Sample Code
<#assign cmis_object=entry.getExtension(atom.names.cmis_object)>

Methods

Method : createEntry

Help :

Constructs an empty entry


Return : Empty entry

Method : getNames

Help :

Gets pre-configured Atom Extensions (QNames)


Return : map of QNames by alias

Method : createFeed

Help :

Constructs an empty feed


Return : Empty feed

Method : createQName

Help :

Creates a QName


Return : QName

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Uri string


Parameter : var1

Java Class : java.lang.String

Help :

Local name



Method : toMimeType

Help :

Establishs mimetype of atom content


Return : mimetype (or null, if it could not be established)

Parameters

Parameter : var0

Java Class : org.apache.abdera.model.Entry

Help :

Entry



Method : toAtom

Help :

Parses an Atom element


Return : Element

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom element



Method : toAtom

Help :

Parses an Atom element


Return : Element

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom element string



Method : toService

Help :

Parses an Atom service


Return : Atom servce

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom entry



Method : toService

Help :

Parses an Atom service


Return : Atom service

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom entry string



Method : toEntry

Help :

Parses an Atom Entry


Return : Entry

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom entry



Method : toEntry

Help :

Parses an Atom entry


Return : Entry

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom entry string



Method : toFeed

Help :

Parses an Atom feed


Return : Feed

Parameters

Parameter : var0

Java Class : org.springframework.extensions.surf.util.Content

Help :

Atom feed



Method : toFeed

Help :

Parses an Atom feed


Return : Feed

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Atom feed string




D.3. date
Java Class : java.util.Date

D.4. dateCompare
Java Class : org.springframework.extensions.webscripts.DateCompareMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Perform a test to see how two dates compare, optionally offset by a specified number of
milliseconds.

Usage:
  dateCompare(dateA, dateB) - 1 if dateA if greater than dateB
  dateCompare(dateA, dateB, millis) - 1 if dateA is greater than dateB by at least millis, else 0
  dateCompare(dateA, dateB, millis, test) - same as above, but the 'test' variable is one of the
  following strings ">", "<", "==" - greater than, less than or equal - as the test to perform.


Sample Code :

<#if (dateCompare(child.properties["cm:modified"], date, 1000*60*60*24*7) == 1)>
</#if>

Methods

D.5. encodeuri
Java Class : org.springframework.extensions.webscripts.UrlEncodeMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Encode a URL Path.

Usage: pathencode(String url)


Sample Code :

<link rel="self" href="${absurl(encodeuri(url.full))?xml}"/>

Methods

D.6. jsonUtils
Java Class : org.springframework.extensions.webscripts.json.JSONUtils

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of JSON Utility methods.


Sample Code :

//JavaScript Sample Code
var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);

//Freemarker Template Sample Code
[
    <#list tags as tag>
        ${jsonUtils.encodeJSONString(tag)}<#if tag_has_next>,</#if>
    </#list>
]

Methods

Method : toObject

Help :

Takes a JSON string and converts it to a native java script object


Sample Code :

//JavaScript Sample Code
model.postCode = jsonUtils.toObject(json).postCode;

Return : the created native JS object that represents the JSON object

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

A valid json string



Method : toObject

Help :

Takes a JSON object and converts it to a native java script object


Sample Code :

//JavaScript Sample Code
model.postCode = jsonUtils.toObject(json).postCode;

Return : the created native object

Parameters

Parameter : var0

Java Class : org.json.JSONObject

Help :

The json object



Method : toJSONString

Help :

Converts a given JavaScript native object and converts it to the relevant JSON string.


Sample Code :

//JavaScript Sample Code
var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);

Return : JSON string

Parameters

Parameter : var0

Java Class : java.lang.Object

Help :

JavaScript object



Method : encodeJSONString

Help :

Encodes a JSON string value


Return : Encoded value

Parameters

Parameter : var0

Java Class : java.lang.Object

Help :

Value to encode




D.7. server
Java Class : org.springframework.extensions.webscripts.PresentationContainer$PresentationServerModel

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

D.8. stringUtils
Java Class : org.springframework.extensions.webscripts.ScriptableUtils

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Collection of script utility methods for working with strings etc.


Sample Code :

//JavaScript Sample Code
model.biohtml = stringUtils.replaceLineBreaks(bio);

//Freemarker Template Sample Code
${stringUtils.stripUnsafeHTML(item.node.content)?substring(0, contentLength)}

Methods

Method : urlDecode

Help :

Decodes input URL string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : stripEncodeUnsafeHTML

Help :

Strips encode unsafe HTML tags from the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : stripUnsafeHTML

Help :

Strips unsafe HTML tags from the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : replaceLineBreaks

Help :

Replaces line breaks in the input string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : encodeHTML

Help :

Encodes input HTML string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : encodeJavaScript

Help :

Encodes input JavaScript string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : urlEncode

Help :

Encodes input string using URLEncoder


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : urlEncodeComponent

Help :

Encode input URL string


Return : Processed string

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input string



Method : parseXMLNodeModel

Help :

Converts an xml string to a freemarker node model


Return : Freemarker node model

Parameters

Parameter : var0

Java Class : java.lang.String

Help :

Input XML string




D.9. xmldate
Java Class : org.springframework.extensions.webscripts.ISO8601DateFormatMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Render Date to ISO8601 format. Or parse ISO6801 format string date to a Date object.

Usage: xmldate(Date date)
        xmldate(String date)


Sample Code :

<updated>${xmldate(date)}</updated>

Methods

Appendix E. Template API Reference
This document displays list of available custom Template methods that can be used in view templates if they are registered as Template root objects.

Each custom template method is backed by a server-side java class. For custom Freemarker template method, it will need to implement interface freemarker.template.TemplateMethodModelEx.

For example

var myObj = {'name':'Test Object','size':100};
var myObjAsString = jsonUtils.toJSONString(myObj);
This project has total 15 avaialble custom Template methods

E.1. org.springframework.extensions.webscripts.AbsoluteUrlMethod
Java Class : org.springframework.extensions.webscripts.AbsoluteUrlMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Render absolute url for the specified url (only if the url isn't already absolute).

Usage: absurl(String url)


Sample Code :

${absurl(url.context)}

Methods

E.2. org.springframework.extensions.webscripts.ArgReplaceMethod
Java Class : org.springframework.extensions.webscripts.ArgReplaceMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Given a URL string and N named/value pairs, replace each URL argument with
respective name/value pair (if name matches existing URL argument), or add
name/value pair to URL (if name does not match existing URL argument).

Usage: argreplace(url.args, "skipCount", cursor.nextPage, ...)


Sample Code :

[#if cursor.hasFirstPage]
<link rel="first" href="${absurl(encodeuri(scripturl(argreplace(url.args, pageNo,
cursor.firstPage, pageSize, cursor.pageSize))))?xml}" type="${format.type}"/>
[/#if]

Methods

E.3. org.springframework.extensions.webscripts.ClientUrlFunctionMethod
Java Class : org.springframework.extensions.webscripts.ClientUrlFunctionMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Render a client side javascript function to build urls to this service.

Usage: clientUrlFunction(String funcName)


Sample Code :

${clienturlfunction("encUrl")}

Methods

E.4. org.springframework.extensions.webscripts.DateCompareMethod
Java Class : org.springframework.extensions.webscripts.DateCompareMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Perform a test to see how two dates compare, optionally offset by a specified number of
milliseconds.

Usage:
  dateCompare(dateA, dateB) - 1 if dateA if greater than dateB
  dateCompare(dateA, dateB, millis) - 1 if dateA is greater than dateB by at least millis, else 0
  dateCompare(dateA, dateB, millis, test) - same as above, but the 'test' variable is one of the
  following strings ">", "<", "==" - greater than, less than or equal - as the test to perform.


Sample Code :

<#if (dateCompare(child.properties["cm:modified"], date, 1000*60*60*24*7) == 1)>
</#if>

Methods

E.5. org.springframework.extensions.webscripts.FormatWriterMethod
Java Class : org.springframework.extensions.webscripts.FormatWriterMethod

Module Artifact Id : spring-webscripts

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-webscripts

Module Version : target

Java Doc : link

Help :

Render object to mimetype of web script template.  If object cannot be serialized to mimetype
then no output is written.

Usage: formatwrite(object)


Methods

E.6. org.springframework.extensions.webscripts.FreemarkerI18NMessageMethod
Java Class : org.springframework.extensions.webscripts.FreemarkerI18NMessageMethod

Module Artifact Id : spring-surf

Module Group Id : Users.mindthegab.Dev.alfresco.workspace.spring-surf-parent.target.checkout.spring-surf

Module Version : target

Java Doc : link

Help :

Returns an I18N message resolved for the current locale and specified message ID.

Usage: message(String id)


Sample Code :

${message("templates.doc_info.name")}

Methods

E.7. org.springframework.extensions.webscripts.ISO8601DateFormatMethod
Java Class : org.springframework.extensions.webscripts.ISO8601DateFormatMethod

M
  • ECB.rar (848.3 KB)
  • 下载次数: 3
分享到:
评论

相关推荐

    XDoclet in Action

    - **Integration with Frameworks**: Examples of integrating XDoclet with popular web frameworks like Struts and Spring. #### Chapter 5: XDoclet and Web Frameworks Building on the previous chapter, ...

    linux基础进阶笔记

    linux基础进阶笔记,配套视频:https://www.bilibili.com/list/474327672?sid=4493093&spm_id_from=333.999.0.0&desc=1

    IMG20241115211541.jpg

    IMG20241115211541.jpg

    Sen2_ARI_median.txt

    GEE训练教程——Landsat5、8和Sentinel-2、DEM和各2哦想指数下载

    毕业设计&课设_基于 flask-whoosh-jieba 的代码,涉及文件管理及问题修复.zip

    该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过严格测试运行成功才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。

    基于springboot家政预约平台源码数据库文档.zip

    基于springboot家政预约平台源码数据库文档.zip

    Ucharts添加stack和折线图line的混合图

    Ucharts添加stack和折线图line的混合图

    基于springboot员工在线餐饮管理系统源码数据库文档.zip

    基于springboot员工在线餐饮管理系统源码数据库文档.zip

    2015-2021年新能源汽车分地区、分类型、分级别销量逐月数据和进出口数据-最新出炉.zip

    新能源汽车进出口数据 1、时间跨度:2018-2020年 2、指标说明:包含如下指标的进出口数据:混合动力客车(10座及以上)、纯电动客车(10座及以上)、非插电式混合动力乘用车、插电式混合动力乘用车、纯电动乘用车 二、新能源汽车进出口月销售数据(分地区、分类型、分 级别) 1、数据来源:见资料内说明 2、时间跨度:2014年1月-2021年5月 4、指标说明: 包含如下指标 2015年1月-2021年5月新能源乘用车终端月度销量(分类型)部分内容如下: 新能源乘用车(单月值、累计值 )、插电式混合动力 月度销量合计(狭义乘用车轿车、SUV、MPV、交叉型乘用车); 月度销量同比增速(狭义乘用车轿车、SUV、MPV、交叉型乘用车); 累计销量合计(狭义乘用车轿车、SUV、IPV、交叉型乘用车); 累计销量同比增速(狭义乘用车轿车、SUV、MPV、交叉型乘用车); 累计结构变化(狭义乘用车轿车、SUV、IPV、交叉型乘用车); 2015年1月-2021年5月新能源乘用车终端月度销量(分地区)内容如下: 更多见资源内

    中心主题-241121215200.pdf

    中心主题-241121215200.pdf

    蓝奏云下载链接与密码整理

    内容概要:本文档提供了多个蓝奏云下载链接及其对应解压密码,帮助用户快速获取所需文件。 适合人群:需要从蓝奏云下载文件的互联网用户。 使用场景及目标:方便地记录并分享蓝奏云上文件的下载地址和密码,提高下载效率。 阅读建议:直接查看并使用提供的链接和密码即可。若遇到失效情况,请尝试联系上传者确认更新后的链接。

    Javaweb仓库管理系统项目源码.zip

    基于Java web 实现的仓库管理系统源码,适用于初学者了解Java web的开发过程以及仓库管理系统的实现。

    Python-文件重命名-自定义添加文字-重命名

    资源名称:Python-文件重命名-自定义添加文字-重命名 类型:windows—exe可执行工具 环境:Windows10或以上系统 功能: 1、点击按钮 "源原文"【浏览】表示:选择重命名的文件夹 2、点击按钮 "保存文件夹"【浏览】表示:保存的路径(为了方便可选择保存在 源文件中 ) 3、功能①:在【头部】添加自定义文字 4、功能②:在【尾部】添加自定义文字 5、功能③:输入源字符 ;输入替换字符 可以将源文件中的字符替换自定义的 6、功能④:自动加上编号_1 _2 _3 优点: 1、非常快的速度! 2、已打包—双击即用!无需安装! 3、自带GUI界面方便使用!

    JDK8安装包,为各位学习的朋友免费提供

    JDK8安装包

    Centos-7yum的rpm包

    配合作者 一同使用 作者地址没有次下载路径 https://blog.csdn.net/weixin_52372189/article/details/127471149?fromshare=blogdetail&sharetype=blogdetail&sharerId=127471149&sharerefer=PC&sharesource=weixin_45375332&sharefrom=from_link

    setup_python_geospatial_analysis.ipynb

    GEE训练教程

    毕业设计&课设_文成公主微信公众号全栈工程,含技术栈、架构及部署流程等内容.zip

    该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过严格测试运行成功才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。

    基于springboot交通感知与车路协同系统源码数据库文档.zip

    基于springboot交通感知与车路协同系统源码数据库文档.zip

    基于springboot+vue 雅妮电影票购买系统源码数据库文档.zip

    基于springboot+vue 雅妮电影票购买系统源码数据库文档.zip

Global site tag (gtag.js) - Google Analytics