blob: 9aa152bdc4d54c7ad4b03f355cb314a1da6671ae [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Team Support for Logical Model Integration</title>
</head>
<body>
<table width="100%" cellpadding="2" cellspacing="5" border="0">
<tbody>
<tr>
<td bgcolor="#0080c0" valign="top" align="left"> <b><font
face="Arial,Helvetica" color="#ffffff"> Eclipse 3.2 - Library Example</font></b></td>
</tr>
</tbody>
</table>
<h1>Library Example</h1>
<p>Version 3.2 M5</p>
<p>This document describes the library example that illustrates some the the logical
model support that is being added in 3.2. </p>
<h2>Setup</h2>
<p>Here's what you need to do to setup Eclipse to use this example:</p>
<ol>
<li>Download and install Eclipse Milestone 5 (M5) from Eclipse.org</li>
<li>Download and install EMF 2.1 from Eclipse.org</li>
<li>Download the library example plugin from <a href="../../../plugins/library3_2_M5.zip">here</a>.
These plugins are workspace projects so you will need to import them into
a workspace to work with them.</li>
<li>The example depends on the <em>org.eclipse.jface.examples.binding.emf</em>
plugin which is included in the download but is also available from the <em>:pserver:anonymous@dev.eclipse.org:/cvsroot/tools</em>
repository in the <em>org.eclipse.ve.sweet.internal/binding/org.eclipse.jface.examples.binding.emf</em>
directory.</li>
</ol>
<h2>Performing Team&gt;Updates</h2>
<p>Be sure to turn on the Team&gt;CVS&gt;Work In Progress preference for performing
client side merges. Once this is one, all updates should result in a dialog
that previews any updates by showing the affected model objects.</p>
<h2>Libraries, Books and Writers</h2>
<p>The model is persisted in several types of files:</p>
<ul>
<li>*.library files which contain the name of a library and one or more book
copy records which reference a book and indicate the number of copies of the
book the libraries contain.</li>
<li>*.books files which contain one or more books. Each book has several properties
(name, number of pages, etc.) as well as a reference to the book's author.</li>
<li>*.writers files which contain one or more writers. Each writer has properties
(e.g. name) as well as references to one or more books that have been authored
by the writer.</li>
</ul>
<p>The following screen shot shows an example Library.</p>
<p><img height="229" width="306" src="libraryView.png"></p>
<p>Here is the containment relationship of these model elements</p>
<ul>
<li>My.writers: contains "Bob"</li>
<li>My.books: contains "The Life of Bob"</li>
<li>mylib.library: contains copies of the "Life of Bob"</li>
</ul>
<p>The model provider and related classes are found in the <em>org.eclipse.team.examples.library.adapt</em>
plugin.</p>
<p>Here are some example steps that illustrate how to create Libraries, Books
and Writers.</p>
<h3>Part 1: Create a library and share it</h3>
<ul>
<li>Open the Library Management View (Window/Show View&gt;Libraries/Library
Management)</li>
<li>Create a library </li>
<ul>
<li>From context menu of view, create a New/Library.
<ul>
<li>Choose to create it in a new project.</li>
<li>Enter the project name &quot;libraries&quot;.</li>
</ul>
</li>
<li>Name the library
<ul>
<li>Expand Libraries and select Library</li>
<li>Open the Properties view (Window/Show View&gt;Basic/Properties)</li>
<li>Enter the name &quot;Main Library&quot;</li>
</ul>
</li>
<li>Click the view Save button</li>
</ul>
<li> Create a writer named &quot;Bob&quot;
<ul>
<li>From context menu of view, create a New/Writers Catalog: &quot;My.writer&quot;.</li>
<li>Edit the new writer
<ul>
<li>Expand Writers and select Writer</li>
<li>In the Properties view, enter the name &quot;Bob&quot;</li>
</ul>
</li>
<li>Click the view Save button</li>
</ul>
</li>
<li> Create a book
<ul>
<li>From context menu of view, create a New/Book Catalog: &quot;My.books&quot;.
<ul>
<li>Expand Books and select Writer</li>
<li>In the Properties view, enter the title &quot;The Life of Bob&quot;</li>
<li>Choose Bob as the author</li>
<li>Enter values for the other fields</li>
</ul>
</li>
<li>Click the view Save button</li>
</ul>
</li>
<li>Add a book to the library
<ul>
<li>From the context menu of &quot;Main Library&quot;, choose Add Book Copy</li>
<li>Expand &quot;Main Library&quot; and select Copy</li>
<li>In the Properties view, select &quot;The Life of Bob&quot; as the book</li>
<li>Enter 3 as the number of copies</li>
<li>Click the view Save button</li>
</ul>
</li>
<li> Check Resource Mappings
<ul>
<li>Select the writer &quot;Bob&quot; and choose &quot;Show Resource Mappings&quot;
<ul>
<li>You will see the file&quot;My.writers&quot; </li>
</ul>
</li>
<li>Try it on the &quot;Main Library&quot;
<ul>
<li>You will see the file&quot;mylib.library&quot;</li>
</ul>
</li>
</ul>
</li>
<li> Share the project with a CVS repository and commit all the files</li>
</ul>
<h3> Part 2: Create a second library</h3>
<ul>
<li>From context menu of view, create a New/Library.
<ul>
<li>Choose NOT to create it in a new project.</li>
<li>Select the project &quot;libraries&quot; and name the library file &quot;Another.library&quot;.</li>
<li>In the Properties view, name the library &quot;Another Library&quot;</li>
</ul>
</li>
<li> Create a new writers catalog and book catalog named &quot;Anther.writers&quot;
and &quot;Another.books&quot; respectively
<ul>
<li>File in the fields for the writer and book</li>
<li>Add a copy of the book to &quot;Another Library&quot;</li>
<li>Save the view</li>
<li>Commit &quot;Another Library&quot;</li>
</ul>
</li>
</ul>
<h3>Part 3: Parallel Developement</h3>
<ul>
<li>Start up a second workspace
<ul>
<li>Load the libraries project in the second workspace </li>
</ul>
</li>
<ul>
<li>Open the Library Management view</li>
</ul>
<li>Make a change to a Book (e.g. changes the number of pages)
<ul>
<li>Choose Open from the context menu of the book</li>
<li>Changes the number of pages in the editor and Save</li>
<li>Select the book in the view and choose Team.Commit</li>
<li>In the original workspace, select the book and choose update</li>
</ul>
</li>
</ul>
<p><br>
</p>
</body>
</html>