I would like to use a library like jQuery or YUI in my controller scripts. However, when I try to import these libraries there are always some errors, because they expect to be in a browser environment, using objects such as "document" or "window".
I would just pull the functions you need out of the libraries - what are you trying to achieve?
The other path you might try going down is to create "fake" document and window JavaScript objects - although I suspect you'll end up stubbing-out half the browser's API in order to keep the libraries happy!
I want to make remote calls to another web service, so I'd like to use the simplified AJAX functions. I've seen that Alfresco Share has a remote API, but as far as I understand it only supports http (I'd need https), right?
The problem you'll have is that the XmlHttpRequest object isn't supported by Rhino, so you won't get any AJAX-style functionality anyway.
The remote/connector API should support https as far as I'm aware (please raise a JIRA bug if this doesn't work); you'd need to update or add new endpoints in the webscript-framework configuration.
Ok, thanks a lot for your input. If it´s possible to get https working I think that the connector API would suit my needs perfectly. I'm not really interested in AJAX functionality, I just want a simple way to connect to a remote web service, retrieve information and present it in a dashlet.