[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kettle-developers
Subject:    Re: Get connection metadata from shared.xml in KETTLE_HOME
From:       Matt Casters <mcasters () pentaho ! org>
Date:       2012-09-10 9:57:09
Message-ID: CAM1YkNLM6RwPiVj1WZQve0hCEKUxzmviQ-Rfc0uOBpU-_2QApA () mail ! gmail ! com
[Download RAW message or body]

I put some extra convenience methods in 4.4.0 and trunk (5.0) so hopefully
that helps future developers.  Thanks for the feedback.

Matt


2012/9/4 origin <strawpad4@hotmail.com>

> Issue created as http://jira.pentaho.com/browse/PDI-8458
> 
> 
> On Tuesday, September 4, 2012 1:00:36 PM UTC+2, origin wrote:
> > 
> > OK, this is really a very late reply :) Sorry, I didn't expect an answer
> > anymore and I didn't get a mail notification either.
> > 
> > No, I didn't haven't created a JIRA entry yet, but I'm going to do so
> > once I'm registered.
> > 
> > Regards!
> > 
> > Phil
> > 
> > 
> > On Friday, August 10, 2012 2:36:31 PM UTC+2, Matt Casters wrote:
> > > 
> > > Sorry for the late reply Origin, vacation and a lot of work got in the
> > > way.
> > > Did you ever create a JIRA case for your proposed improvement?  I would
> > > be happy to pass the change into 5.0 so that future generations of Kettle
> > > developers have an easier time ;-)
> > > 
> > > Thanks in advance!
> > > 
> > > Matt
> > > 
> > > 
> > > 2012/7/27 origin <stra...@hotmail.com>
> > > 
> > > > Hi,
> > > > 
> > > > thanks for your reply! The problem is that SharedEntry is a private
> > > > class in SharedObjects, so we can't simply create an instance of it.
> > > > 
> > > > But we found a snippet like this somewhere in the kettle code:
> > > > 
> > > > SharedObjects so = new SharedObjects();
> > > > for (SharedObjectInterface soi : so.getObjectsMap().values()) {
> > > > if ((soi instanceof DatabaseMeta)
> > > > && soi.getName().equals(**connectionName)) {
> > > > DatabaseMeta dm = (DatabaseMeta) soi;
> > > > this.driver = dm.getDriverClass();
> > > > this.user = dm.getUsername();
> > > > this.password = dm.getPassword();
> > > > this.jdbcUrl = dm.getURL();
> > > > break;
> > > > }
> > > > }
> > > > 
> > > > ... which is of course less than very clean (looping over the set of
> > > > values and doing an instanceof).
> > > > 
> > > > (Perhaps it would be better to make the key class of the Map public
> > > > (?))
> > > > 
> > > > 
> > > > Regards,
> > > > Origin
> > > > 
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "kettle-developers" group.
> > > > To view this discussion on the web visit https://groups.google.com/d/**
> > > > msg/kettle-developers/-/**7hk2utQ2d_8J<https://groups.google.com/d/msg/kettle-developers/-/7hk2utQ2d_8J>
> > > >                 
> > > > .
> > > > 
> > > > To post to this group, send email to kettle-d...@googlegroups.com.
> > > > To unsubscribe from this group, send email to kettle-develop...@**
> > > > googlegroups.com.
> > > > For more options, visit this group at http://groups.google.com/**
> > > > group/kettle-developers?hl=en<http://groups.google.com/group/kettle-developers?hl=en>
> > > >                 
> > > > .
> > > > 
> > > 
> > > 
> > > 
> > > --
> > > Matt Casters <mcas...@pentaho.org>
> > > Chief Data Integration, Kettle founder, Author of Pentaho Kettle
> > > Solutions<http://www.amazon.com/Pentaho-Kettle-Solutions-Building-Integration/dp/0470635177>
> > >  (Wiley<http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470635177.html>
> > > )
> > > Fonteinstraat 70 - 9400 OKEGEM - Belgium - Cell : +32 486 97 29 37
> > > *Pentaho  -  Powerful Analytics Made Easy*
> > > 
> > > --
> You received this message because you are subscribed to the Google Groups
> "kettle-developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/kettle-developers/-/bjPOWcNfFGQJ.
> 
> To post to this group, send email to kettle-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> kettle-developers+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/kettle-developers?hl=en.
> 



-- 
Matt Casters <mcasters@pentaho.org>
Chief Data Integration, Kettle founder, Author of Pentaho Kettle
Solutions<http://www.amazon.com/Pentaho-Kettle-Solutions-Building-Integration/dp/0470635177>
  (Wiley <http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470635177.html>)
Fonteinstraat 70 - 9400 OKEGEM - Belgium - Cell : +32 486 97 29 37
*Pentaho  -  Powerful Analytics Made Easy*

-- 
You received this message because you are subscribed to the Google Groups \
"kettle-developers" group. To post to this group, send email to \
kettle-developers@googlegroups.com. To unsubscribe from this group, send email to \
kettle-developers+unsubscribe@googlegroups.com. For more options, visit this group at \
http://groups.google.com/group/kettle-developers?hl=en.


[Attachment #3 (text/html)]

I put some extra convenience methods in 4.4.0 and trunk (5.0) so hopefully that helps \
future developers.  Thanks for the feedback.<div><br>Matt</div><div><br><br><div \
class="gmail_quote">2012/9/4 origin <span dir="ltr">&lt;<a \
href="mailto:strawpad4@hotmail.com" \
target="_blank">strawpad4@hotmail.com</a>&gt;</span><br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Issue created as <a \
href="http://jira.pentaho.com/browse/PDI-8458" \
target="_blank">http://jira.pentaho.com/browse/PDI-8458</a><div> <div \
class="h5"><br><br>On Tuesday, September 4, 2012 1:00:36 PM UTC+2, origin \
wrote:<blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">OK, \
this is really a very late reply :) Sorry, I didn&#39;t expect an answer anymore and \
I didn&#39;t get a mail notification either.<br> <br>No, I didn&#39;t haven&#39;t \
created a JIRA entry yet, but I&#39;m going to do so once I&#39;m \
registered.<br><br>Regards!<br><br>Phil<br><br><br>On Friday, August 10, 2012 2:36:31 \
PM UTC+2, Matt Casters wrote:<blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> Sorry \
for the late reply Origin, vacation and a lot of work got in the way.<div>Did you \
ever create a JIRA case for your proposed improvement?  I would be happy to pass the \
change into 5.0 so that future generations of Kettle developers have an easier time \
;-)</div>

<div><br></div><div>Thanks in advance!<br><br>Matt</div><div><br></div><div><br><div \
class="gmail_quote">2012/7/27 origin <span \
dir="ltr">&lt;<a>stra...@hotmail.com</a>&gt;</span><br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi, <br><br>thanks for your reply! The problem is that <font \
face="courier new, monospace">SharedEntry <font face="arial,sans-serif">is a private \
class in <span style="font-family:courier \
new,monospace">SharedObjects</span></font></font>, so we can&#39;t simply create an \
instance of it. <br>

<br>But we found a snippet like this somewhere in the kettle code:<br><br><span \
style="font-family:courier new,monospace">        SharedObjects so = new \
SharedObjects();</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">        for (SharedObjectInterface \
soi : so.getObjectsMap().values()) {</span><br style="font-family:courier \
new,monospace"><span style="font-family:courier new,monospace">            if ((soi \
instanceof DatabaseMeta)</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">                    &amp;&amp; \
soi.getName().equals(<u></u>connectionName)) {</span><br style="font-family:courier \
new,monospace"><span style="font-family:courier new,monospace">                \
DatabaseMeta dm = (DatabaseMeta) soi;</span><br style="font-family:courier \
new,monospace">

<span style="font-family:courier new,monospace">                this.driver = \
dm.getDriverClass();</span><br style="font-family:courier new,monospace"><span \
style="font-family:courier new,monospace">                this.user = \
dm.getUsername();</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">                this.password = \
dm.getPassword();</span><br style="font-family:courier new,monospace"><span \
style="font-family:courier new,monospace">                this.jdbcUrl = \
dm.getURL();</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">                break;</span><br \
style="font-family:courier new,monospace"><span style="font-family:courier \
new,monospace">            }</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">        }</span><br><br>... which is \
of course less than very clean (looping over the set of values and doing an <span \
style="font-family:courier new,monospace">instanceof</span>). <br>

<br>(Perhaps it would be better to make the key class of the <span \
style="font-family:courier new,monospace">Map public \
</span>(?))<div><br><br>Regards,<br>Origin<br><br>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups \
&quot;kettle-developers&quot; group.<br></div> To view this discussion on the web \
visit <a href="https://groups.google.com/d/msg/kettle-developers/-/7hk2utQ2d_8J" \
target="_blank">https://groups.google.com/d/<u></u>msg/kettle-developers/-/<u></u>7hk2utQ2d_8J</a>.<div>


<div><br> 
To post to this group, send email to <a>kettle-d...@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to \
<a>kettle-develop...@<u></u>googlegroups.com</a>.<br>

For more options, visit this group at <a \
href="http://groups.google.com/group/kettle-developers?hl=en" \
target="_blank">http://groups.google.com/<u></u>group/kettle-developers?hl=en</a>.<br>



</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matt Casters \
&lt;<a>mcas...@pentaho.org</a>&gt;<br>Chief Data Integration, Kettle founder, Author \
of <a href="http://www.amazon.com/Pentaho-Kettle-Solutions-Building-Integration/dp/0470635177" \
target="_blank">Pentaho Kettle Solutions</a> (<a \
href="http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470635177.html" \
target="_blank">Wiley</a>)<br>

Fonteinstraat 70 - 9400 OKEGEM - Belgium - Cell : <a \
href="tel:%2B32%20486%2097%2029%2037" value="+32486972937" target="_blank">+32 486 97 \
29 37</a><div><b style><font color="#ff6600"><span \
style="font-family:arial,sans-serif;line-height:11px">Pentaho</span>  -  <span \
style="font-family:arial,sans-serif;line-height:11px">Powerful Analytics Made \
Easy</span></font></b></div>

<br>
</div>
</blockquote></blockquote>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups \
&quot;kettle-developers&quot; group.<br></div></div> To view this discussion on the \
web visit <a href="https://groups.google.com/d/msg/kettle-developers/-/bjPOWcNfFGQJ" \
target="_blank">https://groups.google.com/d/msg/kettle-developers/-/bjPOWcNfFGQJ</a>.<div \
class="HOEnZb"> <div class="h5"><br> 
To post to this group, send email to <a \
href="mailto:kettle-developers@googlegroups.com" \
target="_blank">kettle-developers@googlegroups.com</a>.<br> To unsubscribe from this \
group, send email to <a \
href="mailto:kettle-developers%2Bunsubscribe@googlegroups.com" \
target="_blank">kettle-developers+unsubscribe@googlegroups.com</a>.<br>

For more options, visit this group at <a \
href="http://groups.google.com/group/kettle-developers?hl=en" \
target="_blank">http://groups.google.com/group/kettle-developers?hl=en</a>.<br>


</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matt Casters \
&lt;<a href="mailto:mcasters@pentaho.org" \
target="_blank">mcasters@pentaho.org</a>&gt;<br>Chief Data Integration, Kettle \
founder, Author of <a \
href="http://www.amazon.com/Pentaho-Kettle-Solutions-Building-Integration/dp/0470635177" \
target="_blank">Pentaho Kettle Solutions</a> (<a \
href="http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470635177.html" \
target="_blank">Wiley</a>)<br> Fonteinstraat 70 - 9400 OKEGEM - Belgium - Cell : +32 \
486 97 29 37<div><b style="background-color:rgb(255,255,255)"><font \
color="#ff6600"><span \
style="font-family:arial,sans-serif;line-height:11px">Pentaho</span>  -  <span \
style="font-family:arial,sans-serif;line-height:11px">Powerful Analytics Made \
Easy</span></font></b></div> <br>
</div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups \
"kettle-developers" group.<br /> To post to this group, send email to \
kettle-developers@googlegroups.com.<br /> To unsubscribe from this group, send email \
to kettle-developers+unsubscribe@googlegroups.com.<br />

For more options, visit this group at \
http://groups.google.com/group/kettle-developers?hl=en.<br />



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic