| <!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>Updates</h2> |
| <p>Be sure to turn on the Team>CVS>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>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 "libraries".</li> |
| </ul> |
| </li> |
| <li>Name the library |
| <ul> |
| <li>Expand Libraries and select Library</li> |
| <li>Open the Properties view (Window/Show View>Basic/Properties)</li> |
| <li>Enter the name "Main Library"</li> |
| </ul> |
| </li> |
| <li>Click the view Save button</li> |
| </ul> |
| <li> Create a writer named "Bob" |
| <ul> |
| <li>From context menu of view, create a New/Writers Catalog: "My.writer".</li> |
| <li>Edit the new writer |
| <ul> |
| <li>Expand Writers and select Writer</li> |
| <li>In the Properties view, enter the name "Bob"</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: "My.books". |
| <ul> |
| <li>Expand Books and select Writer</li> |
| <li>In the Properties view, enter the title "The Life of Bob"</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 "Main Library", choose Add Book Copy</li> |
| <li>Expand "Main Library" and select Copy</li> |
| <li>In the Properties view, select "The Life of Bob" 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 "Bob" and choose "Show Resource Mappings" |
| <ul> |
| <li>You will see the file"My.writers" </li> |
| </ul> |
| </li> |
| <li>Try it on the "Main Library" |
| <ul> |
| <li>You will see the file"mylib.library"</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 "libraries" and name the library file "Another.library".</li> |
| <li>In the Properties view, name the library "Another Library"</li> |
| </ul> |
| </li> |
| <li> Create a new writers catalog and book catalog named "Anther.writers" |
| and "Another.books" respectively |
| <ul> |
| <li>File in the fields for the writer and book</li> |
| <li>Add a copy of the book to "Another Library"</li> |
| <li>Save the view</li> |
| <li>Commit "Another Library"</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> |