Setting up IntelliJ IDEA
These instructions assume IDEA version 8.1
- Check out Ambra head from svn
- Follow the command-line instructions on Development Setup page
- or Version Control -> Check out from version control -> Subversion
- Select File -> New Project
- Select Import project from external model
- Select Maven
- Select root directory to your head dir
- Check Keep .ipr and .iml files in to some directory that is not inside your Subversion tree (else you might end up having to re-create the project if you decide to wipe the head directory)
- Check all maven profiles and projects to import
- Use an external Maven
- Click on Maven project on right hand tool panel
- Click on Maven settings
- Go to File -> Project Structure
- On the Project tab
- For Project SDK, use the latest Java version available
- For Project language level, use 5.0 (enum keyword, autoboxing, etc.)
- On the Modules tab
- In the module structure ambra-webapp -> Web -> Struts 2, select all of the libraries offered
- In the module structure ambra-webapp -> Groovy, select Maven: org.codehaus.groovy:groovy-all
- In the module structure ambra-webapp -> Spring, select only applicationContext.xml
- Organize Project Modules into Module Groups (top level) and Module Subgroups
- right click on module -> move to place each Module in the appropriate location (Module Groups and Module Subgroups can be created as needed)
- The location of each Module should reflect the file path of that Module. For instance, if the Module all-journals is in directory /home/USER_NAME/topaz/head/ambra/journals/all-journals, then place the Module all-journals into the Module Subgroup journals inside the Module Group ambra. (See the following illustrations)
- On the Project tab
- The plugins JetGroovy? and Struts 2 should already be installed. If not, choose File -> Settings, select Plugins, and add the missing plugins.
- Set up Topaz code style
- Copy TopazProject.xml to your Idea setup directory ( ~/.IntelliJIdea80/config/codestyles under Linux)
- Go to File -> Settings
- In the Project Settings section, select Code Style -> Imports
- For the Scheme name: picklist, choose the name of the file you just copied
- Set the header content for new files
- Go to File -> Settings -> Copyright -> Copyright Profiles
- Create a new profile, naming it something clever like Topaz Project Copyright Profile
- Copy the contents of TopazProjectCopyrightProfile.txt into the large form field
- Click Validate to ensure that the template is valid and will be rendered correctly
Running Tasks
You can run all Maven tasks
- Click Maven Projects in the right-hand margin
- Click Topaz Project -> Lifecycle
The first time this project is created in an Idea installation
- Click Profiles and de-select all the checked Profiles
- Under Topaz Project -> Lifecycle
- Right-click on the clean task and select Run (do not be surprised if this gives errors)
- Right-click on the install task and select Run
Subsequent to installation
- To build or rebuild the whole project
- Under Topaz Project -> Lifecycle
- Control-click both clean and install tasks
- Right-click and select Run
- Under Topaz Project -> Lifecycle
- To build or rebuild just the Ambra portion of the project
- Under Modules -> Ambra application -> Lifecycle
- Control-click both clean and install tasks
- Right-click and select Run
- Under Modules -> Ambra application -> Lifecycle
- To run the Jetty application server
- Under Topaz Project -> Modules -> Ambra application -> Modules -> Ambra Web Application -> Plugins -> jetty
- Control-click the jetty:run task
- Right-click and select Run
- Under Topaz Project -> Modules -> Ambra application -> Modules -> Ambra Web Application -> Plugins -> jetty
Addenda
- To add one or more tasks to a picklist at the top of the screen (the Run menu)
- Select the desired tasks (control-click for multiple tasks)
- Right-click and choose the Select... option (next to the little blue gear)
- You can run jetty:run task in debug mode too
Setting jetty with embedded mulgara and simple blob store without need for ambra.xml
Example parameters:
-Dambra.topaz.tripleStore.mulgara.baseuri=local:///topazproject -Dambra.topaz.blobStore.beanName=simpleBlobStore -Dambra.topaz.tripleStore.mulgara.dbDir=/home/dkrsmanovic/MulgaraDB/topazproject -Dambra.topaz.blobStore.simple.directory=/home/dkrsmanovic/BlobStore -Dambra.services.documentManagement.ingestSourceDir=/home/dkrsmanovic/Topaz/ingest/ -Dambra.services.documentManagement.ingestDestinationDir=/home/dkrsmanovic/Topaz/ingested/ -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dambra.platform.dummySsoEnable=true -Xmx512m
Note that the directories included in the parameter list must exist. In this case, the directories MulgaraDB/topazproject, BlobStore?, ingest, and ingested had to be created.
Recomended JVM parameters from IDEA
Edit ~/idea-xxxx/bin/idea.vmoptions
-Xms32m -Xmx512m -XX:MaxPermSize=256m -ea
Attachments
- jetty-run-embedded.png (176.7 kB) -
IDEA jetty run setup
, added by dragisak on 12/23/08 16:29:58. - intellij_idea_setup_project_structure_1.jpg (195.1 kB) -
Module Group structure for the topaz/ambra project in the IntelliJ IDEA IDE (1 of 2)
, added by ssterling on 04/02/09 14:54:20. - intellij_idea_setup_project_structure_2.jpg (201.7 kB) -
Module Group structure for the topaz/ambra project in the IntelliJ IDEA IDE (2 of 2)
, added by ssterling on 04/02/09 14:55:13. - TopazProject.xml (3.8 kB) -
Editor configuration file for IntelliJ Idea IDE
, added by ssterling on 04/07/09 14:32:05. - TopazProjectCopyrightProfile.txt (0.6 kB) - added by ssterling on 04/07/09 14:51:01.

