Opened 15 years ago

Closed 11 years ago

Last modified 11 years ago

#568 closed enhancement (wontfix)

Redo activity Journal APIs

Reported by: wadeb Owned by: erikos
Priority: Unspecified by Maintainer Milestone:
Component: Sugar Version: Git as of bugdate
Severity: Major Keywords:
Cc: alsroot, walter, silbe Distribution/OS: Unspecified
Bug Status: New

Description

When an activity starts up, it can be in one of several states:

  • Starting a new instance.
  • Resuming an instance from the Journal.
  • Joining a shared activity.

While executing, several additional events can occur:

  • Saving to the journal.
  • Sharing the activity.

The APIs for these events are currently scattered.

  • New instance: init only
  • Resume instance: init followed by read_file (called by set_canvas)
  • Save instance: write_file
  • Join instance: init followed by join_cb (must be connected manually)
  • Share instance: init followed shared_cb (must be connected manually)

My hope is to see a clear set of APIs for activities to interact with the journal and sharing.

A possible example of this API was developed by alsroot and can be seen here:
http://git.sugarlabs.org/projects/cartoon-builder/repos/mainline/blobs/master/shared.py

This introduces the following new Activity methods:

  • new_instance
  • resume_instance
  • save_instance
  • join_instance
  • share_instance

One of {new,resume,join}_instance is guaranteed to be called at startup, after init returns (the set_canvas relationship is removed).

Further, share_instance and save_instance will be called as needed.

Ideally, these new method calls would be integrated to the Sugar Activity class, with default implementations which call the old read_file and write_file APIs for backwards compatibility purposes.

Note that even with these changes, the collaboration API remains difficult to use and should be the subject of a separate ticket. One possibility for improving this comes from the Calculate activity:
http://git.sugarlabs.org/projects/calculate/repos/mainline/blobs/master/shareable_activity.py

Change History (9)

comment:1 Changed 15 years ago by wadeb

  • Component changed from sugar to sugar-toolkit
  • Owner changed from tomeu to erikos

comment:2 Changed 15 years ago by alsroot

  • Cc alsroot added

comment:3 Changed 15 years ago by erikos

  • Milestone changed from Unspecified by Release Team to 0.86

comment:4 Changed 15 years ago by erikos

  • Bug Status changed from Unconfimed to New

comment:5 Changed 15 years ago by tomeu

  • Milestone changed from 0.86 to 0.88

seems too late to get this one in 0.86, slipping to 0.88

comment:6 Changed 14 years ago by walter

  • Cc walter silbe added
  • Milestone changed from 0.88 to 0.90

This is all potentially tied to Sascha's versioning work... maybe it will all come together in 0.90

comment:7 Changed 11 years ago by dnarvaez

  • Component changed from sugar-toolkit to Sugar

comment:8 Changed 11 years ago by dnarvaez

  • Resolution set to wontfix
  • Status changed from new to closed

The whole activity API would probably need to be redone, I don't see that happening now that we are working on a js toolkit though.

comment:9 Changed 11 years ago by dnarvaez

  • Milestone 0.90 deleted

Milestone 0.90 deleted

Note: See TracTickets for help on using tickets.