Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
titleCommunity JSON format
{
	// Basic system parameters:
	"_id": string, // String representation of MongoDB ObjectId
	"created": string, // Java date format, time when community was created
	"modified": string, // Java date format, time when community details were last changed
	
	// Advanced system parameters:
	"communityStatus": string, // "active", "disabled", or "pending" (awaiting admin approval)
	"isSystemCommunity": boolean, // true for the one system community each cluster has (that every member joins by default)
	"isPersonalCommunity": boolean, // Every user also has a personal community, of which only they are a member
	"parentId": string, // String representation of MongoDB ObjectId, the "_id" of the parent community (currently meaningless, every community is a "child" of the system community)
see below. 
	"parentName": string, // The "name" of the (meaningless) "parent" community, see below.
 
	// Community metadata:
	"ownerId": string, // The "_id" field of the community owner (ie the user who created it)
	"ownerDisplayName": string, // The above user's "displayName"
	"name": string, // The display name of the community
	"description": string, // A longer description
	"tags": [ string ], // Metadata tags (for future searching applications)
	
	// Member information:
	"numberOfMembers": integer, 
	"members": [{
		// From "person" object, see link below
		"_id": string, 
		"email": string,
		"displayName": string,
		"languages": [ string ],
		"contacts": [ {...} ], // The same format as for the "person" object
		"links": [ {...} ], // The same format as for the "person" object
 
		"userType": string, // One of "member", "moderator" or "owner" (moderators have the same abilities as the owner)
		"userStatus": string, // One of "active", "disabled" or "pending" ("pending" means awaiting approval from an owner/moderator)
 
		"userAttributes": [{ // Overrides for the default
			"type": string, // This actually maps onto the key from the parent "userAttributes" map, see below
			"value": string // The default or overridden value
		}]	
	}],
 
	// Community properties:
	"userAttributes": { // This is a list of things that members can do (see below)
		"USERPROP1": { // This is a map, ie this format is for USERPROP1, USERPROP2, etc;
			"type": string, // "boolean", "string"
			"defaultValue": string, // string representation of the default value
			"allowOverride": boolean // if "true", users can override the default values; defaults to false
		},
		//etc
	},
	"communityAttributes": { // This is a list of community properties (see below)
		"COMMPROP1": { // This is a map, ie this format is for COMMPROP1, COMMPROP2, etc;
			"type": string, // "boolean", "string"
			"value": string
		},
		//etc
	}	
} 

Note that most of the "members" object fields are simply copied from the Person object.

Info

By default community parent attributes point to the system community, in which case they are ignored (the same as not being present). They can be set to a different community via the community create API call. In that case the "sub-community" shares its Lucene index with the parent community (note this is purely an implementation detail, it makes no fuctional/security). It can be used where there are large numbers of communities, since creating large numbers of Lucene indexes gets inefficient.

Three of the fields in the above format are lists (actually sets) or maps of type/value objects:

...