Getting Started from Real Life case Precondition First we assume

Getting Started from Real Life case
Precondition
First we assume you can install jdk 1.7 and maven 3.0 in your local machine.
Secondly, you are assigned to the develop of one app and you have a set of
requirements (for example new open call). We will mock the case of an developer
implemented T442-1: Transport Demand App.
Steps
1.-Architectural decisision
After reading requirements and talk with customer, I have to consider different
scenerios:
Has my app independ UI or should be integrated within fispace frontend?
Does my app connect to other app or just with fispace?
Is my app part of a business process or it is just an agent which use and
already define business process?
In our example, Transport Demand App, we are considering UI part of fispace
frontend. My app connects to FIspace and to other App, Logistic Planning App for the
req APP442-1_REQ8. Finally, Transport Demand App is part of a business.
Finally, we take a pen and paper and draw the architecture proposal
2.- Create project structure using provided archetype by SDK
Creating a project structure is a monotonous activities and value less activity for the
customer. Therefore, FIspace Studio will provide some utilities in order to
automatizate as much as possible the work. In maven, there is a way to generate
project using template. In order to execute by command line the project creation
wizard, we should just execute in a shell:
mvn archetype:generate -DarchetypeCatalog=http://37.131.248.110/repository/archetype-catalog.xml
And I obtain the following shell:
a159628@a159628-Latitude-E6230:~$ mvn archetype:generate -DarchetypeCatalog=http://37.131.248.110/repository/archetypecatalog.xml
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------------------------------------------------------[INFO] Building Maven Stub Project (No POM) 1
[INFO] -----------------------------------------------------------------------[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom --[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:ProductInformationServiceApp-archetype
(ProductInformationServiceApp)
2: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:fispace-app-widget-archetype (fispace-app-widget)
3: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:myApp-archetype (myApp)
4: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp.decoupled.backend:backend-archetype (backend)
5: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp.decoupled:parent-archetype (parent)
6: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp.decoupled.widget:widget-archetype (widget)
7: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp:bus-connector-archetype (bus-connector)
8: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:ProductInformationServiceApp-archetype-archetype
(ProductInformationServiceApp-archetype)
9: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:fispace-app-widget (app-widget)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : Choose archetype:
1: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:ProductInformationServiceApp-archetype
(ProductInformationServiceApp)
2: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:fispace-app-widget-archetype (fispace-app-widget)
3: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:myApp-archetype (myApp)
4: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp.decoupled.backend:backend-archetype (backend)
5: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp.decoupled:parent-archetype (parent)
6: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp.decoupled.widget:widget-archetype (widget)
7: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps.myapp:bus-connector-archetype (bus-connector)
8: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:ProductInformationServiceApp-archetype-archetype
(ProductInformationServiceApp-archetype)
9: http://37.131.248.110/repository/archetype-catalog.xml -> eu.fispace.apps:fispace-app-widget (app-widget)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :
You have 9 options, some of them are submodules of a more general module, like
for example type 5 ( eu.fispace.apps.myapp.decoupled:parent-archetype) which is
composed of two more specific modules type 4
(eu.fispace.apps.myapp.decoupled.backend:backend-archetype) and type 6
(eu.fispace.apps.myapp.decoupled.backend:widget-archetype).
I will go to type 5 which fulfill my architectural necessities.
Press 5, groupId, artifactId... etc and confirm Y
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 5
Downloading: http://mordac.es.atos.net:8080/nexus/content/repositories/FispaceThirdparty/eu/fispace/apps/myapp/decoupled/parentarchetype/0.1.0-S1352-SNAPSHOT/maven-metadata.xml
Downloading: http://37.131.248.110/repository/eu/fispace/apps/myapp/decoupled/parent-archetype/0.1.0-S1352-SNAPSHOT/maven-
metadata.xml
Downloading: http://mordac.es.atos.net:8080/nexus/content/repositories/Fispace/eu/fispace/apps/myapp/decoupled/parentarchetype/0.1.0-S1352-SNAPSHOT/maven-metadata.xml
Define value for property 'groupId': : eu.fispace.apps.washmachineTransportDemandApp
Define value for property 'artifactId': : washmachineTransportDemandApp
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': eu.fispace.apps.washmachineTransportDemandApp: :
Confirm properties configuration:
groupId: eu.fispace.apps.washmachineTransportDemandApp
artifactId: washmachineTransportDemandApp
version: 1.0-SNAPSHOT
package: eu.fispace.apps.washmachineTransportDemandApp
Y: : y
[INFO] ---------------------------------------------------------------------------[INFO] Using following parameters for creating project from Archetype: parent-archetype:0.1.0-S1352-SNAPSHOT
[INFO] ---------------------------------------------------------------------------[INFO] Parameter: groupId, Value: eu.fispace.apps.washmachineTransportDemandApp
[INFO] Parameter: artifactId, Value: washmachineTransportDemandApp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: eu.fispace.apps.washmachineTransportDemandApp
[INFO] Parameter: packageInPathFormat, Value: eu/fispace/apps/washmachineTransportDemandApp
[INFO] Parameter: package, Value: eu.fispace.apps.washmachineTransportDemandApp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: groupId, Value: eu.fispace.apps.washmachineTransportDemandApp
[INFO] Parameter: artifactId, Value: washmachineTransportDemandApp
[INFO] Parent element not overwritten in /home/a159628/washmachineTransportDemandApp/backend/pom.xml
[INFO] Parent element not overwritten in /home/a159628/washmachineTransportDemandApp/widget/pom.xml
[INFO] project created from Archetype in dir: /home/a159628/washmachineTransportDemandApp
[INFO] -----------------------------------------------------------------------[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------------------------------[INFO] Total time: 8:41.570s
[INFO] Finished at: Mon Feb 10 14:43:38 CET 2014
[INFO] Final Memory: 15M/106M
[INFO] ------------------------------------------------------------------------
3.- Build
So far, we have a project structure compose by a widget and backend. Backend is
responsible to connect to FIspace and widget has capabilities to be deployed in
FIspace frontend by a wirecloud widget.
a159628@a159628-Latitude-E6230:~/washmachineTransportDemandApp$ ls -la
total 20
drwxr-xr-x 4 a159628 a159628 4096 feb 10 14:43 .
drwxr-xr-x 46 a159628 a159628 4096 feb 10 14:43 ..
drwxr-xr-x 3 a159628 a159628 4096 feb 10 14:43 backend
-rw-r--r-- 1 a159628 a159628 763 feb 10 14:43 pom.xml
drwxr-xr-x 3 a159628 a159628 4096 feb 10 14:43 widget
Anyway, I dont trust to this black magic, so I will build the project just in order to know
if compile...
a159628@a159628-Latitude-E6230:~/washmachineTransportDemandApp$ mvn clean install
[INFO] Scanning for projects...
[INFO] -----------------------------------------------------------------------[INFO] Reactor Build Order:
[INFO]
[INFO] fispace-app-decoupled-washmachineTransportDemandApp
[INFO] fispace-app-decoupled-backend
[INFO] fispace-app-decoupled-widget
[INFO]
[INFO] -----------------------------------------------------------------------[INFO] Building fispace-app-decoupled-washmachineTransportDemandApp 1.0-SNAPSHOT
[INFO] -----------------------------------------------------------------------[INFO]
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ washmachineTransportDemandApp --[INFO]
[INFO] --- maven-install-plugin:2.3:install (default-install) @ washmachineTransportDemandApp --[INFO] Installing /home/a159628/washmachineTransportDemandApp/pom.xml to
/home/a159628/.m2/repository/eu/fispace/apps/washmachineTransportDemandApp/washmachineTransportDemandApp/1.0SNAPSHOT/washmachineTransportDemandApp-1.0-SNAPSHOT.pom
[INFO]
[INFO] -----------------------------------------------------------------------[INFO] Building fispace-app-decoupled-backend 1.0-SNAPSHOT
[INFO] -----------------------------------------------------------------------[INFO]
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ backend --[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ backend --[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/a159628/washmachineTransportDemandApp/backend/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ backend --[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/a159628/washmachineTransportDemandApp/backend/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ backend --[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/a159628/washmachineTransportDemandApp/backend/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ backend --[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ backend --[INFO] No tests to run.
[INFO] Surefire report directory: /home/a159628/washmachineTransportDemandApp/backend/target/surefire-reports
------------------------------------------------------TESTS
------------------------------------------------------Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ backend --[INFO] Packaging webapp
[INFO] Assembling webapp [backend] in [/home/a159628/washmachineTransportDemandApp/backend/target/backend-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/a159628/washmachineTransportDemandApp/backend/src/main/webapp]
[INFO] Webapp assembled in [221 msecs]
[INFO] Building war: /home/a159628/washmachineTransportDemandApp/backend/target/backend-1.0-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.3:install (default-install) @ backend --[INFO] Installing /home/a159628/washmachineTransportDemandApp/backend/target/backend-1.0-SNAPSHOT.war to
/home/a159628/.m2/repository/eu/fispace/apps/washmachineTransportDemandApp/backend/backend/1.0-SNAPSHOT/backend-1.0SNAPSHOT.war
[INFO] Installing /home/a159628/washmachineTransportDemandApp/backend/pom.xml to
/home/a159628/.m2/repository/eu/fispace/apps/washmachineTransportDemandApp/backend/backend/1.0-SNAPSHOT/backend-1.0SNAPSHOT.pom
[INFO]
[INFO] -----------------------------------------------------------------------[INFO] Building fispace-app-decoupled-widget 1.0-SNAPSHOT
[INFO] -----------------------------------------------------------------------[INFO]
[INFO] --- maven-clean-plugin:2.3:clean (default-clean) @ widget --[INFO]
[INFO] --- maven-dependency-plugin:2.6:copy (default) @ widget --[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ widget --[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ widget ---
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
[INFO]
No sources to compile
--- maven-resources-plugin:2.3:testResources (default-testResources) @ widget --Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory /home/a159628/washmachineTransportDemandApp/widget/src/test/resources
--- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ widget --No sources to compile
--- maven-surefire-plugin:2.10:test (default-test) @ widget --No tests to run.
Surefire report directory: /home/a159628/washmachineTransportDemandApp/widget/target/surefire-reports
------------------------------------------------------TESTS
------------------------------------------------------Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.3:war (default-war) @ widget --[INFO] Packaging webapp
[INFO] Assembling webapp [widget] in [/home/a159628/washmachineTransportDemandApp/widget/target/widget-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/a159628/washmachineTransportDemandApp/widget/src/main/webapp]
[INFO] Webapp assembled in [116 msecs]
[INFO] Building war: /home/a159628/washmachineTransportDemandApp/widget/target/widget-1.0-SNAPSHOT.war
[INFO]
[INFO] --- maven-antrun-plugin:1.4:run (build-widget) @ widget --project.artifactId
[INFO] Executing tasks
[zip] Building zip: /home/a159628/washmachineTransportDemandApp/widget/target/widget-1.0-SNAPSHOT.wgt
[INFO] Executed tasks
[INFO]
[INFO] --- maven-install-plugin:2.3:install (default-install) @ widget --[INFO] Installing /home/a159628/washmachineTransportDemandApp/widget/target/widget-1.0-SNAPSHOT.war to
/home/a159628/.m2/repository/eu/fispace/apps/washmachineTransportDemandApp/widget/widget/1.0-SNAPSHOT/widget-1.0SNAPSHOT.war
[INFO] Installing /home/a159628/washmachineTransportDemandApp/widget/pom.xml to
/home/a159628/.m2/repository/eu/fispace/apps/washmachineTransportDemandApp/widget/widget/1.0-SNAPSHOT/widget-1.0SNAPSHOT.pom
[INFO] -----------------------------------------------------------------------[INFO] Reactor Summary:
[INFO]
[INFO] fispace-app-decoupled-washmachineTransportDemandApp SUCCESS [0.891s]
[INFO] fispace-app-decoupled-backend ..................... SUCCESS [4.703s]
[INFO] fispace-app-decoupled-widget ...................... SUCCESS [3.358s]
[INFO] -----------------------------------------------------------------------[INFO] BUILD SUCCESS
[INFO] -----------------------------------------------------------------------[INFO] Total time: 9.143s
[INFO] Finished at:
Mon Feb 10 15:56:28 CET 2014
[INFO] Final Memory: 21M/168M
[INFO] ------------------------------------------------------------------------
4.- [Optional] First commit
hg commit -A -m first commit"
hg push
5.- First deployment 5.1.- backend deployment
cd backend
mvn jetty:run
5.2.- frontend deployment
cd widget
mvn jetty:run -Djetty.port=9090
6.- Test First use case browser
http://localhost:9090/widget-launcher
7.- Start customization
mvn eclipse:eclipse