Slide 1 EE557: Server-Side Development eXtensible Stylesheet Language (XSL) XSL is the language that describes how XML documents are displayed XSL developed.

Slides:



Advertisements
Similar presentations
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
Advertisements

Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
Introduction to push technology © 2009 Research In Motion Limited.
Interprocess Communications
A Study in JMS (Java Messaging Service) Chad Beaudin CS 522 Fall Semester 2002.
Java Messaging Services CS-328. Messaging Systems A messaging System allows and promotes the loose coupling of components –allows components to post messages.
Layer 7- Application Layer
Slide 1 EE557: Server-Side Development Lecturer: David Molloy Room: XG19 Mondays 10am-1pm Notes:
Chapter 29 Structure of Computer Names Domain Names Within an Organization The DNS Client-Server Model The DNS Server Hierarchy Resolving a Name Optimization.
A Study in JMS (Java Messaging Service) Chad Beaudin CS 522 Fall Semester 2002.
Exchange server Mail system Four components Mail user agent (MUA) to read and compose mail Mail transport agent (MTA) route messages Delivery agent.
Java Message Service API CSE 487/587 Feb 17, 2005 References: JRun Programmer’s Guide.
JMS Java Message Service Instructor Professor: Charles Tappert By Student: Amr Fouda.
COS/PSA 413 Day 17. Agenda Lab 8 write-up grades –3 B’s, 1 C and 1 F –Answer the Questions!!! Capstone progress report 2 overdue Today we will be discussing.
ECSE Software Engineering 1I HO 7 © HY 2012 Lecture 7 Publish/Subscribe.
Chapter 30 Electronic Mail Representation & Transfer
September 2011 At A Glance The API provides a common interface to the GMSEC software information bus. Benefits Isolates both complexity of applications.
Service Broker Lesson 11. Skills Matrix Service Broker Service Broker, provides a solution to common problems with message delivery and consistency that.
Messaging Technologies Group: Yuzhou Xia Yi Tan Jianxiao Zhai.
Electronic Mail (SMTP, POP, IMAP, MIME)
Computer Concepts 2014 Chapter 7 The Web and .
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Application Layer Protocols Simple Mail Transfer Protocol.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
WORKING WITH XSLT AND XPATH
Java Message Service - What and Why? Bill Kelly, Silvano Maffeis SoftWired AG, Zürich
Application Layer CHAPTER 2. Announcements and Outline  Administrative Items  Questions? Recap 1.Introduction to Networks 1.Network Type 2.N etwork.
Client Server Technologies Middleware Technologies Ganesh Panchanathan Alex Verstak.
Java Message Service Sangeetha Chavala. What is Messaging? Method of Communication between software components/applications peer-to-peer facility Not.
第十四章 J2EE 入门 Introduction What is J2EE ?
CIS 1310 – HTML & CSS 1 Introduction to the Internet.
Lecture 15 Introduction to Web Services Web Service Applications.
Web Services Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
What is and How Does it Work?  Electronic mail ( ) is the most popular use of the Internet. It is a fast and inexpensive way of sending messages.
An Overview of the Internet: The Internet: Then and Now How the Internet Works Major Features of the Internet.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: JMS.
1 Java Message Service Манин П Enterprise messaging Key concept: 1. Messages are delivered asynchronously 2. Sender is not required to wait for.
The Internet The internet is simply a worldwide computer network that uses standardised communication protocols to transmit and exchange data.
Message Oriented Communication Prepared by Himaja Achutha Instructor: Dr. Yanqing Zhang Georgia State University.
NETWORK HARDWARE AND SOFTWARE MR ROSS UNIT 3 IT APPLICATIONS.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
XML and Web Services (II/2546)
Interprocess Communications
JMS (Java Messaging Service)
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
1 Java Servlets l Servlets : programs that run within the context of a server, analogous to applets that run within the context of a browser. l Used to.
Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Java Message Service (JMS) Web Apps and Services.
Martin Kruliš by Martin Kruliš (v1.1)1.
Computer Network Architecture Lecture 6: OSI Model Layers Examples 1 20/12/2012.
Java Message Service Introduction to JMS API. JMS provides a common way for Java programs to create, send, receive and read an enterprise messaging system’s.
Distributed Computing, M. L. Liu 1 Interprocess Communications Mei-Ling L. Liu.
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
Instructor Materials Chapter 5 Providing Network Services
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Software Connectors.
Chapter 10: Application Layer
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Topic 5: Communication and the Internet
Java Messaging Service (JMS)
Java Messaging Service (JMS)
Harjutus 3: Aünkroonne hajussüsteemi päring
J2EE Lecture 13: JMS and WebSocket
Presentation transcript:

Slide 1 EE557: Server-Side Development eXtensible Stylesheet Language (XSL) XSL is the language that describes how XML documents are displayed XSL developed by the W3C Working Group Consists of three parts - XSLT (XSL Transformations) - XSL Formatting Objects (XSL-FO) - XPath XSLT – is the language that specifies the conversion of a document from one format to another, where the XSL stylesheet defines the means -> typically used for for textual transformations, such as HTML or WML from XML XSL-FO – formatting objects used when converting XML into binary formats such as PDF files, or Word Documents. This part is not covered by JAXP or here XPath – allows you to specify the part of the structure you are talking about It allows you to distinguish between and -> We can describe different transformations for different elements

Slide 2 EE557: Server-Side Development David Molloy John Peter Smith Jane Grogan xslexample1.xml

Slide 3 EE557: Server-Side Development xslexample1.xsl stylesheet is the top level element -> root of the XSL stylesheet tree associates the template with the root of the doc works like a ‘for’ loop selects the value of the tag within the root element Employee Firstname: Lastname:

Slide 4 EE557: Server-Side Development Client-Side/Server-Side Transformations

Slide 5 EE557: Server-Side Development Client-Side/Server-Side Internet Explorer 5.0+ goes a long way towards implementing client side transformations of XML Non standards compliant in many ways with some omissions/changes Perform a client transformation example Many advantages in performing a manual transformation on the server - works across multiple browsers (HTML) - lightweight clients - transformations are performed in advance – quicker java –classpath.;xalan.jar org.apache.xalan.xslt.Process –IN xslexample1.xml –XSL xslexample1.xsl -OUT xslexample1.html Work through second example in the notes xslcustomers.xml/.xsl

Slide 6 EE557: Server-Side Development XSLT and JAXP Often need to perform transformation real-time with dynamic data Eg. XML to browser-specific HTML XML to Wireless Markup Language (WML) for mobile phones Personalized webpages/documentation JAXP contains four packages responsible for handling XSLT - javax.xml.transform - javax.xml.transform.dom - javax.xml.transform.sax - javax.xml.transform.stream

Slide 7 EE557: Server-Side Development XSLT and JAXP Steps: 1) Import javax.xml.transform package classes and other classes such as DOM packages if you use DOM 2) Instantiate a TransformerFactory object TransformerFactory tFactory = TransformerFactory.newInstance() 3) Create a Transformer, in which we can define a set of transformation instructions. In our example, we supply an XSL StreamSource 4) Perform the transformation on the input (which can be created from a SAX reader, a DOM or an input stream) – in our example, we provide a DOMSource. The transform method takes a second argument, which in our example is a File (via a FileWriter) 5) Handle the possible exceptions Work through the example in the notes

Slide 8 Messaging with Java Most common form of message is This is person-to-person or server-to-person messaging, not application to application messaging is made up of a Header and Content Each header attribute has its own line, with attributes split by a ‘:’ Eg. Precedence: bulk From: “David Molloy” Show full message from the notes EE557: Server-Side Development

Slide 9 Messaging with Java messages are stored or sent using one of a number of different protocols - Simple Mail Transfer Protocol (SMTP) - Post Office Protocol (POP3) - Internet Message Access Protocol (IMAP4) IMAP4 typically considered more advanced than POP3, since it supports folders and status flags (among other features) EE557: Server-Side Development

Slide 10 JavaMail API J2EE developer does not need to understand underlying protocols JavaMail API includes providers for the most commonly used protocols JavaMail sits on top of the electronic mail vendor’s systems Provides a standard, independent framework for Java client applications to use electronic mail Can use JavaMail to: - Compose messages (including multi-part messages with attachments) - Send messages to particular servers - Retrieve and store messages in folders When using JavaMail, the application needs network access to a mail service that can send messages to the destination (dialup or network service) EE557: Server-Side Development

Slide 11 JavaMail API JavaMail is contructed with an Open Architecture, so can support future protocols and standards Two different types of protocols providers can implement: - Transport: is the service which sends messages to the destination Most commonly used transport is SMTP - Store: the service that provides access to messages that have been delivered to a mailboc. Most commonly used is POP3 but IMAP4 is considered better and becoming more common JavaMail relies heavily on the Java Activation Framework (JAF). JAF designed to work in a standard way with different types of data When an application needs to work with a particular data type, these JAF objects can be “activated” and used to process data (mail.jar, activation.jar, J2EE standard inclusion) EE557: Server-Side Development

Slide 12 JavaMail API javax.mail.Session class is starting point for JavaMail. Allows the specification of properties, such as the transport mechanism and the mail server Using the Session we can create a new MimeMessageObject We then set the properties for the message, such as the sender, recipient, subject and contents of the message Finally, we use Transport.send(message) to open up a new connection to the mail service and send the message Show the example code -> issues with running application (local access only etc.) - demoMail.java EE557: Server-Side Development

Slide 13 Java Message Service (JMS) JavaMail is an API for Messaging using Java Message Service (JMS) is an API for Messaging between applications Developed by Sun Microsystems as part of the Java 2 Enterprise Ed. Provides a common way for Java programmers to create, send, receive and read an enterprise messaging system’s messages “A message is a unit of data that is sent from a process running on one computer to other processes running on the same computer or a different computer” Messages can be simple text, or more complicated structures such as Java Hashtables or other serializable Java objects Object is serializable if it can be transmitted across a network as a series of bytes and re-created into a copy of the original object EE557: Server-Side Development

Slide 14 MOM is a specialized type of middleware that coordinates the sending and receiving of messages Provides dependable mechanisms that enable applications to create, send, and receive messages asynchronously in an enterprise environ. Numerous examples of MOM: - IBM MQ Series - Fiorano Message Server - Progress SonicMQ - SilverStream JbrokerMQ -> JMS provides a standard interface to these MOM products Frees developers from having to write low level infrastructure code, also known as “plumbing”, allowing them to build solutions quicker JMS is used and integrates with other components of J2EE (eg. JDBC used for persisting messages, JMS used in MDBs) EE557: Server-Side Development Java Message Service (JMS)

Slide 15 Two primary communication modes: EE557: Server-Side Development Java Message Service (JMS) 1.Synchronous Communication: conducted between two parties, both parties must be active and must acknowledge receipt of a message (known as a blocking call) before proceeding - easily affected by hardware, software and network failures, resulting in delayed messages and traffic backups - if hardware capacities are exceeded information is typically lost - Example: chat application 2.Asynchronous Communication: all parties are peers and can send messages at will. Does not require real-time acknowledgement of messages. Requester can continue with other processing once it sends the message (known as a non-blocking call) - Example: . Even though your client may not be running on your PC, people can still send multiple messages to you. - Example: internet-based purchase ring tone system -> return feedback to browser, mobile phone turned off/no signal?

Slide 16 Using messaging for exchanging data provides for: EE557: Server-Side Development Java Message Service (JMS) - Easy integration of incompatible systems - Asynchronous communications - One-to-many communications - Guaranteed messaging - Transactional messaging (all or none, commit/abort) JMS supports two message models known as Point-to-Point (PTP) and Publish/Subscribe (Pub/Sub) Both models can deliver messages synchronously or asynchronously

Slide 17 Sends messages to a receiver on a one-to-one basis, such as in instant messaging, or sending an order to another system Message delivered to a queue -> processed on FIFO basis Only one receiver can process each message (regardless of number of receivers) Receiver can look through messages in a Queue (eg. To count them) but must process them FIFO EE557: Server-Side Development Point-to-Point Model (PTP)

Slide 18 Publish/Subscribe Model Applications can publish messages on a one-to-many or many-to-many basis. Eg. Sending news stories to interested parties, stock prices to traders Messages are published to a Topic -> one or more publishers can publish messages to a Topic -> clients must subscribe to receive messages -> typically must be subscribed in advance If no clients subscribed, messages are typically destroyed EE557: Server-Side Development

Slide 19 JMS API Programming Model Firstly, we set up a QueueConnectionFactory or a TopicConnectionFactory for use in our JMS applications We achieve this by using the Sun Application Server Admin Console (or whatever console is appropriate for the application server we are using). The steps to add the ConnectionFactory are detailed in the notes At beginning of JMS application, we perform a JNDI API lookup of the connection factory. Eg. Context ctx = new InitialContext(); QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) ctx.lookup(“myQueueConnectionFactory”); EE557: Server-Side Development

Slide 20 We also need to define a ‘destination’, which will be either a Queue or a Topic. It defines the target of messages it produces and the source of messages it consumes Again we create this resource using the Admin Console In our Java application we perform a JNDI lookup for our destination: Queue myQueue = (Queue) ctx.lookup(“MyQueue”); Topic myTopic = (Topic) ctx.lookup(“MyTopic”); Obtain a QueueConnection/TopicConnection to the provider by using the QueueConnectionFactory or TopicConnectionFactory Obtain a QueueSession/TopicSession with the provider by using the QueueConnection/TopicConnection EE557: Server-Side Development JMS API Programming Model

Slide 21 JMS API Programming Model EE557: Server-Side Development Create a QueueSender or QueueReceiver (TopicPublisher or TopicSubscriber) via the QueueSession (TopicSession) for the required Queue (Topic) Send and/or receive messages (Publish and/or subscribe messages) Close the QueueConnection (automatically closes QueueSender/Receiver, and the QueueSession). For Pub/Sub, close the TopicConnection, TopicPublisher/Subscriber and TopicSession

Slide 22 JMS API Programming Model EE557: Server-Side Development

Slide 23 JMS Messages Typically formatted data (such as a request, event or status) passed between applications. Message can contain simple or complex data types, including Serializable Java objects JMS message is made up of 1 required component and 2 optional: - A header (required) – used for identifying and routing messages, setting expiration,priority etc. – many settable by clients - Properties (optional) – extra header information - A body (optional) – one of 5 different formats ByteMessage,ObjectMessage,TextMessage,StreamMessage and MapMessage (hashtable type) message = queueSession.createTextMessage(); for (int i = 0; i < NUM_MSGS; i++) { message.setText("This is message " + (i + 1)); System.out.println("Sending message: " + message.getText()); } EE557: Server-Side Development

Slide 24 Point-to-Point Example SimpleQueueSender.java SimpleQueueReceiver.java EE557: Server-Side Development Publish/Subscribe Example SimpleTopicPublisher.java SimpleTopicSubscriber.java TextListener.java