Accessibility

Table of Contents

Developing Your First Application with Adobe Connect Professional

Examining the Breeze Web Services Architecture

The Adobe Connect Professional architecture separates the presentation of information from the underlying application in an elegant way. Communication from the user interface to the application is exclusively XML-based. Because of this, after you install the server, you automatically have web-service access to the application and data. The server by default provides a framework that you may easily access. If your server is installed at breezedev.mycompany.com, for example, the URL to access your web services is breezedev.mycompany.com/api/xml. The overall architecture is diagrammed in Figure 1.

Breeze web services architecture

Figure 1. Adobe Connect Professional web services architecture

The XML/API servlet listens for incoming requests that include authentication credentials, session information, the Action Request, and related parameters. Actions are requested by name. For example, the request to get your current meetings is called report-my-meetings. Every request you submit must include the name of the action and any necessary parameters. The request is sent over HTTP or HTTPS as either an XML document or as parameters on the URL. The server responds to the Action Request, retrieving data from the database as necessary, and formats the Action Response as an XML document that is returned to your application.

Web service interactions are not surrounded by an envelope, such as with SOAP, nor do you need to validate the XML against a schema. Future versions of the web services may include support for these features. For now, you simply need to parse the XML response within your application.

Designing Your Application

It is always a good idea to think about the organization of your application and your development strategies before you start writing code. Decide how you will separate presentation from business rules and data. Think about what design patterns to follow. Model-View-Controller is most often the choice du jour. For this example, you could think of the XML/API servlet as the Controller and the Adobe Connect Professional application as the Model. Your application is a View to present your meetings. Easy enough.

Your first application displays all of your meetings. Your next application might display all of your active courses or all courses completed in the previous week. Therefore, one of your design principles should be to create reusable code as much as possible. The code that connects to the web services is a prime candidate for reusability. In this article, you will create an API class that encapsulates all the connection details and performs all XML parsing. That way, a JSP programmer could create future applications and benefit from your existing work.

Your sample application has a login page as well as a page to display the meeting list. You can use a simple HTML page to handle the login. Because the meeting display page references your reusable class, this needs to be a JSP page. You will create a Java class to handle the API interaction and XML parsing and a Meeting class to capture the meeting data once it is parsed from the XML response. At this point, you're ready to start creating the files you need:

  • Login.html: Create a login form that collects the username, password and server URL. Set the form method to GET and the action to MyMeetings.jsp.
  • MyMeetings.jsp: Create a simple table that lists the meeting name in one cell of a row and the start date and time in the next cell. For now, this file can just contain HTML. You will add the Java code in a later step.
  • Meetings.java: Create a simple class using the package name of your choice. The class should have protected strings for the meeting name, description, meeting launch URL that users must click to participate in the meeting, and a protected Date object. Your constructor should accept the name, description, meeting launch URL, and a date string which will need to be parsed into the Date object. The getDate method should return a string and not the actual date object.
  • XMLApiBean.java: Create another class in the same package as Meetings.java. This class is where you do the bulk of the work. Create protected strings for all the access parameters—including the server URL, username and password—and for the breezesession, which is provided to authenticate API calls once login succeeds. The constructor should accept all of these. Add a second constructor that accepts the URL and breezesession which you will use for the logout function.
  • Logout.jsp: Create a simple JSP that notifies the user he has been successfully logged out. You should include a link Login.html for easy access back to the application. This page is very simple and is not covered in this article. Look over the sample code to see how the JSP is connected the logout method of the XMLApiBean class.

You should also set up your project in your IDE to build a web application. Make sure you include the parser JAR files in your web application or add them to the CLASSPATH of your Java application server. Don't be surprised if you see the word Breeze in the code samples for this article. Breeze was the name of the product when this article was first written and is easier to use for variable or method names as opposed to Adobe Connect Professioanl. At this point, you are ready to crank out some code!