Movatterモバイル変換


[0]ホーム

URL:


In: content-servicesIn: All docs
Close
Alfresco Content Services

Repository JavaScript root objects reference

The JavaScript API provides a number of root objects which are available from your JavaScript code.

The root objects have various types, depending on which part of the system they expose. For example, the commonrepository concepts, such as the Company Home folder and the logged in user, are represented through objects of typeScriptNode. These objects support the full range of properties and object-oriented API of theScriptNode class.

Depending on the context in which the script is invoked, other types of root object are available that represent aspectsof the system such as server details, user information, request headers and parameters passed to the script. Further, avariety of services are accessible from your JavaScript code, each of these services has a corresponding root object, onwhich properties can be accessed and a variety of methods called as dictated by the service’s API.

The root objects available to your JavaScript code will depend on the context in which the code is invoked. Differentcontexts will have access to a different set of root objects. There are several contexts to be considered:

This information looks at the most commonly used root objects. More specialized root objects are described in moredetail in the relevant sections of this documentation.

Simple root objects

The following table lists root objects that do not expose an API, but consist of simple data structures or types:

Root ObjectType in Script RuntimeDescription
guestBooleanTrue if the user is logged in as a guest
serverObjectServer details
modelObjectUsed to pass a model from the control script to the view renderer (template). Web scripts only.

Root objects that expose ScriptNode objects

The following table lists root objects that exposeScriptNode objects:

Root ObjectType in Script RuntimeDescription
companyhomeorg.alfresco.repo.jscript.ScriptNodeThe company homeScriptNode. See ScriptNode API for properties and methods.
documentorg.alfresco.repo.jscript.ScriptNodeThe current nodeScriptNode (if any)
personorg.alfresco.repo.jscript.ScriptNodeTheScriptNode representing thePerson object of the currently authenticated user. See ScriptNode API for properties and methods.
roothomeorg.alfresco.repo.jscript.ScriptNodeThe store rootScriptNode. The repository root folder. See ScriptNode API for properties and methods.
scriptorg.alfresco.repo.jscript.ScriptNodeTheScriptNode representing the script object itself. This is only available if the script is loaded from the Java classpath.
spaceorg.alfresco.repo.jscript.ScriptNodeThe primary parent ScriptNode for the current node (ScriptNode). For a script executing from a rule, thespace object is the space in which the rule resides. If the rule is inherited, this might not be the expected space.
userhomeorg.alfresco.repo.jscript.ScriptNodeThe current user’s Home SpaceScriptNode. See ScriptNode API for properties and methods.

Root objects also available in web scripts

The following table lists root objects that are available when the script is running as a web script. See the web scriptreference for additional information on these root objects.

Root ObjectType in Script RuntimeDescription
argsListList of arguments passed to the script
argsMListList of arguments passed to the script
cacheObjectObject containing cache information
headersListList of headers passed to the script
headersMListList of headers passed to the script
sessionObjectObject containing session information for the user connection
urlObjectObject containing information about the URL used to invoke web script

Root objects that expose additional APIs

The following table lists root objects that expose additional APIs:

Root ObjectType in Script RuntimeDescription
actionsorg.alfresco.repo.jscript.ActionsRoot object providing invocation of registeredactions
activitiesorg.alfresco.repo.activities.script.ActivityRoot object providing access to the Alfresco Process Services API.
appUtilsorg.alfresco.repo.jscript.ApplicationScriptUtilsRoot object providing access to methods specifically for external application use
bulkFSImportorg.alfresco.repo.bulkimport.script.BulkImportBulk Import object
classificationorg.alfresco.repo.jscript.ClassificationAccess to the root elements of the Classification API
cmisorg.alfresco.repo.cmis.client.CMISLocalConnectionManagerImplCMIS client
cmisServerorg.alfresco.repo.cmis.rest.CMISScriptCMIS server REST access
crossRepoCopyorg.alfresco.repo.jscript.CrossRepositoryCopyCross repository copy support.
imaporg.alfresco.repo.jscript.ImapRoot object providing access to IMAP methods for mailbox support
formatorg.springframework.extensions.webscripts.FormatModelFormat model
jsonUtilsorg.springframework.extensions.webscripts.json.JSONUtilsJSON utilities. Web scripts only.
loggerorg.alfresco.repo.jscript.ScriptLoggerRoot object providing access to console logging facilities for script debugging
msgorg.springframework.extensions.webscripts.ScriptMessageWeb scripts only
pagingorg.alfresco.repo.web.util.paging.PagingPaging API. web scripts only.
peopleorg.alfresco.repo.jscript.PeopleRoot object providing access to and manipulation of person objects and groups
presenceorg.alfresco.repo.jscript.PresenceRoot object providing access to methods for detecting online presence of users
searchorg.alfresco.repo.jscript.SearchRoot object providing access to the various Content Services search interfaces such as FTS-Alfresco, Lucene, XPath, and Saved Search results
sessionorg.alfresco.repo.jscript.SessionSession-related information such as the current authentication ticket
slingshotDocLiborg.alfresco.repo.jscript.SlingshotDocLibCustomResponseSlingshot
stringUtilsorg.springframework.extensions.webscripts.ScriptableUtilsString utilities
testorg.alfresco.repo.jscript.ScriptTestUtilsRoot object providing access to test utilities
utilsorg.alfresco.repo.jscript.ScriptUtilsRoot object providing access to a library of helper functions that are not provided as part of generic JavaScript
workfloworg.alfresco.repo.workflow.jscript.WorkflowManagerRoot object providing access to the workflow service.

Root Objects that expose services

The following table lists root objects that expose services:

Root ObjectType in Script RuntimeDescription
actionTrackingServiceorg.alfresco.repo.action.script.ActionTrackingServiceRoot of the Action Tracking Service
atomorg.springframework.extensions.webscripts.atom.atomServiceAtom service
commentServiceorg.alfresco.repo.web.scripts.comment.ScriptCommentServiceRoot of the Comment Service
formServiceorg.alfresco.repo.forms.script.ScriptFormServiceRoot of the Form Service
groupsorg.alfresco.repo.security.authority.script.ScriptAuthorityServiceRoot of the Group authorities providing access to advanced authority APIs for manipulating groups and zones.
invitationsorg.alfresco.repo.invitation.script.ScriptInvitationServiceRoot of the Invitations API providing access to invitations for web sites.
preferenceServiceorg.alfresco.repo.preference.script.ScriptPreferenceServiceRoot of the Preference Service
ratingServiceorg.alfresco.repo.rating.script.ScriptRatingServiceRoot of the Rating Service
renditionServiceorg.alfresco.repo.rendition.script.ScriptRenditionServiceRoot of the Rendition Service
replicationServiceorg.alfresco.repo.replication.script.ScriptReplicationServiceRoot of the Replication Service
siteServiceorg.alfresco.repo.site.script.ScriptSiteServiceThe root of sites service providing access to the sites service.
taggingServiceorg.alfresco.repo.Tagging.script.ScriptTaggingServiceRoot of the Tagging Service
thumbnailServiceorg.alfresco.repo.thumbnail.script.ScriptThumbnailServiceRoot of the Thumbnail Service
transferorg.alfresco.repo.transfer.script.ScriptTransferServiceThe root of transfer service providing access to the transfer service.

Edit this page

Suggest an edit on GitHub
By clicking "Accept Cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.View Cookie Policy.

[8]ページ先頭

©2009-2025 Movatter.jp