User Tools

Site Tools


uf:profiles

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uf:profiles [2008/08/27 15:05]
alombide
uf:profiles [2009/11/18 14:38] (current)
elisag adding
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 "doesProfileMatch" proximity) can be defined based on these properties). +Profiles represent the user identity in the frameworkThey are highly extensible and besides number of mandatory fields, flockrs can add as many custom fields as they likeFor example, users could add a field with their year of graduation and use it to create a flock of nearby flockrs which graduated the same year. Furthermore, the framework provides some infrastructure that makes it easy to add new custom data types without having to write too much boiler plate code
-  * Profile Dude: manages the profiles. Is responsible of propagating "changed events" to the other "reachable" flockrs. +  
-  * Changed events: when flockr modifies his profile, the Profile Dude broadcasts a change event to all other flockrs. In reaction to these events, all connected flockrs should re-evaluate their proximities such that the flocks can reflect the change in the profile+When Flockr modifies his Profilea 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 Flocks
-  * Caching: 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.+ 
 +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  the appropriate user interface component (e.g. a text input field for text, a combobox for enumerations...) and to limit the possible values that can be assigned to the field. It is also used to specify which comparator operations are allowed on the field of this type. 
 + 
 +==== Field Types ==== 
 + 
 +Field Types are represented as Field Type objects. These objects have the following API: 
 +  * isString() 
 +  * isEnumeration() 
 +  * isInteger() 
 +  * isDate() 
 +  * isPossibleValue(aValue): checks if aValue is a possible value for this type. 
 +  * getPossibleValues(): returns the possible values for this type. 
 +  * name() 
 +  * defaultValue() 
 +  * fieldSize(): can be specified for some field types for displaying purposes on a GUI. 
 +  * comparators(): get the list of comparison operators defined on this type. 
 +Some of these methods should be overridden when a custom type is added. 
 + 
 +The following Field Types are built in: 
 +  * StringFieldType: for text. 
 +  * EnumerationFieldType: for a list of possible symbols. 
 +  * IntegerTypeField: for integers. For integers, a range can be specified. 
 +  * DateTypeField: for dates. For dates, a range can be specified. 
 + 
 +==== Mandatory Fields ==== 
 + 
 +Each profile has the following mandatory fields: 
 +  * username 
 +  * firstname 
 +  * lastname 
 +  * birthdate 
 +  * sex
  
 ==== API ==== ==== API ====
  
-  * Profile +  * getFieldType(fieldName) 
-  * Profile Dude +  * checkFieldTypeForValue 
-  * Flockr+  * addFieldTypeMapping(field, typeObject) 
 +  * removeFieldTypeMapping(field) 
 +  * makeStringFieldTypeObject() 
 +  * makeEnumerationFieldTypeObject(possibleValues) 
 +  * makeIntegerTypeFieldObject(low, high) 
 +  * makeDateTypeFieldObject(low, high) 
 +  * isMandatoryField(propName) 
 +  * addField(propName, propVal, propType) 
 +  * removeField(propName) 
 +  * setField(propName, propVal) 
 +  * fieldMatches(field, value) 
 +  
 +==== 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.1219842344.txt.gz · Last modified: 2008/08/27 15:06 (external edit)