Abstract:
A system and method for creation of a network server application page where objects containing custom tags in a JAVA server page (JSP) are aggregated by input ( 32 ), process ( 34 ) and output ( 36 ) stages. The input stage involves arranging information into a structure having a number of elements with each element having a number of sub-elements. The process stage involves forming a template to represent each element type, the template having a marker, such that when the structure that represents the input is traversed, a corresponding template is matched with corresponding element values. The matching element values are substituted into the template text where the marker indicates, and the template content is appended to the output. The output is a ‘complex JSP page’, an aggregation of template content based on the structure representation of the input, which without this method of using templates would be very difficult to build.

Description:
FIELD OF THE INVENTION  
       [0001]     This invention relates to creation of network server application pages, and particularly, though not exclusively, to such server page creation in ‘JAVA™ 2 Platform, Enterprise Edition’ (J2EET).  
       BACKGROUND OF THE INVENTION  
       [0002]     In the field of this invention the use of custom tag libraries to access custom discrete functionality from within a J2EE application is increasing rapidly. Many of these tag libraries are extremely complex and exceedingly cumbersome to use. For example, constructing a complex JSP page having multiple tags wherein the cumulative effect of the tags represent a complicated structure such as a hierarchy of different objects is difficult to achieve.  
         [0003]     From patent publication EP1126681 there is known the use of nested tags in JAVA™ Server Page (JSP™) pages. EP1126681 concerns formatting pages to support different devices using templates as a form for a style sheet. However, the approach taken in EP1126681 has the disadvantage that a complex JSP page remains relatively difficult to build.  
         [0004]     A need therefore exists for a system and method for the creation of complex network server application pages wherein the abovementioned disadvantages may be alleviated.  
       STATEMENT OF INVENTION  
       [0005]     In accordance with a first aspect of the present invention there is provided a system for creation of a network server application page comprising means for representing information in a structure having at least one element, each element having at least one sub-element, means for processing a template representing each element and sub-element, the template having a marker, the means for processing for searching the structure for a corresponding template that matches the marker in the template, and substituting into the template an element value where the marker indicates, and means for aggregating the template based on the structure.  
         [0006]     In accordance with a second aspect of the present invention there is provided a method for creation of a network server application page comprising representing information in a structure having at least one element, each element having at least one sub-element, processing a template representing each element and sub-element, the template having a marker, searching the structure for finding a corresponding template that matches the marker in the template, substituting into the template an element value where the marker indicates, and aggregating the template based on the structure to form the network server application page.  
         [0007]     In accordance with a third aspect of the present invention there is provided a computer program product for creation of a network server application page for creating a network application page comprising a computer useable medium having a computer readable program code means embodied in the medium for causing creation of a network server application page, the computer program product comprising a computer readable program code means for representing information in a structure having at least one element, each element having at least one sub-element, a computer readable program code means for processing a template representing each element and sub-element, the template having a marker, a computer readable program code means for searching the structure for a corresponding template that matches the marker in the template, a computer readable program code means for substituting into the template an element value where the marker indicates, and a computer readable program code means for aggregating the template based on the structure to form the network server application page.  
         [0008]     In accordance with a fourth aspect of the present invention there is provided a computer programmed to perform a method of creating a network server application page, the method comprising representing information in a structure having at least one element, each element having at least one sub-element, processing a template representing each element and sub-element, the template having a marker, searching the structure for a corresponding template that matches the marker in the template, substituting into the template an element value where the marker indicates, and aggregating the template based on the structure to form the network server application page. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0009]     One system and method for aggregation for creation of objects containing custom tags in a network server application page incorporating the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which:  
         [0010]      FIG. 1  shows a block diagram of a system in which an embodiment of the invention may be implemented;  
         [0011]      FIG. 2  shows a screenshot of a screen display on a user&#39;s screen display of a user device in accordance with an embodiment of the invention;  
         [0012]      FIG. 3  shows a screenshot of a screen display on a user&#39;s screen display of a user device in accordance with an embodiment of the invention; and  
         [0013]      FIG. 4  shows a flow chart of a method in accordance with an embodiment of the invention. 
     
    
     DESCRIPTION OF PREFERRED EMBODIMENTS  
       [0014]     An embodiment of the invention is a mechanism to resolve the complexity associated with tag libraries as used in network server application pages, such as in JAVA™ server page (JSP™), and to simplify the use of tag libraries by cascading or nesting templates to aggregate the custom tags and apply standardised behaviors and attributes to the tags. The templates are interpreted by a tool such as an integrated development environment (IDE) such as IBM™ WEBSPHERE™ Studio Site Designer (WSSD), IBM WEBSPHERE Studio Application Developer, or the like that may be associated with the web-authoring environment. Such tools may be used to implement an embodiment by causing the insertion of complicated structures of custom tags which may be edited manually if so required. A complex JSP page is, for example, a page that may be constructed to have multiple tags, and the tags may have multiple parameters, wherein the cumulative effect of the tags represent a complicated structure such as a hierarchy of different objects.  
         [0015]     Another example of an network server application page like JSP is an active server page (ASP) which is a hyper-text markup language (HTML) page that includes one or more scripts (small embedded programs) that are processed on a web server prior to the page being sent to the user. ASP, similar to a server-side include or a common gateway interface (CGI) application in that all involve programs that run on the server, usually tailors a page for the user. Typically, the script in the web page at the server uses input received as the result of the user&#39;s request for the page to access data from a database and then builds or customizes the page on the fly before sending the page to the user or requester.  
         [0016]     An embodiment may be implemented in a system such as the computer device  2  and network system  1  shown in  FIG. 1 . The user device  2  allows a user to create complex JSP pages  12  via a web-authoring environment application  14 . The user device may be any computer device, such as a laptop, desktop, personal digital assistant (PDA), or the like, that may access and communicate to a network  4  and provide a web-authoring environment. Such user device may include a central processing unit  8  to control communication within the user device between a memory  10 , the application  14  and complex JSP page  12 , and an input/output (I/O) and network interface  6 . The I/O-network interface may support peripheral devices  16  such as a screen display, and the like. The network  4  may be the internet, enterprise network, combination, or the like. The user device  2  may allow a user to design a complex JSP page  12 , and apply the page via the network and a server device  3  having a network interface  7 , processor  9 , memory  11  for storing items  13  such as documents, information, such as JSP pages and the like. Web pages  5  are also accessible by the server and user device via the network.  
         [0017]     An example of a graphical user interface implementing the mechanism is shown in  FIG. 2 .  FIG. 2  shows a screenshot  18  of a screen display  16  on a user&#39;s screen display  16  of a user device  2 . The user device shown provides a web-authoring environment, for example an IDE such as WSSD or the like as discussed above. The screenshot  18  is a graphical representation of a JSP page editor  20  in the mid-window of the screen together with navigator window  28  in the left-window of the screen listing a number of projects and files contained within the projects, and a database  26  such as IBM LOTUS™ DOMINO™ (DOMINO) database in the right-window of the screen. WSSD includes the JSP editor and the navigator, and the DOMINO database is a plugin such as IBM LOTUS DOMINO Toolkit for WEBSPHERE Studio. JSP content  24  in the JSP editor window  20  shows the source code view of a JSP page with some HTML structure. The navigator window  28  is used to select which file that is displayed in the editor pane  20 . The DOMINO window displays the structure of a previously selected DOMINO database, and from the DOMINO window elements of the DOMINO structure may be inserted by inserting means such as “drag and drop” into the source window  20  of the JSP editor whereby the expansion to JSP tags occurs.  
         [0018]      FIG. 3  is another screen shot  30  showing a graphical representation of JSP editor window  20  with JSP editor content  25  of the JSP source file after the insertion or drag and drop operation described above. For example, with WSSD, JSP editor  20  and DOMINO database  26 , the drag and drop may be performed to the source window or an insertion procedure may be performed from the element of the DOMINO structure that produces a menu with an option to insert the element in the DOMINO database into the source code. In this example, the listed elements (“DateAcquired”, “Comments”, “Media”, “Artist”, “Title”, “Category”) in the DOMINO database  26  of  FIG. 2  are inserted into the JSP editor  20  resulting in JSP content  25  of  FIG. 3 .  
         [0019]     With this configuration, a functionality is achieved at a further level of abstraction from tag libraries, allowing aggregations to be used as easily as each individual tag, while preserving the flexibility, functionality and power of the original tag library.  
         [0020]     In a particular implementation, an embodiment of the present invention may be effected by aggregation for creation of objects containing custom tags in JSP through following input, process and output stages as indicated in the flow chart of a method  40  embodying the invention in  FIG. 4 . The input stage  32  structures element information  42  and sub-element information  44 . The structuring of the information may be a representation of the design of a DOMINO database application. The structure design contains a number of elements such as views, forms and other constructs, where each element of the design contains a number of sub-elements, which may be sources of information like items, sub-forms, fields, or the like. Essentially, in this embodiment the information is structured as a hierarchical tree. Of course, the information may be structured in other ways such as linear lists, directed graphs, or the like.  
         [0021]     The process stage  34  forms the element template  46  and the sub-element template  48 . The template exists to represent each element type. Markers are formed  52  in the templates, and the hierarchical tree structure that represents the input is traversed. When the corresponding template that matches the element type is found, the element values are substituted  54  into the template text where the markers indicate, and the template content is appended to the output.  
         [0022]     The output stage  36  forms the complex network server application page  56 , such as a complex JSP page. The complex JSP page is formed by aggregation of template content based on the hierarchical representation of the input.  
         [0023]     A sample implementation is to aggregate the DOMINO custom tags for a DOMINO view in three templates: The view template contains:  
         [0024]     &lt;%--Single sign-on (SSO) support allows Web users to authenticate once when accessing Web resources across multiple WAS servers. To enable Single Sign On (SSO), uncomment the line of code which sets the user variable equal to *webuser, and comment out the line of code containing the explicit username and password.--%&gt; 
                                                   &lt;%--  &lt;$(tagprefix) :view viewname=” $(viewname) ”           dbserver=” $(servername) ” dbname=” $(databasepath) ”           user=”*webuser”  $(hostname) &gt; --%&gt;           &lt; $(tagprefix) :view viewname=” $(viewname) ”           dbserver=” $(servername) ” dbname=” $(databasepath) ” user=”&lt;%=           username %&gt;” password=”&lt;%= password %&gt;” $(hostname) &gt;            &lt;table&gt;             &lt;tr&gt;             $(viewtitles)  &lt;/tr&gt;             &lt; $(tagprefix) :viewloop&gt;              &lt;tr&gt;             $(viewitems)  &lt;/tr&gt;             &lt;/ $(tagprefix) :viewloop&gt;            &lt;/table&gt;           &lt;/ $(tagprefix) :view&gt;                      
 
         [0025]     The keys underlined allow for substitution, either as known keywords, for example “$(tagprefix)” refers to the ID associated with the particular tag library, or as nested calls to other templates, for example “$(viewtitles)” or “$(viewitems)”.  
         [0026]     The view titles template may contain:  
                                   &lt;td&gt;  $(startattr)   $(columntitle)   $(endattr)  &lt;/td&gt;                  
 
         [0027]     The view items template may contain:  
                                                   &lt;td&gt;  $(ifcatbegin)   $(startattr)  &lt;DOMINO:viewitem           col=” $(columnnumber) ”/&gt;  $(endattr)   $(ifcatend)  &lt;/td&gt;                      
 
         [0028]     The keys underlined may be either replaced in the generated JSP source code by values from the initial structure, for example from the DOMINO database, or used to drive further processing, for example the inclusion of another template file at that point.  
         [0029]     A further sample uses a form template and a form item template to construct the JSP tagging to allow the viewing of a document using a DOMINO form.  
         [0030]     Form Template may contain:  
                                                   &lt;%--Single sign-on (SSO) support allows Web users to           authenticate once when accessing Web resources across           multiple WAS servers. To enable Single Sign On (SSO),           uncomment the line of code which sets the user variable           equal to *webuser, and comment out the line of code           containing the explicit username and password. --%&gt;           &lt;%-- &lt; $(tagprefix) :form name=”formname”           dbname=” $(databasepath) ” dbserver=” $(servername) ”             $(hostname)  user=”*webuser” schema=” $(formname) ”&gt; --%&gt;           &lt; $(tagprefix) :form name=”formname” dbname=” $(databasepath) ”           dbserver=” $(servername) ”  $(hostname)  user=”&lt;%= username %&gt;”           password=”&lt;%= password %&gt;” schema=” $(formname) ”&gt;              &lt;table&gt;             $(formitems)  &lt;/table&gt;           &lt;/ $(tagprefix) :form&gt;           The Form Item Template may contain:           &lt;tr&gt;                 &lt;td&gt; $(fieldname) &lt;/td&gt;                 &lt;td&gt;&lt;DOMINO:input name=” $(fieldname) ”           type=” $(datatype) ”/&gt;&lt;/td&gt;              &lt;/tr&gt;                      
 
         [0031]     Similarly, as discussed above, the keys underlined allow for substitution, either as known keywords, or as nested calls to other templates. The keys underlined may be either replaced in the generated JSP source code by values from the initial structure, for example from the DOMINO database, or used to drive further processing, for example the inclusion of another template file at that point.  
         [0032]     It will be understood that the system and method described above for aggregation objects containing custom tags in a JSP provide the advantage of facilitating building of complex JSP pages. While only specific embodiments of the invention have been described herein, it will be understood that various change or modifications may be made without departing from the scope of the invention.