34
Set up a Luminis Development Environment David Wolowicz Luminis, LUM01 Tuesday Oct 03 2006 2:15-3:00

Set up a Luminis Development Environment

  • Upload
    ismail

  • View
    68

  • Download
    3

Embed Size (px)

DESCRIPTION

Set up a Luminis Development Environment. David Wolowicz Luminis, LUM01 Tuesday Oct 03 2006 2:15-3:00. Session Rules of Etiquette. Please turn cell phones/pagers off or switch to vibrate mode If you must leave the session early, please do so as discreetly as possible - PowerPoint PPT Presentation

Citation preview

Page 1: Set up a Luminis Development Environment

Set up a Luminis Development Environment

David Wolowicz

Luminis, LUM01 Tuesday Oct 03 2006 2:15-3:00

Page 2: Set up a Luminis Development Environment

Session Rules of Session Rules of EtiquetteEtiquette

Please turn cell phones/pagers off or switch to vibrate modePlease turn cell phones/pagers off or switch to vibrate mode If you must leave the session early, please do so as If you must leave the session early, please do so as

discreetly as possiblediscreetly as possible Please avoid side conversations during the presentation.Please avoid side conversations during the presentation.

Thank youThank you

Page 3: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 4: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 5: Set up a Luminis Development Environment

What is a Channel?What is a Channel?Channels are:Channels are: Pluggable user interface componentsPluggable user interface components HTML/XHTML/WML/XML snippetsHTML/XHTML/WML/XML snippets Portlets*Portlets* Java code based on the iChannel framework Java code based on the iChannel framework The interpretation of data into a small user interface The interpretation of data into a small user interface

componentcomponent

Page 6: Set up a Luminis Development Environment

What is a Channel?What is a Channel?For the developer:For the developer: All channels displayed in Luminis are made extending the All channels displayed in Luminis are made extending the

iChannel framework in JavaiChannel framework in Java Channels are compiled using Java 1.3Channels are compiled using Java 1.3 Compiled channel files can be stored in a Java Archive (jar) Compiled channel files can be stored in a Java Archive (jar)

that is named as a “Channel Archive (car)” filethat is named as a “Channel Archive (car)” file The channel creates XML that is parsed with the The channel creates XML that is parsed with the

corresponding XSLT templatecorresponding XSLT template

Page 7: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 8: Set up a Luminis Development Environment

Eclipse IntroductionEclipse IntroductionEclipseEclipse is a free software / open source platform-independent is a free software / open source platform-independent

software framework for delivering what the project calls software framework for delivering what the project calls "rich-client applications", as opposed to "thin client" "rich-client applications", as opposed to "thin client" browser-based applications. So far this framework has browser-based applications. So far this framework has typically been used to develop IDEs (Integrated typically been used to develop IDEs (Integrated Development Environments), such as the Java IDE called Development Environments), such as the Java IDE called Java Development ToolkitJava Development Toolkit (JDT) and compiler that comes as (JDT) and compiler that comes as part of Eclipse (and which are also used to develop Eclipse part of Eclipse (and which are also used to develop Eclipse itself). However, it can be used for other types of client itself). However, it can be used for other types of client application as well. application as well.

Page 9: Set up a Luminis Development Environment

Eclipse IntroductionEclipse Introduction

Eclipse has plug-ins for:Eclipse has plug-ins for: Compiling and source editing (Java, PHP, C++, CSS…)Compiling and source editing (Java, PHP, C++, CSS…) Collaborating (CVS, SVN, FTP, WebDav…)Collaborating (CVS, SVN, FTP, WebDav…) Unit testingUnit testing Creating visual interfacesCreating visual interfaces Administrating databasesAdministrating databases Modeling and code generationModeling and code generation Business intelligence and reportingBusiness intelligence and reporting DebuggingDebugging And many, many more (Search for “Eclipse Plug-ins”)And many, many more (Search for “Eclipse Plug-ins”)

Page 10: Set up a Luminis Development Environment

Eclipse IntroductionEclipse Introduction

Demonstration of Eclipse.Demonstration of Eclipse.

Page 11: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 12: Set up a Luminis Development Environment

uPortal Quick-startuPortal Quick-start

The easiest way to start developing channels is by using the The easiest way to start developing channels is by using the uPortal Quick-start PackageuPortal Quick-start Package

Download uPortal 2.1.5 Quick-start from Download uPortal 2.1.5 Quick-start from Install as per instructionsInstall as per instructions You require:You require:

JDK 1.3 or higher.JDK 1.3 or higher. JDK must include tools.jar.JDK must include tools.jar. JAVA_HOME environment variable must be set.JAVA_HOME environment variable must be set. Nothing else should be running on port 8080 and 8887.Nothing else should be running on port 8080 and 8887. Path to uPortal_2-1-5-quick-start folder should not contain Path to uPortal_2-1-5-quick-start folder should not contain

spaces.spaces.

Page 13: Set up a Luminis Development Environment

uPortal Quick-startuPortal Quick-startYou will be using (n) copies of the JDK and JRE and we will use Eclipse You will be using (n) copies of the JDK and JRE and we will use Eclipse

to run application in each environment. Set your JAVA_HOME to run application in each environment. Set your JAVA_HOME variable to the most resent version.variable to the most resent version.

JRE 5 (JAVA_HOME)

JDK 1.3 JDK 1.4

Eclipse

uPortal 2.1.5Some other

Java AppTomcat

Page 14: Set up a Luminis Development Environment

uPortal Quick-startuPortal Quick-startIn Eclipse:In Eclipse:1.1. Install the Sysdeo Tomcat Plug-in (Install the Sysdeo Tomcat Plug-in (

http://www.sysdeo.com/eclipse/tomcatpluginhttp://www.sysdeo.com/eclipse/tomcatplugin))2.2. Go into the Eclipse preferences (Window->Preferences) and add Go into the Eclipse preferences (Window->Preferences) and add

all of the JREs that you would like to use (Java->Installed JREs). all of the JREs that you would like to use (Java->Installed JREs). 3.3. Create a new Java project and point it at your uPortal Quick-start Create a new Java project and point it at your uPortal Quick-start

directorydirectory4.4. Under the Eclipse Preferences set the Tomcat plug-in to use JRE Under the Eclipse Preferences set the Tomcat plug-in to use JRE

1.3 and point the plug-in at your Tomcat Home1.3 and point the plug-in at your Tomcat Home5.5. In the Eclipse Preferences set the Ant to use the JDK 1.3.1 tools.jar In the Eclipse Preferences set the Ant to use the JDK 1.3.1 tools.jar

file (I believe you can do this on a per target basis too)file (I believe you can do this on a per target basis too)6.6. Drag your Build.xml to the Ant view. Drag your Build.xml to the Ant view.

You should now be able to start HSQL from the Ant targets provided You should now be able to start HSQL from the Ant targets provided and start Tomcat from the Sysdeo plug-in buttonsand start Tomcat from the Sysdeo plug-in buttons

Page 15: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 16: Set up a Luminis Development Environment

Setup Channel Setup Channel DevelopmentDevelopment

I have created a small zip file with the directory structure and I have created a small zip file with the directory structure and build.xml file for compiling and deploying the Car filesbuild.xml file for compiling and deploying the Car files

1.1. Download and Un-zip the starter packDownload and Un-zip the starter pack

2.2. Create a Java project in Eclipse that points to the Un-zipped Create a Java project in Eclipse that points to the Un-zipped source codesource code

3.3. Make sure the source folders are correct and set the Make sure the source folders are correct and set the location for where you want automatic compilation to location for where you want automatic compilation to output to.output to.

4.4. Add the uPortal Quickstart Project to the new projectAdd the uPortal Quickstart Project to the new project

5.5. You will need to add the jar files from the uPortal Library to You will need to add the jar files from the uPortal Library to the project. You can do this a number of ways. I include a the project. You can do this a number of ways. I include a custom user Library.custom user Library.

Page 17: Set up a Luminis Development Environment

Setup Channel Setup Channel DevelopmentDevelopment

To Create a custom library from a project:To Create a custom library from a project:

1.1. Go to the Project properties and the Libraries tab of the Go to the Project properties and the Libraries tab of the Java Build Path SectionJava Build Path Section

2.2. Select “Add Library” then “User Library”Select “Add Library” then “User Library”

3.3. Select “User Libraries…” then “New…”Select “User Libraries…” then “New…”

4.4. Enter a name and press OK.Enter a name and press OK.

5.5. Select the new Libray and press “Add Jars” Select the new Libray and press “Add Jars”

6.6. For uPortal go to the “lib” folder and select all of the .jar For uPortal go to the “lib” folder and select all of the .jar and .zip filesand .zip files

7.7. You now have a re-usable library for use in projectsYou now have a re-usable library for use in projects

Page 18: Set up a Luminis Development Environment

Setup Channel Setup Channel DevelopmentDevelopment

To Create a custom library from a project:To Create a custom library from a project:

1.1. Go to the Project properties and the Libraries tab of the Go to the Project properties and the Libraries tab of the Java Build Path SectionJava Build Path Section

2.2. Select “Add Library” then “User Library”Select “Add Library” then “User Library”

3.3. Select “User Libraries…” then “New…”Select “User Libraries…” then “New…”

4.4. Enter a name and press OK.Enter a name and press OK.

5.5. Select the new Libray and press “Add Jars” Select the new Libray and press “Add Jars”

6.6. For uPortal go to the “lib” folder and select all of the .jar For uPortal go to the “lib” folder and select all of the .jar and .zip filesand .zip files

7.7. You now have a re-usable library for use in projectsYou now have a re-usable library for use in projects

Page 19: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 20: Set up a Luminis Development Environment

Setup Channel Setup Channel DevelopmentDevelopment

You should now have a Channel Project with no errors in the You should now have a Channel Project with no errors in the source code. source code.

You can now drag and drop the build.xml files into the “Ant You can now drag and drop the build.xml files into the “Ant View” or run it by right clicking on it.View” or run it by right clicking on it.

We now need to setup the build parameters for Ant.We now need to setup the build parameters for Ant.

Page 21: Set up a Luminis Development Environment

Setup Channel Setup Channel DevelopmentDevelopment

Included in the Project is the folder “buildsettings”. Build settings can Included in the Project is the folder “buildsettings”. Build settings can have (n) folders. Each folder is for a publishing configuration. Here have (n) folders. Each folder is for a publishing configuration. Here are the files that you need to change:are the files that you need to change:

/buildsettings/chandev.properties/buildsettings/chandev.properties Change the directory to the root of your project folderChange the directory to the root of your project folder

/buildsettings/Dev/chandev.properties/buildsettings/Dev/chandev.properties This file is the publishing configuration for the “Dev” environmentThis file is the publishing configuration for the “Dev” environment Set build.car.dir to the directory you want the car file to go toSet build.car.dir to the directory you want the car file to go to

/buildsettings/Dev/replacements.properties/buildsettings/Dev/replacements.properties This file replaces certain strings in the source code and related This file replaces certain strings in the source code and related

files (xslt, xml, properties…)files (xslt, xml, properties…) The first string is the string that will be replaced, the second sting The first string is the string that will be replaced, the second sting

is the replacement. ie: String.to.Replace=theReplacementStringis the replacement. ie: String.to.Replace=theReplacementString

Page 22: Set up a Luminis Development Environment

Setup Channel Setup Channel DevelopmentDevelopment

You should now have a channel development environment for You should now have a channel development environment for creating basic channels. creating basic channels.

If you want to create channels that are only compatible with If you want to create channels that are only compatible with Luminis you should Copy the Luminis Web-0Inf folder to Luminis you should Copy the Luminis Web-0Inf folder to your local machine, create a library, and include it in your your local machine, create a library, and include it in your channel development project.channel development project.

Including the uPortal source code in your project like we have Including the uPortal source code in your project like we have will allow Eclipse to provide the included Javadoc will allow Eclipse to provide the included Javadoc information from the uPortal source code.information from the uPortal source code.

Page 23: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 24: Set up a Luminis Development Environment

SubversionSubversion

SubversionSubversion is an open source application used for revision is an open source application used for revision control. It is sometimes abbreviated to control. It is sometimes abbreviated to svnsvn in reference to in reference to the name of its command line interface. Subversion is the name of its command line interface. Subversion is designed specifically to be a modern replacement for CVS designed specifically to be a modern replacement for CVS and shares a number of the same key developers. and shares a number of the same key developers.

Page 25: Set up a Luminis Development Environment

SubversionSubversion

There are a number of Subversion Clients, I recommend:There are a number of Subversion Clients, I recommend: Tortoise SVNTortoise SVN

Free Windows ClientFree Windows Client Windows explorer integrationWindows explorer integration Can create repositories (I don’t know much about this)Can create repositories (I don’t know much about this)

SubclipseSubclipse Eclipse plug-inEclipse plug-in Free clientFree client

Page 26: Set up a Luminis Development Environment

SubversionSubversion

Demonstration of SubversionDemonstration of Subversion

Page 27: Set up a Luminis Development Environment

SubversionSubversion

Things to remember using subversion with Eclipse:Things to remember using subversion with Eclipse: Add the .project and .settings to the SVN ignore properties. Add the .project and .settings to the SVN ignore properties.

You might also want to exclude your bin directory if its in You might also want to exclude your bin directory if its in your shared directory.your shared directory.

It’s nice to be able to recreate your project from the It’s nice to be able to recreate your project from the repository. While the project settings will not all be there, repository. While the project settings will not all be there, you can create projects from browsing the SVN (Checkout you can create projects from browsing the SVN (Checkout as Project)as Project)

Page 28: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 29: Set up a Luminis Development Environment

Unit TestingUnit Testing

Eclipse has a JUnit built in. The project that was provided has a Eclipse has a JUnit built in. The project that was provided has a sample Unit test in it. sample Unit test in it.

You will need junit.jar to the project. Eclipse will notify you of You will need junit.jar to the project. Eclipse will notify you of thisthis

In the provided project the Unit tests are kept in a separate In the provided project the Unit tests are kept in a separate “source” directory. You can keep yours anywhere. “source” directory. You can keep yours anywhere.

Page 30: Set up a Luminis Development Environment

Unit TestingUnit Testing

I have not figured out a method of emulating the RuntimeData I have not figured out a method of emulating the RuntimeData and static data required to test a channel; but, you can still and static data required to test a channel; but, you can still test all of your public methods, and any additional classes test all of your public methods, and any additional classes that you write.that you write.

To Run the included test:To Run the included test: Make sure that any compilation errors are resolvedMake sure that any compilation errors are resolved Right click on the file, Select Run As-> Junit TestRight click on the file, Select Run As-> Junit Test

This will bring up the results in the JUnit ViewThis will bring up the results in the JUnit View

Eclipse has many magical ways of going from test to code, Eclipse has many magical ways of going from test to code, code to test and do some automatic code generation things.code to test and do some automatic code generation things.

Page 31: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 32: Set up a Luminis Development Environment

The UVic EnvironmentThe UVic Environment SVN is used to distribute Production code changesSVN is used to distribute Production code changes Eclipse is used to do versioning, Java, XML, XSLT and JSP Eclipse is used to do versioning, Java, XML, XSLT and JSP

development and operations.development and operations. Request Tracker and SVN are used to track bugs, ticket Request Tracker and SVN are used to track bugs, ticket

requests and associate changes to them.requests and associate changes to them. Luminis server drive shares are published to directly from Luminis server drive shares are published to directly from

EclipseEclipse iPlanet web based server administrator is used to restart iPlanet web based server administrator is used to restart

the server and clear any JSP cache the server and clear any JSP cache

Page 33: Set up a Luminis Development Environment

OutlineOutline IntroductionIntroduction What is a channel?What is a channel? Eclipse introductionEclipse introduction uPortal Quick-startuPortal Quick-start Setting up Eclipse for Channel DevelopmentSetting up Eclipse for Channel Development Compiling and deploying ChannelsCompiling and deploying Channels Subversion (SVN)Subversion (SVN) Unit testing in EclipseUnit testing in Eclipse How UVic is using EclipseHow UVic is using Eclipse QuestionsQuestions

Page 34: Set up a Luminis Development Environment

Questions?Questions?

Please complete the session evaluation. Thank You

Dave WolowiczSr. Web DeveloperUniversity of [email protected]