METHOD FOR CONVERTING CQDES
TECHNICAL FIELD
The invention relates to a method for converting programs in connection with collecting and displaying so called HTML pages from a web server. HTML stands for HyperTextMarkup Language and is a text based coding language. The content of HTML pages is made available in a client or a so called browser at the user. The client and browser normally is software that is executed in a computer. The HTML pages are stored as files in the web server which is a computer or a set of computers that are connected to a network. Also the computer of the user is connected to the network which can be the Internet or be a part of Internet.
PRIOR ART
A HTML page includes a character string including the information that will be shown in the client. The information may comprise text as well as images and sounds. There is included also code and commands for controlling the client computer. Some characters of the code form control characters (tags) and represent format, location or commands that control the location of the content and the treatment of it in the client or that point at other sources of information not consisting of text.
The tags are normally enclosed between less-than sign and greater-than sign (< and >) and controls an analyzer in the client software to make it structure the information correctly. The client software which sometimes is called a browser, interprets the tags one by one as they are read. A HTML page including tags and information basically is static, i.e. the information which will be available at the client is not changed depending on when it is shown.
It is possible to include in a HTML page instructions that will result in local execution of programs at the client. Java, JavaScript, JScript and VBScript are examples of programming languages that are used in this connection for the purpose of providing more dynamic pages. However, it should be noted that the result of a program that is executed at the client side will be available there only and not in the server. This is a major disadvantage in those cases where information need to be
returned from the client to the server. In practii normally used for graphic effects and the like.
The static character of a HTML page will result in large restrictions when dynamically changing information needs to be presented. An alternative to use programs that are executed locally at the client is to save the information required to fulfill the desired dynamic in a database or similar arrangement and to collect it in the present shape when a user requests to read a HTML page.
This can be achieved by using for instance CGI (Common Gateway Interface) or ASP (Active Server Pages). A modification of the traditional ASP code is known under the name ASP.NET. In a following ASP, or ASP code, is used as a generic term for all types of ASP code. CGI is a standardized method for allowing a program on a web server to communicate with at browser in simple ASCII code. A CGI program basically can be written in any programming language but normally PERL is used. Just as the case with CGI no specific programming language need to be used when ASP is used. When using ASP the programming code, so called ASP code, is imbedded in the HTML code which makes ASP more user friendly. As a result of including ASP code in the HTML code when ASP is used the ASP exists completely or partly as a source code which is another important difference as compared to CGI. ASP is a server based macro language ("Server-side inline scripting"). The technique is developed by Microsoft Corporation and can be described as a framework for including proc ramming expressions are interpreted and executed on the server when clients request to receive information.
The dynamic functions normally are written in VBScript or JScript but there is support also for Visual Basic, Visual C++ and C#. The technique makes it possible to conditionally supply information to clients and accordingly adds dynamic to information sources that in other aspects are static.
Normally ASP is applied on information sources in HTML format, but can be applied also to sources formatted in other HTTP based (HyperText Transfer Protocol) data formats, such as for instance XML (Extensive Markup Language), WML (Wireless Markup Language), GIF (Graphics Interchange Format), and other document structure languages. In'the following HTML is used as a generic term for
this type of document structure languages. Fo included, the term source page is used below. Several source pages can be combined together with HTML pages to form an application.
A simple example of pure HTML code is shown below in example 1 and a corresponding example of a combination of ASP code and HTML code in a source page is shown below in example 2. Exemple 1
<font size=1>Hej</font><br>
<font size=2>Hej</font><br> <font size=3>Hej</font><br>
<font size=4>Hej</font><br>
Exemple 2
<% for i = 1 to 4 %>
<font size=<%=i%»Hej</font><br> <% next %>
As shown in example 2 the ASP code is enclosed by the characters <% and %>, which discriminates this code from other code on the source page. The result will be the same ' n four lines with an increasing size oτ ine τonι in eacn line as snown oeiow. Hej Hej Hej
Hej
A problem with source pages is that they all together or in part are available as source code. As a result a provider will reveal a technical solution that has been developed with a contribution of work and money. The technical solution may also be crucial to business which increases the risks when the source code is available. By making the pages available a source code will result also in a disadvantage as regards the integrity of an installed system. It is comparatively simple for a customer
to make changes into the code. Inappropriate debugging in connection with support provided by the supplier.
SUMMARY OF THE INVENTION An object of the invention is to provide a method according to which the above described problems and disadvantages are overcome, so as to ensure that applications can be created, installed, used and maintained in a simple, efficient and secure way. In accordance with the invention existing source pages are converted into a binary module. In one embodiment the binary module is created by a translation of the source pages in such a way at they will form a source code that can be compiled for forming components. These components can be put together to a compiled binary module. The binary module is designed in such a way that a request from a client will produce the same result as if an original source page is requested. It should be noted that no specifically defined additions to the language are required in the source pages.
In one embodiment there is created a set of ASP pages that form the same mutual relations as the original set of source pages. In each of these ASP pages there is a call to a section of the binary module. When the section is executed the same result is produced at the client as when the original source page is requested. However, it ir ~
+ — — * ■~
l~
:- "
. ._=__.
..:,_ _ _
. -
. ^
)n anotner embodiment «
uμnαLu ac uuu m ii iσ uiπcti y i nυuuic cti i be made directly. This can be accomplished by an ISAPI filter or corresponding technique specifically adapted for this purpose.
By converting each source page to an ASP page essentially comprising a call for a component the underlying idea and technique used by the editor of the program can be completely concealed. During the development of the pages the pages can be available in a normal way as source code which will facilitate the work with the pages at this stage. Not until the separate pages and a set have been completed they are converted and can be transferred to the customer or user. The binary module is designed in such a way that when a client requests a page the same result will be achieved as if the original source page is requested, that is the client will experience the same functionality before as after the conversion. Furthermore, the
converted pages can be utilized more efficienl code can be executed directly without interpretation.
Another advantage with the invention is that practical handling of source pages is facilitated in connection with selling, introduction, updating and the like, because the dynamic functions can be produced in form of a binary module instead of a plurality of files.
BRIEF DESCRIPTION OF THE DRAWINGS
The invention will be described in detail below in connection with practical embodiments, reference being made to the accompanying drawings, in which
Fig. 1 is a schematic view showing a hierarchy of source pages and the same hierarchy after the creation of a corresponding set of ASP pages in accordance with a first embodiment of the invention, and
Fig. 2 is a schematic view of a single source page that has been converted in accordance with Fig. 1.
DETAILED DESCRIPTION
Fig. 1 shows to the left a first set of source pages 10. Each source page 11 may include pure conventional HTML code 12 conventional simnl^ Δςp code 13 and ASP code ine _ . . . .- . code is denoted 15. Different types of codes can exist in different arbitrary combinations as indicated for the different pages in Fig. 1. A page may comprise also further query components 15'.
One example of a source page 11 is shown below. Existing ASP code is shown in bold type. Please note the characters <% and %>, respectively, which enclose the ASP code. The code on the page checks whether the user is logged onto a system. The page comprises HTML code 12 and simple ASP code 13, but lacks query components 15 other than the component session imbedded in ASP. Depending on whether the user is logged onto the system or not different messages are displayed to the user.
<%@ Language=VBScript %>
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD> <BODY>
<P>Test</P>
<% if Session ("USERID") <> "" then %>
Du ar inloggad, tryck <a href="logout . asp">har</a> for att logga ut . <% else %>
Du ar inte inloggad, tryck <a href="login. asp">har</a> for att logga in.
<% end if %>
</BODY> </HTML>
The codes enclosed between a less-than sign and a greater-than sign (< and >) represent so called tags. In a first tag it is stated that the programming language VBScript is used for the ASP code. In the above shown code Session is one of the imbedded components of ASP and it is used for saving and utilizing information related to a c
All code of the source pages is converted. In the embodiment shown in Fig. 1 the conversion is illustrated with an arrow 16. After conversion a set 17 of ASP pages 8 is provided with the same hierarchy as the set of source pages 0. However, as a result of the conversion the content of the pages has been changed and each ASP page 18 includes only ASP code with a query 15 to the binary module.
As regards the example above the result after conversion can be as follows:
<%@ Language=VBScript %> <% Set obj = Server. CreateObject ("INCORDIA. TEST") Response .Write obj . GeneratePage () Set obj = nothing
%>
In the above described example an instance of the component "INCORDIA.TEST", which is included in the binary module and which holds the content of the original source page, is created. Server and Response represent embedded components in ASP. The binary module can be created directly in a conversion process for the language used in the ASP code. It is possible also to carry out the conversion in several steps. In such embodiments the content of the source page is converted in a first step to source code in an arbitrary compilable programming language. In a second step this source code is compiled to form the binary module.
An example of a possible source code for INCORDIA.TEXT expressed in Visual Basic is disclosed below.
Public Function GeneratePage ( ) as String
Dim S As String
S = "<HTMLXHEAD><TITLE>Test</TITLE></HEAD><BODY><P>Test</P>" if ctx . Session ( "USERID" ) <> " " then S = S + "Du ar inloggad, tryck <a href=""logout.asp"">har</a> "
S = else
S = S + "Du ar inte inloggad, tryck <a ' href="login . asp">har</a> "
S = S + "for att logga in . " end if
Test = S + "</BODYX/HTML>" End Function
Fig. 2 shows in more detail how a more complicated source page having a plurality of sections of ASP code 13, HTML code 12 and ASP code including query components 14 after conversion will receive a simple structure in a single ASP page 18. In the simple structure there is included only one section with ASP code having a
query component 14. Behind the query comp( shown above is accommodated.