Last modified 15 years ago
Last modified on 10/09/09 20:47:15
Analysis
Overview
The goal of this group of tasks is to finalize all the things from the other two revisions of the deployment and to try to run Sophie 2 with Java 1.5 version.
Task requirements
- FileEntryManager should be refactored not to depend on static things and util methods should be separated in utility class.
- Rpm and dep packages should be created. Rpm package generation should be automated.
- Under Mac and Linux bug with the resource directory that is named with %20% in its name should be fixed.
- Script for daily update of applet and jws Sophie jars should be created.
- JWS local storage on user machine should be implemented.
- Applet should not have to be run twice to launch Sophie 2.
- Installer can be optimized to create runnable shortcut under linux. Some readme.txt can be created too.
- Make a try to run Sophie 2 under Java 1.5.
- Create MacOS packages that use macOS menu bar.
Task result
New packages, java web start local storage, daily update of applet and jws jars, better installer
Implementation idea
- See the implementation ideas from the other revisions(r1 and r0).
- Use jar bundler under MacOS.
- Discuss how to prevent static paths in the entry manager.
- Create new FileSearchUtil class where all the utility methods will be available.
Related
GROUP_DEPLOYMENT_R0
GROUP_DEPLOYMENT_R1
How to demo
- Demonstrate all the packages, applet and jws running and resource folders created on the user machine.
Design
- FileEntryManager and FileSearchUtil class diagram follows:
- First I'll note which system propeties should be used for help cleaning the static paths from FEM:
- sophie2.development - True if Sophie 2 is launched under Fake or True launchers in Eclipse
- sophie2.testing - True if we are in testing phase.
- sophie2.config.file - String with the config file location
- user.dir - location of the current user directory
- sophie2.module.paths - String with the location of all the modules to target/classes(or target/test-classes) folder. This is done because there is no other (known) way(under Fake launch) to extract the paths to the sophie modules. The java class path didn't do the work because there are some other packages and we use prefix to extract only org.sophie2 modules, but if the prefix become different a problem will occur.
- Some of the logic how the things work for the FileEntryManager should be changed:
- in roRoots there is no need to append target/classes and target/test-classes suffixes to the paths because src/main(test)/resources locations won't be read only roots anymore. All resources should be searched in target folder where are the compiled classes.
- rwRoot - tmp-distrib folder(created under Fake and True for shared entries for writing) has to be stored in launcher/tmp-distrib but has to be ignored from the svn. This way we can save the configurations for the next launch of Sophie 2.
- getEntry method can check if the entry file exists and after this returing it.
- About the FileSearchUtil:
- fillFakeModulePaths should not fill the paths using the class path but the sophie2.module.paths system property.
- in findPomFromUrl there is a static path org.sophie2 which helps finding the module name which pom is wanted. It has to use sophie2.module.paths instead of this.
- extractFromJar should be reimplemented to take only one parameter - URL and to extract the entry path from this URL. This will be used in findConfigFile - XXX comment has to be removed using the new method. It has to be reimplemented carefully(i.e. not to append the entryPath twice) - this will be fixed when the entryPath is extracted in this method not in the ones that use it.
- There is a bad bug under distribution package which has to be fixed. Plugin enable/disable doesn't work because the configuration file is read from the jar not from the distrib where it is edited, so findConfigFile should check the rwRoot for a file first and then search in the jars.
- In jarUrlExists use getEntryName to determine if entry really exists in the jar instead of swallowing IOException.
- deleteFile and clean methods has to be united in one - deleteFile method which deletes file or directory only if it is not null and it exists.
- The URI and URL classes has to be used instead of Strings everywhere is possible, because they manage to deal with the protocols before the location addresses and with the file separators.
- Carefully look for exceptions and log them with appropriate message.
- About the applet - java 5 backward compatibility has to be implemented because there is no other way to run the applet under MacOS 10.5(it default 64 bit java6 but the browsers use 32 bit only, so mac browser uses java 5). Set jre that eclipse use to 1.5 and java-compiler-plugin in maven to 1.5(source and target tags). In this case maven will use java 1.5 for compiling. Keep in mind that the errors that eclipse shows are not all the errors - maven install has to be used as compiler too. Most of the errors are trivial:
- enums has to be imported as static imports - static import org.sophie2.*.EnumName.*;
- @Override annotations for the methods coming from interface not superclass has to be removed.
- <?> generics has to be changed where the wildcards of the class are V and T for example. One way to do this it to just remove generic and add suppress warning(because <?> include everything possible for parameter).
- Where classes from java 6 are used a way to pass over them has to be implemented. For example TransferSupport is not included in java5 so TransferHandler importData(JComponent, Transferable) has to be used instead of importData(TransferSupport). Another example is that IOException class doesn't have constructor which takes throwable argument(only String). So where IOException is thrown SophieLog has to be used to log the throwable object and appropriate string has to be added in IOException throw.
- Applet has to use MDAppletWindow to show in the real applet window no in the separate one.
- Use jar bundler application for MacOS installer. Use tutorial and examples to create runnable package: http://www.devdaily.com/apple/mac/java-jar-bundler/Getting_started_with_Jar_Bu.shtml
- For the PersistenceStorage(java web start sandbox) go to design of revision R1 of the task GROUP_DEPLOYMENT_R1
- If there is time left think about native librarires in the distribution package. Add them to the native section of the installer configuration and see if this works.
- maven-deploy-plugin has to be added as a dependency and configured in the base pom.xml. Use this example http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ssh-external.html
Implementation
- Things are done except:
- Mac installer is Platypus not jar installer - jar installer is not examined enough to build Sophie. That's why the menu bar in the mac doesn't show Sophie menus for now.
- Applet throws security exception under Mac OS - has to be fixed.
- maven-deploy-plugin is not integrated.
- java web start local storage is not ready yet.
- There are some new classes that helps running under java 5:
- SophiePainter - paints custom look and feel elements using SophieImagePainter(which extends CachedPainter from the swing library).
- Xml file is separated in two files - for java 5 and java 6 running.
- FileExtensionFilter is created - it replaces functionality of the FileNameExtensionFilter which is missing in java 5.
- Class representing a stack is implemented. It uses methods from LinkedList.
- Resources are moved from distrib to src/main/resources package because of the old load method of SynthLookAndFeel implementation.
- Skins are painted in different way so they look ugly - has to be tested and fixed where possible.
Revision are merged and branches are already deleted.
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)