You are on page 1of 10

02/02/2017 Rootobjects|AlfrescoDocumentation

Overview(http://docs.alfresco.com/4.0/concepts/systemabout.html)
HowTovideos(http://docs.alfresco.com/4.0/topics/alfrescovideotutorials.html)
GettingStartedtutorials(http://docs.alfresco.com/4.0/concepts/mastergsintro.html)
Installing(http://docs.alfresco.com/4.0/concepts/masterchinstall.html)
Upgrading(http://docs.alfresco.com/4.0/concepts/chupgrade.html)
Administering(http://docs.alfresco.com/4.0/concepts/chadministering.html)
UsingAlfresco(http://docs.alfresco.com/4.0/concepts/masterusingintro.html)
Customizing(http://docs.alfresco.com/4.0/concepts/chcustomize.html)
Programming(http://docs.alfresco.com/4.0/concepts/programmingintro.html)
IntegratingyourapplicationwithAlfresco(http://docs.alfresco.com/4.0/concepts/integrationoptions.html)
Designingyourapplication(http://docs.alfresco.com/4.0/concepts/alfrescoconsiderations.html)
ProgrammingwithCMIS(http://docs.alfresco.com/4.0/concepts/cmisabout.html)
Configuringtherepository(http://docs.alfresco.com/4.0/concepts/introcore.html?m=2)
ProgrammingwithAlfrescoservices(http://docs.alfresco.com/4.0/concepts/servusingabout.html)
ProgrammingwithSurf(http://docs.alfresco.com/4.0/concepts/surffworkintro.html)
WebScripts(http://docs.alfresco.com/4.0/concepts/wsarchitecture.html)
AlfrescoAPIReference(http://docs.alfresco.com/4.0/concepts/APIintro4.html)
RepositoryJavaScriptAPI(http://docs.alfresco.com/4.0/concepts/APIJSintro.html)
Aboutscriptfiles(http://docs.alfresco.com/4.0/concepts/APIJSScripts.html)
ScriptingAPI(http://docs.alfresco.com/4.0/references/APIJSScriptingAPI.html)
Rootobjects(http://docs.alfresco.com/4.0/references/APIJSrootscoped.html)
ScriptNodeObjectAPI(http://docs.alfresco.com/4.0/references/APIJSScriptNode.html)
SearchAPI(http://docs.alfresco.com/4.0/references/APIJSSearch.html)
PeopleAPI(http://docs.alfresco.com/4.0/references/APIJSPeople.html)
ActionsAPI(http://docs.alfresco.com/4.0/references/APIJSActions.html)
ScriptActionAPI(http://docs.alfresco.com/4.0/references/APIJSScriptAction.html)
LoggingAPI(http://docs.alfresco.com/4.0/references/APIJSLogging.html)
SessionAPI(http://docs.alfresco.com/4.0/references/APIJSSession.html)
ClassificationAPI(http://docs.alfresco.com/4.0/references/APIJSClassification.html)
AVMAPI(http://docs.alfresco.com/4.0/references/APIJSAVM.html)
WCMWebProjects(http://docs.alfresco.com/4.0/references/APIJSWCMWebProjects.html)
Utilitymethods(http://docs.alfresco.com/4.0/references/APIJSUtility.html)
ServicesAPI(http://docs.alfresco.com/4.0/references/APIJSServices.html)
RESTfulAPIreference(http://docs.alfresco.com/4.0/references/RESTfulintro.html)
RepositoryFreeMarkerTemplatereference(http://docs.alfresco.com/4.0/references/APIFreeMarkerintro.html)

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 1/10
02/02/2017 Rootobjects|AlfrescoDocumentation

SurfPlatformAPIreference(http://docs.alfresco.com/4.0/references/APISurfPlatformintro.html)
Troubleshooting(http://docs.alfresco.com/4.0/concepts/chtroubleshoot.html)
Reference(http://docs.alfresco.com/4.0/concepts/chreference.html)
Copyright(http://docs.alfresco.com/4.0/reuse/copyright.html)
Disclaimer(http://docs.alfresco.com/4.0/reuse/disclaimer.html)

AlfrescoEnterprise4.0.2(http://docs.alfresco.com/4.0/concepts/welcomeinfocenter.html)Programming
(http://docs.alfresco.com/4.0/concepts/programmingintro.html)AlfrescoAPIReference
(http://docs.alfresco.com/4.0/concepts/APIintro4.html)RepositoryJavaScriptAPI
(http://docs.alfresco.com/4.0/concepts/APIJSintro.html)ScriptingAPI
(http://docs.alfresco.com/4.0/references/APIJSScriptingAPI.html)

Root objects
TheJavaScriptAPIprovidesanumberofrootobjectswhichareavailablefromyourJavaScriptcode.

Therootobjectshavevarioustypes,dependingonwhichpartofthesystemtheyexpose.Forexample,thecommon
Alfrescorepositoryconcepts,suchastheCompanyHomefolderandtheloggedinuser,arerepresentedthrough
objectsoftypeScriptNode.TheseobjectssupportthefullrangeofpropertiesandobjectorientedAPIofthe
ScriptNodeclass.

Dependingonthecontextinwhichthescriptisinvoked,othertypesofrootobjectmaybeavailablethatrepresent
aspectsofthesystemsuchasserverdetails,userinformation,requestheadersandparameterspassedtothe
script.Further,avarietyofAlfrescoservicesareaccessiblefromyourJavaScriptcode,eachoftheseserviceshasa
correspondingrootobject,onwhichpropertiescanbeaccessedandavarietyofmethodscalledasdictatedbythe
service'sAPI.

TherootobjectsavailabletoyourJavaScriptcodewilldependonthecontextinwhichthecodeisinvoked.Different
contextswillhaveaccesstoadifferentsetofrootobjects.Thereareseveralcontextstobeconsidered:

Webscripts
Surf
Rules/actions
Workflow
Explorer

Thissectionofthereferencedocumentationlooksatthemostcommonlyusedrootobjects.Morespecializedroot
objectsaredescribedinmoredetailintherelevantsectionsofthisdocumentation.

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 2/10
02/02/2017 Rootobjects|AlfrescoDocumentation

FurtherinformationonrootobjectsprovidedbyservicesandtheexposedAPIscanbefoundintheServicesAPI
reference(APIJSServices.html).

Seealsotherelatedlinksattheendofthissection.

Simple root objects


ThefollowingtablelistsrootobjectsthatdonotexposeanAPI,butconsistofsimpledatastructuresortypes:

Root TypeinScript
Object Runtime Description

guest Boolean Trueiftheuserisloggedinasaguest

server Object Serverdetails

model Object Usedtopassamodelfromthecontrolscripttotheviewrenderer(template).


Webscriptsonly.

Root objects that expose ScriptNode objects


ThefollowingtablelistsrootobjectsthatexposeScriptNodeobjects:

RootObject TypeinScriptRuntime Description

companyhome org.alfresco.repo.jscript.ScriptNode ThecompanyhomeScriptNode.SeeScriptNode


APIforpropertiesandmethods.

document org.alfresco.repo.jscript.ScriptNode ThecurrentdocumentScriptNode(ifany)

person org.alfresco.repo.jscript.ScriptNode TheScriptNoderepresentingthePersonobject


ofthecurrentlyauthenticateduser.See
ScriptNodeAPIforpropertiesandmethods.

roothome org.alfresco.repo.jscript.ScriptNode ThestorerootScriptNode.Therepositoryroot


folder.SeeScriptNodeAPIforpropertiesand
methods.

script org.alfresco.repo.jscript.ScriptNode TheScriptNoderepresentingthescriptobject


itself.Thisisonlyavailableifthescriptisloaded
fromtheJavaclasspath.

space org.alfresco.repo.jscript.ScriptNode ThecurrentspaceScriptNode(ifany).Fora


scriptexecutingfromarule,thespaceobjectis
thespaceinwhichtheruleresides.Iftheruleis
inherited,thismaynotbetheexpectedspace.

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 3/10
02/02/2017 Rootobjects|AlfrescoDocumentation

userhome org.alfresco.repo.jscript.ScriptNode Thecurrentuser'sHomeSpaceScriptNode.See


ScriptNodeAPIforpropertiesandmethods.

Root objects also available in web scripts


Thefollowingtablelistsrootobjectsthatareavailablewhenthescriptisrunningasawebscript.Seethewebscript
referenceforadditionalinformationontheserootobjects.

RootObject TypeinScriptRuntime Description

args List Listofargumentspassedtothescript

argsM List Listofargumentspassedtothescript

cache Object Objectcontainingcacheinformation

headers List Listofheaderspassedtothescript

headersM List Listofheaderspassedtothescript

session Object Objectcontainingsessioninformationfortheuserconnection

url Object ObjectcontaininginformationabouttheURLusedtoinvokewebscript

Root objects that expose additional APIs


ThefollowingtablelistsrootobjectsthatexposeadditionalAPIs:

RootObject TypeinScriptRuntime Description

actions org.alfresco.repo.jscript.Actions Rootobject


providing
invocationof
registered
Alfresco
actions

activities org.alfresco.repo.activities.script.Activity Rootobject


providing
accesstothe
ActivityAPI.

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 4/10
02/02/2017 Rootobjects|AlfrescoDocumentation

appUtils org.alfresco.repo.jscript.ApplicationScriptUtils Rootobject


providing
accessto
methods
specificallyfor
external
application
use

avm org.alfresco.repo.jscript.AVM Accessto


WCMobjects
suchasAVM
pathsand
searching
withinAVM
storesand
webprojects.

bulkFSImport org.alfresco.repo.bulkimport.script.BulkImport BulkImport


object

classification org.alfresco.repo.jscript.Classification Accesstothe


rootelements
ofthe
Classification
API

cmis org.alfresco.repo.cmis.client.CMISLocalConnectionManagerImpl CMISclient


cmisServer org.alfresco.repo.cmis.rest.CMISScript CMISserver
RESTaccess

crossRepoCopy org.alfresco.repo.jscript.CrossRepositoryCopy Cross


repository
copysupport.

imap org.alfresco.repo.jscript.Imap Rootobject


providing
accessto
Imapmethods
formailbox
support

format org.springframework.extensions.webscripts.FormatModel Formatmodel

jsonUtils org.springframework.extensions.webscripts.json.JSONUtils JSONutilities.


Webscripts
only.

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 5/10
02/02/2017 Rootobjects|AlfrescoDocumentation

logger org.alfresco.repo.jscript.ScriptLogger Rootobject


providing
accessto
console
logging
facilitiesfor
script
debugging

msg org.springframework.extensions.webscripts.ScriptMessage Webscripts


only

paging org.alfresco.repo.web.util.paging.Paging PagingAPI.


webscripts
only.

people org.alfresco.repo.jscript.People Rootobject


providing
accesstoand
manipulation
ofperson
objectsand
groups

presence org.alfresco.repo.jscript.Presence Rootobject


providing
accessto
methodsfor
detecting
online
presenceof
users

search org.alfresco.repo.jscript.Search Rootobject


providing
accesstothe
various
Alfresco
search
interfaces
suchasFTS
Alfresco,
Lucene,
XPath,and
SavedSearch
results

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 6/10
02/02/2017 Rootobjects|AlfrescoDocumentation

session org.alfresco.repo.jscript.Session Session


related
information
suchasthe
current
authentication
ticket

slingshotDocLib org.alfresco.repo.jscript.SlingshotDocLibCustomResponse Slingshot

stringUtils org.springframework.extensions.webscripts.ScriptableUtils Stringutilities

test org.alfresco.repo.jscript.ScriptTestUtils Rootobject


providing
accesstotest
utilities

utils org.alfresco.repo.jscript.ScriptUtils Rootobject


providing
accesstoa
libraryof
helper
functionsthat
arenot
providedas
partofgeneric
JavaScript

webprojects org.alfresco.wcm.webproject.script.WebProjects Rootobject


providing
accesstothe
WCM
JavaScript
API.This
facilitates
accesstoweb
projects,
sandboxes,
WCMassets,
andproject
membership.

workflow org.alfresco.repo.workflow.jscript.WorkflowManager Rootobject


providing
accesstothe
workflow
service.

Root Objects that expose services


http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 7/10
02/02/2017 Rootobjects|AlfrescoDocumentation

Root Objects that expose services


Thefollowingtablelistsrootobjectsthatexposeservices:

RootObject TypeinScriptRuntime Descr

actionTrackingService org.alfresco.repo.action.script.ActionTrackingService Rooto


Action
Track
Servic

atom org.springframework.extensions.webscripts.atom.atomService Atom


servic

commentService org.alfresco.repo.web.scripts.comment.ScriptCommentService Rooto


Comm
Servic

formService org.alfresco.repo.forms.script.ScriptFormService Rooto


Form
Servic

groups org.alfresco.repo.security.authority.script.ScriptAuthorityService Rooto


Group
autho
provid
acces
advan
autho
APIsf
manip
group
zones

invitations org.alfresco.repo.invitation.script.ScriptInvitationService Rooto


Invitat
API
provid
acces
invitat
forwe
sites.

preferenceService org.alfresco.repo.preference.script.ScriptPreferenceService Rooto


Prefer
Servic

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 8/10
02/02/2017 Rootobjects|AlfrescoDocumentation

ratingService org.alfresco.repo.rating.script.ScriptRatingService Rooto


Rating
Servic

renditionService org.alfresco.repo.rendition.script.ScriptRenditionService Rooto


Rendi
Servic

replicationService org.alfresco.repo.replication.script.ScriptReplicationService Rooto


Replic
Servic

siteService org.alfresco.repo.site.script.ScriptSiteService Thero


sitess
provid
acces
thesit
servic

taggingService org.alfresco.repo.Tagging.script.ScriptTaggingService Rooto


Taggi
Servic

thumbnailService org.alfresco.repo.thumbnail.script.ScriptThumbnailService Rooto


Thum
Servic

transfer org.alfresco.repo.transfer.script.ScriptTransferService Thero


transf
servic
provid
acces
thetra
servic

Parenttopic:ScriptingAPI(../references/APIJSScriptingAPI.html)
Relatedconcepts
Webscriptreference(../concepts/devwsreference.html)
Relatedreference
Rootscopedobjects(APISurfrootscoped.html)

Displayaprinterfriendlyversionofthispage(/print/book/export/html/1057562)

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 9/10
02/02/2017 Rootobjects|AlfrescoDocumentation

2ratings

Did you find this page useful?

Let us know what you think of the documentation *

Your name (optional)

First Last

Your email address (optional)

2017AlfrescoSoftware,Inc.AllRightsReserved.Legal(http://www.alfresco.com/termsuse)|Privacy
Follow@alfrescodocs
(http://www.alfresco.com/privacy)|alfresco.com(http://www.alfresco.com)

http://docs.alfresco.com/4.0/references/APIJSrootscoped.html 10/10

You might also like