Using the Corporate Geographic Data Model with Subversion
-
Upload
debbie-wilson -
Category
Self Improvement
-
view
895 -
download
0
description
Transcript of Using the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with Subversion
Debbie Wilson
Senior Geographic Information Architect
16th January 2014
Version Control – Configuration Management
• Version control is the management of changes to resources.• OS Information Models are concurrently developed by a diverse
team• Need for formal management of change that supports:
• Concurrent editing (on-site/off-site environments)• Track changes• Roll-back changes• Create snapshots of individual model components (e.g.
releases or baselines)• Subversion is an open-source software for version control • Alternates are GitHub but only Subversion is supported by
Enterprise Architect
Version Controlling – Configuration Management
Further Reading:• Several internal resources for version control developed by IS
Software Configuration Management (SCM):• Subversion Quick Reference Guide
IS Subversion Training
Using the CGDM with Subversion
There are 4 steps required to set up the Corporate Geographic Data Model for use with Subversion:
1. Install Subversion Clients (complete)
2. Checkout local version of UML repositories
3. Create a local EAP file and configure version control settings
4. Get Data Model package(s)
5. Editing version controlled packages
6. Creating version controlled packages
Step 1: Install Subversion Clients
• Two clients are required for using and managing version controlled resources within Subversion:• Collabnet Subversion Command Line Client v1.7• Tortoise Subversion client v1.7
NOTE: The latest version of both Subversion clients is v1.8. However, this does not currently work with the public INSPIRE UML repository. As it forces a requirement to have user credentials which is not required in v1.7.
Accessing the repository without SVN client
• You can access as a read-only user without dedicated SVN clients
• All you need is a web browser and user credentials
http://svn/corp_geo_data_model/
What is contained within the repository?
• The Corporate Geographic Data Model repository has the standard subversion repository structure:
Subversion directories
• Trunk• This is directory containing the resources that are used for
the main line of development• Tags
• This directory contains folders that represent snapshots of the resources that have been tagged as notable revisions such as releases
• Branches• Branches are used when you are asked to “tweak” the
resource to meet the requirements of a specific user • But their requirements are not needed as part of the core
resource
Contents of the CGDM Trunk
Information Models:
• EA XMI files containing model elements
• Separated into 3 directories:
• Products
• Systems: MRDP, GDMS etc.
• Services: (future)
• Contains set of pre-defined model structures
Contents of the CGDM Trunk
Resources
• Contains supporting tools for modelling and creating schemas
• UML Profiles
• Document Templates
• MDA Transformations
• ShapeChange
Contents of the CGDM Trunk
schemas
• This directory shall contain the various implementation schemas for products, systems, services:
• GML schemas
• Ontologies
• Dictionaries/vocabularies
• DDLs
Contents of the CGDM Trunk
The CGDM is not limited to these resources. Can been extended. We all have full right privileges so anyone can
create new content.
Step 2: Checkout local version of repository
• The Corporate Geographic Data Model contains only the UML models created and managed by Ordnance Survey
• But Information models are built upon international standards developed by ISO TC211, OGC and INSPIRE Directive
• Therefore several UML repositories must be checked out to use the Corporate Geographic Data Model:
1. Corporate Geographic Data Model: http://svn/corp_geo_data_model/
2. ISO TC211: https://inspire-twg.jrc.ec.europa.eu/svn/iso or https://www.seegrid.csiro.au/mirrors/iso-harmonized-model/
3. INSPIRE: https://inspire-twg.jrc.ec.europa.eu/svn/inspire-model/branches/public
Step 2: Checkout Corporate Geographic Data Model
1. Create a directory to contain the UML repositories (e.g. C:\UML)
2. Open a cmd dialog window and set directory to be your UML repository
3. Use the subversion command line svn checkout to download a local copy of the Corporate Geographic Data Model
• You will be required to log in using your windows credentials
NOTE: this should only be required once
Step 2: Checkout Corporate Geographic Data Model
Step 2: Checkout INSPIRE and ISO TC211 repositories
INSPIRE repository
• You may get this message
• Accept the certificate permanently by typing the 'p' and press return.
Step 2: Checkout ISO TC 211and INSPIRE repositories
ISO TC 211 UML repository• Can check out ISO repository using Tortoise SVN client rather
than the command line client as don’t need to edit it or accept any certificates
• Within your UML repository directory in Windows Explorer right-click and select SVN Checkout…
TortoiseSVN is not a program you access from Start Menu. It’s
added a set of SVN tools to Windows Explorer
Step 2: Checkout ISO TC 211and INSPIRE repositories
• In Checkout dialog type URL for ISO TC211 UML Repository (can choose either INSPIRE or SEEGrid ISO mirror both same)
• Name the destination directory iso
Step 3: Create a local EAP file and configure version control settings • We will no longer be using a single corporate EAP file• Instead each of us shall use a local enterprise architect file
which shall either contain:• Full Corporate Geographic Data Model• Subset view of the Corporate Geographic Data Model (e.g.
Products only or MRDP)• User defined project made up of one or more packages from
model
What the benefits of moving to SVN?
1. Version controlled• Can track changes – know who made which change• Fully maintained history of all changes• Roll back any changes that may been made in error• Improve process for managing development/release – no
longer maintain archive packages in model
2. Can Work offline/off-site more effectively• Check out packages to work on when offline • On VPN - EA accesses local repository so responds as if in
office
3. Integrates with other tools• JIRA/Fisheye – trace changes to back tasks/bugs• GitHub – supports collaboration with Subversion so can
integrate with IS better in future
Step 3: Create a local EAP file and configure version control settings
1. Open Enterprise Architect and create a new project and save locally in preferred directory
2. Cancel Model Wizard dialog as importing existing models from repository
3. Right-click on the Root Model in Project Browser, select Package Control Version Control Settings
Insert protective marking - see QSP 032
Step 3: Configure version control settings
• In the Version Control Settings dialog need to configure subversion settings for the three UML repositories:• Corporate Geographic Data Model• ISO TC211 • INSPIRE
Step 3: Configure version control settings
1. Tick This model is private
2. In configuration details assign a unique id for the Corporate Geographic Data Model: CGDM
3. Select Subversion as type
4. Set working copy path to trunk directory of checked out repository: e.g. C:\UML\corp_geo_data_model\trunk
5. Set Subversion Exe Path to location of the Collabnet Subversion Client: e.g. C:\Program Files\CollabNet\Subversion Client\svn.exe
6. Save
NOTE: this only needs to be set once it will now be remembered.
Step 3: Configure version control settings
Repeat for ISO TC211 and INSPIRE
1. Select New
2. In configuration details assign the unique id: isotc211
3. Set type as Subversion
4. Set working copy path to trunk directory of checked out repository: e.g. C:\UML\iso
5. Save
Step 3: Configure version control settings
1. Select New
2. In configuration details assign the unique id: inspire-model
3. Set type as Subversion
4. Set working copy path to trunk directory of checked out repository: e.g. C:\UML\public\approved\latest
5. Save. You are now accessing models from 3 UML repositories
6. Close
Use this approach to add more repositories as required if working on systems (e.g. IS/1Spatial for MRDP)
Step 4: Get Package and import models
• Once the version control settings are configured you can import either:
1. Pre-defined model (focus of this section)
2. Set up your own model and import individual version controlled models from the Corporate Geographic Data Model, Foundation Schema or other external schema as required
Step 4: Import Pre-Defined Model
• Within the Corporate Geographic Data Model several pre-defined models have been configured:
1. Corporate Geographic Data Model: Provides a consolidated view of all models developed within OS for products, systems and services
2. Products: Contains the logical and implementation models for products
3. Systems: Contains |the various models (data models, business rules, requirements, use cases, data flows) for data maintenance and productions systems
Step 4: Import Pre-Defined Model
• Right click on the root Model package and select Package Control Get Package
Step 4: Get Package and import models
• In the Get Shared File dialog select CGDM from the Select a Version Control Configuration drop down list:
Step 4: Get Package and import models • Select one of the root model packages:
Step 4: Get Package and import models • Chose whether to import model as Root Model or under
selected package
• As we are importing a pre-defined model structure select Yes
NOTE: If you are creating a user-defined model structure you would select No - this will give you the option to move packages around as
you build the structure
Step 4: Get Package and import models
• Final Step is to import all models• Right-click on a package, select Package Control Get all
Latest Import changed files only
NOTE: This will take a long time the first time –
good time for a brew!
Corporate Geographic Data Model
• You have successfully set up Enterprise Architect to work with version controlled models
Importing INSPIRE/ISO TC211 models
Issue 1: Inconsistent use of Foundation Models• In past we have manually imported snapshots of the INSPIRE
and ISO models• While these models are pretty stable they do change• Required us to regularly manually check for changes and then
re-import models• Only parts of the ISO TC211 data modelling packages imported• Some aspects of the ISO TC211 models may have been
deleted – THIS IS A BIG NO NO!• INSPIRE models are imported on a package by package basis
as required. GCM containing common models not included!
Importing INSPIRE/ISO TC211 models
Issue 2: Maintenance of EA identifiers• Can run into issues when sharing models that use manual
imports of foundation models: • Foundation Model elements may have different EA
identifiers so “disappear” from the model• By using formal models within repository ensure that same EA
identifiers are used• Ensure our models can be integrated with INSPIRE/OGC/ISO
models by users
Now – we shall all use the same Foundation Schema to ensure modelling consistency
Editing version controlled packages
• Lots of packages now have lock icons• Not allowed to make any changes to any element in the
package• To make edits to a model you need to checkout the package
from the version control repository
Right-click on package to edit Package Control Check Out
Editing version controlled packages
• When you check out a package, EA checks against the central repository whether the version is the model is the latest
• If it is the latest version select Accept current package
NOTE: EA only supports exclusive check out• i.e. package is locked to one user only• Can only edit package once its been checked back in
Editing version controlled packages
• Select a package to edit – make sure its not the same package as someone else
• Test that you can move items on diagram and add/edit classes
Editing version controlled packages
• To check in edits, Right-click on the package Package Control Check In
• Before the check-in is committed you will be prompted to add a Check-in comment
• This should be short description
of edits made (+ JIRA task id)
Insert protective marking - see QSP 032
Editing version controlled packages
• By adding comments it makes it easier to understand what changes occurred by whom and when
• Allows traceability when viewing history
Viewing history
• You can view history of changes to a package either within EA or using TortoiseSVN
• To view history in EA, select package Right click Package Control File History
Viewing history
• You can view history of changes to a package either within EA or using TortoiseSVN
• To view history in EA, select package Right click Package Control File History
Viewing history
• Using TortoiseSVN, select xmi representing package Right-click TortoiseSVN Show log
Editing version controlled packages
• There may be times when you check out a package but make no edits or do not want the edits to be committed
• EA allows you to Undo Check Out
• Undo Check Out for the package you checked out earlier
Adding packages to Subversion
• We will need to continually add new model packages to Subversion • Restructure large models for easier management• May need to move packages around• Create new models
• Thankfully this is relatively easy and involves 3 steps:
1. Export package as XMI 1.1 and save to respective directory in your local SVN directory
2. Add the file to the central repository and commit
3. Delete exported package from model and Get Package from repository
Adding packages to Subversion
Step 1: Export Package as XMI 1.1 and save to SVN • Right-click on package Select Import/Export Export to
Package to XML…• Export as XMI 1.1
Adding packages to Subversion
Step 2: Add file to central repository and commit• Navigate to output directory in Window Explorer• Select exported XMI file Right-click TortoiseSVN Add
• Commit file to central SVN Repository
Adding packages to Subversion
Step 3: Replace original package with version controlled package• Delete the exported package from the Project Browser
NOTE: If the package is contained within another package may need to check-out parent package, if version controlled• Right-click on parent package Package Control Get
Package• Select the CGDM• Select the exported XMI
file from list• Check in parent package