The sync engine allows multiple applications that use the same schema to sync together. When one client begins a sync session, other clients may be invited to join the same sync session. Since SimpleStickies and FancyStickies share the same schema, each is given the opportunity to join the sync session started by the other client. You can use Syncrospector to view the results of multiple clients syncing together.
Displaying Change Alerts
Launching FancyStickies
Syncing FancyStickies and SimpleStickies
Viewing the Session History of Multiple Clients
Viewing Sync Plans in Action
When debugging multiple clients, it is useful to turn on the change alert panels. Normally, change alert panels are displayed for .Mac only. You can turn on change alert panels for all clients by using Syncrospector.
Launch Syncrospector.
Select Preferences from the Syncrospector menu to open the Preferences panel.
Click Always Show Data Change Alert.
Launch FancyStickies to register a second client that uses the Stickies schema.
Launch FancyStickies, located in the StickiesExample/Applications folder.
If a panel appears asking whether you want to sync FancyStickies with other applications—for example, to SimpleStickies—click Allow.
FancyStickies syncs at startup so you should see a sticky window appear for each Note record you created using SimpleStickies.
Using Syncrospector, select Clients from the left-side menu to view the state of the FancyStickies client.
Click History, open the last sync session, select com.mycompany.FancyStickies, and select Open Call History to view the sync session details.
Now make some changes in either application and sync both applications to push changes from one application to the other.
Using FancyStickies, change the text in the sticky window, and select Save from the File menu.
FancyStickies saves and syncs the changes—pushing the changes to the sync engine.
If change alert panels are turned on, a Sync Alert panel appears. Check to see that it detected the correct number of changes you made and then click Allow.
Using SimpleStickies, select Sync from the File menu to pull the changes from the sync engine.
Click Allow if a Sync Alert panel appears.
Using SimpleStickies, change some attributes of Note records, or add and remove some records. Select Sync from the File menu again to push the changes.
FancyStickies joins the sync session and pulls the changes automatically.
If a change alert panel appears, click Allow.
Read “Trickle Syncing”to learn how to configure SimpleStickies to join a sync session when FancyStickies syncs.
Use Syncrospector to view the call history of multiple clients that join the same sync session.
Using Syncrospector, select Clients from the pull-down menu to check the sync state of each client.
The Last Sync date for SimpleStickies and FancyStickies should be the same.
Select History from the pull-down menu and optionally, click Reload.
Select the last sync session from the table and open the clients.
You should see both SimpleStickies and FancyStickies listed as clients that joined the last sync session.
Select com.mycompany.FancyStickies and click Open Call History, and then select com.mycompany.SimpleStickies and click Open Call History to compare the history of each client in separate windows.
For example, click the pushChangesFromRecord:withIdentifier: method in the SimpleStickies Call History window to see the records that SimpleStickies pushed to the sync engine.
Click the nextObject method in the FancyStickies Call History window to see the records that FancyStickies pulled from the sync engine.
You can also view the call history of multiple clients during a sync session.
Using Syncrospector, select Show Sync Plans from the Window menu.
Again, modify some records using SimpleStickies—for example, change the colors of some notes—and select Sync from the File menu to push the changes.
If a Sync Alert panel appears in FancyStickies, click Allow to continue.
View the sync plans in the Sync Server window in Syncrospector by selecting the last sync session.
SimpleStickies and FancyStickies should be listed in the Participants column in the detail view. The Entities column should show the entities each client synced—for example, com.mycompany.stickies.Note.
Last updated: 2007-07-11