<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/assets/atom.xsl" type="text/xsl"?><feed
	xmlns="http://www.w3.org/2005/Atom"
	xmlns:thr="http://purl.org/syndication/thread/1.0"
	xml:lang="en-US"
	><title>Sacha Chua - tag - java</title>
	<subtitle>Emacs, sketches, and life</subtitle>
	<link rel="self" type="application/atom+xml" href="https://sachachua.com/blog/tag/java/feed/atom/index.xml" />
  <link rel="alternate" type="text/html" href="https://sachachua.com/blog/tag/java" />
  <id>https://sachachua.com/blog/tag/java/feed/atom/index.xml</id>
  <generator uri="https://11ty.dev">11ty</generator>
	<updated>2011-03-22T00:03:00Z</updated>
<entry>
		<title type="html">Learning more about Websphere and web service development</title>
		<link rel="alternate" type="text/html" href="https://sachachua.com/blog/2011/03/learning-more-about-websphere-and-web-service-development/"/>
		<author><name><![CDATA[Sacha Chua]]></name></author>
		<updated>2011-03-22T04:03:00Z</updated>
    <published>2011-03-22T00:03:00Z</published>
    <category term="development" />
<category term="geek" />
<category term="ibm" />
		<id>https://sachachua.com/blog/?p=22164</id>
		<content type="html"><![CDATA[<p>So I finally figured out what was wrong with the way I was trying to generate my web services for Websphere 6.1. I&#8217;d been using &#8220;Generate Java bean skeleton&#8221; from the WSDL file, which worked fine for the 6.0 target, but which didn&#8217;t work for 6.1. The correct way to do it is to right-click on the service and choose &#8220;Generate &#8211; Top-down Service&#8221;. </p>
<p> I also spent some time figuring out how to correctly use the XSD the IT architect sent me in order to use it for the data types in the WSDL. This is how: </p>
<pre class="example">&lt;xsd:import schemaLocation="....xsd" namespace="..."&gt;
&lt;/xsd:import&gt;
</pre>
<p> One of the pieces that was missing for me was dealing with namespaces, but once I got my head around XML again, I added some namespaces and got the referred types working. </p>
<p> So I&#8217;ve retwiddled our web services and gotten them to work with the new data structures.  My test cases pass again. Progress! </p>
<p>  <span class="timestamp-wrapper"> <span class="timestamp">2011-03-21 Mon 20:03</span></span> </p>
<p>You can <a href="https://sachachua.com/blog/2011/03/learning-more-about-websphere-and-web-service-development/#comment">view 1 comment</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2011%2F03%2Flearning-more-about-websphere-and-web-service-development%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></content>
		</entry><entry>
		<title type="html">Sample code for allowing drag-and-drop of Notes/Domino documents (including email) to a table in a plugin</title>
		<link rel="alternate" type="text/html" href="https://sachachua.com/blog/2010/08/sample-code-for-allowing-drag-and-drop-of-notesdomino-documents-including-email-to-a-table-in-a-plugin/"/>
		<author><name><![CDATA[Sacha Chua]]></name></author>
		<updated>2010-08-07T02:00:23Z</updated>
    <published>2010-08-09T12:00:00Z</published>
    <category term="geek" />
<category term="lotus" />
		<id>https://sachachua.com/blog/?p=7304</id>
		<content type="html"><![CDATA[<p>Because I had to piece this together from examples on the Internet, and probably other people do too:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:3d8a5785-288f-4bb1-8649-27fa45c3fa79" class="wlWriterEditableSmartContent">
<pre class="brush: java">Transfer[] transferArray = new Transfer[]{
    XMLTransfer.getInstance(),
};
tableViewer.addDropSupport(DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK,
    transferArray, new DropTargetAdapter() {
        public void drop(DropTargetEvent event) {
            TableItem item = (TableItem) event.item;
            // You can access the object with item.getData()
            try {
                NotesThread.sinitThread();
                Session session = NotesFactory.createSessionWithFullAccess();
                if (event.data instanceof URIDescriptor[]){ 
                    URIDescriptor[] droppedURL = (URIDescriptor[]) event.data;
                    for (int i = 0; i &lt; droppedURL.length; i++) { 
                        URI uri = ((URIDescriptor) droppedURL[i]).uri;
                        Document d = (Document) session.resolve(uri.toString());
                        // Do things with the document
                    }					
                }
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                NotesThread.stermThread();
            }
        }});</pre>
</div>
<p>Use session.resolve instead of db.getDocumentByURL to retrieve a document from a plugin, as both session.getAgentContext() and session.getCurrentDatabase() will return null.</p>
<p>You can <a href="https://sachachua.com/blog/2010/08/sample-code-for-allowing-drag-and-drop-of-notesdomino-documents-including-email-to-a-table-in-a-plugin/#comment">view 2 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2010%2F08%2Fsample-code-for-allowing-drag-and-drop-of-notesdomino-documents-including-email-to-a-table-in-a-plugin%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></content>
		</entry><entry>
		<title type="html">Ruby versus Java</title>
		<link rel="alternate" type="text/html" href="https://sachachua.com/blog/2006/05/ruby-versus-java/"/>
		<author><name><![CDATA[Sacha Chua]]></name></author>
		<updated>2006-05-13T23:02:00Z</updated>
    <published>2006-05-13T19:02:00Z</published>
    <category term="barcamp" />
<category term="ruby" />
		<id>https://sachachua.com/blog/?p=3468</id>
		<content type="html"><![CDATA[<p>This is totally cool. I'm in the middle of a geek crowd discussing<br>
Java vs Ruby, but there's none of that &#8220;my language is better than<br>
yours&#8221; vibe that often comes out in Linux distribution discussions. I<br>
think what's cool about it is that most people here use both, so we're<br>
just figuring out where one is better than the other for something,<br>
and how we can improve things&#8230;</p>


<p>You can <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2006%2F05%2Fruby-versus-java%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></content>
		</entry>
</feed>