Introduction to CSDT Development and Deployment

advertisement
Introduction to CSDT Development and Deployment
1. Subversion
Before doing anything, you will need a subversion login and password. After you have been
given this, you need to set up your environment. For the purposes of this tutorial, I am going to
explain how to set up the environment for the CSDTs within NetBeans.
To begin with, you need to install jogl on your computer. Use this:
http://www.felixgers.de/teaching/jogl/JOGLInstall.html
From NetBeans, check out the entire pCSDT directory by going to Team->Subversion->Checkout




Repository URL : https://subversion.hss.rpi.edu/svn/csdt_src
And use the login and password you were given.
Click Next and then click Browse beside “Repository Folder(s)”
Click Finish
You can now open the CSDT you want to work on in NetBeans by going to File ->Open Project
Within your checked out files, unzip the most recent web deploy zip archive, and go into
/webdeploy/media/ then notice jogl and glugen. Click until you get all the way down to where
you see …jogl…architecture….jar and glugen….architecture….jar, and then at the command line
type “jar -xvf jogl (or gluegen) [architecture].jar” . Do this for both jogl and gluegen.
For example: -xvf gluegen-rt-natives-windows-amd64.jar.
Presumably, you are choosing the x86_64 bit version. From here you just copy them to the
appropriate places according to the website above on how to install jogl.
2. Opening a CSDT project in NetBeans
To begin development, you need to open your CSDT in NetBeans as well as opening Core. You
will receive a resolve references error. To fix this, say yes to resolve references, then you will get
a list of problem reference libraries and jars. Click resolve, then 'new library', then type the
name exactly as it was in the list - for example JOgl, then add /pcsdt/jars, and then both jogl.jar
and glugen.jar. JOgl is the only one that has two files. The others all have only one, and if you
are resolving a .jar then when you resolve it, you should just get a file chooser to click on the .jar
- though you will have to navigate to that directory again. After all the jars are resolved, you will
also need to add the Core project to the references list. Do this by going to the CSDT’s
properties-> Libraries-> Add Project-> and find the Core project in your file system.
After all the errors are resolved to run the CSDT you need to clean and build Core by right
clicking on the entire project and selecting “Clean and Build”. Then you need to Clean and Build
your CSDT. Finally, find the file within your CSDT labeled gui (for example CCGui.java for CC) and
right click and select “Run”.
3. Deployment
Ok so now you’ve made changes to your CSDT and you want to deploy them to the server so
others can see what awesome things you’ve done. Every time you deploy, there are two things
you must remember. 1) Always commit your changes to the subversion server. This allows for a
place to keep track of changes that have been made, and provides a safety net in case you need
to revert back to a CSDT’s previous state. 2) You need to move your CSDT’s new jar that you’ve
made to the CCD server. This server provides access to changing CSDTs on the website so that
everyone has access to them. A word of warning for this server: make sure your changes work
properly before adding them or else you could bring down the entire system. It would be a good
idea to add your new changes to a test folder to make sure everything runs smoothly before
replacing previous versions.
So let’s go over the two different places you are going to add your finished code to.
First off, to commit your changes to subversion you have two choices. You can either commit
within NetBeans or you can download and use TortoiseSVN. The latter might prove easier
because NetBeans can get a bit frustrating at times, but for the purposes of this tutorial, I’m just
going to stick with NetBeans. To commit within NetBeans, right click on your project and click
Subversion -> Commit and it should show you a list of the files you’ve made changes to. A neat
thing about NetBeans is your files will be highlighted blue in your project window when you
have files that you have changed but haven’t committed yet, so it’s a good reminder.
Next, deploying to the CCD server is a bit more work. First off, you will need Ant and Ant contrib
installed on your machine.


Ant should be there because of the Java jdk
Ant contrib on windows can be easily installed if you use this:
http://code.google.com/p/winant/ and select download the latest version under get it
If you use winant, I am 99% sure it takes care of the path variables for you. (If the system can't
find ant later on, then this will need to be taken care of).
Next, remember the web_deploy folder we used earlier? Well let’s go back to that. Unzip the
latest one. Open a cmd window and navigate to the root folder /.../web_deploy/current. You
will find files like mykeystore, readme.txt, signfolder.bat in this directory. You need to
regenerate the signing certificate by doing the following:
type:
keytool -genkey -alias mykey -keystore mykeystore -validity 3650
Then keytool will ask you a series of questions:
keystore password = makemyday (Use this for any password it asks for)
commName = pCSDT Developer
ogranizational unit = CS
organization name = RPI
Locality = Troy
State = NY
C = US
Next you want to edit your signfolder.bat file so that it has a line with -Dfolder =[your CSDT] on
the first line of the file. For example, if I’m working on CC I will move the line that starts with “Dfolder=CC” to the top of the list.
(Unusual thing here - in Linux, all of the lines get processed and all jars in folders listed get
signed. In windows, only the first line gets processed. So, if you needed to make updates to
Core, you would need to edit the signfolder.bat file so that each folder needing to be signed
makes it to the top of the file and then run the file.)
Now copy your CSDT’s jar file from netbeans/..../your CSDT/dist/ to the
/.../web_deploy/current/your CSDT/v0.41/. Now double click on signfolder.bat, and it will sign
your jar. Next start an ftp program (I use Filezilla). If you need to, click on Site Manager (if this is
the first time running Filezilla, then you need to). Click New Site.
Fill in:
Host: www.ccd.rpi.edu
Server Type: FTP
Logon Type: Normal
User: win\your_rpi_id
Password:
your_rpi_password
Click connect.
Possible errors you might encounter: If it tries to connect and takes a long time and doesn't
succeed, make sure you have win\ in front of your user name. If it can't find the server, make
sure you have “www.” in front of ccd.rpi.edu. Verify FTP and not a different protocol. If still no
luck, then did Ron add you to the CCD server?
In the right hand middle box of the Filezilla main screen navigate to eglash\csdt\pcsdt\your
CSDT\v0.41. In the left hand middle box of the Filezilla main screen navigate to
\where_ever_web_deploy\current\your CSDT\v0.41. Drag your newly signed jar from left to
right and you should be done. Verify that you were successful by clicking here:
www.ccd.rpi.edu\eglash\csdt\pcsdt\
And click on your CSDT. With any luck, your applet should start.
4. Final Tips
So I have given you the basics here, but there are a few small things to remember. When you
deploy a CSDT, all you need to do is sign that jar and move it over to the appropriate folder on
the CCD server. However, if you are deploying the Core, you need to sign the Core folder, lib
folder, and media folder. Then you need to move Core.jar into \eglash\csdt\pcsdt\Core\v0.41.
Move the contents of your signed lib folder into \eglash\csdt\pcsdt\Core\lib AND
\eglash\csdt\pcsdt\lib. Also move your signed media folder over to the media folder on the
server.
Good luck!
Download