Import jQuery or other library in controller script?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2009 06:14 AM
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".
Is there anyway around this?
Is there anyway around this?
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2009 08:06 AM
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!
Mike
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!
Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2009 11:37 AM
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?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2009 12:16 PM
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.
Thanks,
Mike
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.
Thanks,
Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2009 12:27 PM
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.
