Skip to content

Metadata Structure

kubedo8 edited this page Apr 5, 2017 · 38 revisions

CollectionMetadataFacade

{
   "name":"CollectionMetadataFacadeCollectionDropOrDecrementAttribute",
   "internal-name":"collection.collectionmetadatafacadecollectiondropordecrementattribute_0",
   "project-id":"default",
   "attributes":{
      "attribute 1":{
         "attribute-name":"attribute 1",
         "attribute-constraints":[ "isNumber", "lessThan:3"],
         "attribute-count":1,
         "child-attributes":{
            "child":{
               "attribute-name":"child",
               "attribute-constraints":[],
               "attribute-count":1,
               "child-attributes":{

               }
            }
         }
      }
   },
   "last-time-used":   ISODate("2017-03-24T17:04:10.989   Z"),
   "recently-used-documents":[]
}

name is name of collection given by user,

internal-name is actual name of the collection,

project-id is project ID,

attributes is a document, keys are names of the attributes, values are documents with metadata,

attribute-constraints is array of strings with constraints configurations,

attribute-count is a number of documents in collection that contain the attribute,

child-attributes are attributes of nested documents,

last-time-used is the time when collection was used for the last time,

recently-used-documents is an array of IDs of documents in collection, the first is the one most recently used.

DocumentMetadataFacade

    {
   	"_meta-create-date" : date,
   	"_meta-update-date" : date,
   	"_meta-creator-user" : user_name,
   	"_meta-update-user" : user_name,
   	"_meta-rights" : [
              "user_name1" : 1  //execute permissions
              "user_name2" : 2  //write permissions
              "user_name3" : 4  //read permissions
              "user_name4" : 3  //execute and write permissions = 1 + 2
              "user_name5" : 5  //read and execute permissions = 1 + 4
              "user_name6" : 6  //write and read permissions = 2 + 4
              "user_name7" : 7  //full permissions = 1 + 2 + 4
              "others" : 0  //others is forced to be there, maybe if not presented, that means 0 permissions
       ],
       "_meta-group-rights” : [
              "group_name1" : 1  //execute permissions
              "group_name2" : 2  //write permissions
              "group_name3" : 4  //read permissions
              "group_name4" : 3  //execute and write permissions = 1 + 2
              "group_name5" : 5  //read and execute permissions = 1 + 4
              "group_name6" : 6  //write and read permissions = 2 + 4
              "group_name7" : 7  //full permissions = 1 + 2 + 4
      ]
   	… (rest of the document) …
   }

_meta-create-date is date of creation document,

_meta-update-date is date of last update of document,

_meta-creator-user is user who create the document,

_meta-update-user is user who perform last update on document,

_meta-rights specific rights for users,

_meta-group-rights specific rights for user groups

ViewFacade

{
   "name":"viewCreateInitialMetadata",
   "view-id":0,
   "type":"default",
   "configuration":{

   }
}

name is name of view given by user,

view-id is unique number generated by SequenceFacade,

type is view type,

configuration is nested document with arbitrary keys and values.

VersionFacade

{
   {"_id":{"_id" : idOfDocument, "_meta-version" : 3}},
   // rest of document is same as in DocumentMetadataFacade
}

LinkingFacade

Main linking table

{
 "fromCollection": collection1,
 "toCollection" : "collection2,
 "collection_name" : internalNameOfCollection
 "role" : role
}

fromCollection is name of first collection

toCollection is name of second collection

collection_name is internal name of collection, where links are located,

role is name of role which specify link between collections

Collection linking table

{
   "fromId" : id1,
   "toId" : id2,
   "attributes" : {
         "attr1" : value1,
         ....
    }
}

fromId is id of first document,

toId is id of second document,

attributes some custom attributes of link

ProjectFacade

{ "project-id" : projId, "organization-id" : orgId, "project-name" : name, "users" : [ {"user" : user1, "user-roles":["role1", "role2", "role3"]}, {"user" : user2, "user-roles":["role15", "role26", "role31"]}, {"user" : user3, "user-roles":["role2", "role3", "role4"]}, {"user" : user4, "user-roles":["role2", "role3", "role5"]}, ], "_meta-icon": icon, "_meta-color" : color, "_meta-default-roles" : ["role1", "role15"] } project-id is unique id of the project,

organization-id is id of the organization,

project-name is unique name of the project,

users is array of users and their roles,

_meta-icon is icon of the project,

_meta-color is default color of the project,

_meta-default-roles are default role for newly created users

OrganizationFacade

// TODO

Clone this wiki locally