uf:profiles
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
uf:profiles [2008/09/05 11:39] – alombide | uf:profiles [2009/11/18 14:38] (current) – adding elisag | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== Profiles ==== | ==== Profiles ==== | ||
- | * Profiles: each Flockr has a Profile. There is a minimal set of properties that are present in each Profile (such that Proximities (e.g. a " | + | Profiles |
- | * Changed events: when a Flockr modifies his Profile, a change event is propagated to the remote interfaces of all other Flockrs. In reaction to these events, all connected Flockrs propagate these events to the interested | + | |
- | * Caching: | + | When a Flockr modifies his Profile, a change event is propagated to the remote interfaces of all other Flockrs. In reaction to these events, all connected Flockrs propagate these events to the interested |
+ | |||
+ | Each Flockr keeps a cached Profile of the other Flockrs such that the Profile can be consulted offline. When a Flockr is connected for which there is a cached Profile, he should propagate the necessary changed events to make sure that both the cached Profile and the Flocks of the other Flockrs are updated. | ||
+ | |||
+ | ==== Profile Fields ==== | ||
+ | |||
+ | A Profile is a property object containing a number of named fields. Each field also has a Field Type. This Field Type is used to generate | ||
+ | |||
+ | ==== Field Types ==== | ||
+ | |||
+ | Field Types are represented as Field Type objects. These objects have the following API: | ||
+ | * isString() | ||
+ | * isEnumeration() | ||
+ | * isInteger() | ||
+ | * isDate() | ||
+ | * isPossibleValue(aValue): | ||
+ | * getPossibleValues(): | ||
+ | * name() | ||
+ | * defaultValue() | ||
+ | * fieldSize(): | ||
+ | * comparators(): | ||
+ | Some of these methods should be overridden when a custom type is added. | ||
+ | |||
+ | The following Field Types are built in: | ||
+ | * StringFieldType: | ||
+ | * EnumerationFieldType: | ||
+ | * IntegerTypeField: | ||
+ | * DateTypeField: | ||
+ | |||
+ | ==== Mandatory Fields ==== | ||
+ | |||
+ | Each profile has the following mandatory fields: | ||
+ | * username | ||
+ | * firstname | ||
+ | * lastname | ||
+ | * birthdate | ||
+ | * sex | ||
==== API ==== | ==== API ==== | ||
- | * Profile: | + | * getFieldType(fieldName) |
- | * Flockr - Remote Interface: profileChangedOf(flockrRef) | + | * checkFieldTypeForValue |
- | * Flockr - Local Interface: getUpdatedProfile(flockrRef) | + | * addFieldTypeMapping(field, typeObject) |
- | * Proximity: profileChanged(profile, flockrRef) | + | * removeFieldTypeMapping(field) |
- | * CachedProfile: | + | * makeStringFieldTypeObject() |
+ | * makeEnumerationFieldTypeObject(possibleValues) | ||
+ | * makeIntegerTypeFieldObject(low, high) | ||
+ | * makeDateTypeFieldObject(low, high) | ||
+ | * isMandatoryField(propName) | ||
+ | * addField(propName, | ||
+ | * removeField(propName) | ||
+ | * setField(propName, | ||
+ | * fieldMatches(field, | ||
+ | |||
+ | ==== Implementation ==== | ||
+ | |||
+ | Properties of Profiles are represented as slots in the profile objects. Each Profile object has a parent object that contains the common behavior and mandatory fields for each profile. Since profiles are frequently copied over the network, they are isolate objects. |
uf/profiles.1220607547.txt.gz · Last modified: 2009/02/27 15:20 (external edit)