Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 8ea1b9c337fb525e34e236cd5bc4399ea0bc9cb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0" encoding="ISO-8859-1"?><!--
	Copyright (c) 2005, 2006, 2007 Springsite BV (The Netherlands) and others
	All rights reserved. This program and the accompanying materials
	are made available under the terms of the Eclipse Public License v1.0
	which accompanies this distribution, and is available at
	http://www.eclipse.org/legal/epl-v10.html
--><!--
	@author <a href="mtaal@elver.org">Martin Taal</a>
	@version $Revision: 1.15 $ $Date: 2007/07/18 16:11:21 $
--><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
<document> 
&#9;<header> 
&#9;&#9;<title>Resource Utility: directly open an editor, import/export</title> 
&#9;</header> 
&#9;<body>
&#9;&#9;<p>As part of the EMF Hibernate plugin install a separate utility is also installed.
&#9;&#9;&#9;This utility can be used to directly open a relational Hibernate database in 
&#9;&#9;&#9;the generated EMF editor. 
&#9;&#9;</p>
&#9;&#9;<p><em>This resource utility is in many
&#9;&#9;ways very basic. It may or may not be usefull for you and will be extended in the future.</em></p>
&#9;&#9;<section><title>The ehb file</title>
&#9;&#9;<p>The resource utility operates on files with the extension <em>ehb</em>. This file
&#9;&#9;contains registration and database connection information for a Session Factory.
&#9;&#9;An example ehb file with a description of its content can be downloaded here: 
&#9;&#9;&#9;<link href="samples/library.ehb">library.ehb</link>.</p>
&#9;&#9;<p><em/></p>
&#9;&#9;</section>
&#9;&#9;<section><title>Open Resource</title>
&#9;&#9;<p>When rightclicking on an ehb file the Teneo menu option is displayed. Within this 
&#9;&#9;menu the option <em>Open Resource</em> is shown. Choosing this option will open a 
&#9;&#9;EMF editor which reads its contents from the connection/session information in the
&#9;&#9;ehb file.</p>
&#9;&#9;<p>
&#9;&#9;<img src="images/resourceutility.jpg" alt="Resource utility"/>&#9;&#9;
&#9;&#9;</p>
&#9;&#9;</section>
&#9;&#9;<section><title>Export/Import to and from XMI or XML</title>
&#9;&#9;&#9;<p>The XML/XMI export
&#9;&#9;&#9;&#9;function can be used to make a backup of your current data and import this
&#9;&#9;&#9;&#9;data again in an empty (new) database. The main drawback 
&#9;&#9;&#9;of the XML/XMI import is that it will add all the content to the database and will
&#9;&#9;&#9;not check if the content already exists in the database. Note that the XMI
&#9;&#9;&#9;export/import is more powerfull (than XML) because it supports export/import of multiple
&#9;&#9;&#9;root objects.</p>
&#9;&#9;</section>
&#9;&#9;<section><title>Throubleshooting: empty editor when opening resource, can not add</title>
&#9;&#9;<p>When you open an empty resource (relational database) by right clicking on the 
&#9;&#9;&#9;ehb file an editor is opened which does not allow you to add the first document. This
&#9;&#9;&#9;is a restriction of the generated EMF editor. So you should always have at least one
&#9;&#9;&#9;document in the resource. This document can be created by importing from a XML document
&#9;&#9;&#9;or by using the standard EMF open model wizard.</p>
&#9;&#9;</section>
&#9;&#9;<section><title>Throubleshooting: the editor is not started but instead the ehb file is opened in the text editor</title>
&#9;&#9;<p>This happens when the ehb file is already open in a text editor. This can happen because you need to 
&#9;&#9;edit the properties in a text editor. So first close the text editor with the ehb file and then choose 'Open Resource'.</p>
&#9;&#9;</section>
&#9;&#9;&#9;&#9;<section><title>Throubleshooting: editor does not start, AssertionFailedException</title>
&#9;&#9;<p>See <link href="troubleshooting.html#Editor+does+not+start%2C+AssertionFailedException">here</link>
&#9;&#9;in the troubleshooting page.</p>
&#9;&#9;</section>
&#9;&#9;
&#9;&#9;<section><title>Future extensions</title>
&#9;&#9;&#9;<ul>
&#9;&#9;&#9;&#9;<li>Instead of a property file offer a more advanced ui</li>
&#9;&#9;&#9;&#9;<li>Extend the export/import to support different modes such as 
&#9;&#9;&#9;&#9;&#9;overwrite existing documents, add to the relational store etc.</li>
&#9;&#9;&#9;&#9;<li>Support for xsl transformations when exporting/importing</li>
&#9;&#9;&#9;&#9;<li>Export subsets of the relational store using HQL queries or other 
&#9;&#9;&#9;&#9;filtering</li>
&#9;&#9;&#9;</ul>
&#9;&#9;&#9;<p>Please post a message on the <link href="mailinglist.html">newsgroup</link> if you
&#9;&#9;&#9;have other ideas or requirements for resource utilities.</p>
&#9;&#9;<p/>
&#9;&#9;</section>&#9;&#9;
&#9;</body>
</document>

Back to the top