A GENERIC APPROACH TO USER INTERFACE CODE CONVERSION



Similar documents
Using Database Metadata and its Semantics to Generate Automatic and Dynamic Web Entry Forms

Tutorial 6 Creating a Web Form. HTML and CSS 6 TH EDITION

XHTML Forms. Form syntax. Selection widgets. Submission method. Submission action. Radio buttons

ASP.NET: THE NEW PARADIGM FOR WEB APPLICATION DEVELOPMENT

Short notes on webpage programming languages

10CS73:Web Programming

WIRIS quizzes web services Getting started with PHP and Java

Terms and Definitions for CMS Administrators, Architects, and Developers

Overview of DatadiagramML

Introduction to XML Applications

Overview. In the beginning. Issues with Client Side Scripting What is JavaScript? Syntax and the Document Object Model Moving forward with JavaScript

Further web design: HTML forms

Data Integration through XML/XSLT. Presenter: Xin Gu

Chapter 1 Programming Languages for Web Applications

PHP Form Handling. Prof. Jim Whitehead CMPS 183 Spring 2006 May 3, 2006

A LANGUAGE INDEPENDENT WEB DATA EXTRACTION USING VISION BASED PAGE SEGMENTATION ALGORITHM

FileMaker Server 9. Custom Web Publishing with PHP

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

PHP. Introduction. Significance. Discussion I. What Is PHP?

DESIGNING HTML HELPERS TO OPTIMIZE WEB APPLICATION DEVELOPMENT

An XML Based Data Exchange Model for Power System Studies

Bitrix Site Manager 4.1. User Guide

Developing XML Solutions with JavaServer Pages Technology

CGI Programming. What is CGI?

ActiveX AJAX ASP. AudioMP3

Xtreeme Search Engine Studio Help Xtreeme

INTERNET PROGRAMMING AND DEVELOPMENT AEC LEA.BN Course Descriptions & Outcome Competency

A Comparative Study of Web Development Technologies Using Open Source and Proprietary Software

Internet Technologies

VB.NET - WEB PROGRAMMING

12 File and Database Concepts 13 File and Database Concepts A many-to-many relationship means that one record in a particular record type can be relat

Working With Templates in Web Publisher. Contributed by Paul O Mahony Developer Program

Whitepapers at Amikelive.com

Selenium Automation set up with TestNG and Eclipse- A Beginners Guide

The goal with this tutorial is to show how to implement and use the Selenium testing framework.

REDUCING THE COST OF GROUND SYSTEM DEVELOPMENT AND MISSION OPERATIONS USING AUTOMATED XML TECHNOLOGIES. Jesse Wright Jet Propulsion Laboratory,

XML Processing and Web Services. Chapter 17

PHP Tutorial From beginner to master

II. PREVIOUS RELATED WORK

A Complete Guide to HTML Form Output for SAS/IntrNet Developers Don Boudreaux, SAS Institute Inc., Austin, TX

Viewing Form Results

PDG Software. Site Design Guide

ASP &.NET. Microsoft's Solution for Dynamic Web Development. Mohammad Ali Choudhry Milad Armeen Husain Zeerapurwala Campbell Ma Seul Kee Yoon

Introduction to Ingeniux Forms Builder. 90 minute Course CMSFB-V6 P

An Automated Testing Tool Using UI Structure

ResPAK Internet Module

Term Paper. P r o f. D r. E d u a r d H e i n d l. H o c h s c h u l e F u r t w a n g e n U n i v e r s i t y. P r e s e n t e d T o :

HTML5. Turn this page to see Quick Guide of CTTC

PHP Web Authoring for Database Management based on MVC Pattern

Design and Functional Specification

Cross Site Scripting Prevention

InternetVista Web scenario documentation

Credits: Some of the slides are based on material adapted from

FileMaker Server 15. Custom Web Publishing Guide

Lab 5 Introduction to Java Scripts

DiskPulse DISK CHANGE MONITOR

Data Transfer Tips and Techniques

Course Name: Course in JSP Course Code: P5

NASSI-SCHNEIDERMAN DIAGRAM IN HTML BASED ON AML

FileMaker Server 10 Help

Rotorcraft Health Management System (RHMS)

Even if your end-users only push a digital button for a living, I want to use my background and my abilities to enrich that experience.

Web Pages. Static Web Pages SHTML

XSLT Mapping in SAP PI 7.1

SOFTWARE TESTING TRAINING COURSES CONTENTS

Client-side Web Engineering From HTML to AJAX

Web Design and Implementation for Online Registration at University of Diyala

Redpaper Axel Buecker Kenny Chow Jenny Wong

Content Management System (CMS)

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

OVERVIEW OF ASP. What is ASP. Why ASP

Google AdWords TM Conversion Tracking Guide

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

metaengine DataConnect For SharePoint 2007 Configuration Guide

Drupal CMS for marketing sites

Web Development using PHP (WD_PHP) Duration 1.5 months

FusionPro Links Microsite Creation Guide

Introduction to ASP. Are you sick of static HTML pages? Do you want to create dynamic web pages? Do you

07 Forms. 1 About Forms. 2 The FORM Tag. 1.1 Form Handlers

Content Management Systems: Drupal Vs Jahia

LAB MANUAL CS (22): Web Technology

FileMaker Server 12. Custom Web Publishing with PHP

CSCI110: Examination information.

Software Requirement Specification For Flea Market System

Specialized Programme on Web Application Development using Open Source Tools

Demonstration of XML Validation Framework using OASIS CAM approach

Load testing with. WAPT Cloud. Quick Start Guide

By Glenn Fleishman. WebSpy. Form and function

A Conceptual Overview for CMS Administrators, Architects, and Developers

Business & Computing Examinations (BCE) LONDON (UK)

Introduction to web development using XHTML and CSS. Lars Larsson. Today. Course introduction and information XHTML. CSS crash course.

Transcription:

A GENERIC APPROACH TO USER INTERFACE CODE CONVERSION Arjun Chiddarwar arjun.chiddarwar@gmail.com Kamini Kadhane kamini.kadhane@gmail.com Rishi Parmar rishi_parmar@ymail.com Sudhanshu Sane sudhanshu.sane@gmail.com Abstract In a software development lifecycle, there are numerous steps involved in the web page design process, and the GUI has a certain importance in today s applications. There are various web design technologies available for use, each with a different approach to designing web pages. HTML currently is the most widely used web design technology due to its simplicity, but it does not support logic scripting within the HTML code. We have implemented a code convertor using.net platform and XML related technologies, which can be used to convert HTML page to any other web design technology such as ASP.NET, JSP, and PHP, as these target languages allow scripting within code. In this paper, we put forth a generic approach to accomplish this task. Keywords- ASP.NET; code converter; code generation;gui; HTML;.NET framework; parser; XML; XSLT I. INTRODUCTION In this paper, we focus on the conversion of HTML to ASP.NET. The same approach can be used for conversion to other web technologies. Hyper Text Markup Language (HTML) is the main markup language for primarily creating web pages that can be displayed using a web browser. The browser uses the tags to interpret the content of the page and accordingly displays them. HTML elements form the building blocks of all websites [1]. Active Server Pages (ASP) is a server-side scripting environment that can be used to create and run dynamic, interactive Web server applications. With ASP.NET, you can combine HTML pages and script commands to create interactive Web pages and powerful Web-based applications that are easy to develop and modify. Fundamentally an ASP.NET page is just the same as an HTML page. If a client requests an HTML page from the server, the server sends the page to the client's browser without any modifications. If a client requests an ASP.NET page, the server processes any executable code in the page, before the results are sent back to the client's browser. Thus HTML pages are static and server side code cannot be embedded in it, whereas ASP.NET can contain scripting making it dynamic [2][3]. In a software design cycle, GUI development team and developers work separately. The GUI is developed based on the requirement and wants of the client. After the client has approved of the GUI, the HTML prototype is given to the development team. The development team has to give functionality to the web page and make it dynamic. But this scripting cannot be embedded into HTML as mentioned earlier. Thus the developer has to recreate the GUI in ASP.NET technology where he can include scripting. This can result in undesirable changes to the UI. Client might be unsatisfied with the final design in such cases, even though the web page performs as per requirements. This is where our project comes into picture. In this paper, we present an approach for building a software tool, using.net framework and XML related technologies, for complete conversion of HTML code into corresponding ASP.NET, JSP, PHP code, while retaining all elements and attributes of the GUI. ISSN : 2229-3345 Vol. 4 No. 03 Mar 2013 243

II. LITERATURE SURVEY Various code converters are introduced in the industry which mainly target conversions among C#, VB.NET, Java and C++. TangibleSoftwareSolutions.com [4] is a code converter available which deals with code conversion between C++, C#, Java and VB. Telerik.com [5] is another widely used code converter which handles the conversion of C# to VB and vice versa. It offers a variety of products for these conversions and is known for its instant conversion and high accuracy. Currently there is need of conversion among HTML, JSP, ASP.NET, PHP etc. There are some online converters for conversion between web design technologies. Yellowpipe Internet Services [6] provides an HTML to ASP, PHP, JavaScript converter. This conversion is fairly simple. It converts HTML to ASP by using Perl, where it first stores the HTML tags in an array and then prints them, to PHP using echo command and to JavaScript by using document.writeln() method. Livio.net [7] an online converter provides an HTML to XHTML followed by conversion into ASP.NET. It is coded in classic ASP, but it converts simply by putting HTML tags in 'response.write()' string. These above mentioned converters put HTML tags into customized strings using output methods. This conversion does not provide a developer with a workable code. A1VBCode [8] is a free VB.NET, ASP.NET, and C# source code and resource site. This site provided a converter for conversion of HTML to ASP.NET. The code produced is a workable. A comparison with this converter is done later in the paper. III. APPROACH The software tool, henceforth referred to as GUICC (Generic User Interface Code Converter), has two stages of processing. The first stage in GUICC is a parser. The parser is used to parse HTML tags into XML (extensible Markup Language) tags. XML is used as the target language of the parser as XML is a language used not for data display, but for data storage. It is widely used for the representation of arbitrary data structures, for example in web services[9]. In GUICC, XML document acts as an intermediate database, which is accessed in the second module of GUICC. The parser is built on.net framework and is programmed in C#. Each tag in HTML has a format, many tags having the same format, thus requiring same processing during parsing. These various formats are categorized, and stored in the database. SQL Database is connected to the server, and it contains list of HTML tags, along with category of the tag. The required HTML file is uploaded to the server and is then parsed. The user of GUICC is also required to specify the conversion he/she wishes to perform i.e. HTML to ASP.NET or HTML to JSP or HTML to PHP. We have considered conversion of HTML to ASP.NET here. ISSN : 2229-3345 Vol. 4 No. 03 Mar 2013 244

Figure 1: Work-Flow in GUICC A. Parser First step of parsing consists of reading an HTML tag. Tags are identified by looking for "<" ">", in the HTML document. HTML tags maintain hierarchy thus not requiring separate handling. In the second step once the tag is read, SQL Database is accessed to obtain the category of that tag. Depending on the category of the tag i.e. the tag format, particular methods are called which then add XML elements to build resultant text. The called method creates corresponding opening XML element and it also reads the attributes, if any, creating its child elements. HTML element tags are read sequentially. As XML has a tree structure, element tag forms a parent node and its attributes form child nodes. XML closing tags, which are compulsory, are formed when corresponding closing tag in HTML is read or when tag ends. XHTML can be considered as input, as HTML is not strict about closing tags.html syntax rules were observed as guidelines while building the parser. There are packages available for the parsing of HTML to XML (), but we chose to develop our own parser. The final resultant text which is correct XML representation of the given HTML file, is then stored as an.xml file to be accessed in the next stage of processing.. ISSN : 2229-3345 Vol. 4 No. 03 Mar 2013 245

Sample HTML input. XML Generated by parser. <?xml version= 1.0 encoding= utf-8?> <html><body> <root><body> <input type= text name= t1 value= abc ></input> <text> <select> <name>t1</name> <option>red</option> <value>abc</value> <option>blue</option> </text> </select> <select> </body></html> <option>red</option> <option>blue</option> </select> </body></root> B. Mapper The second module uses XSLT (XML Stylesheet Language Transformation). XSLT is a language for transforming XML documents into other documents that is recognized by a browser i.e. HTML or other XML document. The XSLT language is declarative rather than listing an imperative sequence of actions to perform. XSLT has in-built processor and provides template for matching. Template rules only define how to handle a node matching a particular XPath-like pattern [10]. In the transformation process, XSLT uses XPath to define parts of the source document that should match one or more predefined templates. When a match is found, XSLT will transform the matching part of the source document into the result document. XSLT does not offer the option to directly transform a document into ASP.NET, but it does give freedom with regard to plaintext in output. In GUICC, this feature of XSLT has been used to address our need of generating target codes i.e. ASP.NET. For each element in XML, there is an XSLT template which extracts the element information and transforms it into the corresponding ASP.NET tag format. The ASP.NET tag is determined by the element name used for template matching. XSLT processor traverses through nodes of a template after transferring control to it. This way the attributes of each element in XML are handled inside the template, by checking for its declaration. If certain attributes are not mentioned, then default values are assumed later by the browser. The value of each element or attribute is accessed by selecting current value of node. ASP.NET code is generated by XSLT in the form <asp:textbox runat="server" ID="textbox1" Text="enter text here" MaxLength="15" align="left" /> XSLT does not allow generation of "<" or ">", hence these must be written as "<" and ">" and later with post-processing be replaced into required form(< and > respectively). The output of the second module in GUICC is a text file. This text file is post-processed as mentioned above and saved with.aspx extension, which is then recognized by the browser. IV. RESULT There are a few aspects to verify the validity of the result. Firstly the converted code should be syntactically correct. The ASP.NET tags that are formed should have proper structure. Secondly, all the mentioned attributes in HTML should be retained in ASP.NET. Thus the resultant web page should have the same look and feel as the original HTML page, confirming that the code conversion has been done correctly. Source HTML file : Output ASP.NET file : <html><body> <form runat= server > <input type= text name= t1 value= abc ></input> <asp:textbox runat= server ID= t1 Text= abc /> <select name= colours > <asp:dropdownlist runat= server ID= colours > <option>red</option> <asp:listitem>red</asp:listitem> <option>blue</option> <asp:listitem>blue</asp:listitem> </select> </form> </body></html> ISSN : 2229-3345 Vol. 4 No. 03 Mar 2013 246

In the example shown above we can see that the conversion is done accurately. It can also be observed that if this GUI output was to be generated manually in ASP.NET alone, the code would be the same as seen in the generated output of GUICC. This confirms the first two aspects of our result. Consider the browser snapshots given below to verify that the look and feel is retained in output. Figure 2: HTML input file Figure 3: ASP.NET output file The A1VB code converter [8] is a desktop application coded in VB.NET and can convert only limited number of HTML control (Button, select, img, password, text, checkbox, radio, file, hidden, submit, textarea.) whereas GUICC is web based and can convert more number of HTML controls. A1VB code converter select tags, searches for them (as strings) in the file; if the string is found, it replaces it directly with ASP.NET string, While on the other hand GUICC put forth a more generic way of handling these tags with the use of XML related technologies. A1VB code converter has not extended the approach to other web technologies as it is target language specific and involves complete recoding, while GUICC involves only addition of XSLT file for each new web technologies without changing the existing code. V. DISCUSSION As already stated above GUICC focuses on HTML to ASP.NET code conversion, but with the successful implementation of this conversion the same approach can be extended for conversion of HTML prototype to various other web design technologies such as PHP, JSP, JavaScript and PERL. A case study conversion to JSP has been performed using same approach to verify this. In the GUICC prototype created, most commonly used HTML tags have been covered. As a further implementation all HTML tags can be catered to as per needs. The approach used in GUICC has a one to one mapping of tags, whether it is from HTML to XML or XML to ASP.NET. Code optimization is not a high priority feature in this project as the requirement of the developer is to obtain a GUI in desired language, with its features retained. The approach taken in GUICC ensures near optimal conversion because of the manner of mapping, though the optimality of the generated code is open to discussion. VI. CONCLUSION GUICC was built to be used in the industry at developer s end. The developers need to embed functionality into the HTML GUI prototype approved by client. Thus to save time and efforts of recoding the same HTML prototype in web technology allowing scripting, GUICC has been developed. GUICC has used XML related technologies such as XML document (to store HTML tag information) and XSLT (to retrieve XML information and place it in ASP.NET tag format) which has made this approach generic and independent of target language. This paper presents our on-going efforts in performing code conversion in a generic manner and to retain the GUI details in the targeted web design technology. The former aim has been achieved as this approach can be ISSN : 2229-3345 Vol. 4 No. 03 Mar 2013 247

extended to other target languages and the latter achieved as both the input (HTML file) and output (ASP.NET file) have same GUI. REFERENCES [1] Master Reference to HTML 4,W3.org,retrieve on (16 feb 2012). [2] Msdn Library,adapted from Microsoft Corporation,Active server pages tutorial, 2000,p 199. [3] Jonathon Goodyear, Brian Peek, Brad Fox, Designing Microsoft ASP.NET Applications (Microsoft Press) [4] Adapted from Tangible Software Solutions, http://www.tangiblesoftwaresolutions.com/index.htm. [5] Telerik code converter, adapted form http://converter.telerik.com/. [6] Yellowpipe Internet Service,http://www.yellowpipe.com/yis/tools/HTML_converter/index.html. [7] Adapted from @livio.net online code converter,http://www.livio.net/main/xhtmlasp.asp. [8] Adapted from A1VBcode, http://www.a1vbcode.com/code.asp?type=asp.net. [9] Farhan Ali,28 aug 2007, XML for Beginner,adated form http://www.codeproject.com/articles/20113/xml-for-beginners. [10] Nicholas chase,a intoduction on XSLT,adapted form IBM developerworks xml technical library, http://www.ibm.com/developerworks/xml/tutorials/x-introxslt/,(23 jan 2007) [11] Ben Albahari, Peter Drayton & Brad Merrill, C# Essentials, 2nd edition (O'Reilly). [12] "Tags used in HTML". World Wide Web Consortium. November 3, 1992. http://www.w3.org/history/19921103- hypertext/hypertext/www/markup/tags.html. Retrieved November 16, 2008. ISSN : 2229-3345 Vol. 4 No. 03 Mar 2013 248