Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Sync new CollectionNode

Avatar

Former Community Member

I hope I can explain this right:

I have an application where users can create CollectionNodes dynamically.

How do I sync those new CollectionNodes to the other users ?

6 Replies

Avatar

Former Community Member

You can create CollectionNodes as part of  your model. SharedModel example's SimpleSharedPollModel.as creates a CollectionNode.

You need to give an sharedID to this CollectionNode. You can access this new CollectionNode by its sharedID and calling subscribe() function onto it. If the other users know the sharedID of your collectionNode , then they can access.

One way I can think for your specific case, you create a collectionNode, and assign it a sharedID and subscribe it. Then let other users know this sharedID using some existing CollectionNode which other users already have access to. Then when the other users get that sharedID, they can instantiate a collectionNode with that sharedID and call subscribe, and they will be able to get the data on the newly created collectionNode.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Former Community Member

Thanks Hironmay - I had the same solution in mind, but just wanted to make sure there wasn't an easier way like an event fired on the session.

Avatar

Former Community Member

Sorry, but I need to bring this up again as I have encountered a new problem.

Apparently the only users that can create collectionNodes are Owners, but my users are guests that get promoted to Publishers.

To explain my application in more detail.

It's a shared whiteboard, but with the abilty to create new whiteboards (like tabs in firefox) so I need to have a whiteboard-collectionNode for every whiteboard created.

Do you have any ideas for a solution to this ?

Avatar

Former Community Member

I'm thinking of 2 possible solutions.

1.

We're creating the rooms on demand via php. I guess I could set a maximum number of whiteboards that the users can create in the application.

I believe I can create a Room template that is then used when we create the Room in php, right ?

I could then create CollectionNodes for all of the (let's say max. 10) whiteboards in that template and still use another CollectionNode (ie. WhiteboardManager) that manages how many are actually used.

The only problem is I would have to set a maximum.

2.

Have a "secret" Owner-user log in that can create CollectionNodes as the users need them. Is that at all possible ?

Avatar

Former Community Member

Both of those are possible, indeed. Of the 2 I'd go for #1.

In a future release (we're working on it, but it won't be ready before the

New Year), we're adding APIs so that your PHP server can log in as an owner

and create CollectionNodes on-the-fly.

There might be a third option - are you needing there to be multiple

whiteboards available at the same time, or just one-at-a-time?

nigel

Avatar

Level 1

Yes, there is need for multiple whiteboards at the same time.

Thanks for the advice, and I agree - I like #1 too

Thank you