Javascript API - get all properties

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2007 04:00 AM
Hi all,
this question may be a bit off topics as it's propably just a Javascript/Java question I'm not familiar with.
I would like to retrieve all properties of, say, "person" from Javascript.
I know we can get a named property with person.properties.MyProperty (person.properties.lastName eg).
As person is a JavaObject and person.properties is a ScriptableQNameMap (if I'm right), i cannot list all properties with a simple "for (prop in person) {…}".
So what is the way to list all properties?
—
In the same area, what is the best way to list all users from JS API?
—
As I am with it, what is the way to import javascript libraries (like Prototype) which I'd like to have available for all scripts?
Thanks in advance,
Cheers,
Stéphane
this question may be a bit off topics as it's propably just a Javascript/Java question I'm not familiar with.
I would like to retrieve all properties of, say, "person" from Javascript.
I know we can get a named property with person.properties.MyProperty (person.properties.lastName eg).
As person is a JavaObject and person.properties is a ScriptableQNameMap (if I'm right), i cannot list all properties with a simple "for (prop in person) {…}".
So what is the way to list all properties?
—
In the same area, what is the best way to list all users from JS API?
—
As I am with it, what is the way to import javascript libraries (like Prototype) which I'd like to have available for all scripts?
Thanks in advance,
Cheers,
Stéphane
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2007 09:36 AM
There was a missing method on our implementation of ScriptableQNameMap in 2.0 - this has been fixed in 2.1 HEAD so you can now use a simple for() loop to list the props e.g.
Kevin
for (var propName in userhome.properties)
{
var propValue = userhome.properties[propName];
// do something with the value
}
Hope this helps,Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2007 09:59 AM
Thanks for your reply, Kevin.
As I'm currently testing with 2.1.0dev of 20070619 wherein it still doesn't work. I'll give a try to the new nightly build soon.
Still no idea of the best way to get the list of all users from JS API. And is it expected that people.getGroup("GROUP_EVERYONE") returns null even though this group is special?
Best regards,
Stéphane
As I'm currently testing with 2.1.0dev of 20070619 wherein it still doesn't work. I'll give a try to the new nightly build soon.
Still no idea of the best way to get the list of all users from JS API. And is it expected that people.getGroup("GROUP_EVERYONE") returns null even though this group is special?
Best regards,
Stéphane

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2007 10:15 AM
Yes you will need a newer nightly build.
