Changes between Version 96 and Version 97 of DeveloperInstructions


Ignore:
Timestamp:
07/16/14 11:44:25 (10 years ago)
Author:
Vangel Ajanovski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperInstructions

    v96 v97  
    9393If this is not the one you installed for our purpose, delete that one or add new one that points to the JDK that you installed (and not JRE) similar to the image below
    9494
    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
     99Before 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
     101This 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.
    99102If you don't know where this is - check Eclipse preferences - maven - user settings.
    100103
     
    145148You can create several profiles in this file, with different id and activation parameters, so that you can use choose the one you want on running the application, or packaging for deployment.
    146149
    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)'''
     150Contact the developer team for parameter values for the development test servers and example content of this file.
     151
     152Otherwise, 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
     154When 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
     156More 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
     160If you use another database system, then hibernate.dialect should be changed, '''but this is not tested'''.
     161
     162=== CAS (CENTRAL AUTHENTICATION SERVICE) ===
     163
     164The application uses CAS for login authentication, so you need to set up a test service.
    156165
    157166If you already have a CAS server, change the paths in the settings.xml file.
     
    159168
    160169- Download any of the 3.5.x CAS versions  from [http://downloads.jasig.org/cas/] and unpack it.
    161 - Find the file named CAS-server-webapp-versionnumber.war and copy it to the main folder of the Eclipse project and rename it to cas.war
     170- Find the included file named CAS-server-webapp-someversionnumber.war and copy it to the main folder of the isis project and rename it to cas.war
    162171
    163172This will enable a test login to the system, whereas the username is anything you need, and the password is the same as the username.
    164173
    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
     176Run -> 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
     178In the profiles put the name of the profile (the id of the profile) that you have put in .m2/settings.xml.
     179
     180Usually 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
     182Repeat this again for another configuration for stopping the app - all the same but with a Name '''stop isis''' and Goals '''jetty:stop'''
    171183
    172184It should look like this:[[BR]]
     
    175187Click on Run and the application will begin to build.
    176188
    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/
     189Note 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
     191If everything is OK you will see in the console log that the system listens on port 8081 (Jetty on 8081)
     192
     193So open
     194http://localhost:8081/upisi
     195in your browser
    182196
    183197'''Note:'''