Total Knowledge Projects Jobs Clientele Contact

UU Templates

Personal tools
From Total Knowledge
(Difference between revisions)
Jump to: navigation, search
(Template organization: Add the theme structure document)
Current revision (14:04, 18 January 2009) (view source)
m
 
 +
<keywords content="skin,template,theme,CSP,C++,Server,Pages,C++ Server Pages,servlet,design,graphics,web,university,school,course,study,online,on-line"/>
 +
=Intro=
=Intro=
[[Image:HiLevelArch.svg|right|600px|thumbnail|High-level architecture diagram]]
[[Image:HiLevelArch.svg|right|600px|thumbnail|High-level architecture diagram]]
* Controller determines which language to render page in based on user preferences
* Controller determines which language to render page in based on user preferences
* Controller forwards the request to the view object
* Controller forwards the request to the view object
 +
 +
=Controller Servlets (libui)=
 +
Most of controller servlets will be derived from UuServlet class, rather then servlet::HttpServletRequest UuServlet provides standard service() function, which handles common tasks, and then forwards actual processing to service(UuRequest&, UuResponse&) function, which should be overridden by servlets.
 +
Following common tasks are taken care of by UuServlet:
 +
* Login to database
 +
* Handling of common exceptions
 +
* Forwarding to the corresponsing view based on user's choice of theme
 +
* Language setup
 +
* Prepare common data for request (user object, counts of available UMOs for side bar, etc.)
 +
 +
Following is expected from Controller servlet:
 +
* Set view to use (exception: if servlet wants to redirect, view must be set to "")
 +
* Retrieve servlet-specific data from database, and set it as request attributes
 +
* Call database functions for data modifications
 +
* Handle servlet-specific error conditions
=Template organization=
=Template organization=
   Exceptions are handled by calling servlets by redirecting
   Exceptions are handled by calling servlets by redirecting
   to common error pages.
   to common error pages.
 +
* theme CSPs should '''not''' access database themselves
 +
  This would conflict with "no exception handling" and would
 +
  generally make theme code messy and unreadable
Finally, there are few recommendations for organizing your theme.
Finally, there are few recommendations for organizing your theme.
* Theme should have Header.csinc, included by each .csp, which builds common menus and such.
* Theme should have Header.csinc, included by each .csp, which builds common menus and such.
* Theme should have Footer.csinc, which displays any error messages accumulated during CSP execution in uniform way.
* Theme should have Footer.csinc, which displays any error messages accumulated during CSP execution in uniform way.
 +
* Theme should have minimum of C++, and preferably in Header.csinc or Footer.csinc
 +
  This is meant to make theme as readable as possible.

Current revision