<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>RoBlog</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/" />
<modified>2006-02-24T17:39:01Z</modified>
<tagline>A blog about nothing or everything</tagline>
<id>tag:www.robsite.org,2006://2</id>
<generator url="http://www.movabletype.org/" version="3.2">Movable Type</generator>
<copyright>Copyright (c) 2006, rcleveng</copyright>
<entry>
<title>Rob&apos;s ADF based blog</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2006/02/robs_adf_based_blog.html" />
<modified>2006-02-24T17:39:01Z</modified>
<issued>2006-02-24T15:23:00Z</issued>
<id>tag:www.robsite.org,2006://2.88</id>
<created>2006-02-24T15:23:00Z</created>
<summary type="text/plain">I&apos;ve started a new blog more specifically about ADF, JSF, and fusion middleware running on a new blog engine I&apos;m calling ADFBlogger. ADFBlogger is in its early stages of development, however after about 6 hours of work (most of which was spent tweaking my database model) it is functional enough to use. Currently, ADFBlogger supports: RSS 0.91 (soon to be 2.0) Creating entries Editing entries Creating comments Approving comments The technologies used: JAZN for authentication and authorization OC4J stand-alone for the J2EE server Oracle XE for the database JSF for the view ADF Faces components ADF data bindings TopLink for the JavaBeans EJB 3.0 Session Beans OurFaces style sheet tag Frank and Duncan&apos;s JSF-Security tags Oracle XML Query support for RSS generation via SQL I&apos;ve started the project off small, so that it can grow into a full application using the oracle stack, and I&apos;ll share the thoughts and processes involved in scaling up my little app. Also, I&apos;ll setup a subversion repository with source access shortly for anyone interested....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>JDeveloper</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>I've started a new blog more specifically about ADF, JSF, and fusion middleware running on a new blog engine I'm calling <a href="http://blog.robsite.org/adfblogger/blog/roblog">ADFBlogger</a>.  ADFBlogger is in its early stages of development, however after about 6 hours of work (most of which was spent tweaking my database model) it is functional enough to use. </p>
<p>Currently, ADFBlogger supports:</p>
<ul>
<li>RSS 0.91 (soon to be 2.0)</li>
<li>Creating entries</li>
<li>Editing entries</li>
<li>Creating comments</li>
<li>Approving comments</li>
</ul>

<p>The technologies used:</p>
<ul>
<li>JAZN for authentication and authorization</li>
<li>OC4J stand-alone for the J2EE server</li>
<li>Oracle XE for the database</li>
<li>JSF for the view</li>
<li>ADF Faces components</li>
<li>ADF data bindings</li>
<li>TopLink for the JavaBeans</li>
<li>EJB 3.0 Session Beans</li>
<li><a href="http://ourfaces.dev.java.net">OurFaces style sheet tag</a></li>
<li><a href="http://jsf-security.sourceforge.net">Frank and Duncan's JSF-Security tags</a></li>
<li>Oracle XML Query support for RSS generation via SQL</li>
</ul>

I've started the project off small, so that it can grow into a full application using the oracle stack, and I'll share the thoughts and processes involved in scaling up my little app.  Also, I'll setup a subversion repository with source access shortly for anyone interested.]]>

</content>
</entry>
<entry>
<title>Creating a Mac OS X disk image from the command line</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2006/01/creating_a_mac_os_x_disk_image.html" />
<modified>2006-01-31T01:02:41Z</modified>
<issued>2006-01-31T00:58:58Z</issued>
<id>tag:www.robsite.org,2006://2.87</id>
<created>2006-01-31T00:58:58Z</created>
<summary type="text/plain">I have been the one building the Mac OS X disk images for JDeveloper for the last couple of years, and realized that not everyone knew (when I asked around) that you could do it from the commandline. The syntax is: hdiutil {action} {arguments} I typically use: hdiutil create -srcfolder FolderNamer DiskImageName.dmg Quite easy to use, and easily scriptable. Now if only we could build this on out linux build machines with an Ant task....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Apple</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>I have been the one building the Mac OS X disk images for <a href="http://www.oracle.com/technology/products/jdev/">JDeveloper</a> for the last couple of years, and realized that not everyone knew (when I asked around) that you could do it from the commandline.</p>

<p>The syntax is:</p>

<p><tt>hdiutil {action} {arguments}</tt></p>

<p>I typically use:</p>

<p><tt>hdiutil create -srcfolder FolderNamer DiskImageName.dmg</tt></p>

<p>Quite easy to use, and easily scriptable.  Now if only we could build this on out linux build machines with an <a href="http://ant.apache.org/">Ant</a> task.</p>]]>

</content>
</entry>
<entry>
<title>JSF Converter for MT Comments.</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2006/01/jsf_converter_for_mt_comments.html" />
<modified>2006-01-31T22:47:13Z</modified>
<issued>2006-01-31T00:22:30Z</issued>
<id>tag:www.robsite.org,2006://2.86</id>
<created>2006-01-31T00:22:30Z</created>
<summary type="text/plain"><![CDATA[I've been working on a JSF front end to my blog lately, and needed to display comments. My first instinct was to create a new JSF component, and although that would be a bit of fun, I decided to just create a converter and use an existing ADF Faces component. I am simply displaying the comments in an outputText, using my Moveable Type converter. The converter simply replaces each line of the comment with &lt;p&gt;line&lt;/p&gt; If you haven't created a JSF converter before, it's really simple and here are the steps: Create a class that implements javax.faces.convert.Converter. register your converter with your faces-config.xml file. Call your converter in your view. Here is the Converter source: 1 package org.robsite.adfblog.view; 2 3 import java.io.BufferedReader; 4 import java.io.IOException; 5 import java.io.StringReader; 6 7 import javax.faces.component.UIComponent; 8 import javax.faces.context.FacesContext; 9 import javax.faces.convert.Converter; 10 11 import oracle.adf.view.faces.context.AdfFacesContext; 12 import oracle.adf.view.faces.context.Agent; 13 14 15 /** 16 * Movable Type comment converter. 17 * Wraps a comment from Moveble Type (stored in the database as plain text, 18 * with CR/LF line endings with html paragraph tags for proper display in a 19 * web page. 20 * Note: If ADF Faces is in use, the conversion will only happen if the 21 * ADF Faces's device type is a desktop device. 22 */ 23 public class MtCommentConverter implements Converter { 24 private boolean wrapComment; 25 26 public MtCommentConverter() { 27 try { 28 Agent agent = AdfFacesContext.getCurrentInstance().getAgent(); 29 wrapComment = ( agent.getType() == Agent.TYPE_DESKTOP ); 30 } 31 catch (Exception e) { 32 wrapComment = true; 33 } 34 } 35 36 public Object getAsObject(FacesContext context, 37 UIComponent component, String s) { 38 return s; 39 } 40 41 public String getAsString(FacesContext context, 42 UIComponent component, Object o) { 43 if ( wrapComment && o instanceof String) 44 { 45 final String commentRaw = (String)o; 46 try { 47 BufferedReader reader = new BufferedReader( new StringReader( commentRaw ) ); 48 49 final StringBuilder sb = new StringBuilder( (int)(commentRaw.length() * 1.2 ) ); 50 for( String line = reader.readLine(); line != null; ) { 51 sb.append( "&lt;p>" + line + "&lt;/p>" ); 52 line = reader.readLine(); 53 if ( line == null ) { 54 reader.close(); 55 } 56 } 57 return sb.toString(); 58 } 59 catch (IOException e) { 60 return commentRaw; 61 } 62 } 63 return o.toString(); 64 } 65 } &nbsp; Now you need to add an entry into your faces-config.xml file: 1 &lt;converter> 2 &lt;converter-id>org.robsite.adfblog.view.MtCommentConverter&lt;/converter-id> 3 &lt;converter-class>org.robsite.adfblog.view.MtCommentConverter&lt;/converter-class> 4 &lt;/converter> &nbsp; Now finally add the tag into your output tag in your JSP or JSPX page: 1 &lt;af:outputText value="#{row.commentText}" 2 escape="false"> 3 &lt;f:converter converterId="org.robsite.adfblog.view.MtCommentConverter" /> 4 &lt;/af:outputText> &nbsp;...]]></summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>I've been working on a JSF front end to my blog lately, and needed to display comments.  My first instinct was to create a new <a href="http://www.fawcette.com/javapro/2004_01/magazine/features/cschalk/">JSF component,</a> and although that would be a bit of fun, I decided to just create a converter and use an existing <a href="http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/index.html">ADF Faces</a> component.  I am simply displaying the comments in an outputText, using my Moveable Type converter.</p>

<p>The converter simply replaces each <tt>line</tt> of the comment with <tt>&lt;p&gt;line&lt;/p&gt;</tt></p>

<p>If you haven't created a JSF converter before, it's really simple and here are the steps:
<ol>
<li>Create a class that implements javax.faces.convert.Converter.</li>
<li>register your converter with your <tt>faces-config.xml</tt> file.</li>
<li>Call your converter in your view.</li>
</ol>
</p>
<p>
Here is the Converter source:
<PRE><A NAME="1">1      </A><font color="#31659C"><B>package</B></font> org.robsite.adfblog.view;
<A NAME="2">2      </A>
<A NAME="3">3      </A><font color="#31659C"><B>import</B></font> java.io.BufferedReader;
<A NAME="4">4      </A><font color="#31659C"><B>import</B></font> java.io.IOException;
<A NAME="5">5      </A><font color="#31659C"><B>import</B></font> java.io.StringReader;
<A NAME="6">6      </A>
<A NAME="7">7      </A><font color="#31659C"><B>import</B></font> javax.faces.component.UIComponent;
<A NAME="8">8      </A><font color="#31659C"><B>import</B></font> javax.faces.context.FacesContext;
<A NAME="9">9      </A><font color="#31659C"><B>import</B></font> javax.faces.convert.Converter;
<A NAME="10">10     </A>
<A NAME="11">11     </A><font color="#31659C"><B>import</B></font> oracle.adf.view.faces.context.AdfFacesContext;
<A NAME="12">12     </A><font color="#31659C"><B>import</B></font> oracle.adf.view.faces.context.Agent;
<A NAME="13">13     </A>
<A NAME="14">14     </A>
<A NAME="15">15     </A><font color="#0030CE">/**</font>
<A NAME="16">16     </A><font color="#0030CE"> * Movable Type comment converter.  </font>
<A NAME="17">17     </A><font color="#0030CE"> * Wraps a comment from Moveble Type (stored in the database as plain text, </font>
<A NAME="18">18     </A><font color="#0030CE"> * with CR/LF line endings with html paragraph tags for proper display in a </font>
<A NAME="19">19     </A><font color="#0030CE"> * web page.  </font>
<A NAME="20">20     </A><font color="#0030CE"> * <em>Note: If ADF Faces is in use, the conversion will only happen if the </font>
<A NAME="21">21     </A><font color="#0030CE"> * ADF Faces's device type is a desktop device.</em></font>
<A NAME="22">22     </A><font color="#0030CE"> */</font>
<A NAME="23">23     </A><font color="#31659C"><B>public</B></font> <font color="#31659C"><B>class</B></font> MtCommentConverter <font color="#31659C"><B>implements</B></font> Converter {
<A NAME="24">24     </A>    <font color="#31659C"><B>private</B></font> <font color="#31659C"><B>boolean</B></font> wrapComment;
<A NAME="25">25     </A>    
<A NAME="26">26     </A>    <font color="#31659C"><B>public</B></font> MtCommentConverter() {
<A NAME="27">27     </A>        <font color="#31659C"><B>try</B></font> {
<A NAME="28">28     </A>            Agent agent = AdfFacesContext.getCurrentInstance().getAgent();
<A NAME="29">29     </A>            <A HREF="#24">wrapComment</A> = ( <A HREF="#28">agent</A>.getType() == Agent.TYPE_DESKTOP );
<A NAME="30">30     </A>        }
<A NAME="31">31     </A>        <font color="#31659C"><B>catch</B></font> (Exception e) {
<A NAME="32">32     </A>            <A HREF="#24">wrapComment</A> = <font color="#9C6500">true</font>;
<A NAME="33">33     </A>        }
<A NAME="34">34     </A>    }
<A NAME="35">35     </A>
<A NAME="36">36     </A>    <font color="#31659C"><B>public</B></font> Object getAsObject(FacesContext context, 
<A NAME="37">37     </A>                              UIComponent component, String s) {
<A NAME="38">38     </A>        <font color="#31659C"><B>return</B></font> <A HREF="#37">s</A>;
<A NAME="39">39     </A>    }
<A NAME="40">40     </A>
<A NAME="41">41     </A>    <font color="#31659C"><B>public</B></font> String getAsString(FacesContext context, 
<A NAME="42">42     </A>                              UIComponent component, Object o) {
<A NAME="43">43     </A>        <font color="#31659C"><B>if</B></font> ( <A HREF="#24">wrapComment</A> && <A HREF="#42">o</A> <font color="#31659C"><B>instanceof</B></font> String)
<A NAME="44">44     </A>        {
<A NAME="45">45     </A>            <font color="#31659C"><B>final</B></font> String commentRaw = (String)<A HREF="#42">o</A>;
<A NAME="46">46     </A>            <font color="#31659C"><B>try</B></font> {
<A NAME="47">47     </A>                BufferedReader reader = <font color="#31659C"><B>new</B></font> BufferedReader( <font color="#31659C"><B>new</B></font> StringReader( <A HREF="#45">commentRaw</A> ) );
<A NAME="48">48     </A>                
<A NAME="49">49     </A>                <font color="#31659C"><B>final</B></font> StringBuilder sb = <font color="#31659C"><B>new</B></font> StringBuilder( (<font color="#31659C"><B>int</B></font>)(<A HREF="#45">commentRaw</A>.length() * 1.2 ) );
<A NAME="50">50     </A>                <font color="#31659C"><B>for</B></font>( String line = <A HREF="#47">reader</A>.readLine(); <A HREF="#50">line</A> != <font color="#9C6500">null</font>; ) {
<A NAME="51">51     </A>                    <A HREF="#49">sb</A>.append( <font color="#0030CE">"&lt;p>"</font> + <A HREF="#50">line</A> + <font color="#0030CE">"&lt;/p>"</font> );
<A NAME="52">52     </A>                    <A HREF="#50">line</A> = <A HREF="#47">reader</A>.readLine();
<A NAME="53">53     </A>                    <font color="#31659C"><B>if</B></font> ( <A HREF="#50">line</A> == <font color="#9C6500">null</font> ) {
<A NAME="54">54     </A>                        <A HREF="#47">reader</A>.close();
<A NAME="55">55     </A>                    }
<A NAME="56">56     </A>                }
<A NAME="57">57     </A>                <font color="#31659C"><B>return</B></font> <A HREF="#49">sb</A>.toString();
<A NAME="58">58     </A>            }
<A NAME="59">59     </A>            <font color="#31659C"><B>catch</B></font> (IOException e) {
<A NAME="60">60     </A>                <font color="#31659C"><B>return</B></font> <A HREF="#45">commentRaw</A>;
<A NAME="61">61     </A>            }
<A NAME="62">62     </A>        }
<A NAME="63">63     </A>        <font color="#31659C"><B>return</B></font> <A HREF="#42">o</A>.toString();
<A NAME="64">64     </A>    }
<A NAME="65">65     </A>}
</PRE>
</p>
<p>&nbsp;</p>
<p>Now you need to add an entry into your <tt>faces-config.xml</tt> file:</p>
<PRE><A NAME="1">1      </A>  &lt;converter>
<A NAME="2">2      </A>    &lt;converter-id>org.robsite.adfblog.view.MtCommentConverter&lt;/converter-id>
<A NAME="3">3      </A>    &lt;converter-class>org.robsite.adfblog.view.MtCommentConverter&lt;/converter-class>
<A NAME="4">4      </A>  &lt;/converter>
</PRE>
<p>&nbsp;</p>
<p>Now finally add the tag into your output tag in your JSP or JSPX page:</p>
<PRE><A NAME="1">1      </A>            &lt;af:outputText value="#{row.commentText}"
<A NAME="2">2      </A>                            escape="false">
<A NAME="3">3      </A>              <font color="#f00">&lt;f:converter converterId="org.robsite.adfblog.view.MtCommentConverter" /></font>
<A NAME="4">4      </A>            &lt;/af:outputText>
</PRE>
<p>&nbsp;</p>]]>

</content>
</entry>
<entry>
<title>JDeveloper&apos;s Java Model outside of JDeveloper</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/11/jdevelopers_jav.html" />
<modified>2006-01-11T22:53:00Z</modified>
<issued>2005-11-01T21:59:37Z</issued>
<id>tag:www.robsite.org,2005://2.85</id>
<created>2005-11-01T21:59:37Z</created>
<summary type="text/plain">One of the changes that we have made to JDeveloper in the 10.1.3 release is to support using the Java Model (formerly called JOT) from outside of JDeveloper. In my example, we programmatically set the source and class path for our model to use. I&apos;m working on an extended sample that uses the Project model to obtain this information. Here&apos;s a simple example which just lists the methods from a class. package org.jdeveloper.sample.javaparser; import java.io.File; import java.io.PrintStream; import java.util.Collection; import java.util.Iterator; import oracle.ide.net.URLFactory; import oracle.ide.net.URLPath; import oracle.javatools.parser.java.v2.JavaProvider; import oracle.javatools.parser.java.v2.model.JavaClass; import oracle.javatools.parser.java.v2.model.JavaMethod; import oracle.javatools.parser.java.v2.model.JavaType; import oracle.javatools.parser.java.v2.model.JavaVariable; import oracle.jdeveloper.java.provider.PathFileProvider; public class StandaloneJDeveloperParser { JavaProvider provider; public StandaloneJDeveloperParser() { try { final URLPath classPath = new URLPath(); final String javaHome = System.getProperty(&quot;java.home&quot;); classPath.add(URLFactory.newJarURL(new File(javaHome + &quot;\\lib\\rt.jar&quot;), null)); classPath.add(URLFactory.newJarURL(new File(&quot;C:\\jdev\\jdevstudio1013_3528\\ide\\lib\\ide.jar&quot;), null)); provider = new PathFileProvider(null, classPath); } catch (Exception e) { e.printStackTrace(); System.exit( 1 ); provider = null; } } private void displayMethodList(String className, PrintStream out) { if ( provider == null ) throw new IllegalStateException( &quot;provider may not be null&quot;); if ( className == null ) throw new IllegalArgumentException( &quot;className may not be null&quot; ); final JavaClass ideClass = provider.getClass(className); out.println(&quot;Source of &quot; + className); final Collection declaredMethods = ideClass.getDeclaredMethods(); for (Iterator iter = declaredMethods.iterator(); iter.hasNext(); ) { final JavaMethod m = iter.next(); out.println(getSignature(m)); } } private String getSignature(JavaMethod method) { if ( method == null ) throw new IllegalArgumentException( &quot;method may not be null&quot; ); final StringBuilder builder = new StringBuilder(255); builder.append(method.getReturnType().getName() + &quot; &quot; + method.getName() + &quot;(&quot;); final Collection methods = method.getParameters(); int parameterNumber = 1; for (JavaVariable variable : methods) { if (parameterNumber &gt; 1) builder.append(&quot;, &quot;); builder.append(variable.getResolvedType().getName() + &quot; &quot;); builder.append(getParameterName(parameterNumber, variable)); parameterNumber++; } builder.append(&quot;)&quot;); Collection exceptions = method.getExceptions(); if (exceptions.size() &gt; 0) { builder.append(&quot;throws &quot;); int exceptionNumber = 1; for (JavaType exception : exceptions) { if (exceptionNumber &gt; 1) builder.append(&quot;, &quot;); builder.append(exception.getQualifiedName()); ++exceptionNumber; } } return builder.toString(); } private String getParameterName(int parameterNumber, JavaVariable variable) { return (variable.getName().length() &gt; 0) ? variable.getName() : &quot;param&quot; + parameterNumber; } public static void main(String[] args) { StandaloneJDeveloperParser app = new StandaloneJDeveloperParser(); app.displayMethodList(&quot;oracle.ide.Ide&quot;, System.out); System.exit(0); } }...</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>JDeveloper</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>One of the changes that we have made to JDeveloper in the 10.1.3 release is to support using the Java Model (formerly called JOT) from outside of JDeveloper. In my example, we programmatically set the source and class path for our model to use. I'm working on an extended sample that uses the Project model to obtain this information.</p>
<p>
Here's a simple example which just lists the methods from a class.
</p>
<PRE><A NAME="1"></A><font color="#31659C"><B>package</B></font> org.jdeveloper.sample.javaparser;
<A NAME="2"></A>
<A NAME="3"></A><font color="#31659C"><B>import</B></font> java.io.File;
<A NAME="4"></A><font color="#31659C"><B>import</B></font> java.io.PrintStream;
<A NAME="5"></A>
<A NAME="6"></A><font color="#31659C"><B>import</B></font> java.util.Collection;
<A NAME="7"></A><font color="#31659C"><B>import</B></font> java.util.Iterator;
<A NAME="8"></A>
<A NAME="9"></A><font color="#31659C"><B>import</B></font> oracle.ide.net.URLFactory;
<A NAME="10"></A><font color="#31659C"><B>import</B></font> oracle.ide.net.URLPath;
<A NAME="11"></A>
<A NAME="12"></A><font color="#31659C"><B>import</B></font> oracle.javatools.parser.java.v2.JavaProvider;
<A NAME="13"></A><font color="#31659C"><B>import</B></font> oracle.javatools.parser.java.v2.model.JavaClass;
<A NAME="14"></A><font color="#31659C"><B>import</B></font> oracle.javatools.parser.java.v2.model.JavaMethod;
<A NAME="15"></A><font color="#31659C"><B>import</B></font> oracle.javatools.parser.java.v2.model.JavaType;
<A NAME="16"></A><font color="#31659C"><B>import</B></font> oracle.javatools.parser.java.v2.model.JavaVariable;
<A NAME="17"></A>
<A NAME="18"></A><font color="#31659C"><B>import</B></font> oracle.jdeveloper.java.provider.PathFileProvider;
<A NAME="19"></A>
<A NAME="20"></A>
<A NAME="21"></A><font color="#31659C"><B>public</B></font> <font color="#31659C"><B>class</B></font> StandaloneJDeveloperParser {
<A NAME="22"></A>    JavaProvider provider;
<A NAME="23"></A>
<A NAME="24"></A>    <font color="#31659C"><B>public</B></font> StandaloneJDeveloperParser() {
<A NAME="25"></A>        <font color="#31659C"><B>try</B></font> {
<A NAME="26"></A>            <font color="#31659C"><B>final</B></font> URLPath classPath = <font color="#31659C"><B>new</B></font> URLPath();
<A NAME="27"></A>            <font color="#31659C"><B>final</B></font> String javaHome = System.getProperty(<font color="#0030CE">"java.home"</font>);
<A NAME="28"></A>            <A HREF="#26">classPath</A>.add(URLFactory.newJarURL(<font color="#31659C"><B>new</B></font> File(<A HREF="#27">javaHome</A> + <font color="#0030CE">"\\lib\\rt.jar"</font>), <font color="#9C6500">null</font>));
<A NAME="29"></A>            <A HREF="#26">classPath</A>.add(URLFactory.newJarURL(<font color="#31659C"><B>new</B></font> File(<font color="#0030CE">"C:\\jdev\\jdevstudio1013_3528\\ide\\lib\\ide.jar"</font>), <font color="#9C6500">null</font>));
<A NAME="30"></A>            <A HREF="#22">provider</A> = <font color="#31659C"><B>new</B></font> PathFileProvider(<font color="#9C6500">null</font>, <A HREF="#26">classPath</A>);
<A NAME="31"></A>        } <font color="#31659C"><B>catch</B></font> (Exception e) {
<A NAME="32"></A>            <A HREF="#31">e</A>.printStackTrace();
<A NAME="33"></A>            System.exit( 1 );
<A NAME="34"></A>            <A HREF="#22">provider</A> = <font color="#9C6500">null</font>;
<A NAME="35"></A>        }
<A NAME="36"></A>    }
<A NAME="37"></A>
<A NAME="38"></A>    <font color="#31659C"><B>private</B></font> <font color="#31659C"><B>void</B></font> displayMethodList(String className, PrintStream out) {
<A NAME="39"></A>        <font color="#31659C"><B>if</B></font> ( <A HREF="#22">provider</A> == <font color="#9C6500">null</font> ) <font color="#31659C"><B>throw</B></font> <font color="#31659C"><B>new</B></font> IllegalStateException( <font color="#0030CE">"provider may not be null"</font>);  
<A NAME="40"></A>        <font color="#31659C"><B>if</B></font> ( <A HREF="#38">className</A> == <font color="#9C6500">null</font> ) <font color="#31659C"><B>throw</B></font> <font color="#31659C"><B>new</B></font> IllegalArgumentException( <font color="#0030CE">"className may not be null"</font> );
<A NAME="41"></A>        <font color="#31659C"><B>final</B></font> JavaClass ideClass = <A HREF="#22">provider</A>.getClass(<A HREF="#38">className</A>);
<A NAME="42"></A>
<A NAME="43"></A>        <A HREF="#38">out</A>.println(<font color="#0030CE">"Source of "</font> + <A HREF="#38">className</A>);
<A NAME="44"></A>        <font color="#31659C"><B>final</B></font> Collection declaredMethods = <A HREF="#41">ideClass</A>.getDeclaredMethods();
<A NAME="45"></A>        <font color="#31659C"><B>for</B></font> (Iterator<JavaMethod> iter = <A HREF="#44">declaredMethods</A>.iterator(); <A HREF="#45">iter</A>.hasNext(); ) {
<A NAME="46"></A>            <font color="#31659C"><B>final</B></font> JavaMethod m = <A HREF="#45">iter</A>.next();
<A NAME="47"></A>            <A HREF="#38">out</A>.println(<A HREF="#51">getSignature</A>(<A HREF="#46">m</A>));
<A NAME="48"></A>        }
<A NAME="49"></A>    }
<A NAME="50"></A>
<A NAME="51"></A>    <font color="#31659C"><B>private</B></font> String getSignature(JavaMethod method) {
<A NAME="52"></A>        <font color="#31659C"><B>if</B></font> ( <A HREF="#51">method</A> == <font color="#9C6500">null</font> ) <font color="#31659C"><B>throw</B></font> <font color="#31659C"><B>new</B></font> IllegalArgumentException( <font color="#0030CE">"method may not be null"</font> );
<A NAME="53"></A>        <font color="#31659C"><B>final</B></font> StringBuilder builder = <font color="#31659C"><B>new</B></font> StringBuilder(255);
<A NAME="54"></A>        <A HREF="#53">builder</A>.append(<A HREF="#51">method</A>.getReturnType().getName() + <font color="#0030CE">" "</font> + <A HREF="#51">method</A>.getName() + <font color="#0030CE">"("</font>);
<A NAME="55"></A>        <font color="#31659C"><B>final</B></font> Collection<JavaVariable> methods = <A HREF="#51">method</A>.getParameters();
<A NAME="56"></A>        <font color="#31659C"><B>int</B></font> parameterNumber = 1;
<A NAME="57"></A>        <font color="#31659C"><B>for</B></font> (JavaVariable variable : <A HREF="#55">methods</A>) {
<A NAME="58"></A>            <font color="#31659C"><B>if</B></font> (<A HREF="#56">parameterNumber</A> > 1) <A HREF="#53">builder</A>.append(<font color="#0030CE">", "</font>);
<A NAME="59"></A>            <A HREF="#53">builder</A>.append(<A HREF="#57">variable</A>.getResolvedType().getName() + <font color="#0030CE">" "</font>);
<A NAME="60"></A>            <A HREF="#53">builder</A>.append(<A HREF="#77">getParameterName</A>(<A HREF="#56">parameterNumber</A>, <A HREF="#57">variable</A>));
<A NAME="61"></A>            <A HREF="#56">parameterNumber</A>++;
<A NAME="62"></A>        }
<A NAME="63"></A>        <A HREF="#53">builder</A>.append(<font color="#0030CE">")"</font>);
<A NAME="64"></A>        Collection<JavaType> exceptions = <A HREF="#51">method</A>.getExceptions();
<A NAME="65"></A>        <font color="#31659C"><B>if</B></font> (<A HREF="#64">exceptions</A>.size() > 0) {
<A NAME="66"></A>            <A HREF="#53">builder</A>.append(<font color="#0030CE">"throws "</font>);
<A NAME="67"></A>            <font color="#31659C"><B>int</B></font> exceptionNumber = 1;
<A NAME="68"></A>            <font color="#31659C"><B>for</B></font> (JavaType exception : <A HREF="#64">exceptions</A>) {
<A NAME="69"></A>                <font color="#31659C"><B>if</B></font> (<A HREF="#67">exceptionNumber</A> > 1) <A HREF="#53">builder</A>.append(<font color="#0030CE">", "</font>);
<A NAME="70"></A>                <A HREF="#53">builder</A>.append(<A HREF="#68">exception</A>.getQualifiedName());
<A NAME="71"></A>                ++<A HREF="#67">exceptionNumber</A>;
<A NAME="72"></A>            }
<A NAME="73"></A>        }
<A NAME="74"></A>        <font color="#31659C"><B>return</B></font> <A HREF="#53">builder</A>.toString();
<A NAME="75"></A>    }
<A NAME="76"></A>
<A NAME="77"></A>    <font color="#31659C"><B>private</B></font> String getParameterName(<font color="#31659C"><B>int</B></font> parameterNumber, JavaVariable variable) {
<A NAME="78"></A>        <font color="#31659C"><B>return</B></font> (<A HREF="#77">variable</A>.getName().length() > 0) ? <A HREF="#77">variable</A>.getName() : <font color="#0030CE">"param"</font> + <A HREF="#77">parameterNumber</A>;
<A NAME="79"></A>    }
<A NAME="80"></A>
<A NAME="81"></A>    <font color="#31659C"><B>public</B></font> <font color="#31659C"><B>static</B></font> <font color="#31659C"><B>void</B></font> main(String[] args) {
<A NAME="82"></A>        StandaloneJDeveloperParser app = <font color="#31659C"><B>new</B></font> <A HREF="#24">StandaloneJDeveloperParser</A>();
<A NAME="83"></A>        <A HREF="#82">app</A>.<A HREF="#38">displayMethodList</A>(<font color="#0030CE">"oracle.ide.Ide"</font>, System.out);
<A NAME="84"></A>        System.exit(0);
<A NAME="85"></A>    }
<A NAME="86"></A>
<A NAME="87"></A>
<A NAME="88"></A>}</PRE>]]>

</content>
</entry>
<entry>
<title>Using local Javadoc in JDeveloper 10.1.3</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/10/using_local_jav_1.html" />
<modified>2006-01-19T18:43:33Z</modified>
<issued>2005-10-19T15:23:55Z</issued>
<id>tag:www.robsite.org,2005://2.84</id>
<created>2005-10-19T15:23:55Z</created>
<summary type="text/plain">I was asked today, how to set JDeveloper to use a locally installed copy of Javadoc for the Java SE classes instead of referring to Sun&apos;s hosted Javadoc. Here is the answer: First download the Javadoc zip file from Sun. Currently the URL is http://java.sun.com/j2se/1.5.0/download.jsp. Now edit the J2SE definition (it should be the one under user). Remove the URL to http://java.sun.com/j2se/1.5/api from the Doc Path for the JDK definition. Add (using the Add Entry button) the path to &quot;docs/api inside of the JAR file). JDeveloper&apos;s file open dialog allows navigation into JAR and ZIP files by treating them as a directory, so navigate into the jdk-1_5_0-doc.zip file and pick the directory &quot;docs&quot; and then &quot;api&quot;. Now JDeveloper should be using the local Javadoc instead of the hosted copy. You should also make sure your projects are using the JDK definition that does not include the words (Default) in the name. This is how the J2SE definition should look once finished....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>JDeveloper</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>I was asked today, how to set JDeveloper to use a locally installed copy of Javadoc for the Java SE classes instead of referring to <a href="http://www.sun.com">Sun's <a href="http://java.sun.com/j2se/1.5/api">hosted Javadoc</a>.
</p>
<p>Here is the answer:</p>
<p>
First download the Javadoc zip file from Sun.  Currently the URL is <a href="http://java.sun.com/j2se/1.5.0/download.jsp">http://java.sun.com/j2se/1.5.0/download.jsp</a>.
</p><p>
Now edit the J2SE definition (it should be the one under user).
<ul>
<li>Remove the URL to <a href="http://java.sun.com/j2se/1.5/api">http://java.sun.com/j2se/1.5/api</a>  from the Doc Path for the JDK definition.
<li>Add (using the <tt>Add Entry</tt> button) the path to "docs/api inside of the JAR file).  
</ul>
<em>JDeveloper's file open dialog allows navigation into JAR and ZIP  files by treating them as a directory, so navigate into the jdk-1_5_0-doc.zip file and pick the directory "docs" and then "api".</em>
</p>
<p>Now JDeveloper should be using the local Javadoc instead of the hosted copy.  You should also make sure your projects are using the JDK definition that does not include the words <tt>(Default)</tt> in the name.</p>
<p><img src="http://www.robsite.org/blogimages/1013-jdev-java-page.jpg" title="JDeveloper Configure J2SE definition page" alt="[JDeveloper J2SE Configuration Page]">
<p>
This is how the J2SE definition should look once finished.</p>]]>

</content>
</entry>
<entry>
<title>Getting extension versions in JDeveloper 10.1.3 EA</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/10/getting_extensi.html" />
<modified>2006-01-19T18:43:33Z</modified>
<issued>2005-10-12T15:55:46Z</issued>
<id>tag:www.robsite.org,2005://2.83</id>
<created>2005-10-12T15:55:46Z</created>
<summary type="text/plain">I was asked how to list the versions of the extensions located in a given JDeveloper install directory, so here is a short example of how to do this from outside of JDeveloper. I&apos;m sure I&apos;ll get a comment from Brian telling me I should use XPath in here, but version is pretty trivial to get without it. package jdev.test; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.util.Locale; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import oracle.xml.parser.v2.DOMParser; import org.xml.sax.SAXException; public class ExtensionVersions { public static void main(String[] args) { File jdevhome = new File(&quot;C:\\jdev\\jdevstudio1013_3412&quot;); File exthome = new File(jdevhome, &quot;jdev\\extensions&quot;); File[] jars = exthome.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.getName() .toLowerCase(Locale.ENGLISH) .endsWith(&quot;.jar&quot;); } } ); for (File jar : jars) { String version = getExtensionVersion(jar); System.out.printf( &quot;file: [%s] version: [%s]\n&quot;, jar.getName(), version ); } } private static String getExtensionVersion(File jar) { try { ZipFile zf = new ZipFile(jar); ZipEntry ze = zf.getEntry(&quot;META-INF/extension.xml&quot;); if (ze != null) { DOMParser parser = new DOMParser(); parser.parse(zf.getInputStream(ze)); return parser.getDocument().getDocumentElement().getAttributeNS(null, &quot;version&quot;); } } catch (IOException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } return &quot;(unknown)&quot;; } }...</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>JDeveloper</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>I was asked how to list the versions of the extensions located in a given JDeveloper install directory, so here is a short example of how to do this from outside of JDeveloper.  I'm sure I'll get a comment from <a href="http://www.orablogs.com/duffblog/">Brian</a> telling me I should use <a href="http://www.orablogs.com/duffblog/archives/001444.html">XPath</a> in here, but version is pretty trivial to get without it.</p>

<PRE><font color="#31659C"><B>package</B></font> jdev.test;

<font color="#31659C"><B>import</B></font> java.io.File;
<font color="#31659C"><B>import</B></font> java.io.FileFilter;
<font color="#31659C"><B>import</B></font> java.io.IOException;

<font color="#31659C"><B>import</B></font> java.util.Locale;
<font color="#31659C"><B>import</B></font> java.util.zip.ZipEntry;
<font color="#31659C"><B>import</B></font> java.util.zip.ZipFile;

<font color="#31659C"><B>import</B></font> oracle.xml.parser.v2.DOMParser;

<font color="#31659C"><B>import</B></font> org.xml.sax.SAXException;


<font color="#31659C"><B>public</B></font> <font color="#31659C"><B>class</B></font> ExtensionVersions {
    <font color="#31659C"><B>public</B></font> <font color="#31659C"><B>static</B></font> <font color="#31659C"><B>void</B></font> main(String[] args) {
        File jdevhome = <font color="#31659C"><B>new</B></font> File(<font color="#0030CE">"C:\\jdev\\jdevstudio1013_3412"</font>);
        File exthome = <font color="#31659C"><B>new</B></font> File(jdevhome, <font color="#0030CE">"jdev\\extensions"</font>);
        File[] jars = exthome.listFiles(<font color="#31659C"><B>new</B></font> FileFilter() {
                                            <font color="#31659C"><B>public</B></font> <font color="#31659C"><B>boolean</B></font> accept(File pathname) {
                                                <font color="#31659C"><B>return</B></font> pathname.getName()
                                                .toLowerCase(Locale.ENGLISH)
                                                .endsWith(<font color="#0030CE">".jar"</font>);
                                            }
                                        }
            );
        <font color="#31659C"><B>for</B></font> (File jar : jars) {
            String version = getExtensionVersion(jar);
            System.out.printf( <font color="#0030CE">"file: [%s] version: [%s]\n"</font>, jar.getName(), version );
        }
    }

    <font color="#31659C"><B>private</B></font> <font color="#31659C"><B>static</B></font> String getExtensionVersion(File jar) {
        <font color="#31659C"><B>try</B></font> {
            ZipFile zf = <font color="#31659C"><B>new</B></font> ZipFile(jar);
            ZipEntry ze = zf.getEntry(<font color="#0030CE">"META-INF/extension.xml"</font>);
            <font color="#31659C"><B>if</B></font> (ze != <font color="#9C6500">null</font>) {
                DOMParser parser = <font color="#31659C"><B>new</B></font> DOMParser();
                parser.parse(zf.getInputStream(ze));
                <font color="#31659C"><B>return</B></font> parser.getDocument().getDocumentElement().getAttributeNS(<font color="#9C6500">null</font>, <font color="#0030CE">"version"</font>);
            }
        } <font color="#31659C"><B>catch</B></font> (IOException e) {
            e.printStackTrace();
        } <font color="#31659C"><B>catch</B></font> (SAXException e) {
            e.printStackTrace();
        }
        <font color="#31659C"><B>return</B></font> <font color="#0030CE">"(unknown)"</font>;
    }
}</PRE>]]>

</content>
</entry>
<entry>
<title>setLocationRelativeTo</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/07/setlocationrela_1.html" />
<modified>2006-01-19T18:43:33Z</modified>
<issued>2005-07-14T21:56:22Z</issued>
<id>tag:www.robsite.org,2005://2.82</id>
<created>2005-07-14T21:56:22Z</created>
<summary type="text/plain">If you&apos;ve used a Swing GUI Builder, or have a custom utility to center your frame/windows, you probably have run into code like: public void centerWindow( Window w ) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension windowSize = w.getSize(); if (windowSize.height &gt; screenSize.height) { windowSize.height = screenSize.height; } if (windowSize.width &gt; screenSize.width) { windowSize.width = screenSize.width; } w.setLocation( ( screenSize.width - windowSize.width ) / 2, ( screenSize.height - windowSize.height ) / 2 ); } Many IDE&apos;s put something like this in the main method of the default swing Application. If you are using JDK 1.4 or later, you can use the method setLocationRelativeTo to replace all of that code. Here&apos;s an example: myWindow.setLocationRelativeTo(null);...</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>If you've used a Swing GUI Builder, or have a custom utility to center your frame/windows, you probably have run into code like: </p>

<pre>
  public void centerWindow( Window w )
  {
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension windowSize = w.getSize();
    if (windowSize.height > screenSize.height)
    {
      windowSize.height = screenSize.height;
    }
    if (windowSize.width > screenSize.width)
    {
      windowSize.width = screenSize.width;
    }
    w.setLocation( ( screenSize.width - windowSize.width ) / 2, ( screenSize.height - windowSize.height ) / 2 );
  }
</pre>

<p>Many IDE's put something like this in the main method of the default swing Application.</p>

<p>If you are using JDK 1.4 or later, you can use the method <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html#setLocationRelativeTo(java.awt.Component)">setLocationRelativeTo</a> to replace all of that code.</p>

<p>Here's an example:</p>

<pre>  myWindow.setLocationRelativeTo(null); </pre>]]>

</content>
</entry>
<entry>
<title>At JavaOne (like everyone else it seems)</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/06/at_javaone_like.html" />
<modified>2006-01-19T18:43:33Z</modified>
<issued>2005-06-28T18:51:51Z</issued>
<id>tag:www.robsite.org,2005://2.81</id>
<created>2005-06-28T18:51:51Z</created>
<summary type="text/plain">The JavaOne Pavilion is about to open today. I&apos;m over at the Agile Development Oracle pod if you want to check out JDeveloper. We&apos;ve also brought one of our Mac&apos;s up here with us to show JDeveloper on a nice big 23&quot; cinema display screen. After lunch, there are a couple of swing sessions starting at 1:30pm that look interesting. I&apos;ll post anything interesting from them for those of you not here. Also, 5pm today we have quite a few announcements that will be happening at Thomas Kurian&apos;s keynote today. Be sure to check it out....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>The JavaOne Pavilion is about to open today.  I'm over at the Agile Development Oracle pod if you want to check out JDeveloper.  We've also brought one of our Mac's up here with us to show JDeveloper on a nice big 23" cinema display screen.  After lunch, there are a couple of swing sessions starting at 1:30pm that look interesting.  I'll post anything interesting from them for those of you not here.  Also, 5pm today we have quite a few announcements that will be happening at Thomas Kurian's keynote today.  Be sure to check it out.</p>]]>

</content>
</entry>
<entry>
<title>It&apos;s been a Long Time</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/06/its_been_a_long.html" />
<modified>2006-01-19T18:39:28Z</modified>
<issued>2005-06-28T18:48:41Z</issued>
<id>tag:www.robsite.org,2005://2.80</id>
<created>2005-06-28T18:48:41Z</created>
<summary type="text/plain">It&apos;s been a long time since I&apos;ve posted anything, been quite busy with a new girl in my life. She&apos;s about 10lbs now, 8 weeks old, and cute as can be. I&apos;m quite lucky that she gets her good looks from her mother....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>General</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>It's been a long time since I've posted anything, been quite busy with a  new girl in my life.  She's about 10lbs now, 8 weeks old, and cute as can be.  I'm quite lucky that she gets her good looks from her mother.</p>]]>

</content>
</entry>
<entry>
<title>Tivo HME JDeveloper Extension</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/03/tivo_hme_jdevel.html" />
<modified>2006-01-19T18:43:33Z</modified>
<issued>2005-03-30T06:35:23Z</issued>
<id>tag:www.robsite.org,2005://2.79</id>
<created>2005-03-30T06:35:23Z</created>
<summary type="text/plain">After writing up my last bit on how to create HME applications with JDeveloper, I created a simple HME Extension for JDeveloper so you can just run/debug a HME application and JDeveloper will automatically launch the HME Simulator for you. Let me know if anyone has any feedback or suggestions for it. My email address is rob at this domain....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>JDeveloper</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>After writing up my last bit on how to create <a href="http://tivohme.sourceforge.net">HME</a> applications with JDeveloper, I created a simple <a href="http://robsite.org/projects/jdevhme/index.html">HME Extension</a> for JDeveloper so you can just run/debug a HME application and JDeveloper will automatically launch the HME Simulator for you.</p>

<p>Let me know if anyone has any feedback or suggestions for <a href="http://robsite.org/projects/jdevhme/index.html">it</a>.  My email address is rob at this domain.</p>]]>

</content>
</entry>
<entry>
<title>Creating Tivo HME Applications in Oracle JDeveloper</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/03/creating_tivo_h.html" />
<modified>2006-01-19T18:43:33Z</modified>
<issued>2005-03-30T00:36:26Z</issued>
<id>tag:www.robsite.org,2005://2.78</id>
<created>2005-03-30T00:36:26Z</created>
<summary type="text/plain"><![CDATA[Tivo HME provides a Java API for developing applications running on your Tivo Series2 device as well as a Java Simulator to use during development. It&#8217;s quite easy to set this up to use JDeveloper as your IDE while creating Tivo HME applications. First off you need to install the Tivo HME SDK from http://tivohme.sourceforge.net and uncompress it. In my example here, I used the C:\lib\ directory, which once unpacked put the SDK into C:\lib\hme_sdk_ea1.1. Once you have it installed, you can verify that it works by using the runsamples.bat (or runsamples.sh) script located in the samples directory. To use the SDK in JDeveloper, you need to create a library. Here are the steps: Use Tools | Manage Libraries to bring up the Manage Libraries Dialog. Click New&#8230; Enter &#8220;Tivo HME&#8221; as the name of your library To the Class Path, add C:\lib\hme_sdk_ea1.1\hme.jar and C:\lib\hme_sdk_ea1.1\simulator.jar To the Source Path, add C:\lib\hme_sdk_ea1.1\src.zip To the Doc Path, add C:\lib\hme_sdk_ea1.1\doc\hme-javadoc.zip Click OK. Now you will need to create a new Application testing the SDK. File | New Choose Application Enter a new name for your Application or accept the default value and click OK Enter a new name for your Project or accept the default value and click OK Tools | Project Properties On the Libraries page, add your newly created Tivo HME library to your project. File | New Select Java Class Change the class to extend com.tivo.hme.sdk.Application Add the following init method: protected void init(Context context) throws Exception { root.setResource(createText(&quot;default-36-bold.font&quot;, Color.white, &quot;Hello from JDeveloper!&quot;)); } Add the following main method: public static void main(String[] args) { Simulator.main(new String[] {HelloWorld.class.getName()}); } Now you can run your application and the Tivo Simulator will launch your Tivo HME application. &nbsp;...]]></summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>Tivo HME provides a Java API for developing applications running on your Tivo
  Series2 device as well as a Java Simulator to use during development. It&#8217;s
  quite easy to set this up to use JDeveloper as your IDE while creating Tivo
  HME applications.</p>
<p>First off you need to install the Tivo HME SDK from <a href="http://tivohme.sourceforge.net
">http://tivohme.sourceforge.net</a>
  and uncompress it. In my example here, I used the C:\lib\ directory, which
  once unpacked put the SDK into C:\lib\hme_sdk_ea1.1. Once you have it installed,
  you can verify that it works by using the runsamples.bat (or runsamples.sh)
  script located in the samples directory.</p>
<p>To use the SDK in JDeveloper, you need to create a library. Here are the steps:</p>
<ol>
  <li>  Use Tools | Manage Libraries to bring up the Manage Libraries Dialog.</li><br>
  <img src="http://www.robsite.org/blogimages/tivohme/manage-libs.jpg" width="700" height="500">
  <li> Click New&#8230;</li>
  <li> Enter &#8220;Tivo HME&#8221; as the name of your library</li>
  <li> To the Class Path, add C:\lib\hme_sdk_ea1.1\hme.jar and C:\lib\hme_sdk_ea1.1\simulator.jar</li>
  <li> To the Source Path, add C:\lib\hme_sdk_ea1.1\src.zip</li><br>
       <img src="http://www.robsite.org/blogimages/tivohme/hme-library.jpg" width="354" height="500">
  <li> To the Doc Path, add C:\lib\hme_sdk_ea1.1\doc\hme-javadoc.zip</li>
  <li> Click OK.</li>
</ol>
<p>Now you will need to create a new Application testing the SDK.</p>
<ol>
  <li> File | New</li>
  <li> Choose Application</li>
  <li> Enter a new name for your Application or accept the default value and
  click OK</li>
  <li>Enter a new name for your Project or accept the default value
  and click OK</li>
  <li>Tools | Project Properties<br>
  <img src="http://www.robsite.org/blogimages/tivohme/project-props.jpg" width="700" height="528">  </li>
  <li>On the Libraries page, add your newly created
  Tivo HME library to your project.<br>
  <img src="http://www.robsite.org/blogimages/tivohme/add-library.jpg" width="342" height="477">  </li>
  <li>File | New</li>
  <li>Select <strong> Java Class</strong></li>
  <li>Change the class to extend com.tivo.hme.sdk.Application<br>
  <img src="http://www.robsite.org/blogimages/tivohme/new-class.jpg" width="385" height="327">  </li>
  <li>Add the following
    init method:<br>
<pre>
    protected void init(Context context) throws Exception
    {
        root.setResource(createText(&quot;default-36-bold.font&quot;, Color.white, &quot;Hello from JDeveloper!&quot;));
    }
</pre>
<li>Add the following main method:</li>
<pre>
    public static void main(String[] args)<br>
    {
        Simulator.main(new String[] {HelloWorld.class.getName()});
    }

</pre>
</ol>
<p>Now you can run your application and the Tivo Simulator will launch your
  Tivo HME application.</p>
<p><img src="http://www.robsite.org/blogimages/tivohme/simulator.jpg" width="650" height="608"></p>
<p>&nbsp;</p>
<p></p>
<p><br>
</p>]]>

</content>
</entry>
<entry>
<title>xmlproperty rocks</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/03/xmlproperty_roc.html" />
<modified>2006-01-11T22:53:00Z</modified>
<issued>2005-03-18T18:13:59Z</issued>
<id>tag:www.robsite.org,2005://2.77</id>
<created>2005-03-18T18:13:59Z</created>
<summary type="text/plain"><![CDATA[Brian Duff looked at one of my Ant build scripts which had something like: &lt;!-- this would be better kept in build.properties otherwise --&gt; &lt;property name="extension.name" value="oracle.jdeveloper.vcs.test" /&gt; &lt;property name="extension.version" value="10.1.3" /&gt; &lt;property name="dist.extension.jar.file" value="${dist}/${extension.name}.${extension.version}.jar" /&gt; His comment was to use the xmlproperty Ant task. Excellent idea, now this code goes like: &lt;xmlproperty file="${classes.java}/META-INF/extension.xml" prefix="extensionxml"/&gt; &lt;property name="dist.extension.jar.file" value="${dist}/${extensionxml.extension(id)}.${extensionxml.extension(version)}.jar" /&gt; Also, I don't have to update the version to match extension.xml since the extension.xml file is now the source of truth....]]></summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p><a href="http://www.orablogs.com/duffblog">Brian Duff</a> looked at one of my Ant build scripts which had something like:</p>

<p>&lt;!-- this would be better kept in build.properties otherwise --&gt;<br />
&lt;property name="extension.name" value="oracle.jdeveloper.vcs.test" /&gt;<br />
&lt;property name="extension.version" value="10.1.3" /&gt;<br />
&lt;property name="dist.extension.jar.file" value="${dist}/${extension.name}.${extension.version}.jar" /&gt;</p>

<p>His comment was to use the <a href="http://ant.apache.org/manual/CoreTasks/xmlproperty.html">xmlproperty</a> Ant task.  </p>

<p>Excellent idea, now this code goes like:</p>

<p>&lt;xmlproperty file="${classes.java}/META-INF/extension.xml"<br />
            prefix="extensionxml"/&gt;<br />
&lt;property name="dist.extension.jar.file"<br />
            value="${dist}/${extensionxml.extension(id)}.${extensionxml.extension(version)}.jar" /&gt;</p>

<p>Also, I don't have to update the version to match extension.xml since the extension.xml file is now the source of truth.</p>]]>

</content>
</entry>
<entry>
<title>EJB 3.0 Preview for Oracle Application Server.</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/03/ejb_30_preview.html" />
<modified>2006-01-11T22:53:00Z</modified>
<issued>2005-03-04T16:03:01Z</issued>
<id>tag:www.robsite.org,2005://2.76</id>
<created>2005-03-04T16:03:01Z</created>
<summary type="text/plain">I just got an email from Shay that our (Oracle&apos;s) EJB 3.0 preview release is out on OTN The URL is http://otn.oracle.com/ejb3. There&apos;s the software, and a bunch of documentation and samples to help you get going with EJB3. Check it out. If you run into any problems, or need help, you can post in the J2EE forum on OTN....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>I just got an email from <a href="http://www.orablogs.com/shay/">Shay</a> that our (Oracle's) EJB 3.0 preview release is out on <a href="http://otn.oracle.com/">OTN</a></p>

<p>The URL is <a href="http://otn.oracle.com/ejb3">http://otn.oracle.com/ejb3</a>.  There's the software, and a bunch of documentation and samples to help you get going with EJB3.  Check it out.  If you run into any problems, or need help, you can post in the <a href="http://forums.oracle.com/forums/forum.jsp?forum=46">J2EE forum</a> on OTN.</p>]]>

</content>
</entry>
<entry>
<title>equals and hashCode</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/03/equals_and_hash.html" />
<modified>2006-01-11T22:53:00Z</modified>
<issued>2005-03-03T23:09:53Z</issued>
<id>tag:www.robsite.org,2005://2.75</id>
<created>2005-03-03T23:09:53Z</created>
<summary type="text/plain">I see this mentioned on blogs fairly regularly, and it&apos;s always a surprise for people when they learn you have to override hashCode if you override equals. In short: If you override equals, you must override hashCode. (From the Javadoc comments from java.lang.Object) The general contract of hashCode is: Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. Here are a couple of references: java.lang.Object Javadoc JavaWorld article from 1999 on equals and hashCode Here is another link (from a Geocities site) explaining it....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>I see this mentioned on blogs fairly regularly, and it's always a surprise for people when they learn you have to override hashCode if you override equals.
<p>
In short: If you override <tt>equals</tt>, you <strong>must</strong> override <tt>hashCode</tt>.
<p>
(From the Javadoc comments from <tt>java.lang.Object</tt>)<br>
The general contract of <code>hashCode</code> is: 
 <ul>
 <li>Whenever it is invoked on the same object more than once during 
     an execution of a Java application, the <tt>hashCode</tt> method 
     must consistently return the same integer, provided no information 
     used in <tt>equals</tt> comparisons on the object is modified.
     This integer need not remain consistent from one execution of an
     application to another execution of the same application. 
 <li>If two objects are equal according to the <tt>equals(Object)</tt>

     method, then calling the <code>hashCode</code> method on each of 
     the two objects must produce the same integer result. 
 <li>It is <em>not</em> required that if two objects are unequal 
     according to the <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#equals(java.lang.Object)"><CODE>equals(java.lang.Object)</CODE></A> 
     method, then calling the <tt>hashCode</tt> method on each of the 
     two objects must produce distinct integer results.  However, the 
     programmer should be aware that producing distinct integer results 
     for unequal objects may improve the performance of hashtables.
 </ul>
<p>
Here are a couple of references:
<ul>
<li><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html">java.lang.Object Javadoc</a></li>
<li><a href="http://www.javaworld.com/javaworld/jw-01-1999/jw-01-object-p2.html">JavaWorld article from 1999 on equals and hashCode</a></li>
<li><a href="http://www.geocities.com/technofundo/tech/java/equalhash.html">Here</a> is another link (from a Geocities site) explaining it.</li>
</ol>
<p>]]>

</content>
</entry>
<entry>
<title>Tweak default Mac OS X keymap to be more Windows/Linux like.</title>
<link rel="alternate" type="text/html" href="http://www.robsite.org/archives/2005/03/tweak_default_m.html" />
<modified>2006-01-11T22:53:00Z</modified>
<issued>2005-03-02T00:52:48Z</issued>
<id>tag:www.robsite.org,2005://2.74</id>
<created>2005-03-02T00:52:48Z</created>
<summary type="text/plain">On Mac OS X, you can create a default key-binding file and override the default keymap of most Mac OS X applications. More information on this is available in the Apple Developer Connection article Text System Defaults and Key Bindings. I saw this post on Slashdot, which has a nice example of creating an improved default keymap (improved for those of us recently switching from Windows). I took it and added control-home and control-end to better finish out the windows emulation behavior. In order to use the new key-binding, here&apos;s what you need to do: Create the directory $HOME/Library/KeyBindings Save this as $HOME/Library/KeyBindings/DefaultKeyBinding.dict /* ~/Library/KeyBindings/DefaultKeyBinding.dict */ /* Home/End keys more like Windows */ { &quot;\UF729&quot; = &quot;moveToBeginningOfLine:&quot;; /* home */ &quot;\UF72B&quot; = &quot;moveToEndOfLine:&quot;; /* end */ &quot;$\UF729&quot; = &quot;moveToBeginningOfLineAndModifySelection:&quot;; /* shift + home */ &quot;$\UF72B&quot; = &quot;moveToEndOfLineAndModifySelection:&quot;; /* shift + end */ &quot;^\UF729&quot; = &quot;moveToBeginningOfDocument:&quot;; /* control + home */ &quot;^\UF72B&quot; = &quot;moveToEndOfDocument:&quot;; /* control + end */ } Once done, you can simply fire up TextEdit and try it out....</summary>
<author>
<name>rcleveng</name>
<url>http://www.robsite.org</url>
<email>rob@robsite.org</email>
</author>
<dc:subject>Apple</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.robsite.org/">
<![CDATA[<p>On Mac OS X, you can create a default key-binding file and override the default keymap of most Mac OS X applications.  More information on this is available in the Apple Developer Connection article <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/BasicEventHandling/Tasks/TextDefaultsAndBindings.html">Text System Defaults and Key Bindings</a>.</p>

<p>I saw <a href="http://ask.slashdot.org/askslashdot/05/03/01/2141250.shtml?tid=179&tid=178&tid=201&tid=4&tid=106">this post</a> on Slashdot, which has a nice example of creating an improved default keymap (improved for those of us recently switching from Windows).  I took it and added control-home and control-end to better finish out the windows emulation behavior.</p>

<p>In order to use the new key-binding, here's what you need to do:<br />
 <br />
Create the directory $HOME/Library/KeyBindings<br />
Save this as $HOME/Library/KeyBindings/DefaultKeyBinding.dict</p>

<pre>
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
/* Home/End keys more like Windows */
{
"\UF729" = "moveToBeginningOfLine:"; /* home */
"\UF72B" = "moveToEndOfLine:"; /* end */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* shift + home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* shift + end */
"^\UF729" = "moveToBeginningOfDocument:"; /* control + home */
"^\UF72B" = "moveToEndOfDocument:"; /* control + end */

<p>}<br />
</pre></p>

<p>Once done, you can simply fire up TextEdit and try it out.</p>]]>

</content>
</entry>

</feed>