- 浏览: 10560 次
- 性别:
- 来自: 西安
最新评论
[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
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
- Spring_Webscripts_Reference_Documentation.rar (11.3 KB)
- 下载次数: 3
- zhuomian.rar (8.8 MB)
- 下载次数: 3
- listener.rar (1.7 MB)
- 下载次数: 1
- 新建文件夹.rar (11.4 KB)
- 下载次数: 2
- 新建文件夹.rar (616.6 KB)
- 下载次数: 4
- 新建文件夹.rar (331.8 KB)
- 下载次数: 2
- servlet.rar (901.2 KB)
- 下载次数: 2
- CursedTreasure.rar (6.6 MB)
- 下载次数: 1
- My_Documents.rar (20.6 KB)
- 下载次数: 1
- Desktop.part3.rar (783.8 KB)
- 下载次数: 4
- Desktop.part1.rar (4.8 MB)
- 下载次数: 4
- Desktop.part2.rar (4.8 MB)
- 下载次数: 3
- TOMCAT服务器集群及负载均衡.rar (4.8 MB)
- 下载次数: 2
- WPSummer.zip (378.4 KB)
- 下载次数: 1
- php__2_.rar (984.3 KB)
- 下载次数: 1
- theworld_chrome_br5002.7z (7.5 MB)
- 下载次数: 1
- theworld_chrome_br5001.7z (9 MB)
- 下载次数: 1
- ECB.rar (848.3 KB)
- 下载次数: 3
相关推荐
基于STM8单片机的编程实例,可供参考学习使用,希望对你有所帮助
Matlab遗传优化算法等算法 求解 生鲜配送问题 路径优化 时间窗 新鲜度 损成本 等约束 程序+算法+参考文献
计算机组成原理课程设计任务书 2021-3-1修订版1
单向辐射ugr模型 包含单向辐射电场模,上下表面辐射损耗,能带,q因字。
光伏锂电池储能功率协调控制系统仿真 [1]左侧光伏Boost控制部分:采用扰动观察法来进行MPPT最大功率跟踪,其中可以改变光照和温度模拟环境工况阶跃: [2]锂电池双向Buck_Boost:采用双闭环控制策略,给定负载电压外环,电流内环,通过稳定负载电压从而控制电流进行充放电 [3]负载电压能够稳定在设定值48V,锂离子电池对功率进行功率协调补偿 仿真运行工况模式: (1)当外界光照变弱,光伏输出功率不能满足负载所需功率,储能会放电进行补偿功率 (2)当外界光照变强,光伏输出功率超过负载所需功率,多余的功率储能会充电进行储存
激光熔覆数值模拟 COMSOL仿真 双椭球热源 采用双椭球热源模型,考虑材料热物性参数、相变、马兰戈尼效应、布辛涅斯克近似等,动网格模拟熔覆层,计算瞬态温度场和流场。
multisim学习Multisim2001电路设计及仿真入门与应用附带光盘含大量实例提取方式是百度网盘分享地址
HFI高频注入仿真 直接转矩控制,滑模观测器MATLAB仿真模型
拿来就用的张定友标定法实验报告,特别详细和完整 一、实验目的 3 二、实验器材 3 三、 张正友标定法原理 3 四、实验步骤 4 4.1 整体流程 4 4.2图像采集 4 4.3特征点提取 5 4.4相机标定 5 4.5畸变校正 6 五、 实验结果 6 5.1 内参矩阵K 6 5.2 畸变系数D 7 5.3 外参矩阵 和 7 5.4 标定误差的计算 8 六、实验结论 9 6.1标定结果的准确性与图像数量密切相关 9 6.2标定图像的分布与角度多样性对标定结果的影响 9 6.3重投影误差的评估 9 6.4畸变系数的准确性 9 6.5OpenCV 工具的使用简便性: 9 七、参考文献 10 八、附件 11
内容概要:本篇文章基于 Flask 框架讲解了一个具体的 API 接口实现方法,该接口用于触发特定ID关联的应用程序运行流程(利用Docker容器执行指定的应用Python脚本)。具体地,在接收 POST 请求之后,根据提供的应用ID来检索对应应用程序的相关路径、镜像名称与主脚本的位置等信息,并且尝试将应用程序目录及其相关联的数据目录挂载进一个临时创建出来的docker环境内以运行主要入口脚本,整个执行过程限定在一小时内完成。一旦成功则把结果以 JSON 包的形式发送回客户端,若是出现错误情况,如找不到对应的 App 或者在执行时发生异常或是超出了时限都将给予相应的JSON报错回复。 适用人群:有一定网络编程以及 Flask 框架使用基础的人群,特别是有志于深入研究 Python 网络服务器构建,掌握如何集成外部组件或容器化应用程序来提升业务处理能力的学生或者是工程师。 使用场景及目标:为用户提供一种简易但实用的方式让 Flask Web 应用可以异步地调用位于远端或本地机器上的 Docker 容器内的脚本来开展某些任务,如进行长时间的数据处理作业或是调用第三方工具等。
HFI高频方波注入方案stm32f405 无感FOC控制 直接闭环启动 永磁同步电机无感控制,0速带载启动,堵转保持扭矩 低速HFI, 高速SMO,全速域运行。 基于stm32f405。 高频注入零速启动三步走: 1 .先是高频注入,角度估算收敛。 2.脉冲NS磁极辨识。 3 .角度,速度双闭坏零速启动运行。 包括完整的cubemx配置文件,mdk工程,原理图和开发笔记,初始角度检测仿真,代码全C语言,宏定义选项均有中文注释,方便我植到自己的项目中。 内涵升级版hfi程序和新的foc程序框架,新版hfi程序速度波动更小。
数据来源:基于上市公司公告、年报等相关数据整理计算 数据范围:沪深京上市公司A股,包括主板、中小企业板、创业板、科创板、北京证交所服务板块等 数据详情: https://blog.csdn.net/yushibing717/article/details/144893810 包含六大类数据: 1、上市公司研究报告发布机构关联表20010101-20240929: ReportID [研究报告编码] - 自动生成的一组序列 Title [标题] - 研究报告的标题 DeclareDate [发布日期] - 研报对外发布日期 InstitutionName [发布机构名称] - 如果一个研报对应多个发布机构,分多条录入 2、上市公司研究报告分类关联表20010101-20240929: 3、上市公司研究报告基本信息20010101-20240929 4、上市公司研究报告人员关联表20010101-20240929 5、上市公司研究报告行业关联表20060703-20240929 上市公司研究报告证券关联表20010101-20240929.......
基于STM8单片机的编程实例,可供参考学习使用,希望对你有所帮助
基于STM8单片机的编程实例,可供参考学习使用,希望对你有所帮助
GEC6818 人脸检测
基于STM8单片机的编程实例,可供参考学习使用,希望对你有所帮助
内容概要:本文档是一份详尽的轨道交通信号与控制专业的综合实验指导手册,涵盖了五个主要实验项目,旨在帮助学生深入理解和实践轨道交通领域的关键技术。具体内容包括ZPW-Z000轨道电路信号的FSK调制与解调、机车信号噪声干扰、应答器报文编制与CRC校验。每个实验详细介绍了目的、原理、任务及实验步骤,同时提供了实验报告要求。通过这些实验,学生们能够全面了解和掌握轨道交通信号系统的工作机制和核心技术。 适用人群:高等院校电气与控制工程学院的本科生、研究生,以及从事轨道交通信号与控制系统研究的技术人员。 使用场景及目标:适用于课堂教学、实验课程和研究项目,帮助学生和研究人员掌握轨道电路信号的FSK调制与解调技术,理解噪声对机车信号的影响及应对措施,熟悉应答器报文的设计与CRC校验机制。目标是提高学生的动手能力、实验技能和理论素养,培养他们解决实际问题的能力。 其他说明:该实验手册不仅为学生提供了详细的实验指南,还为教师和实验技术人员提供了一套科学的教学和实验工具,有助于提升教学质量。同时,这些实验也为未来的研究和发展打下了坚实的基础。
基于 OpenCV 和 Angular Velocity 读数的高精度算法,该算法可以从五个不同的视频中重现汽车的方向盘角度。
简易高考志愿填报辅助工具(含源码与说明).zip [资源说明] 1、该项目是团队成员近期最新开发,代码完整,资料齐全,含设计文档等 2、上传的项目源码经过严格测试,功能完善且能正常运行,请放心下载使用! 3、本项目适合计算机相关专业(人工智能、通信工程、自动化、电子信息、物联网等)的高校学生、教师、科研工作者、行业从业者下载使用,可借鉴学习,也可直接作为毕业设计、课程设计、作业、项目初期立项演示等,也适合小白学习进阶,遇到问题不懂就问,欢迎交流。 4、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 5、不懂配置和运行,可远程教学 6、欢迎下载,沟通交流,互相学习,共同进步!