5. SCM
‣ Code evolve in time
‣ Source code is shared
‣ Source Code Management system host code + versioning
6. SCM
‣ Code evolve in time
‣ Source code is shared
‣ Source Code Management system host code + versioning
‣ Many solutions exist: CVS, SVN, GIT, SourceSafe...
7. SCM
‣ Code evolve in time
‣ Source code is shared
‣ Source Code Management system host code + versioning
‣ Many solutions exist: CVS, SVN, GIT, SourceSafe...
‣ SVN is a client/server solution
8. SCM
‣ Code evolve in time
‣ Source code is shared
‣ Source Code Management system host code + versioning
‣ Many solutions exist: CVS, SVN, GIT, SourceSafe...
‣ SVN is a client/server solution
‣ Server can be in-house
9. SCM
‣ Code evolve in time
‣ Source code is shared
‣ Source Code Management system host code + versioning
‣ Many solutions exist: CVS, SVN, GIT, SourceSafe...
‣ SVN is a client/server solution
‣ Server can be in-house
‣ Free solution for open source
http://code.google.com/hosting/
12. Create Project
Project name: geop-demo
Project summary: A demo project for GEOP course
Project description: geop demo code
Version control system: Subversion
Source code license: New BSD License
Use a separate content license:
license...
Project labels:
Create project...
Project name must start with a lowercase letter, followed by lowercase letters, digits, and dashes, with no
spaces. This will be part of your project's URL and cannot be changed later.
Project summary will be shown whenever the project's name is displayed.
Project description is the main content of your project's home page. You may use wiki markup.
Version control system selects the type of your project's repository. Learn more.
Licenses determine how others may build upon your work. Code and documentation may be distributed under
separate licenses.
Project labels help classify your project so others can easily find it or browse projects by label.
15. Command-line access
If you plan to make changes, use this command to check out the code as yourself using HTTPS:
# Project members authenticate over HTTPS to allow committing changes.
svn checkout https://geop-demo.googlecode.com/svn/trunk/ geop-demo --username alexandre.masselot
When prompted, enter your generated googlecode.com password.
Use this command to anonymously check out the latest project source code:
# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://geop-demo.googlecode.com/svn/trunk/ geop-demo-read-only
GUI and IDE access
This project's Subversion repository may be accessed using many different client programs and plug-ins. See your client's
documentation for more information.
33. Sharing an existing project to your google code account
‣ Perspective java
‣ project right-click
- > team
- > share project
- use specifier folder name
trunk/your.project.name
34. ‣ username & password
from google page
‣ save password
check box
35. Commit the project
‣ At this stage, the project is only created on the remote server
- check with SVN repository exploring perspective
- or browse source code from google page
36. Commit the project
‣ At this stage, the project is only created on the remote server
- check with SVN repository exploring perspective
- or browse source code from google page
‣ Mark generated file & folder to be ignored from svn
- e.g. target/
37. Commit the project
‣ At this stage, the project is only created on the remote server
- check with SVN repository exploring perspective
- or browse source code from google page
‣ Mark generated file & folder to be ignored from svn
- e.g. target/
‣ Right-click > team > add to svn:ignore
47. SVN: flow use
‣ Checkout out or share an existing project to contribute
48. SVN: flow use
‣ Checkout out or share an existing project to contribute
‣ Commit changes to the repository
49. SVN: flow use
‣ Checkout out or share an existing project to contribute
‣ Commit changes to the repository
‣ Update changes from repository
50. SVN: flow use
‣ Checkout out or share an existing project to contribute
‣ Commit changes to the repository
‣ Update changes from repository
‣ Eclipse:
- select project
- > right-click
- > team
- > Synchronize with repository
- commit/update/manage conflict
51. SVN: flow use (cont’d)
‣ Command line
svn status
svn update
svn commit -m “my message to describe changes”
54. SVN is more
‣ History
‣ See contribution from others
55. SVN is more
‣ History
‣ See contribution from others
‣ Tag / branch versions
56. SVN is more
‣ History
‣ See contribution from others
‣ Tag / branch versions
‣ Conflict resolution
57. SVN is more
‣ History
‣ See contribution from others
‣ Tag / branch versions
‣ Conflict resolution
‣ Continuous integration / testing on dedicated server
58. SVN is more
‣ History
‣ See contribution from others
‣ Tag / branch versions
‣ Conflict resolution
‣ Continuous integration / testing on dedicated server
‣ File locking :(
59. SVN is more
‣ History
‣ See contribution from others
‣ Tag / branch versions
‣ Conflict resolution
‣ Continuous integration / testing on dedicated server
‣ File locking :(
‣ Integration with tickets
60. SVN is more
‣ History
‣ See contribution from others
‣ Tag / branch versions
‣ Conflict resolution
‣ Continuous integration / testing on dedicated server
‣ File locking :(
‣ Integration with tickets
‣ Windows integration: http://tortoisesvn.tigris.org/
63. Grails: including a third parties libraries
‣ Library is available as a jar (export ➙ .jar)
64. Grails: including a third parties libraries
‣ Library is available as a jar (export ➙ .jar)
‣ Copy jar in lib/
65. Grails: including a third parties libraries
‣ Library is available as a jar (export ➙ .jar)
‣ Copy jar in lib/
‣ For eclipse completion
- right-click
- build path
- add to build path
66. Get is forms for ac (00:44:01.975)
Q70Z44
List
>Q70Z44-1
MQKHSPGPPALALLSQSLLTTGNGDTLIINCPGFGQHRVDPAAFQAVFDRKAIGPVTNYS
VATHVNISFTLSAIWNCYSRIHTFNCHHARPWHNQFVQWNPDECGGIKKSGMATENLWLS
DVFIEESVDQTPAGLMASMSIVKATSNTISQCGWSASANWTPSISPSMDRARAWRRMSRS
FQIHHRTSFRTRREWVLLGIQKRTIKVTVATNQYEQAIFHVAIRRRCRPSPYVVNFLVPS
GILIAIDALSFYLPLESGNCAPFKMTVLLGYSVFLLMMNDLLPATSTSSHASLVAPLALM
QTPLPAGVYFALCLSLMVGSLLETIFITHLLHVATTQPLPLPRWLHSLLLHCTGQGRCCP
TAPQKGNKGPGLTPTHLPGVKEPEVSAGQMPGPGEAELTGGSEWTRAQREHEAQKQHSVE
LWVQFSHAMDALLFRLYLLFMASSIITVICLWNT
>Q70Z44-2
MASMSIVKATSNTISQCGWSASANWTPSISPSMDRAERSPSALSPTQVAIRRRCRPSPYV
VNFLVPSGILIAIDALSFYLPLESGNCAPFKMTVLLGYSVFLLMMNDLLPATSTSSHASL
VRPHPSRDQKRGVYFALCLSLMVGSLLETIFITHLLHVATTQPLPLPRWLHSLLLHCTGQ
GRCCPTAPQKGNKGPGLTPTHLPGVKEPEVSAGQMPGPGEAELTGGSEWTRAQREHEAQK
QHSVELWVQFSHAMDALLFRLYLLFMASSIITVICLWNT
67. Isoforms_v1 -> v5 same controller
different views (gsp)
for different rendering interaction
68. Isoforms_v1 -> v5 same controller
different views (gsp)
for different rendering interaction
76. isoforms_v2: add index.gsp
<html>
<body>
<h1>Isoform list application</h1>
<h2>Get is forms for ac (${String.format('%tH:%<tM:
%<tS.%<tL', new Date())})</h2>
<g:form action="list">
<g:textField name="ac" value="${params.ac}" />
<g:submitButton name="submit" />
</g:form>
</body>
</html>
78. isoform_v3: use template
‣ _form.gsp
<h2>Get is forms for ac (${String.format('%tH:%<tM:%<tS.
%<tL', new Date())})</h2>
<g:form action="list">
<g:textField name="ac" value="${params.ac}" />
<g:submitButton name="submit" />
</g:form>
79. isoform_v3: use template
‣ _form.gsp
<h2>Get is forms for ac (${String.format('%tH:%<tM:%<tS.
%<tL', new Date())})</h2>
<g:form action="list">
<g:textField name="ac" value="${params.ac}" />
<g:submitButton name="submit" />
</g:form>
‣ In index.gsp and list.gsp
<g:render template="form" />
80. isoform_v3: use template
‣ _form.gsp
<h2>Get is forms for ac (${String.format('%tH:%<tM:%<tS.
%<tL', new Date())})</h2>
<g:form action="list">
<g:textField name="ac" value="${params.ac}" />
<g:submitButton name="submit" />
</g:form>
‣ In index.gsp and list.gsp
<g:render template="form" />
85. Ajax: asynchronous load
web browser
Q70Z44 submit server
List isoform/list
>Q70Z44-1
MQKHSPGPPALALLSQSLLTTGNGDTLIINCPGFGQHRVDPAAFQAVFDRKAIGPVTNYS
VATHVNISFTLSAIWNCYSRIHTFNCHHARPWHNQFVQWNPDECGGIKKSGMATENLWLS
DVFIEESVDQTPAGLMASMSIVKATSNTISQCGWSASANWTPSISPSMDRARAWRRMSRS
FQIHHRTSFRTRREWVLLGIQKRTIKVTVATNQYEQAIFHVAIRRRCRPSPYVVNFLVPS
GILIAIDALSFYLPLESGNCAPFKMTVLLGYSVFLLMMNDLLPATSTSSHASLVAPLALM
QTPLPAGVYFALCLSLMVGSLLETIFITHLLHVATTQPLPLPRWLHSLLLHCTGQGRCCP
TAPQKGNKGPGLTPTHLPGVKEPEVSAGQMPGPGEAELTGGSEWTRAQREHEAQKQHSVE
LWVQFSHAMDALLFRLYLLFMASSIITVICLWNT
>Q70Z44-2
MASMSIVKATSNTISQCGWSASANWTPSISPSMDRAERSPSALSPTQVAIRRRCRPSPYV
VNFLVPSGILIAIDALSFYLPLESGNCAPFKMTVLLGYSVFLLMMNDLLPATSTSSHASL
VRPHPSRDQKRGVYFALCLSLMVGSLLETIFITHLLHVATTQPLPLPRWLHSLLLHCTGQ
GRCCPTAPQKGNKGPGLTPTHLPGVKEPEVSAGQMPGPGEAELTGGSEWTRAQREHEAQK
QHSVELWVQFSHAMDALLFRLYLLFMASSIITVICLWNT
47
86. isoform_v4/index.gsp
<html>
<head>
<g:javascript library="prototype" />
</head>
<body>
<h2>Get is forms for ac (${String.format('%tH:%<tM:
%<tS.%<tL', new Date())})</h2>
<!-- g:formRemote stands for an ajax form -->
<g:formRemote name="listForm" url="[action:'list']"
update="isoforms-list">
<g:textField name="ac" value="${params.ac}" />
<g:submitButton name="submit" />
</g:formRemote>
<!-- the target element of the form -->
<div id="isoforms-list"/>
</body>
</html>
93. Person domain
‣ Create the database entry + bean class
grails create-domain-class Person
project > right-click > grails > create-domain-class
Person
94. Person domain
‣ Create the database entry + bean class
grails create-domain-class Person
project > right-click > grails > create-domain-class
Person
‣ Files created:
./grails-app/domain/eop/lec10/twitter/Person.groovy
./test/unit/eop/lec10/twitter/PersonTests.groovy
113. Person.groovy
class Person {
String username
String firstName
String lastName
String email
Date dateCreated
//firstName is compulsory
//email field has an email format
//username cannot be null, is unique and is between 6
and 20 characters
static constraints = {
firstName(blank:false)
email(email:true, blank:false)
username(blank:false, unique:true,
matches:/w{6,20}/)
}
}
Editor's Notes
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
for non-Cuban...\n
for non-Cuban...\n
for non-Cuban...\n
for non-Cuban...\n
for non-Cuban...\n
for non-Cuban...\n
\n
we could use other SCM, but svn is more evolved than cvs, widely used, offered by google code, integrated in eclipse or on command line\n
\n
\n
\n
\n
no trunk/\nacceptpermently\n
no trunk/\nacceptpermently\n
no trunk/\nacceptpermently\n
no trunk/\nacceptpermently\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
as soon as test work, for example\nseveral time a day\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
eop 6-solutions -> jar with build.xml\n
eop 6-solutions -> jar with build.xml\n
eop 6-solutions -> jar with build.xml\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
_ in file name, but not in template tag attribute\n
_ in file name, but not in template tag attribute\n
_ in file name, but not in template tag attribute\n
Although the form part does not change\nLimited here for the volume, but can be much more heavy\n
\n
Asynchronous javascript and xml\n
Asynchronous javascript and xml\n
Asynchronous javascript and xml\n
Asynchronous javascript and xml\n
Asynchronous javascript and xml\n
\n
\n
\n
test=test\ndevelopment=run-app\nproduction=packaged and deployed\n
We can change, if you have access to the web during development\n
\n
\n
\n
\n
def uniprotXmlService in controller will point directly to this bean\n
to change from proteins problems...\n
problem is simple yet illustrates plenty of aspects of a web application\ngrails: twitter in 40 minutes springsource webinar\n
\n
\n
\n
\n
\n
\n
more fields with whatever classes are possible are possible\n
but not very useful\nindeed, you can make SQL call\n(memory DB by default, but we&#x2019;ll see how to put on file, postgres, mySql...)\n
list, add, delete, update...\n
\n
we&#x2019;ll see how to generate explicitly all of them later in order to be modified\n
we&#x2019;ll see how to generate explicitly all of them later in order to be modified\n
we&#x2019;ll see how to generate explicitly all of them later in order to be modified\n
we&#x2019;ll see how to generate explicitly all of them later in order to be modified\n
\n
\n
\n
\n
unique username with given characters\nemail valid\nnon empty first name\n
more fields with whatever classes are possible are possible\n
Next time: foreign key (Person <-> Person <-> Message)\nCriteria\ndatabase persistence\n