How to get changed Presentation.class in tar

Help
2007-11-10
2013-04-16
  • 2 changes were asked for: 1: no automatic checking of the checkbox when you click on a file-link; 2: open files in a separate window. To do this, I think the following changes will suffice: for change 1, in functions.js function clickdown, remove the line "objs[0].checked = !objs[0].checked;". In Presentation.java, private method showFile, remove " onclick='clickcheck(this);'" (otherwise it would not be possible anynmore to get the boxes checked). For change two add " target='_blank'" in the 3 hrefs in the same method.
    I would like to test this in Eclipse, but I could not get the application to work (what is the right way to get the project in eclipse? how to get the right settings, which versions etc. and how do I get eclipse to make a new valid tar?
    So I thought it would be enough to compile Presentation.java (Eclipse does this automatically when you change and save the java-file) and somehow get it in the original tar (0.44). That seemed to work, but on the server (Tomcat 5.0.28 on Linux) I got a "java.lang.UnsupportedClassVersionError: webdisk/Presentation (Unsupported major.minor version 8238.8224)". What versions (jdk, jre) should I use to compile? Or is there a better way?
    Thanks a lot. Jaap van der Linden, NL 

     
    • Hello,

      the eclipse compiler is normally set to Java 1.4 compatibility. But if you recompile the package and your server supports a higher version, you can also use this version. The .tar.gz and .zip files are generated with an ant task (see the build.xml in the root folder). I'm using the latest JDK 1.6.0. I think I'll add your changes as new options in the next release.

      bye
      Thomas

       
    • Hi Thomas,

      thanks for the fast reply. Glad to hear you consider incorporating the changes (as options).
      Alass. I still don't know how to build. I tried running the build.xml in Eclipse, but without success (see below).
      So my original question still stands: what is the right way to get the project into eclipse and which versions should I use. By the way: do you really mean JDK 1.6.0? Or do you mean JRE 1.6.0. Or do you mean JDK 1.5.0?

      Things I tried:
      In the build.xml I changed the reference to a drive h in c.

      In Eclipse, on rightclick of the build.xml, I chose "Run as ant script".
      But I immediately got an error: "Reference to undefined variable JAVA_HOME".
      (This variable is set to: "C:\Program Files\Java\jdk1.5.0_12").

      In the "Edit configuration an launch"-window, in the ClassPath-tab I changed the ANT_HOME: I set it to the place where the ant lib is in. This did not make a difference.

      Then I changed the setting on the jre-tab. I set the Runtime JRE to "Run in the same JRE as the workspace" Instead of on "Separate JRE" that was set to jre1.6.0_01. In effect, it became jdk1.5.0_12.
      Now, when running the ant-script, the JAVA_HOME message did not appear, but I got:
      C:\Documents and Settings\Jaap van der Linden\Mijn documenten\Werk\IntegraTUM_WebDisk_0.44\IntegraTUM_WebDisk_0.44\build.xml:25: basedir does not exist!
      So then on the "Main"-tab, I filled in the Base Directory: ${workspace_loc:/ba}
      This did not have any effect.

      So, I'm at loss..

      Greetings,
      Jaap.

       
      • Hello,

        if Eclipse/Ant is not working for you, you can manually compile the code and copy the new .class files to your Tomcat server and restart it.

        Compiling is described at the end of the installation page:
        http://www.simple-groupware.de/cms/WebDisk/Installation

        Then copy the .class files from "<webdisk-dir>/webapp/WEB-INF/classes/webdisk" to the corresponding folder in the Tomcat webapps directory.

        bye
        Thomas

         
    • Hello Thomas,

      I decided to compile all the webdisk-specific classes together, in the same way, through eclipse. I fiddled with the java-compiler settings in the project properties. With Eclipse 3.3 using JDK-compliance 6.0, Generated .class file compatibility 6.0, Source compatiblity 6.0, I still got the same error (although with code (49.0), in previous tests I had also got (50.0) and 48.0 ). The second time I tried (the target vm on the server is a 1.4), with Eclipse 3.1 using JDK-compliance 1.4, Generated .class file compatibility 1.3, Source compatibility 1.2, it worked. Trial and error, I'm ashamed to say, but I'm glad it works anyway. 
      The changes (in a short test) did exactly what they were supposed to do. Let me know when you would like me to mail the changed Presentation.java and functions.js to you (although in our case the changes are fixed changes, not options).

      bye,
      Jaap.

       
      • Hello,

        you can send me the source files and I'll check them.

        bye
        Thomas