[CDO] Adding to CDO server properties programmatically [message #509761] |
Mon, 25 January 2010 05:29  |
Eclipse User |
|
|
|
I have an application where the database connection details either are
retrieved from a project file or entered by the user at start up. In this
case I'm missing the possibility to add teneo and database properties
programmatically before creating the repository. I do have and use a
cdo-server.xml but would need to be able to add additional properties before
the creation (instantiation) of the repository.
Currently I use the following code while starting the server:
RepositoryConfigurator repositoryConfigurator = new RepositoryConfigurator(
IPluginContainer.INSTANCE);
// Here I would need to add some properties not defined in the config file
IRepository[] repositories = repositoryConfigurator.configure(configFile);
Maybe there is already a solution to this problem that I haven't discovered
yet?
Cheers
Bjoern
|
|
|
|
|
Re: [CDO] Adding to CDO server properties programmatically [message #509795 is a reply to message #509787] |
Mon, 25 January 2010 07:51   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------070807090008020104060904
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Bjoern Sundin schrieb:
> Hi Eike,
>
> Not really. Adding the properties as <property name="..."
> value=".."/> in the cdo.server.xml is what I do right now. This will,
> however, not do in the actual application, as the database settings
> are coming from another source.
> I can of course programmatically open the cdo-server.xml and patch it
> to include the database properties before I pass the file to the
> RepositoryConfigurator. But I had hoped there would be another
> "cleaner" way to add to those properties.
The offender seems to be at the end of
RepositoryConfigurator.configure(File):
| CDOServerUtil.addRepository(container, repository);|
The addRepository() method implicitely activates the repository. We
could add a boolean parameter to control that and make the
RepositoryConfigurator configurable with that value. Would that help?
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
--------------070807090008020104060904
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Bjoern Sundin schrieb:
<blockquote cite="mid:hjk3a9$bo7$1@build.eclipse.org" type="cite">Hi
Eike,
<br>
<br>
Not really. Adding the properties as <property name="..."
value=".."/> in the cdo.server.xml is what I do right now. This
will, however, not do in the actual application, as the database
settings are coming from another source. <br>
I can of course programmatically open the cdo-server.xml and patch it
to include the database properties before I pass the file to the
RepositoryConfigurator. But I had hoped there would be another
"cleaner" way to add to those properties. <br>
</blockquote>
The offender seems to be at the end of
RepositoryConfigurator.configure(File):<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff"> </font><font
color="#000000">CDOServerUtil.addRepository</font><font color="#000000">(</font><font
color="#000000">container, repository</font><font color="#000000">)</font><font
color="#000000">;</font></code> </td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --><br>
<br>
The addRepository() method implicitely activates the repository. We
could add a boolean parameter to control that and make the
RepositoryConfigurator configurable with that value. Would that help?<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
</body>
</html>
--------------070807090008020104060904--
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03595 seconds