95 | | [[Image(2.jpg)]] |
96 | | |
97 | | Before running or building the project, several local parameters should be set. |
98 | | This is done via a standard way of maven profiles, so you should open/create a file named '''settings.xml''' in the '''.m2''' directory in your main OS user profile directory. |
| 95 | [[Image(eclipse_ide_choose_jdk.png)]] |
| 96 | |
| 97 | == Building the project == |
| 98 | |
| 99 | Before running or building the project, several local parameters should be set depeding how to run the project, the paths, which database to use, etc. |
| 100 | |
| 101 | This is done via a standard way of maven profiles, so you should open/create a file named '''settings.xml''' in the '''.m2''' directory in your user profile directory. |
147 | | Contact the developer team for parameter values for the development test servers. Otherwise install PostgreSQL, setup a username, password and create a UTF-8 database, and set the '''hbm2ddlauto''' parameter to '''update''', and the database schema structure will be automatically created. |
148 | | |
149 | | With hbm2ddlauto=update used, enables updates to the database schema structure when the Java source code of the Entities changes, otherwise the default value of this parameter is '''validate'''. |
150 | | |
151 | | More precisely this parameter designates that the database will be scanned and if the source code has structural changes, such changes will be automatically implemented in the database schema. This should be only used by intenet and it should not be left as default as unwanted changes could be commited to the database by mistake without a warning. So set this to update only when you are about to make database structure changes and then change it back to validate, which only checks that the source and the schema correspond. |
152 | | |
153 | | If you use another database system then hibernate.dialect should be changed, '''but this is not tested'''. |
154 | | |
155 | | '''CAS (CENTRAL AUTHENTICATION SERVICE)''' |
| 150 | Contact the developer team for parameter values for the development test servers and example content of this file. |
| 151 | |
| 152 | Otherwise, if you are not part of the official developer team - you can do it yourself, but harder. Install PostgreSQL, setup a username, password and create a new empty UTF-8 database, and set the '''hbm2ddlauto''' parameter to '''update''', and the database schema structure will be automatically created. WARNING: if you create the database yourself, you will need some seed data in some tables to be able to use the application. Check ModelConstants.java for some of the special codes of entities that you will need to have and cope with this :) |
| 153 | |
| 154 | When hbm2ddlauto=update is used, it enables updates to the database schema structure when the Java source code of the Entities changes, otherwise the default value of this parameter is '''validate'''. |
| 155 | |
| 156 | More precisely this parameter designates that the database will be scanned and if the source code has structural changes, such changes will be automatically implemented in the database schema. This should be only used by intent and it should not be left as default as unwanted changes could be commited to the database by mistake without a warning. |
| 157 | |
| 158 | '''So set this to UPDATE only when you are about to make database structure changes and then change it back to VALIDATE, which only checks that the source and the schema correspond.''' |
| 159 | |
| 160 | If you use another database system, then hibernate.dialect should be changed, '''but this is not tested'''. |
| 161 | |
| 162 | === CAS (CENTRAL AUTHENTICATION SERVICE) === |
| 163 | |
| 164 | The application uses CAS for login authentication, so you need to set up a test service. |
165 | | '''Start the application from Eclipse'''[[BR]] |
166 | | |
167 | | Run -> Run Configurations , then in the maven section right click then New, use any Name you like (for example '''start dossier'''), Base Directory -> ${workspace_loc:/projectname} , Goals -> '''clean jetty:run''' |
168 | | In the parameter add one with the name of '''env''', and value of '''develop'''. |
169 | | |
170 | | Repeat this again all the same but with a Name '''stop app''' and Goals '''jetty:stop''' |
| 174 | === Running the application from Eclipse === |
| 175 | |
| 176 | Run -> Run Configurations , then in the maven section right click then New, use any Name you like (for example '''start isis'''), Base Directory -> ${workspace_loc:/isis} , Goals -> '''clean jetty:run''' |
| 177 | |
| 178 | In the profiles put the name of the profile (the id of the profile) that you have put in .m2/settings.xml. |
| 179 | |
| 180 | Usually you will have separate profiles for testing database, profile for official database, etc. This is where you choose how will the application run and where it will connect to. |
| 181 | |
| 182 | Repeat this again for another configuration for stopping the app - all the same but with a Name '''stop isis''' and Goals '''jetty:stop''' |
177 | | Note that on the first run, Maven will try to download all required libraries for development from the Internet and setup the library paths for all dependencies. This can take a very long time if your connection is not fast. |
178 | | On subsequent runs, this will not happed, but Maven tries to check for changes. If you want to speed up the process, after everything has been run without problems at least once, you should check the parameter '''Offline''' in the Maven parameters for that run configuration. |
179 | | |
180 | | The system listens on port 8081 (Jetty on 8081) |
181 | | http://localhost:8081/ |
| 189 | Note that on the first run, Maven will try to download all required libraries for runtime from the Internet and setup the library paths for all dependencies. This can take a very long time if your connection is not fast. On subsequent runs, this will not happen, as Maven only checks for updates. If you want to speed up the process, after everything has been run without problems at least once, you should check the parameter '''Offline''' in the Maven parameters for that run configuration. |
| 190 | |
| 191 | If everything is OK you will see in the console log that the system listens on port 8081 (Jetty on 8081) |
| 192 | |
| 193 | So open |
| 194 | http://localhost:8081/upisi |
| 195 | in your browser |