Split in script [resolved]

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2010 09:54 AM
Hi, I would like to know how I can do to call the function "split" in my script to be able to retrieve the permissions function getPermissions(). It returns a list as "ALLOWED;kevinr;Consumer".
I tried the function "split" but it does not work, because it is not known in Alfresco …
Can you help me ?
I tried the function "split" but it does not work, because it is not known in Alfresco …
Can you help me ?
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2010 10:50 AM
Are you saying this doesn't work?
Mike
"ALLOWED;kevinr;Consumer".split(";")
Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2010 10:51 AM
Ive seen split working. What's your code?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2010 11:54 AM
It's working now, I have changed my code.
I think we should specify that the return of getPermission is a String.
Thx you !
var perm = new String(document.getPermissions());var elements = perm.split(";");
I think we should specify that the return of getPermission is a String.
Thx you !
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2010 01:01 PM
The difficulty you are running into is that Java strings are not Javascript strings. In your solution, you are creating a Javascript string from the Java string. You will find this issue pervades the Alfresco implementation of Javascript.
