cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot access Root Scope Objects in Share dashlet Web Script

deane
Champ on-the-rise
Champ on-the-rise
I'm writing some Web Scripts for Share.  It's going well, so long as I don't try to access any of the "Root Scope Objects" – companyhome, userhome, search, etc.

Whenever I try that, for example –

var userFolderName = userhome.properties.name;

– my Dashlet throws an error –

"userhome" is not defined

Similarly, I get –

"companyhome" is not defined
"search" is not defined

– whenevr I try to access those objects.

I've looked everywhere, and I can't see in any of the examples that you need to import anything.  In fact, I've lifted code directly from some official examples and examples from the Packt book with no success.

Deane
1 REPLY 1

mikeh
Star Contributor
Star Contributor
The Share application is designed to be run on a different server to the Alfresco Repository application. Therefore you don't have access to repository-only concepts such as nodes, company home, user home, etc.  as they are meaningless.

You need to split your webscript logic into Web-tier (Share) and Repo-tier (Repository) parts. There are many examples of this working within the existing Share webscripts.

Mike