How to create IdSpec instance

0 views
Skip to first unread message

yoichiro

unread,
Jul 7, 2008, 8:50:04 PM7/7/08
to OpenSocial and Gadgets Specification Discussion
Hi all,

I want to know how to create the instance of IdSpec in v0.8. I think
as follows:

(1) Create the instance directry with 'new'.

var params = {};
params[opensocial.IdSpec.Field.USER_ID] =
opensocial.IdSpec.PersonId.VIEWER;
var id = new opensocial.IdSpec(params);

(2) Create the instance with opensocial.newIdSpec() function.

var params = {};
params[opensocial.IdSpec.Field.USER_ID] =
opensocial.IdSpec.PersonId.VIEWER;
var id = opensocial.newIdSpec(params);

(3) Etc...

newIdSpec() method is not written in API Reference of v0.8, But I
found it in opensocial.js.

http://opensocial-resources.googlecode.com/svn/spec/0.8/opensocial/opensocial.js

Which is correct as the specification?

Best regards,
Yoichiro

yoichiro

unread,
Jul 10, 2008, 2:04:03 AM7/10/08
to OpenSocial and Gadgets Specification Discussion
Hi all,

I got the answer in OpenSocial Groups. It was that the first method is
the correct one because the opensocial.newIdSpec() is not documented.

However, I think that the second method is suitable, because the first
method also is not documented and special functions (ex.
opensoical.newDataRequest) for creating the instance is defined for
classes other than IdSpec. I afraid that only IdSpec should use 'new'.

I think that the opensocial.newIdSpec() function should be documented
as correct one.
Is my suggestion correct?

Best regards,
Yoichiro

On July 8, 9:50 pm, yoichiro <yoich...@eisbahn.jp> wrote:
> Hi all,
>
> I want to know how to create the instance of IdSpec in v0.8. I think
> as follows:
>
> (1) Create the instance directry with 'new'.
>
> var params = {};
> params[opensocial.IdSpec.Field.USER_ID] =
> opensocial.IdSpec.PersonId.VIEWER;
> var id = new opensocial.IdSpec(params);
>
> (2) Create the instance with opensocial.newIdSpec() function.
>
> var params = {};
> params[opensocial.IdSpec.Field.USER_ID] =
> opensocial.IdSpec.PersonId.VIEWER;
> var id = opensocial.newIdSpec(params);
>
> (3) Etc...
>
> newIdSpec() method is not written in API Reference of v0.8, But I
> found it in opensocial.js.
>
> http://opensocial-resources.googlecode.com/svn/spec/0.8/opensocial/op...

Cassie

unread,
Jul 11, 2008, 1:29:11 PM7/11/08
to opensocial-an...@googlegroups.com
yoichiro - you are right - #2 is correct and #1 is most definitely wrong.
creating the idSpec object directly with new will break in any containers that use a subclass to represent that object. that is why, like you mentioned, we also have opensocial.newActivity opensocial.newNavigationParameters etc.

the js files for the spec are correct:
http://code.google.com/p/opensocial-resources/source/browse/spec/0.8/opensocial/opensocial.js
line 387

so this just means that the generated docs are incorrect.
can somebody with access regenerate the js docs?

- cassie

Krishna Sankar (ksankar)

unread,
Jul 11, 2008, 2:24:13 PM7/11/08
to opensocial-an...@googlegroups.com
Folks,

I am exploring adding couple of concepts and associated
interfaces, vocabulary et al to OpenSocial. Let me briefly explain (will
dig deeper after getting feedback):

Rationale : OpenSocial is an excellent interface not only to Web
2.0 CE (Consumer Edition) but also Web 2.0 EE (Enterprise Edition). But
the manifestation and primitives are a little different; for example,
for collaboration-centric activities (inter and intra company), in
addition to knowing the social network, one also would like to enquire
into the knowledge graph - i.e. what are the expertise one has, what
roles one has been and even what other companies and organizations one
has worked on and what roles.

Concepts : Knowledge graph (expertise, level, time et al), roles
(org, title, desc, duration et al)

Processing model: Capabilities like who in my social circle
knows <xyz> or has worked in <abc Inc> et al.

APIs, Schemas : TBD

a) Does this make sense ?
b) Have you come across similar issues ? if so, how did you
solve it ?
c) Most probably it is possible these can be achieved in
the current version. If so, would appreciate insights.

Cheers
<k/>

P.S : I have been working on this intersection between knowledge graph
and the social graph, especially in the background of Enterprise 2.0
moniker.

Krishna Sankar (ksankar)

unread,
Jul 11, 2008, 5:41:58 PM7/11/08
to opensocial-an...@googlegroups.com
Folks,
Am thinking of initiating an Opensocial container project in
Ruby - most probably as a DSL over RoR. As we had talked earlier, we
need a least one more, other than Schindig for spec verification,
interop et al.

May be this is a bad idea, as a project there are many other
public and private implementations anyway. In that case I will develop
as a one more impl.

Would like to get the wisdom of the community as well as
suggestions on the best way to go about developing and hosting it. Of
course, I have some ideas as well, based on other open source projects.

Cheers
<k/>

Kevin Brown

unread,
Jul 11, 2008, 9:01:32 PM7/11/08
to opensocial-an...@googlegroups.com
That sounds like a great idea!

Putting the project on sourceforge or google code should take care of your hosting. Please feel free to take a look at Shindig and/or opencampfire.net if you're trying to figure out where to get started.

yoichiro

unread,
Jul 12, 2008, 11:12:56 AM7/12/08
to OpenSocial and Gadgets Specification Discussion
Hi Cassie,

Thank you for your reply. I confirmed newIdSpec() was added to the
OpenSocial API Reference page. We can use IdSpec confidently from now
on.

Best regards,
Yoichiro

On July 12, 2:29 pm, Cassie <d...@google.com> wrote:
> yoichiro - you are right - #2 is correct and #1 is most definitely wrong.
> creating the idSpec object directly with new will break in any containers
> that use a subclass to represent that object. that is why, like you
> mentioned, we also have opensocial.newActivity
> opensocial.newNavigationParameters etc.
>
> the js files for the spec are correct:http://code.google.com/p/opensocial-resources/source/browse/spec/0.8/...
> line 387
>
> so this just means that the generated docs are incorrect.
> can somebody with access regenerate the js docs?
>
> - cassie
>

Robert Evans

unread,
Jul 29, 2008, 5:55:54 PM7/29/08
to opensocial-an...@googlegroups.com
I believe there might already be a couple of these in the works.
Trying searching for opensocial rails. Not sure what state any of them
are in though.

Bob Evans

On Fri, Jul 11, 2008 at 2:41 PM, Krishna Sankar (ksankar)
<ksa...@cisco.com> wrote:
>

Krishna Sankar (ksankar)

unread,
Jul 29, 2008, 8:22:23 PM7/29/08
to opensocial-an...@googlegroups.com
Thanks. If there is one, we can contribute; if not I will start one.

Cheers
<k/>
Reply all
Reply to author
Forward
0 new messages