Abstract:
A system and method which utilizes an additional layer of control in a conventional Model View Controller model for web presentations. In particular, the new layer creates logical components of templates which can then be dynamically controlled by rule definitions inherent in the data structure. In this manner the resulting system can apply logic to the rendering of the template while significantly reducing the amount of logic required in the template itself or required to be defined in code. This allows templates to be developed which are easier to understand and modify as they typically contain far less non-HTML artifacts than traditional methods (e.g., Java Server Pages).

Description:
FIELD OF THE INVENTION  
       [0001]     The present invention relates to developing and managing Web user interfaces (to include Web page presentations) using model-view-controller (MVC) design methodology. In particular, using a MVC paradigm, the invention reduces the problems associated with the development and management of a web presentation layer by introducing a new layer of control which utilizes augmented templates and rules inherent in certain types of structured data (e.g. XML language).  
       BACKGROUND OF THE INVENTION  
       [0002]     In designing and maintaining Web page presentations, template engines are frequently employed that allow separation of the function of getting data from a database from the function of presenting this data. Model-View-Controller (MVC) methodology is a common prior art method of performing this separation. MVC relates the user interface to underlying data models. MVC comprises three main components or objects to be used in attaining this goal: 
        A Model, which represent the underlying, logical structure of data in a software application and the high-level class associated with it. That is, the model represents enterprise data and the business rules that govern access to and updates of this data. This object model does not contain any information about the user interface.     A View, which renders the contents of a Model. It accesses enterprise data through the Model and specifies how that data should be presented. Typically, it is a goal of the View component to maintain consistency in its presentation when the Model changes.     A Controller, which translates interactions with the View into actions to be performed by the Model. The actions performed by the Model include activating business processes or changing the state of the Model. Based on the user interactions and the outcome of the Model actions, the Controller responds by selecting an appropriate view.        
 
         [0006]     The separation of model and view allows multiple views to use the same enterprise model. An important consideration of any well designed MVC is to allow for improved efficiency of development and maintenance. Accordingly, such a well designed MVC system entails the ability to develop an application rapidly and maintain it at low cost by having utilized a design that is flexible enough for future improvement. At an abstract level, the separation of logic and presentation is certainly desirable as long as it meets this flexibility goal.  
         [0007]     Typically MVC prior art systems utilize Java Server Pages (JSPs) to create the template. This template essentially describes how data should be visually presented. JSP is a technology for controlling the content or appearance of Web pages through the use of servlets, small programs that run on the Web server. In this manner, these servlets modify the Web page before it is sent to the user who requested it. Microsoft&#39;s Active Server Page (ASP) technology is comparable to JSP. Whereas a Java Server Page is a Java program that is executed by the Web server, an ASP contains a script that is interpreted by a script interpreter (e.g. VBScript or Jscript) before the page is sent to the user.  
         [0008]     Various attempts have been made to implement XML (extensible Markup Language) and XSLT (extensible Stylesheet Language Transformations, which reformats XML data into a new document such as HTML) into template based engines for separating the presentation function. These prior art systems present a tradeoff in the difficult in development (exemplified by those using XSLT) and the difficulty in effecting subsequent changes.  
         [0009]     The present invention overcomes these problems in the prior art by providing a more elegant solution to the problem of separation of the presentation and logic—in a manner that is more conducive to both initial development and subsequent changes.  
       SUMMARY OF THE INVENTION  
       [0010]     The present invention comprises adding a View Controller component between the View component and the System Controller component of a typical MVC system. This View Controller component processes the templates of the View Component and creates its own augmented templates containing logical components. Further, The View Controller handles many common tasks of presentation layouts by incorporating dynamic rule definitions contained in the data (e.g., rule definitions in XML data).  
         [0011]     In this manner the invention applies logic to the rendering of the augmented template without the need of embedding any of the logic in the template itself or needing to define the logic in code. In this process, run-time conditions determine which template(s) to use. This allows template structures to be developed which are very easy to understand and modify as they typically contain far less non-HTML artifacts than traditional JSP&#39;s.  
         [0012]     With the present invention much of the logic of the view presentation is now contained in the View Controller, thereby permitting the View Layer to become much simpler and easier to maintain. In addition, less code is required in the System Controller. This results in the System Controller also being simpler and more maintainable. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0013]     Various embodiments of the present invention will now be described in detail in conjunction with the annexed drawings, in which:  
         [0014]      FIG. 1  shows the major components of a MVC architecture according to the method and system of the present invention;  
         [0015]      FIGS. 2A and 2B  are process diagrams depicting selection of various sub-templates for inclusion into a larger augmented template;  
         [0016]      FIG. 3  illustrates an embodiment of the invention in which a template&#39;s definition includes a template syntax language;  
         [0017]      FIG. 4  illustrates an example of template aliasing based on dynamic rules;  
         [0018]      FIG. 5  illustrates an example of the use of metadata assignments based on dynamic rules;  
         [0019]      FIG. 6  illustrates rule based link management;  
         [0020]      FIG. 7  illustrates an example of selecting skins based on dynamic rules;  
         [0021]      FIG. 8  illustrates a feature of the present invention which displays the name of the template associated with a selected section of the page presentation. 
     
    
     DETAILED DESCRIPTION  
       [0022]      FIG. 1  depicts an embodiment of the invention in which a View Controller  104  is added to a typical prior art MVC system, the latter consisting of a View layer  106 , a model layer  108  and a system controller  110 . In this embodiment, the view controller  104  processes templates and XML rules definitions. By incorporating the view controller  104  in this manner, the view layer  106  requires less logic. Accordingly, the view is simpler and easier to maintain. Further, this arrangement results in less code being required in the system controller  110 . Consequently, the system controller  110  is also easier to maintain.  
         [0023]     The view controller  104  permits very fine grained structured control of the view presentation. That is, it permits a greater level of control of the presentation detail. Typically, presentation details are a function of session state information. That is, as a unique user interacts with a Web application over a period of time (“session”), a collection of objects that are tied to the session are stored on a server. This collection of objects are referred to as the session state. As an example, a user seeking to obtain information about his bank account over the Internet would typically be required to first enter his account number, then a personal identification number (PIN number). Additional session state information might include various responses to questions posed by the system or may be obtained from a data base of the bank which contains personal information relating to that user. In this manner, the view presentation can be personalized to the user—e.g., wishing him a happy birthday when appropriate. The view controller  104  handles many common tasks of these presentation layouts and does so with increased flexiblitity by allowing dynamic rules to be defined against the session state.  
         [0024]     In this embodiment of the invention, augmented templates are dynamically assembled relying on the rules that exist in an XML file.  FIGS. 2A and 2B  depict examples of such template assemblies. As illustrated in  FIG. 2A , three smaller templates,  202 ,  204  and  206  are assembled to form augmented Template A (item  200 ). An XML Rules Evaluator  210  is used as a control point during the assembly of Template A and determines which templates should be included. In the example illustrated by  FIG. 2A , only templates  204  and  206  were incorporated into augmented Template A. In the way of comparison,  FIG. 2B  illustrates only templates  202  and  204  being selected for building an augmented Template B (item  208 ).  
         [0025]     The present invention performs the creation of augmented templates (e.g., Template A, Template B) by a process more sophisticated than merely appending together smaller templates. In particular, the View Controller of the present invention dynamically assembles these templates according to defined rules that exist relating to the structure of the data. In the embodiment depicted in  FIGS. 2A and 2B  this dynamic assembly invokes the rule definitions present in the XML language.  
         [0026]      FIG. 3  shows in greater detail how the assembly of an augmented Template C is implemented according to an embodiment of the present invention using XML rules. In particular, Template C is defined as having three control points (at lines labeled  302 ,  304 , and  306 ) which, upon execution of this program language, allow for the sub templates to be assembled together into Template C. The three individual sub templates (corresponding to items  202 ,  204 , and  206  of  FIG. 2A ) are parsed by a parsing engine and tokens are defined which become the control points on which the definitions of the XML rules operate.  
         [0027]     By way of example, item  302  contains both conventional HTML language used in Web page design (&lt;td width=“218”) as well as the following template language that is unique to the present invention: 
        #render(“/homepage/download vm”)        
 
         [0029]     In its operation, the invention would interpret this template syntax to essentially execute potentially complex operations and logic that is made available within the XML definition—without any such logic existing within the template file itself. Thus, such entries within the template can be viewed as mere place holders which when acted upon by the invention&#39;s interpreter would yield a Web presentation text based format, such as SVG (Scaleable Vector Graphs) or HTML code. Such newly generated HTML code, when combined with the HTML code present in Template C, would then be presented to and treated by the View Template Component  106  in a conventional manner to create the presentation to the user.  
         [0030]     Of significance is that in this embodiment of the invention, the actual HTML language appearing in Template C can be reduced in complexity. The complexity and logic are made available within the XML definitions without requiring their presence in the template. This is made possible because the augmented template indirectly references the XML definitions. Various examples of such definitions (i.e., defined within the XML rules) will now be discussed in greater detail.  
         [0031]     1. Template Aliasing: Allows indirect template substitution based on dynamic rules.  FIG. 4  illustrates this example in which one of two or more alternative elements is selected. The correct target element is chosen when the sub element condition evaluates true. Thus, in the data structure illustrated at  402 , the target templateid becomes “leftnavigation/left NavTopHomePage.vm” when the mapid equals the value specified (“/homepage/homepage.vm”, at  404 ). Alternatively, at  406  the target templateid would be set to “/leftnavigation/leftNavTop.vm” should the mapid equal any other value.  
         [0032]     An example of how this template aliasing would be used by the invention in a template definition follows:  
                                                   &lt;td width=”150” class=”dbg”&gt;             #render (“leftNavTop”)                 &lt;/td&gt;                      
 
         [0033]     The presence of this template syntax in this embodiment of the invention results in the logic of the appropriate leftNavTop becoming the selected target using the XML rules.  
         [0034]     2. Filtering: In-line dynamic template filtering can be applied at any level in the page rendering process by attaching a filter to a template. 
        a. Dynamic Filtering Plug-ins: The filters are based on a plug-in model allowing filters to be dynamically loaded. A metadata element allows dynamic passing of any parameters to the plugin.     b. Regular Expression Filtering: A regular expression filter is provided which provides very powerful dynamic custom filtering without the need of writing any custom filters.     c. Filter Chaining: Filters can be applied in any order to the rendering of a template.  FIG. 5  illustrates an example of a chaining filter process as envisioned by the present invention.        
 
         [0038]     3. Dynamic Metadata: a generic metadata model allows metadata assignments to templates and link elements which may contain dynamic constructs from the application context. 
        a. Template metadata can be assigned globally or per template.     b. Metadata is available directly in templates which allows for more readable templates.     c. Metadata is also rules based for link elements which allows for link attributes to be dynamically assigned and evaluated against the context.     d. The generic metadata model is easily expandable to other elements.     e. Metadata values can by dynamically assigned through introspection of session context.        
 
         [0044]     An Example of the use of dynamic metadata is illustrated below:  
                                                                                        
 
         [0045]     In this example metadata values are mapped directly into a Java Map object. The ${ } notation is dynamically substituted for values in the session using introspection.  
         [0046]     4. Rule Based Target Elements: the rule based target model allows for much of the dynamic features of the present invention 
        a. Targets can be assigned conditions which are evaluated against the application context.     b. Aliases, Links and Layouts currently use the target condition model.     c. The model is easily expanded to any other element. For instance, rule based filtering could be easily implemented.        
 
         [0050]     5. Rule Based Link Management: links are managed and defined in the XML rules definitions. 
        a. Dynamic Link Targets: the link URL can be dynamically assigned by target rule definitions.     b. Link target, parameters and metadata can be defined in the XML rules.        
 
         [0053]      FIG. 6  illustrates an example of rule based linking in which dynamic, external links are being defined.  
         [0054]     6. Global Layouts and Skins: Site wide layouts make it easy to handle site navigation and standard headers and footers.  
         [0055]     a. A layout is used to provide the most common elements around a screen. Typically, a layout includes header, footer, and navigation elements. Layouts support rule based selection whereby the layout is permitted to dynamically change on any rules against the application context.  
         [0056]     b. Layouts can define skins which are a set of templates defining the presentation look and feel.  
         [0057]     c. Common Template Set: common template sets allow template themes to be shared for different skins or layouts. Thus, a model can be structured in a hiearchy such that specific site themes or skins need only to define the templates which differ from the common set. 
        d. Skin selection is based on the layout.        
 
         [0059]      FIG. 7  illustrates an embodiment of the invention in which a layout is selected. In particular, a layout is determined by the target element  702  which evaluates true by the match element. If there is no match element, it is the default target. In this illustrated example, item  704  denotes the common-path which defines a directory set which all skins share. This allows for some reuse among common theme sets. Item  706  depicts the path location for the skin. Changing the entire site theme is readily achieved by simply changing the path location to point to a different template set.  
         [0060]     7. Dynamic Cache: cache definitions can be assigned by XML rules allowing efficient caching of most templates without the need to develop your own cache mechanism. 
        a. Fine Grained: cache is defined per template, allowing precise control over what is cached.     b. Dynamic Context Handles: the cache handle can be dynamically assigned through XML definitions, allowing the cache to operate on and expire against session data.     c. Precise Expiration: cache model allows fine control over expiration through an Application Program Interface (API) as well as a dynamically available chronological (cron) expiration giving precise timing of when a cache expires.        
 
         [0064]     An Example of the use of a dynamic Cache is listed below:  
                                                                                        
 
         [0065]     8. Context Mappings: context mappings provide the dynamic association for all the XML rules to application context. 
        a. Dynamic Session Context: the context mappings allow you to define data which is available to the XML rule evaluators.     b. Introspection Lookups: using introspection, the mappings allow dynamic definitions in XML to any object information in the session context.        
 
         [0068]     An Example of the use of a dynamic session context mapping is listed below in which a value is obtained using the “$request” instruction. This value is subsequently used as the servername.  
                                                                                        
 
         [0069]     9. Realtime Configuration Updates: 
        a. No Web Application Server (WAS) restarts or servlet reloading: all configuration can by updated in realtime while the application is running and serving clients. This includes XML definition rules, system configuration options and the presentation templates.     b. Cron style update timer: a cron compatible update timer defined in properties configures the frequency the system checks for configuration updates.     c. Development Mode Live Updates: system can be configured to update all configuration for each request. This allows developers to change or modify XML rules, templates, macros, or configuration while the system is running and view the results without any restarts of any system.        
 
         [0073]     10. Exception Handling and Redirects: 
        a. Specify alternative templates to render per template in the event of generated exceptions.        
 
         [0075]     An Example of the use of this feature is listed below:  
                                                                                        
        b. Fail Safe redirect policy to a configurable static page for critical errors.        
 
         [0077]     An additional embodiment of the invention provides a useful tool to the individual(s) responsible for developing and managing the Web page presentations. In particular, this tool presents to the individual the template that yielded a selected section of the displayed Web page.  FIG. 8  is a screen shot of a Web page that illustrates this feature of the invention. When the user places his mouse cursor  802  over a region  804  of the page, the specific template that generated that region  804  is displayed in the page&#39;s status bar  806 . As a result, the user readily knows what template needs to be modified to produce any desired changes in the displayed page.  
         [0078]     This feature is particularly useful with other embodiments of the invention in which an augmented template is being generated by combining templates and which augmented template uses rules inherent in structure data to produce the web presentation. That is, the templates which are included in the augmented template are distinguished and visually identified to the user.  
         [0079]     In a further embodiment of the invention JavaScript is utilized to create this feature. An HTML &lt;div&gt; tag is employed which surrounds each template included in the augmented template. Thus, by way of example an HTML &lt;div&gt; tag would surround template  202  of  FIG. 2A . The &lt;div&gt; tag contains the JavaScript which makes that portion of the augmented template visibly highlighted when the mouse cursor is moved over that area. The JavaScript also enables displaying the name of the included template on the browser&#39;s status bar  806 .  
         [0080]     Listed below is an example of a JavaScript &lt;div&gt; tag which surrounds an included template:  
                                                   &lt;div onmouseover = “this.style.borderColor = ‘blue’;           this.style.borderStyle = ‘solid’; window.status =           ‘template: $aliasname’;           event.cancelBubble=true;”           onmouseout = “this.style.borderColor = ‘red’;           this.style.borderStyle = ‘dashed’; window.status = ‘ ’;           event.cancelBubble=true;”           style = “border: 1px dashed red;”&gt;           #parse($template)           &lt;/div&gt;                      
 
         [0081]     The resulting visual effect produced by this code would be that each section of the presented page that is produced by a template so tagged would be presented surrounded by a dashed red line. In the non-color example presented in  FIG. 8 , these are depicted as sections simply surrounded by black dotted lines (e.g.,  808  and  810 ). When the user moves this mouse cursor over one of these sections, the surrounding lines become solid blue lines indicating the selected area. In the  FIG. 8  illustration, section  804  has been so selected wherein the resulting solid lines are illustrated absent the blue color. Moreover, the selection of section  804  results in the name of the template being displayed in the Status bar. As noted above, displaying in this manner the names of templates being used on the presentation page provides a useful tool for a developer or editor to modify the presentation.  
         [0082]     While the invention has been described with reference to the preferred embodiment thereof, it will be appreciated by those of ordinary skill in the art that modifications can be made to the structure and elements of the invention without departing from the spirit and scope of the invention as a whole.