Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Legacy Applications via Bridges

Similar presentations


Presentation on theme: "Using Legacy Applications via Bridges"— Presentation transcript:

1 Using Legacy Applications via Bridges
11/14/2018 Using Legacy Applications via Bridges Mark Baker and Rahim Lakhoo Name, Universities of Portsmouth and Reading, Sakai VRE project. Using legacy applications, with bridging technologies.

2 Outline Introduction. Motivation. Technologies: System Architecture.
11/14/2018 Outline Introduction. Motivation. Technologies: JSR-223, PHP-JavaBridge, PortletBridge-Portlet, Other Bridging Technologies. System Architecture. Demonstration Applications. Issue. Conclusions. I will be giving an introduction to our work, and the motivation. Then I will outline some of the current bridging technologies currently around. Namely, JSR-223, the PHP-JavaBridge, the PortletBridge-portlet and some other bridging technologies, in this case Apache portals bridges. Then we are going to cover our technique of using the php-javabridge with the portletbridge to allow a php application to be used as a portlet. Then we have some nice screenshots of php portlets. Then the issues we’ve seen and conclusions. 14 November 2018

3 11/14/2018 Introduction Portsmouth and Reading’s role in the Sakai VRE project is to develop and deploy a number of portlet-based tools and services. In particular we are looking at: Collaborative tools based on NaradaBrokering, Semantic Web tools based on RDF, Bridging technologies to enable legacy applications, Peer-to-Peer technologies. We will make these tools available, either via a native JSR-168 capability, or via the WSRP consumer developed within the Sakai project. In this talk we will recount our experiences investigating, deploying and testing a range of emerging bridging technologies. So, portsmouth and reading are developing portlet-based tools and services for Sakai VRE project. NB, RDF, Bridging Technologies and P2P. We hope that to ue these tools within sakai via its native jsr-168 support (when ready) or via wsrp. We basically recount our experiences with these bridging technologies. 14 November 2018

4 Legacy Applications Motivation:
11/14/2018 Legacy Applications Motivation: Investigate whether script-based Web applications, such as PHP can be reused in Java-based environment, Investigate if PHP applications can be reused as a portlets, Test by deploying a number of PHP applications as portlets, Add useful tools/utilities to the Sakai Demonstrator. Our motivation was to see if php can be used in a java-based environment, namely tomcat, and if so can we also use them as portlets. We also wanted to deploy some php applications as portlets.our main aim to to add some useful tools for the Sakai demonstrator. 14 November 2018

5 Bridging Technologies
11/14/2018 Bridging Technologies JSR-223: Reference implementation available, Allows Java to communicate objects with script-based languages and vice versa, To be included with the next release of Sun JDK “Mustang” (JDK 1.6). PHP-JavaBridge: Described as an XML-based network protocol, Allows communications between Java and PHP, Provides a suitable environment to execute PHP scripts under Apache Tomcat. PortletBridge-Portlet: Renders Web pages into a JSR-168 portlet, Proxies links and other external resources contained in a Web page, Can load multiple instances, with different configurations. Bridging technologies - Jsr-223 has a reference implementation and it allows java to communicate with script based languages. Its also, going to be included with the next release of the sun jdk, codenamed mustang. PHP-Javabridge is as the name implies a a php t0 java bridge. Its described as an xml-based network protocol. And allows communications between java and php and provides and environment for php applications under tomcat. The portletbridge-portelt is also known as a web clipping portlet and is a jsr portlet and it also proxies any downstream content from a web page/site. And it has the useful configuration to load multiple instances. 14 November 2018

6 11/14/2018 Bridges - JSR-223 (1) JSR-223 specification is lead by Zend Technologies and Sun, amongst others. Allows script-based languages to be used in Java server-side applications and vice versa. Defines a new API, javax.script.*. New API includes scripting-engines for different languages. Reference implementation includes support for Rhino, PHP and Groovy. JSR-223 is lead by Zend and Sun, it defines a new api javax.script which has different scripting engines for different languages.currently the reference implementation includes support for rhino php and groovy. 14 November 2018

7 Bridges - JSR-223 (2) Reference Implementation: 14 November 2018
11/14/2018 Bridges - JSR-223 (2) Reference Implementation: So when u install the reference implementation and install it you can see there’s a php version bundled with configuration files and libraries. The new api includes some scripting engines. And it includes some smaple applications, which can be invoked via the web or command line. 14 November 2018

8 11/14/2018 Bridges - JSR-223 (3) Reference implementation of JSR-223 includes a pre-compiled skeleton installation of PHP5. JSR-223 API includes some scripting engines for PHP, Groovy and Rhino. Also includes a script to invoke Java classes, which contain script-based calls, from the command-line. Samples scripts/programs are available for PHP, Groovy amongst others: Command-line and Web capabilities. PHP a little old, I believe that there will be more scripting engines. It also includes a script which can invoke java classes from the command line which has scripting calls. 14 November 2018

9 Bridges - PHP-JavaBridge (1)
11/14/2018 Bridges - PHP-JavaBridge (1) Described as an XML-based network protocol. Designed to communicate with native scripting engines, which have a Java or ECMA 335 virtual machine. Provides a suitable environment for PHP applications to run under Apache Tomcat. Allows Java and PHP to share sessions, in a J2EE environment. Has a number of configurations for installation and connections to existing Web servers. The php to java bridge project is a sourceforge project. Its actually described as a xml-based network protocol, which gives it some nice flexibility for being used with existing web applications. Its designed to communicate with virtual machines. And I believe it can connect to java and .NET vm’s. if installed under apache tomcat java and php can share sessions. And has considerable flexibility when configurations. 14 November 2018

10 Bridges - PHP-JavaBridge (2)
11/14/2018 Bridges - PHP-JavaBridge (2) Php java bridge installed in tomcat. It includes some java libraries and php cgi binaries, this provides the environment for php scripts. There’s optional configurations, which we used in our setup was cgi binaries used from a hosting system. And optionally it can communicate with an existing apache web server. 14 November 2018

11 Bridges - PHP-JavaBridge (3)
11/14/2018 Bridges - PHP-JavaBridge (3) Includes PHP5-CGI binaries and configurations files. Although the PHP-JavaBridge is not limited to the included CGI environment, it can use the PHP environment of the hosting server. The PHP-JavaBridge can connect to an existing Apache Web Server, executing PHP applications. Has a number of different modes: Request - Created/destroyed on every request/response, Dynamic - Starts/stops synchronously with a HTTP server, System - Installed from a RPM as a system service, J2EE - Installed into a J2EE server, such as Apache Tomcat. If the PHP instance crashes with the PHP-JavaBridge the backend Java server/servlet is unaffected. PHP binaries for windows and Linux/unix based systems and configuration scripts for Solaris. Includes a current version of php5. There’s a number of different modes, request, dynamic, system, j2ee. It also has a nice advantage is that if the php instance crashes the backend is not affected. We’ve also seen its very stable. 14 November 2018

12 Bridges - PortletBridge-Portlet (1)
11/14/2018 Bridges - PortletBridge-Portlet (1) Generic method of rendering Web sites into a JSR-168 portlet, developed by Jamie McCrindle. Tested in various portlet containers, including GridSphere, JetSpeed and JBoss. Proxies a Web sites content, so that a user may use the application from within a portlet. Uses XSLT to rewrite downstream content from Web sites. Includes remote proxy server settings for complex network set-ups. Allows for multiple instances with different configurations. The portletbridge-portlet is a brilliant idea developed by jamie mccrindle. Its been tested in a number of containers. And proxies a web sites content, so a user does not actually need access to the site. Unlike an iframe. XSLT is used to rewrite the content within a portlet. And can use network proxies to gain access to the internet or sites. And it has a handy configuration files for making multiple instances of the portletbridge with different configurations. 14 November 2018

13 Bridges - PortletBridge-Portlet (2)
11/14/2018 Bridges - PortletBridge-Portlet (2) So the web page is processed by a backend servlet which calls tasks to rewrite content etc. eventually the rewritten content is rendered as a portlet. 14 November 2018

14 Bridges - PortletBridge-Portlet (3)
11/14/2018 Bridges - PortletBridge-Portlet (3) PorltetBridge-portlet, uses Apache’s httpclient to GET/POST from/to Web pages. Web pages are transformed using XSLT, which rewrites links and other content, such as: CSS, JavaScript, Images, Forms, Headers, etc… Uses Regex for defining the proxy scope. PortletBridge defines a Memento for storing users state, such as cookies. Uses the apache httpclient to get and post. XSLT rewrites content, such as css, js, images, forms, headers etc… it uses a regular expression for defining the proxy scope, so there may be content u may not want proxied. And defines a memento for storing users state. 14 November 2018

15 11/14/2018 Bridges - Others Apache Portals Bridges project aims to use common Web frameworks via portlets. Currently support is being developed for: Struts, JSF, Perl CGI Scripts, PHP, Velocity Templates. GridSphere 2.1.x portal includes the Struts Portals Bridge. So the apache portals bridges project aims to use web frameworks via portlets. Currently there is support developing for struts,jsf, perl,php and velocity templates. Also various other portals which can be used with the portals bridges, which is listed on their website. 14 November 2018

16 System Architecture (1)
11/14/2018 System Architecture (1) The PHP-JavaBridge provides the runtime environment for the PHP application. A PHP application is packaged and configured as a Web archive (WAR). Included in the WAR is a configured CGI environment, complete with PHP configuration files and extensions, per application. The PHP application can communicate with Java if extra functionality or a hybrid application is desired. The php-javabridge provides the runtime environment. The php app is packaged as a war with the included php cgi binaries and its own php config file. And you can use the php-javabridge for creating hybrid apps or provide additional capabilities. 14 November 2018

17 System Architecture (2)
11/14/2018 System Architecture (2) 14 November 2018

18 System Architecture (3)
11/14/2018 System Architecture (3) The PortletBridge-Portlet is installed as a JSR-168 portlet under GridSphere. PortletBridge-Portlet instances are created and configured for each PHP application installed under the PHP-JavaBridge. If desired, XSL Style Sheets can be configured per PHP application. Once configured, the PHP applications are presented as individual portlets, which can be subscribed to by users. The portletbridge is installed as a jsr portlet, new instances of the portletbridge are configured for the php apps running with the php-javabridge.The XSLT can be used to strip visual components as wanted from an application. In our case we wanted to see how it copes trying to replicated an application. And they appear in the portal as standard portlets. 14 November 2018

19 Demonstration Applications
11/14/2018 Demonstration Applications Using a combination of the PHP-JavaBridge and the PortletBridge-Portlet, we configured some PHP applications as portlets. These are the applications configured: BibAdmin - Bibtex database, YW Guest Book - PHP guest book application, FhImage - A simple image gallery. Deployment procedure: Applications are first deployed as WARs under Tomcat. Then an instance of the PortletBridge-Portlet is created and configured for each PHP application. Like we said before we used a combination of these two bridges to get php-portlets. We will show 3 php apps with this configuration. Bibadmin, yw guest book, and fhimage. And it really only has 2 stages, which I hope is simple for others to use. 14 November 2018

20 11/14/2018 BibAdmin Portlet 14 November 2018

21 11/14/2018 Guest Book Portlet 14 November 2018

22 Guest Book Admin Portlet
11/14/2018 Guest Book Admin Portlet 14 November 2018

23 11/14/2018 Image Gallery Portlet 14 November 2018

24 Demonstrated Applications
11/14/2018 Demonstrated Applications The PHP applications tested with this technique have no real difference in terms of functionality when compared to native installations. Some PHP applications are easier to port to a portlet than others. Other PHP applications have a poor implementation/design, which can lead to issues within a portal environment. So there’s no real difference with this technique when the apps are compared with native versions. Some php apps are easier to port than others. And some poor php implementations would need some changes to run in a portal. 14 November 2018

25 11/14/2018 Issues Login mechanisms can cause problems; simple PHP and PHP with JS logins were tested successfully: However, it is also feasible to disable logins of PHP applications in favor of utilising the portals security framework. Some applications need to have pre-defined PHP variables changed to reflect the J2EE environment, i.e. port number. PHP applications which load new windows have issues with the constraints imposed by a portal. Frames are not supported by the PortletBridge-Portlet. XHTML or mixed XHTML/HTML documents currently cause the proxy facility of the PortletBridge-Portlet to fail: The developers are working on this. There are some CSS leaks into the portal, currently this issue has been seen with GridSphere: Also, background colours cannot always be seen in the portlet versions. 14 November 2018

26 11/14/2018 Conclusions Although this technique is not without issues, it does present a viable solution for reusing existing PHP applications. The PortletBridge-Portlet is still a young project, which is being actively developed. Other bridging technologies, such as the Apache Portals Bridges project will be of interest, as they are starting to be included in portals, such as GridSphere. JSR-223 should see an increase in developers using the new API, as the release of Sun JDK 1.6 approaches. Bridging technologies should be an interesting alternative/addition for developing portlets and could be useful when combined with WSRP. viable solution for people who have a web application which meets there requirements and would normally mean redesigning or forking source code. 14 November 2018

27 References http://portals.dsg.port.ac.uk
11/14/2018 References These are some references that some may find useful. 14 November 2018

28 Questions? http://dsg.port.ac.uk http://acet.rdg.ac.uk 11/14/2018
Any questions? QuickTime™ and a


Download ppt "Using Legacy Applications via Bridges"

Similar presentations


Ads by Google