ScopeThis section is not about developing applications with Orbeon Forms, but about developing Orbeon Forms itself. It is for those who want to modify the code of Orbeon Forms. This documentation provided here is very much work in progress. If you would like to contribute to the Orbeon Forms development and don't find all the information you are looking for here, please feel free to join the ops-users mailing list and ask your question on the list. Java versionThe server part of Orbeon Forms is developed in Java. As of July 2009, it requires Java 5 or newer. In particular, the code base uses the following features of Java 5 :
Nightly buildsAt any time you can download a nightly build, which is a build of the latest Orbeon Forms source code. Unlike released versions of Orbeon Forms, nightly builds are not tested before they are made available. The only guarantee is that nightly builds pass the Orbeon Forms unit tests. A build that does not pass all the unit tests is not uploaded to the nightly build directory. The Orbeon Forms developers are doing their best not to cause any regression in nightly builds, so in most cases you can use nightly builds for development. If you notice any regression is a nightly build, please report it on ops-users. The name "nightly builds" seems to imply that they are created only once a day. In fact, nightly builds are created at all time during the day, whenever a modification occurs on the code repository. So there might in fact be several nightly builds in a day of development is active during that day, or no new build if nothing was checked in the repository that day. Getting the sourceFirst note that if your main reason for getting the source is to have a build of Orbeon Forms with the latest code, we recommend that you instead download a nightly build (see above). The source code of Orbeon Forms is available on the git repository. Building with antWe build Orbeon Forms with Ant. The Ant configuration file (build.xml) is located at the root of the source directory. You can start Ant from the command line. If you are using an IDE like Eclipse or IntelliJ, you can also use the builtin Ant support provided by your IDE. The Orbeon Forms build.xml defines a number of targets, but only a few are used frequently:
Building with your IDENOTE: If you use the directory-based project settings (.idea directory), you can also check our configuration files directly from git. During development, you can choose to compile Java files with your IDE instead of compiling them with Ant. You might want to do this because:
HotSwap works by starting the VM in debug mode and connecting to the VM with your IDE. As your application is running, you can then modify the Java code, and recompile it with your IDE. After the IDE has successfully compiled any modified Java file, it will send the new code to the JVM, which will replace the old code with the new code. HotSwap still has limitations: it is not a silver bullet and there will be cases where you will need to redeploy the web application or restart the application server. But you will spare yourself a redeployment or restart in most of the cases where your modification to the Java code does not significantly change the structure of the Java class. If you are using IntelliJ, you can find more information about HotSwap on their site. To compile files from your IDE:
IntelliJ Setup What follows are tips how how to better use and configure IntelliJ.Resolving XInclude Paths If you are using XInlcude in IntelliJ, you might have seen errors like this:IntelliJ attempts to resolve paths in XInclude relative to the paths you defined as source folders in your Project Structure. You might have defined paths like src/java as a source folder; that is: folders in which you have Java code. But if you keep you resources separate from your Java files (i.e. in src/resources and src/resource-packaged like we do in Orbeon Forms), you will get the error above as IntelliJ fails to find a file src/java/foo/bar.xhtml. As of IntelliJ 8.1, you can't disable this behavior so rather than become numb to errors reported by IntelliJ, you can setup it up to look for those files in your resources folder by adding resources a Source Folder or Test Source Folder. A negative side-effect of this configuration is that when compiling your source with IntelliJ as described earlier, it will copy all the files that it considers to be resources in the output path. Mostly, this means that compiling will start taking more time than it should. You can disable this behavior by editing the pattern that describes what IntelliJ considers to be a resource. You can change this pattern under Settings, Compiler, Resource patterns. Entirely removing the pattern will do. Performing VCS Operations in the BackgroundIt isn't clear why IntelliJ doesn't by default perform all the operations on your version control system (VCS) in the background, but you can enable this on per-projet basis in Settings, Version Control, Background, as shown in the following screenshot.Enabling background VCS operations (screenshot from IntelliJ 8.1) Testing with your IDEIntelliJ supports a built-in JUnit front-end which can be convenient. To configure it, go to Run -> Edit Configurations and create a new JUnit configuration called e.g. "Orbeon Forms Tests": -Doxf.resources.factory=org.orbeon.oxf.resources.PriorityResourceManagerFactory |








