Author: jmorliaguet Date: Mon Jan 9 10:21:20 2006 New Revision: 2197 Modified: cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt Log:
- doc update Modified: cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt ============================================================================== --- cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt (original) +++ cpsskins/branches/jmo-perspectives/ui/framework/doc/index.txt Mon Jan 9 10:21:20 2006 @@ -10,7 +10,7 @@ ========== The CPSSkins AJAX toolkit was developed for the CPSSkins application to -simplify the creation of a rich user interface. +simplify the creation of rich user interfaces. Introduction ============ @@ -20,57 +20,96 @@ provides a way of creating "rich widgets" and of controlling their visibility in a simple way. -The implementation is based on the MVC pattern ("Model-View-Controller"). +The implementation is based on the MVC design pattern ("Model-View-Controller"). The pattern imposes to keep presentation concerns separate from the application's data layer and from the user interactions with the application. +Model +----- + +The *model* represents the application's *data* and defines how the data is +accessed. + Views ----- -The concept of *view* is taken from the *MVC pattern* ("Model-View-Controller"). Views provide a graphical representation of the *model*. A same model can be -presented with different views. The components provided by views are called -*widgets*. +presented with different views. Views are associated to widgets. Widgets ------- -A widget is the HTML fragment used by the view to display the model's data. +A widget is the HTML fragment used by the view to render the model. The view +requests the data from the model and uses the widget to display the data in +HTML. Different widgets behave differently. The user's interactions with the +widget are sent to the controller as requests for action. + +Effects +------- +Widgets can be displayed using effects (fade-in, fade-out). Effects are +defined in the view. Perspectives ------------ The notion of perspective is borrowed from the Eclipse UI. A perspective determines which views are visible in a given context. Perspectives are -usually task-oriented. +usually task-oriented, they are selected by the *controller*. Perspectives can be nested to create "sub-perspectives". Sub-perspectives can be used to create "sub-views" of a given view. -Effects -------- -Widgets can be displayed using effects (fade-in, fade-out). +It is possible to navigate between nested perspectives. Switching perspectives +translates into switching views. + +Controllers +----------- + +Controllers map user actions to model updates. + +Controllers can also select views -- this is done by switching *perspectives*. Technical implementation ======================== +Model +----- + +The data displayed by the widget can be obtained directly from the HTML page +itself using data bindings. This is done by embedding HTML comments expressed +in the JSON format inside the page. + +The JSON encoded data gets converted into a javascript object when it is +accessed for the first time. The next time the data is accessed the model +returns the javascript object instead. This only works with identifiable +elements (i.e. nodes that have an "id" attribute). For nodes that are not +identifiable the data wil be stored and retrieved from HTML comments instead. + + +View +---- + Views are declared using XML tags. They get interpreted when the page is initially loaded. For each view that is declared a widget is created. -The data displayed by the widget can be obtained directly from the page -itself using data bindings. This is done by embedding HTML comments expressed -in the JSON format. -The data gets converted into javascript objects when it is accessed for the -first time. It is then possible to query the server to get new data. +It is possible to specify which *effect* will be used when the widget is +shown or hidden. -Views can be registered as *observers* of a model and be refreshed automatically +Views can be registered as *observers* of a model and be redrawn automatically when the data in the model is updated. Views can also register a *controller* that will handle user actions. + + +Controller +---------- + Controllers are written in Javascript. They consist mainly in a collection of action handlers: for each action taken by the user, there is an action handler. +Controller classes have access to the model and to the view. + Available widgets ================= -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins