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).
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.
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.
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.
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.
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.
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.
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.
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:
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.
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'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.
An embodiment may be implemented in a system such as the computer device 2 and network system 1 shown in
An example of a graphical user interface implementing the mechanism is shown in
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.
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
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.
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.
A sample implementation is to aggregate the DOMINO custom tags for a DOMINO view in three templates: The view template contains:
<%--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.--%>
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)”.
The view titles template may contain:
The view items template may contain:
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.
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.
Form Template may contain:
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.
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.
Number | Date | Country | Kind |
---|---|---|---|
0327665.6 | Nov 2003 | GB | national |