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.

CollectionNodeEvent.SYNCHRONIZATION_CHANGE and CollectionNode.isSynchronized

Avatar

Level 1

What does it actually mean when CollectionNode.isSynchronized is true?

========================================================

            var auth : AdobeHSAuthenticator = new AdobeHSAuthenticator();
            auth.userName = 'someaccount';    //change this accordingly
            auth.password = 'somepassword';  //change this accordingly
           
                 
            session = new ConnectSession();
            session.roomURL = 'someroomurl'; //change this accordingly
            session.authenticator = auth;
//          session.login();  //intentionally not logging in


            rootCollectionNode = new RootCollectionNode();
            rootCollectionNode.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE, onSyncChange);
            rootCollectionNode.connectSession = session;
            rootCollectionNode.subscribe();       


        }
       
       
       
        private function onSyncChange(event : CollectionNodeEvent) : void {
            trace("isRootCollectionNode SYNC? " , rootCollectionNode.isSynchronized)

        }

========================================================

  1. Why would rootCollectionNode.isSynchronized return true without logging into the session?
  2. When does isSynchronized get marked as true?
3 Replies

Avatar

Former Community Member

It means we have a bug! FWIW, CollectionNode is fine, but RootCollectionNode doesn't behave exactly like a CollectionNode (you can't pub/sub, for example - it's really only used for determining the set of CollectionNodes in the room). In this case, it's pretty obvious that we've never used RootCollectionNode.isSynchronized (it actually will fire the event again, after you really login).

We'll fix the bug for the next drop, but out of curiosity, what were you using this for? ConnectSession.SYNCHRONIZATION_CHANGE will work as a workaround.

thanks for the feedback!

nigel

Avatar

Level 1

Hey Nigel,

Thanks for the quick clarification. I thought I was going crazy.

Basically trying out the RootCollectionNode class to do remove collectionNodes when the session needs to restart or be 'cleaned'.

Since I am not using the Flex API, the RoomCleaner is not available.

Avatar

Former Community Member

Ooh, useful point - we should allow for roomCleaner to work in the Flash API too. Added to the list.

nigel