UHCL RoboComm: Rule Based Scheduling for Communication Systems First Report Version 1.0 Faculty Advisor Dr. Kwok-Bun Yue Mentor Mr. Dilhar De Silva [ Team Members Thanh Doan Dung Nguyen Tuan Le Hung Tran Spring 2007 April 19, 2006 RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Acknowledgement We would like to thank our instructor Dr. Kwok Bun Yue and mentor Mr. Dilhar De Silva for their support and guidance throughout the semester. We would also like to thank all the people who helped us in this project and whom we might not have mentioned here. http://dcm.cl.uh.edu/caps7g7 -i- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Abstract Atlink Communications, a leading provider of voice process automation technology, develop and provide solutions to companies to automate their business communication processes. One of the solutions the company is developing is a scheduling system that use rule engine to automate the process of organizing conferences over internet. The purpose of the system is to allow highly mobile participants from different time zones to organize conferences, also known as virtual meetings, over the internet with less human interaction possible. The system will be implemented as a three tier Web application using JSP, Servlet for the presentation layer, Java and JBoss Rule Engine for the business logic, and MySQL for the database. To make the application responsive and highly interactive, AJAX technique is adopted to build the user interface for the application. To accommodate changing business rules and future requirements the system is architected to have a separate Rules database that users and administrators can add, update and maintain. This approach allows business communication rules can be evolved while still be able to keep the system fairly stable. Final application will be packaged as standard Java Web Archive file (WAR file) with embedded rule engine library and should be able to deploy into any standard servlet container like Apache Tomcat or any Java application server like JBoss, BEA Weblogic, Oracle application server or IBM WebSphere. http://dcm.cl.uh.edu/caps7g7 - ii - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Table of Contents Acknowledgement .................................................................................................................... i Abstract .................................................................................................................................... ii Table of Contents .................................................................................................................... iv 1. Introduction...............................................................................................................................1 2. Design and Implementation of the Solution .............................................................................2 2.1 Block Diagram …………………………………………………………………………2 2.2 Use Case Diagram ……………………………………………………………………...3 2.2 Database Diagram ……………………………………………………………………...6 3. Main functions of the solution ..................................................................................................8 4. Technologies Selected ..............................................................................................................9 5. JBoss Rules ............................................................................................................................11 6. Zimbra ...................................................................................................................................13 7. Implement Issues ..................................................................................................................16 8. Evaluation of Solution ...........................................................................................................17 8.1 Solution to the problem ………………………………………………………………..17 8.1 Design of the solution ..………………………………………………………………..17 8.1 Lessons Learnt …………….…………………………………………………………..17 http://dcm.cl.uh.edu/caps7g7 - iii - RoboComm: Rule Based Scheduling for Communication Systems 9. Version: <1.0> Date: April 19, 2007 Project Management and Team Information ………………………………………………19 10. Conclusions ………………………………………………………………………………...21 11. References ………………………………………………………………………………….22 12. Appendix A: install Zimbra in Windows environment …..………………………………...23 13. Appendix B: Screen Shots of the User Interface ……………...…………………………...24 14. Appendix C: Class Diagram …….………………….……………………………………...24 15. Appendix D: Database Schema …….……………………………………………………...24 16. Appendix E: Key Data Structures and Classes ……..……………………………………...24 17. Appendix F: Test cases ………………………...……..…………………………………....24 18. Appendix G: Business logic rules in JBoss Rules ….……………………………………...24 http://dcm.cl.uh.edu/caps7g7 - iv - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 First Report 1. Introduction Does your office waste valuable time with an inefficient and frustrating scheduling system? Do you run around the office looking for "the schedule book"? Are you tired of trying to read someone else's scribbled notes? RoboComm system - a Rule Based Scheduling for Communication Systems - will solve these questions! RoboComm system will help you save time and save money. Pop-Up reminders make it virtually impossible to miss an appointment. Utilizing powerful and flexible appointment scheduling software allows you and your whole staff to effortlessly schedule appointments, events, groups, meetings, conference rooms, resources, and more. Now everyone in your office can view and share schedule information with the click of your computer mouse. You won't have to run around looking for "the book" because everyone can access the scheduling in the Internet, and you don't have to struggle to read someone's scribbled notes. And you can also view multiple schedules side by side for easy appointment viewing and setting. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 -1- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 2. Design and Implementation of the Solution 2.1. Block Diagram Figure 1: Block Diagram The four major components of the Block diagram include: 1. User Interface Component: It is used to gather all required information from the convener and participants to schedule a conference call. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 -2- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 2. Database Component: It captures and stores information about the conveners, participants and the conference. It also stores the information about the resultant probable schedules which are facts generated by the rule based inference engine. 3. Rules Component: RoboRules is the basic application that loads in all the rules required from the Rules DRL File. This application loads the rules that have been specified by the RoboApp program. The inputs are the conference id and the list of rules. It then fetches information with regards to that particular conference and creates facts out of them. These facts are then asserted to the Rules Engine and are processed using the loaded rules. Rules Engine comes out with a solution set. 4. EVI will be later integrated with this application. 2.2. Use Case Diagram http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 -3- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 There are 10 use cases in our system: 1. Create meeting request: Initiator select list of participants, a set of date/time periods to create a conference request. Initiator also can update rules for the conference 2. Update meeting request: Initiator can change time and participants of the meeting before it is confirmed. 3. Send meeting request: System send meeting requests to all participants once the request is saved into the database 4. Respond to meeting request: Participant can respond to the meeting request by accept or decline it. In the current version of the requirement participant can not propose a new time. 5. Send reminder: System will send a reminder to any participant that has not respond back to the meeting request when the deadline expires. 6. Suggest meeting times: Whenever system receives a respond from a participant the system updates the conference immediately. The initiator can see schedule and suggested meeting times when he login the system and open the meeting requests 7. Choose meeting time: Initiator can open the meeting request and choose from a list of meeting times that satisfy the meeting requirements. 8. Confirm meeting time: Once Initiator has picked a meeting time; the system will send the confirmation to all participants. 9. Update profile: Any user (initiator or participant) can update the profile including time zone and their own rules. 10. The administrator can add more users into the system: Update rules for whole system as well as rule for each user (UC Update Rules). Administrator can view log data and archive log data (Manage log) http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 -4- RoboComm: Rule Based Scheduling for Communication Systems http://dcm.cl.uh.edu/caps7g7 Version: <1.0> Date: April 19, 2007 UHCL, 2007 -5- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 2. 3 Database schema http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 -6- RoboComm: Rule Based Scheduling for Communication Systems http://dcm.cl.uh.edu/caps7g7 Version: <1.0> Date: April 19, 2007 UHCL, 2007 -7- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 More detail about this database, please appendix B, C 3. Main functions of the solution Basic functionalities of the system include gathering information from the convener and participants with regards to the particular conference, create facts from the information gathered, assert these facts into the rules engine, process those facts using the loaded rules specified by the http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 -8- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 application and producing a set of solutions. Once the convener has requested a conference, the rules get fired when the last participant submits his/her information. 4. Technologies Selected 4.1 JBoss Rules 3.0: JBoss Rules use the Apache Software Foundation open source license that makes it free to download, use, embed, and distribute. Rules engines simplify applications by separating business policy or rules logic from process, infrastructure and presentation logic. This modularity enables business analysts, rules developers and auditors to develop, deploy, modify and manage a business process’s rules with much greater ease and speed. JBoss Rules is a great way to collect complex decision-making logic and work with data sets too large for humans to effectively use. The JBoss rule engine can make decisions based on hundreds of thousands of facts, quickly, reliably and repeatedly. Rule engines facilitate knowledge-transfer to centralized repositories and helps combat issues due to the loss of key decision makers, managers, executives, specialists and highly creative employees from “normal” turnover rates and aging populations. Once your business rules are separated from other logic, they can be more easily reused across many applications and in service-oriented architecture environments. For more details: http://labs.jboss.com/portal/jbossrules/docs 4.2 AJAX & Zimbra 4.2.1 AJAX http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 -9- RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Ajax, shorthand for "Asynchronous JavaScript and XML", is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user requests a change. This is intended to increase the web page's interactivity, speed, and usability. 4.2.2 Zimbra Zimbra is open source server and client software for messaging and collaboration - email, group calendaring, contacts, and web document management and authoring. The Zimbra server is available for Linux, Mac OS X, appliances, and virtualization platforms. The Zimbra Web 2.0 Ajax client runs on Firefox, Safari, and IE, and features easy integration / mash-ups of web portals, business applications, and VoIP using web services. For more details: www.zimbra.com 4.3 Java 1.5.0 Java Platform, Standard Edition (Java SE) software is the premier platform for rapidly developing and deploying secure, portable applications that run on server and desktop systems spanning most operating systems. For more details: http://java.sun.com/j2se/1.5.0 4.4 Microsoft Windows RoboComm has been installed in Microsoft Windows XP operating system. 4.5 Eclipse http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 10 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Eclipse is an open source community, whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. A large and vibrant ecosystem of major technology vendors, innovative start-ups, universities, research institutions and individuals extend, complement and support the Eclipse platform. 4.6 Apache TomCat Apache Tomcat is a Web Server developed at the Apache Software Foundation (ASF). Tomcat implements the servlet and the Java Server Pages (JSP) specifications from Sun Microsystems, providing an environment for Java code to run in cooperation with a web server. It adds tools for configuration and management but can also be configured by editing configuration files that are normally XML-formatted. Tomcat includes its own internal HTTP server. 5. JBoss Rules Basically, at the beginning Rules is a solution for the complex statement if then else. Ex: If A1,not(A2,A3,….An) then do(B1) elseIf A1,A2,not(A3..An) then do(B1,B2) A1,A2,…,An then do(B1,B2,…,Bn) …. elseIf Above if-then-else statement is a very hard to read if n is big and A1,..An is a very complex condition. For using Rule, the problem will much easier Rule 1: When A1 then do(B1) http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 11 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Rule 2: When A2 then do(B2) Rule n: When An then do(Bn) Each Rule for one statement. This source code becomes easier to read and maintain as well. Today, Rules is evolved to be a technology. Business Rule Management Systems build value on top of a Rule Engine providing systems for rule management, deployment, collaboration, analysis and end user tools for business users. Advantages of a rule engine Declarative Programming Logic and Data Separation Speed and Scalability Centralization of Knowledge Tool Integration Understandable rules (readable by domain experts) To understand more about Rules programming and JBoss Rules Model, I recommend you to visit the web page http://labs.jboss.com/portal/jbossrules/docs In our system, we will implement some Rules below Rule 1: All mandatory participants must respond in order for the meeting to be held. Rule 2: Rule 1 will be ignored in case of urgent meeting. Rule 3: Meeting can be held regardless the number of replies from optional participants. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 12 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Rule 4: Initiator may define the how many percents of attendance for the meeting to be held even though the initiator defines mandatory or optional attendance he or not. Rule 5: Initiator can specify a number of hours so that system will send a reminder to participant prior to deadline. (send only one times) Rule 6: Urgent meeting should go to the top (highest priority meeting) even though meeting date is later than the other meetings. Rule 7: There is no confirmation message in case of urgent meeting. Rule 8: If the urgent meeting is cancelled or changed, the system will send the confirmation message to participants. 6. Zimbra 6.1 Zimbra Ajax client Zimbra is to support existing email/messaging client applications, such as Microsoft Outlook, Apple Mail, Novell Evolution, Mozilla Thunderbird … One third of the ZCS client code is made up of the underlying Kabuki Ajax widget toolkit, authored by Zimbra and open-source licensed separately from the full ZCS client/server solution. ZCS Migration Wizard for Exchange .exe file. Use the Migration Wizard .exe file to migrate Microsoft® Exchange server email accounts to the Zimbra server. Accounts from Microsoft Exchange 2000, 2003, and 5.5 can be migrated. Zimbra Collaboration Suite Import Wizard for Outlook .exe file. We can use this file to import their Outlook .pst files to the Zimbra server. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 13 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 ZCS Migration Wizard for Lotus Domino .exe file (Beta). Use the Migration Wizard for Domino .exe file to migrate Lotus Domino server email accounts to the Zimbra server. Accounts from Lotus Notes 6.0 or later can be migrated. 6.2 Zimbra Server architecture overview 6.2.1 Zimlets Zimlet is A Mechanism for Integrating Disparate Information Systems and Content with the Zimbra Collaboration Suite™ (ZCS) Zimlets represent a widget architecture for both UI and server-side integration http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 14 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 The Zimbra Zimlet architecture enables developers to declaratively integrate information from disparate into just about any content within ZCS, including email messages, contact fields, and calendar appointment notes. The architecture of Zimlets consists of a client and server framework, as well as a set of web services and JavaScript APIs. Zimlets are exposed to the end user via the ZCS Ajax client. Zimlet client framework provides support for context menus on panel items, content objects, drag and drop The Zimlet server infrastructure provides the template for lifecycle management such as deployment, configuration, access control, and "undeployment". Integrate with the ZCS search engine For more details: http://www.zimbra.com/products/zimlets.html 6.2.2 Postfix Postfix serves as the Zimbra Mail Transfer Agent (MTA) for sending and receiving email across the Internet. All Zimbra messages (internal and external) flow through Postfix. Postfix uses SMTP/LMTP protocol. Postfix integrate with third party anti-spam – SpamAssassin - and anti-virus ClamAV 6.2.3 Message Store The Zimbra message (or blob) store is built on the underlying Unix/Linux file system. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 15 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 The mapping is one file per message—Zimbra actually write the RFC822 MIME message representation directly to a file. 6.2.4 Metadata SQL Store The Zimbra includes an embedded relational database, MySQL, for managing mailbox meta-data 6.2.5 Lecene Index Lucene is a high-performance, full-text search engine from Apache. The search process required to construct an index. So, Lucene works by generating a full “segment” index. 6.2.6 Journaling The Zimbra journal is like a database transaction log in guaranteeing that no data is lost in the event of a failure and that the system can restart quickly. 7. Implementation Issues We faced many difficulties when starting to develop the RoboComm system based on the Zimbra open source: First, since Zimbra is a huge project, we must spend much time to totally understand the system before building a new system upon the Zimbra open source. Second, since Zimbra provided document is not clear enough and sometimes confused its readers, it is very hard for us to choose a right way to build our application based on Zimbra framework. Third, because Zimbra primarily develop for UNIX environment, it is very hard to install Zimbra in Windows environment. Actually, it took us a few weeks just to install it in Windows environment. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 16 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Last but not least, JBoss Rules is new to us; we must spend much time to do research, to apply JBoss Rules to our system. 8. Evaluation of Solution 8.1 Solution to the problem Friendly UI: users will be interested and feel friendly at the first time using our application! Most of our components based on Zimbra framework are AJAX components which increase the web page's interactivity, speed, and usability. JBoss Rules: since we use Rules to separate business policy or rules logic from process, infrastructure and presentation logic, developer will develop, deploy, modify and manage a business process’s rules with much greater ease and speed. In this application, we have to write a lot of rules that check for a date of the conference on which there is a convener and key participants whose percentage must reach a required minimum for the schedule to successfully be scheduled for that date. 8.2 Design of solution We have divided our entire architecture into three different components namely: Rules Component Database Component and User Interface Component. This division makes it very easy to maintain and enhance the code. It also enhances the flexibility in usage of the system, enabling the developer to modify either of the components without affecting the other. 8.3 Lessons Learnt Importance of Research http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 17 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Since AJAX, JBoss Rules and Zimbra framework are new to us; we must do a lot of research to totally understand before starting to build our system. Although we do a lot of research for the other subjects, after this course we know how to do a research effectively against time constraint. Time Management Time management is another important lesson while working this project; we have to manage how to complete a task in a limited time. We tried our best to make our application better with more functions that are easy for users to use in a given time. Team Work We also understood the importance of team work. Working together as a team with different people is very challenging and reaching a consensus might be tough in certain situations. Gained Valuable Experienced After doing this project we have gained valuable knowledge and experience, we learnt a lot of new technologies such as AJAX, JBoss Rule … We also learnt how to manage time constraint, how to effectively work with the other teammates. 8.4 Future Enhancements Since the most advantage of our application is UI that is very friendly, I do not think we need to change UI any more. The only thing we need to enhance our application is applying more rules. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 18 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 9. Project Management and Team Information Team Member Thanh Doan – Team Leader Task JBoss Rules, Research Zimbra framework, System analysis & design, Task Assignation Dung Nguyen JBoss Rules, Research Zimbra framework, System analysis & design Tuan Le GUI design, Research Zimbra framework, System analysis & design Hung Tran Database design, Documentation, Research Zimbra framework Task Assignments Following are the major tasks of the project Totally understanding the whole Zimbra system Building Rules in JBoss Developing User Interface based on Zimbra framework and the other Ajax library. Creating Database in MySQL Integrating all the above three Report and other Documentation which include UML Diagrams Since the project is very difficult and complex, all the team members had to devote equal time in learning all the new technologies that were used and have contributed equally to all aspects of the project. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 19 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Show below are the various tasks performed in respective time limits. Finally it can be seen that the project deadline has been attained successfully. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 20 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 10.Conclusions After developing this application we concluded that using a rule based approach to solving the problem of scheduling a conference call is one of the best approaches. By using a rule based approach, it is very easy to mange, change and access to business policies. Although JBoss Rules is still transitioning and many features are still being added, we are confident that in the future it will provide a complete set of features necessary to make rule writing easier, more understandable and flexible. Zimbra framework, an open source software, provides a lot of useful components that we reused for our application. And we developed a friendly UI, a useful application for users to manage, schedule meetings. In conclusion we have successfully developed the prototype that meets the requirements. We have captured most of the business logic in rules and successfully developed the user interface using AJAX. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 21 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 11. References The following references have been used in order to understand the underlying technologies used in developing this prototype. These have not been used for our documentation purposes. [1] Zimbra: http://zimbra.com [2] JBoss Rules: http://www.jboss.org [3] Business Rules Engines: http://docs.codehaus.org/ [4] Google Web Toolkit: http://code.google.com/webtoolkit/ [5] Documentation: http://sce.uhcl.edu/yue [6] Java: http://java.sun.com/j2se/1.5.0/docs/api http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 22 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Appendix A Install Zimbra in Microsoft Windows XP Note: We used EDISON version. There is a error after you install the Zimbra: java.io.FileNotFoundException: data/soap/samplecontacts.xml (No such file or directory) We suggest that: 1: copy 2 file "nps-contacts.xml" and "samplecontacts.xml" to "..\EDISON\ZimbraServer\data\soap" 2. In _EDISON\ZimbraServer\build.xml directory, comment this line: <!--<java classname="com.zimbra.soap.SoapTestHarness" fork="true" classpathref="class.path" failonerror="true"> <arg line="-f data/soap/samplesearchfolders.xml" /> http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 23 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 </java>--> To actually work on the source code, add new functionality, fix bugs and deploy those changes it's easiest to set up an Eclipse based development environment. The process involves installing standard packages for the various Zimbra services (OpenLDAP, MySQL, etc) and using Ant tasks from within Eclipse to handle compilation and deployment. The steps to do this are fairly well documented in the ZimbraServer/docs/INSTALL.txt file from the Zimbra subversion repository but we had to make a few changes and find things out based on various forum postings to get it working. There are still some errors that occur due to what seems to be missing or incorrect files from the subversion repository but what we have got is it working to the point of being able to modify the source and run the new version. I'll update this document as we fix and find better ways of doing things. We’ve tested the steps in this article on a Windows XP machine. The instructions will be oriented towards a Windows environment but should also work from a Linux distribution using standard packages. We’ll try it out under Linux when we get some spare time. Please note that in most places we've used the forward slash ('/') in pathnames, even for Windows paths. You'll need to use the backslash in paths where appropriate. We are assuming good knowledge of Windows and/or Linux in this document. Requisites Install the Java Development Kit (JDK) version 1.5.x. Make sure you have the 'bin' directory of this in your path and the JAVA_HOME environment variable set to the install directory. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 24 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Install Tomcat version 5.5.x. Install it to the directory 'c:/opt/zimbra/tomcat'. Under linux this would be '/opt/zimbra/tomcat'. Install MySQL. I use the 'Windows (x86) ZIP/Setup.EXE' version. Use the 'detailed configuration' option of the install so you can set the port that it should run on to be 7306 and the 'root' user password must be 'zimbra'. Install to the directory 'c:/opt/zimbra/mysql'. Install OpenLDAP. I used version 2.2.28 but later versions should work. Install to the directory 'c:/opt/zimbra/openldap'. Install Eclipse. I used the 'Eclipse SDK'. Add the Subclipse plugin for Subversion support under Eclipse. More instructions for using Subclipse are at this IBM DeveloperWorks article. Subversion The Zimbra subversion repository is located at the following URL: https://zimbra.svn.sourceforge.net/svnroot/zimbra/trunk Start Eclipse and open the subversion perspective (Window/Open Perspective/Other/SVN Repository Exploring). Add the Zimbra SVN repository (right click in the 'SVN Repository' tab, choose 'Add a new…'). The URL to enter is: https://zimbra.svn.sourceforge.net/svnroot/zimbra/trunk The repository should now be listed and you can browse it if you want. You'll notice that there are various subdirectories. For example, Ajax AnalyzerSample http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 25 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 branches ThirdParty ZimbraBuild Not all of these are needed for the development build we are doing. We will be selecting the specific projects we want. One thing of interest is the 'branches' directory. Listed under that is 'EDISON' and 'FRANK', and under those are what appears to be similar to the top level branches. From what I understand, the trunk of the SVN repository is the current working copy of the internal version control repository used by Zimbra. It may not always build or work. Under 'EDISON' is the version 4.0 release and 'FRANK' is the current stable release, 4.5. Checkout Projects If you want the 'EDISON' build you need to 'checkout' the following projects: branches/EDISON/Ajax branches/EDISON/ZimbraServer branches/EDISON/ZimbraWebClient If you want the 'FRANK' release you'll need: branches/FRANK/Ajax branches/FRANK/ZimbraCommon branches/FRANK/ZimbraIM branches/FRANK/ZimbraTagLib branches/FRANK/ZimbraServer branches/FRANK/ZimbraWebClient If you want the 'trunk' release you'll need: http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 26 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Ajax ZimbraCommon ZimbraIM ZimbraTagLib ZimbraServer ZimbraWebClient To checkout the projects, right click on them, choose 'Checkout…' and if prompted by a dialog box 'Check out as a project in the workspace'. Do this for each one. Configure Tomcat Tomcat needs to be configured to have a 'zimbra' user and run on port 7070. To make these changes perform the following copies (Where 'ZimbraServer' is the location in your Eclipse workspace directory for the ZimbraServer project you checked out previously): copy ZimbraServer/conf/tomcat-5.5/server.xml c:/opt/zimbra/tomcat/conf/ copy ZimbraServer/conf/tomcat-5.5/tomcat-users.xml c:/opt/zimbra/tomcat/conf/ Configure OpenLDAP Due to the different version (ie. newer version) of OpenLDAP that I installed, changes need to be made to ZimbraServer/conf/ldap/slapd.win.conf. In that file replace all occurences of 'c:/opt/zimbra/openldap/etc/schema' with 'c:/opt/zimbra/openldap/schema' except for amavisd.schema and zimbra.schema. In other words, make that section of the file look like this: include "/opt/zimbra/openldap/schema/core.schema" include "/opt/zimbra/openldap/schema/cosine.schema" include "/opt/zimbra/openldap/schema/inetorgperson.schema" include "/opt/zimbra/openldap/etc/schema/amavisd.schema" http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 27 - RoboComm: Rule Based Scheduling for Communication Systems include Version: <1.0> Date: April 19, 2007 "/opt/zimbra/openldap/etc/schema/zimbra.schema" Add build files Now we're ready to start things up. From within Eclipse, with the Java perspective active, open the Ant view (Window/Show View/Ant). Add the following build files (right click, choose 'Add Buildfiles…'): ZimbraServer/build.xml ZimbraWebClient/build.xml Reset the world Expand the build file for ZimbraServer. Right click on the 'reset-the-world' option, choose 'Run As' and select 'Ant Build'. This will run an Ant task that installs schema in OpenLDAP, inserts information into MySQL, and resets the system to a known starting state. It takes a while. On my system, with the current SVN repository, it fails after doing most of the steps with an error like: java.io.FileNotFoundException: data/soap/samplecontacts.xml (No such file or directory) There is a forum posting about this but it is current unanswered. The error seems to be possible to safely ignore. Continue on with the 'deploy' step below. If it fails due to OpenLDAP not restarting with an error 19, it means you probably didn't make the correct changes to the slapd.win.conf file mentioned earlier. Make those changes and restart the 'reset-the-world'. 'reset-the-world' can always be safely rerun. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 28 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Deploy The next step is to deploy the Zimbra web client. Expand the build file for ZimbraWebClient. Right click on the 'deploy' option, choose 'Run As' and select 'Ant Build'. This will build the web client files and deploy them to the installed Tomcat instance. Admin Deploy The final step is to deploy the admin web tools. Expand the build file for ZimbraWebClient. Right click on the 'admin-deploy' option, choose 'Run As' and select 'Ant Build'. Test the Installation To access the running Zimbra web system from the source you just built, use the following URL: http://localhost:7070/zimbra Login with the user 'user1' and password 'test123'. This should take you to the web mail system. If you are running the 'trunk' checkout you may get Javascript errors or other issues. If you are running the 'EDISON' or 'FRANK' branches then things should work. Sending emails The current setup doesn't allow sending of emails from the webmail interface. The programs required by Zimbra for managing mail are not available on the Windows platform. To work around this you can do the following: Install ActivePerl. Run the following series of commands to install the required libraries: ppm install Net-LMTP ppm install SMTP-Server ppm install Net-DNS http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 29 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 Set the ZIMBRA_HOSTNAME environment variable to the hostname of a running Zimbra installation that will handle the email sending. Run ZimbraServer/src/perl/zMTAHack.pl You should now be able to send emails. They will be redirected by zMTAHack.pl to the other running Zimbra installation for delivery. http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 30 - RoboComm: Rule Based Scheduling for Communication Systems Version: <1.0> Date: April 19, 2007 (Will be submitted in the final report) Appendix B (Screen Shots of the User Interface) Appendix C (Class Diagrams) Appendix D (Database Schema) Appendix E (Key Data Structures and Classes) Appendix F (Test Cases) Appendix G (Business logic rules in JBoss Rules) http://dcm.cl.uh.edu/caps7g7 UHCL, 2007 - 31 -