Difference between revisions of "Sugar Network/Resources"

From Sugar Labs
Jump to navigation Jump to search
(Created page with "The following diagram shows the full list of objects implemented by the Sugar Network API. {| border="0" |- valign="top" align="let" | [[File...")
 
Line 5: Line 5:
 
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]
 
| [[File:Sugar-Network-diagram.png|200px|thumb|Sugar Network objects]]
 
|}
 
|}
 +
 +
'''Resource.layer'''
 +
 +
: This is an attempt to generalize the idea of [http://groups.google.com/group/sugar-network/browse_thread/thread/4cad05ec801f364c user/resource levels] with idea that objects should not be removed from the Network immediately (only hidden, and permanently removed by Network administrators). So, every resource is associated with a layer, i.e., it might be visible for observers only if they requested this layer and have permissions to see it.
 +
 +
: For now, implemented only the following list of layers, but it might be reused for [http://groups.google.com/group/sugar-network/msg/f5a1b4d78494a5d3 teachers related workflows] later:
 +
 +
:* ''general'', the default layer for observers and Network objects; all users can see objects on this layer;
 +
:* ''deleted'' Network objects' layer will be changed to {{Code|deleted}} after removing objects by users.
 +
 +
'''Context.type'''
 +
 +
: Context types:
 +
 +
:* ''application'', software application;
 +
:* ''library'', software library;
 +
:* ''activity'', Sugar activity;
 +
:* ''article'', arbitrary content in a form of article.
 +
 +
'''Context.license'''
 +
 +
: Short license names. The licenses should conform with the [[Activity Library]] licensing [[Activity_Library/Editors/Policy/Licensing|policy]].
 +
 +
'''Implementation.stability'''
 +
 +
: Stability level of the Implementation. Values conform to [http://0install.net/interface-spec.html#id4016716 0install stability levels] and could be:
 +
 +
:* ''insecure'',
 +
:* ''buggy'',
 +
:* ''developer'',
 +
:* ''testing'',
 +
:* ''stable''.
 +
 +
'''Implementation.requires'''
 +
 +
: What Contexts the current one depends on. Value is a dictionary of:
 +
 +
  "''<Context-GUID>''": {
 +
    "''constraints''": [{            # optional array of constrains
 +
      "''not-before''": "''<VERSION>''",  # the lowest-numbered version that can be chosen
 +
      "''before''": "''<VERSION>''",      # this version and all later versions are unsuitable
 +
      }],
 +
    "''importance''":
 +
      "''essential''|''recommended''",    # dependency must be selected or no version is also an option
 +
  }
 +
 +
'''Notification.type'''
 +
 +
:* ''create'', object was created;
 +
:* ''update'', object's properties were modified;
 +
:* ''delete'', object was deleted (hidden);
 +
:* ''vote'', object was voted/unvoted.

Revision as of 03:23, 13 March 2012

The following diagram shows the full list of objects implemented by the Sugar Network API.

Sugar Network objects

Resource.layer

This is an attempt to generalize the idea of user/resource levels with idea that objects should not be removed from the Network immediately (only hidden, and permanently removed by Network administrators). So, every resource is associated with a layer, i.e., it might be visible for observers only if they requested this layer and have permissions to see it.
For now, implemented only the following list of layers, but it might be reused for teachers related workflows later:
  • general, the default layer for observers and Network objects; all users can see objects on this layer;
  • deleted Network objects' layer will be changed to deleted after removing objects by users.

Context.type

Context types:
  • application, software application;
  • library, software library;
  • activity, Sugar activity;
  • article, arbitrary content in a form of article.

Context.license

Short license names. The licenses should conform with the Activity Library licensing policy.

Implementation.stability

Stability level of the Implementation. Values conform to 0install stability levels and could be:
  • insecure,
  • buggy,
  • developer,
  • testing,
  • stable.

Implementation.requires

What Contexts the current one depends on. Value is a dictionary of:
  "<Context-GUID>": {
    "constraints": [{             # optional array of constrains
      "not-before": "<VERSION>",  # the lowest-numbered version that can be chosen
      "before": "<VERSION>",      # this version and all later versions are unsuitable
      }],
    "importance":
      "essential|recommended",    # dependency must be selected or no version is also an option
  }

Notification.type

  • create, object was created;
  • update, object's properties were modified;
  • delete, object was deleted (hidden);
  • vote, object was voted/unvoted.