Project

General

Profile

IntelliJ z2 plugin » History » Version 15

Udo Offermann, 09.05.2014 15:20

1 1 Udo Offermann
h1. IntelliJ z2 plugin
2
3
The z2-plugin for IntelliJ IDEA simplifies development with the z2-environment. 
4
The following features are supported as of version 1.0:
5
6 6 Udo Offermann
* *[[IntelliJ_z2_plugin#Launching|Launching]]:* Start your z2-environment on your local machine from the IDE
7 14 Udo Offermann
* *[[IntelliJ_z2_plugin#Managing z2-modules|Managing z2-modules]]:* z2-modules can be created and deleted on demand
8 10 Udo Offermann
* *[[IntelliJ_z2_plugin#z2-sync|z2-sync]]:* Synchronize your local changes with the z2-environment
9 6 Udo Offermann
* *[[IntelliJ_z2_plugin#z2-dependency-resolution|z2 dependency resolution]]:* Resolve missing dependencies from the z2-environment
10
* *[[IntelliJ_z2_plugin#Arming modules|Arming modules]]:* Armed z2-modules become active after z2-Sync.
11
* *[[IntelliJ_z2_plugin#z2-Module wizard|z2-Module wizard]]:* Create new z2-modules with or without Spring support
12
* *[[IntelliJ_z2_plugin#z2-Properties editor|z2-Properties editor]]:* Provides completions and documentation for z2-properties files
13 1 Udo Offermann
14
h2. Installation
15
16 13 Udo Offermann
TODO
17
18 11 Udo Offermann
h2. Prerequisites
19
20 12 Udo Offermann
The IntelliJ z2-plugin requires a certain project layout. The z2-repositories should be checked out directly beneath the project folder
21
(i.e. as siblings of the .idea folder). You have to checkout at least z2-core (e.g. z2-base.core) and the repository containing the modules
22
you want to work with (let's call it "modules"). If you are using Git you must not necessarily clone z2-base.core and z2-addons etc. - 
23
however if you are using subversion it might be easier to check out the whole trunk making it easier to update the sources with one command.
24
25
The important point is that the project structure should look like this:
26
27
<pre>
28
.../my-project
29
     /modules
30
       /my-module-A
31
         ...
32
       /my-web-app-X
33
         ...
34
       /my-web-app-Y
35
         ...
36
     /z2-base.core
37
      ...
38
</pre>
39
40
Where my-module-A and my-web-app-* are arbitrary z2-modules.
41
42
Note that this is slightly different to the Eclipse approach when working with subversion. In Eclipse it's much easier to checkout a project from subversion into
43
the workspace (note the an Eclipse project is more or less on the same level than an IntelliJ module). So in Eclipse you checkout projects and delete them on demand
44
(after you committed your changes). In IntelliJ you _map_ and _unmap_ modules into the IDE which is similar to the Eclipse-Git approach.
45
46
This means that all checked out repositories automatically belong to the z2 dev-repository. Of course their module remain inactive as long as they are unarmed.
47
48 1 Udo Offermann
h2. Preferences
49
50 8 Udo Offermann
The z2-plugin preferences can be found at Project-Settings -> z2-Environment. The typically development settings like host-name=localhost, port=8080, user=z* and password=z are set by default.
51
Once a z2-environment is up and running the settings can be verified using "Test connection...".
52
53
The field "z2 Home Directory" must point to the folder where the z2-core is installed. This location can be chosen by the file picker dialog or by "Search z2-Home" button.
54
The latter one searches the directory structure within your IntelliJ project folder for a valid z2-Home location. The z2-Home location defines which z2-environment will be started when 
55
launching the z2-environment from the IDE.
56
57 1 Udo Offermann
h2. Launching
58
59 9 Udo Offermann
Once the z2-Home is defined, the z2-environment can be launched from the IDE: Select *Tools* -> *Launch z2-environment...*.
60
This will start the z2-environment on your local machine using your local OS JDK (not the one defined in IntelliJ). Beside
61
the standard z2-Swing window the server output is logged inside an IntelliJ tool window (see *View* -> *Tool Windows* -> *z2-environment*).
62
Logs from the z2-server are displayed in red text color while output from the z2-plugin is displayed in blue.
63 1 Udo Offermann
64 14 Udo Offermann
h2. Managing z2-modules
65
66 15 Udo Offermann
Once the project is setup, the required z2-repositories are checked out and the z2-Home setting is defined in the preferences, 
67
you can create and delete z2-modules on demand. The z2-plugin provides the "Manage z2-module" icon in the IntelliJ toolbar.
68
It opens a dialog containing a check-box tree with the repositories at the first level and the modules on the second level
69
(additional modules can also occur on the first level). 
70
71
Now you can select the modules you want to work on and - of course - unselect those you want to get rid off. 
72
Newly selected modules are displayed in green with a prefixed '+' while modules which are about to be removed are displayed in 
73
red with a prefixed '-'. When pressing ok the newly selected z2-modules become visible in the IDE as IntelliJ modules while
74
unselected modules are removed from the IDE. Please note that this is just a mapping step, no files and directories are physically
75
deleted - with one exception: If you open a z2-module in the IDE, work with it and remove it later on, the initial arming state
76
is restored. So if you open an unarmed z2-module and arm it while working with it while automatically be unarmed when you remove
77
the module from the IDE by deleting the corresponding LOCAL file.
78
79
When open z2-modules using this approach the correct source folders are added automatically.
80
81
82 14 Udo Offermann
83 7 Udo Offermann
h2. z2-sync
84 6 Udo Offermann
85 7 Udo Offermann
h2. z2 dependency resolution
86 6 Udo Offermann
87 7 Udo Offermann
h2. Arming modules
88 6 Udo Offermann
89 7 Udo Offermann
h2. z2-Module wizard
90 6 Udo Offermann
91 7 Udo Offermann
h2. z2-Properties editor