Difference between revisions of "Sugar Network/Resources"

From Sugar Labs
Jump to navigation Jump to search
Line 6: Line 6:
 
|}
 
|}
  
'''Resource.authority'''
+
'''Resource.author'''
  
A dictionary of ''User'' guids and integers with roles information. Role value is a bit-wise ORed value of the following constants:
+
A list of authors working on the corresponding resource. List items are dictionaries with the following keys:
  
* {{Code|1}}<br>corresponding user is the original author of the object; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors; if it is set, user name (not guid) will be automatically added to the {{Code|author}} property in addition to directly set authors.
+
* ''guid''<br>Author's guid in the Sugar Network; might be omitted if particular author is not registered in the Sugar Network;
 +
 
 +
* ''name''<br>Full author's name;
 +
 
 +
* ''role''<br>An integer which is a bit-wise ORed value of the following constants:
 +
** ''1'', author is registered in the Sugar Network (and ''guid'' key is set);
 +
** ''2'', author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.
  
 
'''Resource.layers'''
 
'''Resource.layers'''

Revision as of 21:05, 24 November 2012

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

Sugar Network objects

Resource.author

A list of authors working on the corresponding resource. List items are dictionaries with the following keys:

  • guid
    Author's guid in the Sugar Network; might be omitted if particular author is not registered in the Sugar Network;
  • name
    Full author's name;
  • role
    An integer which is a bit-wise ORed value of the following constants:
    • 1, author is registered in the Sugar Network (and guid key is set);
    • 2, author is the original author of the corresponding resource; if it is not set, user is only a maintainer, e.g., an uploader of a book which has its original authors.

Resource.layers

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:
  • public, object is visible for everyone;
  • deleted Network objects' layer will be changed to deleted after removing objects by users.

Context.type

Context types:
  • activity, Sugar activity;
  • project, general purpose context;
  • package, GNU/Linux package metadata;
  • content, content like PDF files.

Implementation.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.

Notification.type

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

Feedback.type

  • question
  • idea
  • problem

Artifact.type

  • instance, Sugar activity instance object.