<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-31592724</id><updated>2024-09-11T13:01:57.719-04:00</updated><category term="technology"/><category term="eclipse"/><category term="pluto"/><category term="scala"/><category term="javascript"/><category term="media queries"/><category term="portlet"/><category term="responsive"/><category term="spa"/><category term="git"/><category term="html5"/><category term="backbone"/><category term="apache"/><category term="cake-pattern"/><category term="css"/><category term="ember"/><category term="geo"/><category term="google"/><category term="jquery"/><category term="jquerymobile"/><category term="mac"/><category term="maven"/><category term="music"/><category term="notebook"/><category term="parenting"/><category term="review"/><category term="tivo"/><category term="traits"/><category term="twitter"/><category term="unix"/><category term="webapps"/><title type='text'>Marcus Christie&#39;s Blog</title><subtitle type='html'>Wherein I write about stuff that I find interesting.  Most of entries will probably be technology related (Java, Web development, Python, Flex, etc.).  But I will also write about: my adventures in homeschooling and parenting, reviews of books I&#39;ve read, and anything else I&#39;ve learned or seen that I think is cool enough to share.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/-/technology'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/search/label/technology'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/-/technology/-/technology?start-index=26&amp;max-results=25'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-31592724.post-2429213810499808379</id><published>2011-07-09T13:20:00.006-04:00</published><updated>2011-07-09T17:39:42.324-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><title type='text'>How to dynamically change the Tweet Button&#39;s tweet text</title><content type='html'>Looked around on the internet for a way to dynamically change the tweet text of the &lt;a href=&quot;http://dev.twitter.com/pages/tweet_button&quot;&gt;Tweet Button&lt;/a&gt;, but didn&#39;t find a good solution. Most of what I found involved setting the text when the page is being rendered server side or client side. But what I need for &lt;a href=&quot;http://fuelmyroute.com/&quot;&gt;FuelMyRoute.com&lt;/a&gt; is a way to dynamically update the tweet text based on the user&#39;s activity in the page after it has rendered. (Specifically, based on the route provided by the user, I want to update the tweet text to say something specific about how much the user has saved per gallon of gas.)&lt;br /&gt;&lt;br /&gt;The solution I went with uses the iframe Tweet Button, and basically you just need a bit of javascript to manipulate the URL that configures the iframe Tweet Button. I went with the iframe Tweet Button over the javascript Tweet Button because the javascript one manipulates the DOM and replaces your anchor tag with an iframe, etc. You could theoretically dynamically change the tweet text for the javascript Tweet Button but it would be a little brittle, being dependent on how the javascript Tweet Button renders itself.&lt;br /&gt;&lt;br /&gt;Enough jibber jabber, on to the code! You start by adding an iframe Tweet Button to the page:&lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;https://gist.github.com/1073967.js?file=gistfile1.xml&quot;&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Then you need this function which updates the text parameter of the iframe Tweet Button&#39;s query string (which of course will cause the button to reload):&lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;https://gist.github.com/1073778.js?file=gistfile1.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;You can try it out right here. Click on the Tweet Button below and preview the message, which should be &quot;Replace Me&quot;:&lt;br /&gt;&lt;br /&gt;&lt;iframe id=&quot;tweet-button&quot; allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://platform.twitter.com/widgets/tweet_button.html?via=marcus_christie&amp;amp;text=Replace%20Me&amp;amp;count=horizontal&quot; style=&quot;width:110px; height:20px;&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Now click on the button below which will call &lt;code&gt;updateTweetButtonText(&#39;I just dynamically updated the text of a Tweet Button!&#39;);&lt;/code&gt; and then click on the Tweet Button again to see that the preview tweet has been updated:&lt;br /&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;https://raw.github.com/gist/1073778/f0c1148a17240a063dbbfc8983411a70e6cc99b7/gistfile1.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;button&quot; value=&quot;Update text&quot; onclick=&quot;updateTweetButtonText(&#39;I just dynamically updated the text of a Tweet Button!&#39;);&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/2429213810499808379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/2429213810499808379' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/2429213810499808379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/2429213810499808379'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2011/07/how-to-dynamically-change-tweet-buttons.html' title='How to dynamically change the Tweet Button&#39;s tweet text'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-3581935027329668410</id><published>2008-11-04T20:07:00.000-05:00</published><updated>2009-06-06T08:30:26.542-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>How to use custom ant tasks in a WTP generic ant publisher</title><content type='html'>Before creating the &lt;a href=&quot;http://code.google.com/p/pluto-server-plugin/&quot;&gt;Eclipse Pluto Server Plug-in&lt;/a&gt;, I had an Ant script to publish my portlets to a Pluto server.  That Ant script used the &lt;a href=&quot;http://maven.apache.org/ant-tasks/index.html&quot;&gt;Maven2 ant tasks&lt;/a&gt; to download the needed Pluto ant task jar and its dependencies.  This Pluto ant task is needed to rewrite the portlet&#39;s web.xml so that it contains the Pluto server&#39;s invoker of the portlet.  When I first created the plug-in and needed a way to get the Pluto ant task jar, I looked for how to include it with the plug-in jar but I couldn&#39;t figure out how to expose it to the Pluto ant publisher script I created as part of the &lt;a href=&quot;http://www.eclipse.org/webtools/community/tutorials/ServerDefinitionExplained/ServerDefinitionExplained.html&quot;&gt;WTP generic server definition&lt;/a&gt;.  So, I used the Maven2 stuff I already had, and it worked pretty well for me.  However, it was never ideal.&lt;br /&gt;&lt;br /&gt;Recently, actually by accident, I figured out how to make ant tasks in a plug-in available to a WTP ant publisher.  I stumbled upon the Eclipse ant extension point documentation, specifically, the part about &lt;a href=&quot;http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ant_core_extraClasspathEntries.html&quot;&gt;Extra Ant Classpath Entries&lt;/a&gt;.  Not sure how I missed this before, but it&#39;s basically all right there.  There&#39;s also the &lt;a href=&quot;http://help.eclipse.org/stable/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ant_core_antTasks.html&quot;&gt;org.eclipse.ant.core.antTasks&lt;/a&gt; extension point which allows you to expose ant tasks to your ant scripts in Eclipse.  Since it wasn&#39;t immediately obvious to me at first, I thought I would post how I got it working.  It&#39;s actually quite simple once you know what extension points to work with.&lt;br /&gt;&lt;br /&gt;Here&#39;s what I added to the Pluto Server Plug-in plugin.xml to define the Pluto ant task&lt;br /&gt;&lt;pre style=&quot;overflow: auto&quot;&gt;&lt;br /&gt;  &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extension&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;point&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;org.eclipse.ant.core.antTasks&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;antTask&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;pluto.assemble&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;org.apache.pluto.ant.AssembleTask&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/pluto-ant-tasks-1.1.6.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;/extension&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But of course this ant task has dependencies.  To make it&#39;s dependencies available to it, you&#39;ll just need to add extraClasspathEntries&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;overflow: auto&quot;&gt;&lt;br /&gt;  &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extension&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;id&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;pluto-assembletask-classpath&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;point&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;org.eclipse.ant.core.extraClasspathEntries&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/castor-1.1.1.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/cglib-full-2.0.2.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/commons-beanutils-1.7.0.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/commons-cli-1.0.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/commons-digester-1.8.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/commons-io-1.3.1.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/commons-lang-1.0.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/commons-logging-1.0.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/commons-logging-api-1.1.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/pluto-descriptor-api-1.1.6.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/pluto-descriptor-impl-1.1.6.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/pluto-util-1.1.6.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/xercesImpl-2.6.2.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;extraClasspathEntries&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;library&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;lib/xmlParserAPIs-2.6.2.jar&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;/extension&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I&#39;m not quite sure why, but the &lt;code&gt;eclipseRuntime&lt;/code&gt; attribute needs to be set to false to get this to work.  The docs say&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;b&gt;eclipseRuntime&lt;/b&gt; - indicates whether this extra classpath entry should only be considered for builds run in the same VM as Eclipse. The implied value is true, when not specified.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;So I can only guess that this means that the WTP ant publisher doesn&#39;t run in the same VM as Eclipse?  Anyhow, I tried it both ways, and it only worked with the value of false.&lt;br /&gt;&lt;br /&gt;From my ant publisher script, nothing special, I just reference the &lt;code&gt;pluto.assemble&lt;/code&gt; task (I gave it that name).  Here&#39;s the snippet where I use it:&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;target&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;assemble&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;portletxml.exists&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;pluto&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt;assemble&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;webxml&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;${module.dir}/WEB-INF/web.xml&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;portletxml&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;${module.dir}/WEB-INF/portlet.xml&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#008080;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color:#2e8b57;&quot;&gt;&lt;b&gt;destfile&lt;/b&gt;&lt;/span&gt;=&lt;span style=&quot;color:#ff00ff;&quot;&gt;&quot;${webxml.with.portlet.mapping.file}&quot;&lt;/span&gt;&lt;span style=&quot;color:#008080;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color:#008080;&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Previously I had to define the task with a &lt;code&gt;&amp;lt;taskdef&gt;&lt;/code&gt; tag, but I no longer need that.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/3581935027329668410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/3581935027329668410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/3581935027329668410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/3581935027329668410'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2008/11/how-to-use-custom-ant-tasks-in-wtp.html' title='How to use custom ant tasks in a WTP generic ant publisher'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-7669922444788563944</id><published>2008-11-04T19:55:00.000-05:00</published><updated>2009-06-06T08:09:29.000-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="pluto"/><category scheme="http://www.blogger.com/atom/ns#" term="portlet"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Pluto Server Plug-in 1st beta of 1.0.0 released</title><content type='html'>This past weekend I created a 1.0.0.b1 release of the &lt;a href=&quot;http://code.google.com/p/pluto-server-plugin/&quot;&gt;Eclipse Pluto Server Plug-in&lt;/a&gt;.  Biggest change is that I got rid of the hack I had in there using Maven to download the Pluto ant task and dependencies needed to publish a portlet to Pluto.  I now bundle the ant task jar and its dependencies with the plug-in (a topic for a future post).  Having Maven do the download was something that would work most times but had problems.  For example, some users have not been able to get the plug-in to work with a proxy server setup (see &lt;a href=&quot;http://code.google.com/p/pluto-server-plugin/issues/detail?id=3&quot;&gt;issue #3&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;It likely won&#39;t get picked up as an update in Eclipse; you&#39;ll need to go into the Update Manager and install it as a new feature.  And don&#39;t forget to use &lt;a href=&quot;http://pluto-server-plugin.googlecode.com/svn/trunk/pluto.server.update&quot;&gt;http://pluto-server-plugin.googlecode.com/svn/trunk/pluto.server.update&lt;/a&gt; as your update site.  If you try it out, let me know.  I&#39;d like to make the 1.0.0 release soon.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/7669922444788563944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/7669922444788563944' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7669922444788563944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7669922444788563944'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2008/11/pluto-server-plug-in-1st-beta-of-100.html' title='Pluto Server Plug-in 1st beta of 1.0.0 released'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-671973461041663018</id><published>2008-08-02T18:03:00.000-04:00</published><updated>2009-06-06T08:09:29.001-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="pluto"/><category scheme="http://www.blogger.com/atom/ns#" term="portlet"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Could not publish to server NPE bug fixed!</title><content type='html'>I finally had some time to sit down and try to figure out the &quot;Could not publish to server NPE bug&quot;.  Turns out to be a bug in WTP 2.0.2, &lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=219627&quot;&gt;bug #219627&lt;/a&gt;.  The WTP team released a patch and then later they made a &lt;a href=&quot;http://www.eclipse.org/webtools/releases/2.0.3/&quot;&gt;full 2.0.3 release&lt;/a&gt;.  However, if you download the latest version of Eclipse Europa (for JEE), it &lt;span style=&quot;font-style: italic;&quot;&gt;still has the older 2.0.2 version of WTP&lt;/span&gt;.  Which I believe explains why there have been so many reports of this problem.&lt;br /&gt;&lt;br /&gt;So the fix is to run the update manager in Eclipse and get the most recent updates for WTP.  I confirmed this by reverting my Eclipse config to WTP 2.0.2 and was able to reliably reproduce the issue.  Reverting back to WTP 2.0.3 got the deploy to Pluto working again.&lt;br /&gt;&lt;br /&gt;I added a &lt;a href=&quot;http://code.google.com/p/pluto-server-plugin/wiki/FrequentlyAskedQuestions&quot;&gt;FAQ page&lt;/a&gt; for the project with a FAQ also explaining the issue.  I also verified that the Pluto server plug-in works in Ganymede.&lt;br /&gt;&lt;br /&gt;Many thanks to campi, by the way.  I basically &lt;a href=&quot;http://www.google.com/search?q=NullPointerException+at+ComponentUtilities.getDeployUriOfComponent&amp;amp;hl=en&quot;&gt;ran a Google search&lt;/a&gt; based on the &lt;a href=&quot;http://marcus-christie.blogspot.com/2008/06/pluto-server-plug-in-could-not-publish.html?showComment=1216759680000#c1475274554528461010&quot;&gt;stack trace campi posted&lt;/a&gt; to &lt;a href=&quot;http://forums.java.net/jive/thread.jspa?messageID=287798&quot;&gt;find others who had run into the same issue but with a different plug-in&lt;/a&gt;.  And that eventually got me to the Eclipse bug and the resolution.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/671973461041663018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/671973461041663018' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/671973461041663018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/671973461041663018'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2008/08/could-not-publish-to-server-npe-bug.html' title='Could not publish to server NPE bug fixed!'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-4516239955435783638</id><published>2008-06-28T08:44:00.000-04:00</published><updated>2009-06-06T08:09:29.001-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Getting open square bullets in OpenOffice.org</title><content type='html'>Sometimes it&#39;s nice to create a bulleted list with a check box like bullet, e.g., creating a packing list.  Seems like in Word there&#39;s a quick option for selecting this style of bullets, but not so in OpenOffice.  To change a bulleted list to have a check box style bullet:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Select the bulleted list and in the menu go to &lt;span style=&quot;font-weight: bold;&quot;&gt;Format &gt; Bullets and Numbering...&lt;/span&gt;&lt;/li&gt;&lt;li&gt;In the dialog that comes up, select the &lt;span style=&quot;font-weight: bold;&quot;&gt;Options&lt;/span&gt; tab.&lt;/li&gt;&lt;li&gt;Click the &lt;span style=&quot;font-weight: bold;&quot;&gt;...&lt;/span&gt; button labeled &lt;span style=&quot;font-weight: bold;&quot;&gt;Character&lt;/span&gt;.  Under Ubuntu, the default font for my document is &lt;span style=&quot;font-style: italic;&quot;&gt;DejaVu Sans&lt;/span&gt; and the subset of characters displayed is the &lt;span style=&quot;font-style: italic;&quot;&gt;Geometric Shapes&lt;/span&gt;.  If you scroll up or down a bit, you can see a few different open square type bullets that can be used as check boxes.&lt;/li&gt;&lt;/ol&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqf905CIWZvlwigWqLTd0Hf40FFqZaO7_h8luHBbeOo9EMsP50kQAzopBgKdEKp-AL3x1oBt9_0O_K2YVABT7HNXJSy5lm6viZdiojPilgcU0YWI9BjrDv7b9YjVsHv952aVaj1w/s1600-h/openoffice_checkbox_bullets.png&quot;&gt;&lt;img style=&quot;cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqf905CIWZvlwigWqLTd0Hf40FFqZaO7_h8luHBbeOo9EMsP50kQAzopBgKdEKp-AL3x1oBt9_0O_K2YVABT7HNXJSy5lm6viZdiojPilgcU0YWI9BjrDv7b9YjVsHv952aVaj1w/s400/openoffice_checkbox_bullets.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5216915807174186258&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/4516239955435783638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/4516239955435783638' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/4516239955435783638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/4516239955435783638'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2008/06/getting-open-square-bullets-in.html' title='Getting open square bullets in OpenOffice.org'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqf905CIWZvlwigWqLTd0Hf40FFqZaO7_h8luHBbeOo9EMsP50kQAzopBgKdEKp-AL3x1oBt9_0O_K2YVABT7HNXJSy5lm6viZdiojPilgcU0YWI9BjrDv7b9YjVsHv952aVaj1w/s72-c/openoffice_checkbox_bullets.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-6381979954116157470</id><published>2008-06-22T16:07:00.000-04:00</published><updated>2009-06-06T08:09:29.001-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="pluto"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Eclipse Pluto Server Plug-in, v. 0.2.5 (now on Google Code)</title><content type='html'>Just finished moving the Pluto Server Plug-in code over to its own project page, &lt;a href=&quot;http://code.google.com/p/pluto-server-plugin/&quot;&gt;pluto-server-plugin&lt;/a&gt;, on Google Code.  I created a new minor release, v. 0.2.5, just to switch over the update site to the one on Google Code.  Switching over a plug-in&#39;s update site took some experimentation, but here&#39;s how I did it (for future reference and for anyone else needing to change a plug-in&#39;s update site)&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Change the Update Site URL for the Feature to the new update site. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Bump the Feature version and do a new release to the old site.  Users with an older release of the plug-in will get the update which will point them to the new update site for future releases.&lt;/li&gt;&lt;li&gt;Change the Update Site URL in the Update Site&#39;s site.xml file.  Publish the update site to the new update site location.&lt;/li&gt;&lt;/ol&gt;So hopefully it will be a seamless update for Pluto Server Plug-in users.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/6381979954116157470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/6381979954116157470' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6381979954116157470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6381979954116157470'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2008/06/eclipse-pluto-server-plug-in-v-025-now.html' title='Eclipse Pluto Server Plug-in, v. 0.2.5 (now on Google Code)'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-598397469526697447</id><published>2008-06-01T15:43:00.000-04:00</published><updated>2009-06-06T08:09:29.001-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="pluto"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Pluto Server Plug-in: Could not publish to server NPE bug</title><content type='html'>Some users of the Pluto server plug-in have had trouble getting a simple plug-in to deploy.  They receive an error message:&lt;br /&gt;&lt;blockquote&gt;Could not publish to the server.&lt;br /&gt;java.lang.NullPointerException&lt;/blockquote&gt;&lt;br /&gt;Unfortunately, I&#39;ve not been able to recreate the &quot;Could not publish to the server&quot; error.  I have created a new, clean Eclipse workspace and install, and went through the tutorial and it all still works.&lt;br /&gt;&lt;br /&gt;For those who are experiencing problems, I&#39;ve added a &lt;a href=&quot;http://www.cs.indiana.edu/%7Emachrist/projects/pluto-server-plugin/test-portlet.zip&quot;&gt;test portlet eclipse project&lt;/a&gt; that you can import and try to deploy to Pluto.  Some other troubleshooting ideas&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Make sure that you have a portlet.xml along with your portlet code.  That will be necessary.  See the eclipse project above for a simple example.&lt;/li&gt;&lt;li&gt;When first doing the deploy, you&#39;ll need to be connected to the internet so that the Maven ant tasks can download the pluto dependencies.  This is only required the first time you use the plug-in to deploy to a pluto server.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Check &lt;code&gt;ECLIPSE_WORKSPACE/.metadata/.log&lt;/code&gt;.  It may have more details regarding the exact nature of the error.  If you find anything, please do share it with me; I&#39;d love to get to the bottom of this bug.&lt;/li&gt;&lt;/ul&gt;In other Pluto Server Plug-in related business, I hope to have the code moved over to Google Code sometime this month.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/598397469526697447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/598397469526697447' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/598397469526697447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/598397469526697447'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2008/06/pluto-server-plug-in-could-not-publish.html' title='Pluto Server Plug-in: Could not publish to server NPE bug'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-7724549789050485223</id><published>2007-10-21T07:42:00.000-04:00</published><updated>2009-06-06T08:09:29.001-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="pluto"/><category scheme="http://www.blogger.com/atom/ns#" term="portlet"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Pluto Server Plug-in Screencast Posted</title><content type='html'>Just finished the &lt;a href=&quot;http://www.cs.indiana.edu/%7Emachrist/projects/pluto-server-plugin/demo.htm&quot;&gt;screencast&lt;/a&gt; promised for the Pluto Server Plug-in.  It&#39;s fairly simple, goes through installing the plug-in and then creating a simple &quot;hello world&quot; type portlet and deploying and displaying it in Pluto.&lt;br /&gt;&lt;br /&gt;&lt;s&gt;Unfortunately, the size of the screencast, produced with Wink, comes it at a little over 10MB.  I need to figure out how to keep these guys from getting so bloated.&lt;/s&gt; Using color palette now, has reduced the file size to just under 5MB.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/7724549789050485223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/7724549789050485223' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7724549789050485223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7724549789050485223'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/10/pluto-server-plug-in-screencast-posted.html' title='Pluto Server Plug-in Screencast Posted'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-3210697481504259681</id><published>2007-09-30T12:09:00.000-04:00</published><updated>2009-06-06T08:09:29.001-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="pluto"/><category scheme="http://www.blogger.com/atom/ns#" term="portlet"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Eclipse Pluto Server Plug-in, v. 0.2.4</title><content type='html'>I&#39;ve been working on an Eclipse Plug-in recently to provide a server definition for the Pluto portal driver.  Let me explain why.  To start with, I should say that I&#39;ve been &lt;a href=&quot;http://marcus-christie.blogspot.com/2007/03/running-portlets-on-pluto-from-within.html&quot;&gt;using Pluto 1.1.x with Eclipse for a while&lt;/a&gt;, since it comes bundled with Tomcat, it makes a nice, lightweight rapid development environment for working with portlets.  And Pluto keeps getting better.  In the latest release (v. 1.1.4), &lt;a href=&quot;https://issues.apache.org/jira/browse/PLUTO-382&quot;&gt;changes to the portal pages and layouts are persisted across server restarts&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Alas, there has always been the annoyance that Eclipse wants to deploy your web application as-is to the server, including the web.xml, and Pluto, like all portal servers, expects special servlet mappings to be in place for portlets in your portlet application.  For me this has meant having to rewrite the web.xml for when I want to deploy to Pluto in Eclipse, but then changing it back for when I want to change a servlet definition (or deploy to a different portal server, e.g., GridSphere).  So that is the problem that this Eclipse plug-in solves.  The web.xml rewriting is taken care of by the plug-in at deployment time.&lt;br /&gt;&lt;br /&gt;I&#39;ve put up a &lt;a href=&quot;http://www.extreme.indiana.edu/%7Emachrist/projects/pluto-server-plugin/&quot;&gt;quick web page&lt;/a&gt; for those interested.  For the impatient, create a new remote site in the update manager with this url: &lt;a href=&quot;http://www.extreme.indiana.edu/%7Emachrist/projects/pluto-server-plugin/updates&quot;&gt;http://www.extreme.indiana.edu/~machrist/projects/pluto-server-plugin/updates&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I&#39;ve started work on a screencast to show how this thing works, and hopefully I&#39;ll get that posted next week.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/3210697481504259681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/3210697481504259681' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/3210697481504259681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/3210697481504259681'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/09/eclipse-pluto-server-plug-in-v-024.html' title='Eclipse Pluto Server Plug-in, v. 0.2.4'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-7118486140448861471</id><published>2007-07-24T12:23:00.000-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>PURSe Portlets 1.1.0 Released</title><content type='html'>Just finished tagging and releasing a new version of the PURSe Portlets.  There are several great things in this release.  The one I am most proud of is also the one least apparent to the casual observer: the PURSe portlets are now synced up with the mainline PURSe codebase.  In PURSe Portlets 1.0.x, I had made modifications to the PURSe 1.0 release, but now I am a PURSe committer and I&#39;ve committed some of those modifications and bugfixes into the PURSe trunk.  Also, I&#39;ve developed an install script for PURSe that will install PURSe and it&#39;s dependencies, including a minimal deployment of Globus.  This should take a lot of the pain out of getting started with PURSe for the new user.&lt;br /&gt;&lt;br /&gt;Additional new features include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Added an AJAX &quot;Check availability of username&quot; to registration portlet&lt;/li&gt;&lt;li&gt;Forgot password portlet now resets the user&#39;s password instead of revealing it&lt;/li&gt;&lt;li&gt;Administrative portlet has a paged table of users&lt;/li&gt;&lt;li&gt;Administrative portlet also allows to add a single user or multiple users at once&lt;/li&gt;&lt;li&gt;Portal/portlet &quot;branding&quot; greatly simplified and aligned with PURSe&lt;/li&gt;&lt;/ul&gt;See the &lt;a href=&quot;http://www.extreme.indiana.edu/portals/purse-portlets/release-notes.html&quot;&gt;release notes&lt;/a&gt; for more information, or the &lt;a href=&quot;http://www.extreme.indiana.edu/portals/purse-portlets/downloads.html&quot;&gt;download page&lt;/a&gt; to get it now.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/7118486140448861471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/7118486140448861471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7118486140448861471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7118486140448861471'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/07/purse-portlets-110-released.html' title='PURSe Portlets 1.1.0 Released'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-6739936710825145775</id><published>2007-07-09T08:08:00.001-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Apache MaxClients reached, all connections in CLOSE_WAIT</title><content type='html'>Our Extreme Lab web server (Solaris running Apache 1.3) has recently developed a problem.  Twice yesterday it got into a state where it had hit its MaxClients limit (of 128, apparently) and then was unable to service any further requests.  Running &lt;code&gt;&lt;b&gt;netstat -f inet&lt;/b&gt;&lt;/code&gt; showed the all existing connections were in the CLOSE_WAIT stage.  I can&#39;t tell at this stage if there is some denial of service attack going on or just a problem with the server preventing it from finally closing these connections.&lt;br /&gt;&lt;br /&gt;Update: Googling around, and with some help from our local Unix guru, Rob Henderson, I found out that if you have connections stuck in the CLOSE_WAIT stage, this usually indicates that the server side is having trouble closing the connection.  Rob says that usually when he sees this problem it is because of an NFS server being down.  You get requests for something on that NFS mount, and the process hangs there for a long time.  With that NFS server remounted, things are much better.  Whereas before I was seeing steadily increasing numbers of CLOSE_WAIT connections, I now see none.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/6739936710825145775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/6739936710825145775' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6739936710825145775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6739936710825145775'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/07/apache-maxclients-reached-all.html' title='Apache MaxClients reached, all connections in CLOSE_WAIT'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-6219928508816804457</id><published>2007-06-14T16:58:00.000-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>JSF Portlet Fun: Request Scoped Beans Don&#39;t Survive From Action to Render Phase</title><content type='html'>Not sure if this is Pluto specific, but request scoped beans basically don&#39;t work as expected since they get initialized on the action phase and then again on the render phase.  This is with MyFaces 1.1.4 and Pluto 1.1.3.  At least with GridSphere 2.1.5 and MyFaces 1.0.9, I know that request scoped beans do work.  See &lt;a href=&quot;http://issues.apache.org/jira/browse/MYFACES-788&quot;&gt;http://issues.apache.org/jira/browse/MYFACES-788&lt;/a&gt; for more information.  The workaround is basic and actually standard from the Portlet API point of view.  The idea is that for any thing that you want to carry over from the action phase to the render phase, then just add this as a render parameter.  In this example, a field of the request scoped bean called &quot;success&quot; is a boolean.  So in the action method, I do this: &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // add the success field to a render parameter so it will be available in&lt;br /&gt;    // the render phase.  See constructor as well.&lt;br /&gt;    ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext();&lt;br /&gt;    if (extContext.getResponse() instanceof ActionResponse) {&lt;br /&gt;        ActionResponse actionResponse = (ActionResponse) extContext.getResponse();&lt;br /&gt;        actionResponse.setRenderParameter(&quot;success&quot;, Boolean.toString(success));&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Then in the contructor for the bean I have:&lt;br /&gt;    // Pull success value from render parameter set in action phase, i.e., submit()&lt;br /&gt;    ExternalContext extContext = facesContext.getExternalContext();&lt;br /&gt;    Map params = extContext.getRequestParameterMap();&lt;br /&gt;&lt;br /&gt;    if (params.containsKey(&quot;success&quot;)) {&lt;br /&gt;        this.success = Boolean.parseBoolean((String)params.get(&quot;success&quot;));&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/6219928508816804457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/6219928508816804457' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6219928508816804457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6219928508816804457'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/06/jsf-portlet-fun-request-scoped-beans.html' title='JSF Portlet Fun: Request Scoped Beans Don&#39;t Survive From Action to Render Phase'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-1545075847884913074</id><published>2007-06-06T12:44:00.000-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>TeraGrid 2007, Day 3</title><content type='html'>In the Software Provider Forum, I gave a talk on PURSe (using slides provided to me by Rachana Anathakrishnan) and also about the PURSe portlets work I&#39;ve been doing.&lt;br /&gt;&lt;br /&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=60888&amp;doc=purse-and-the-purse-portlets-9375&quot; width=&quot;425&quot; height=&quot;348&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=60888&amp;doc=purse-and-the-purse-portlets-9375&quot; /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;In the presentation I give a sketch of a roadmap for a PURSe portlets 1.1 release, which should be out within a month.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/1545075847884913074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/1545075847884913074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/1545075847884913074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/1545075847884913074'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/06/teragrid-2007-day-3.html' title='TeraGrid 2007, Day 3'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-8991406026372558020</id><published>2007-06-06T12:34:00.001-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>TeraGrid 2007, Day 2</title><content type='html'>Stu Martin and I gave a talk on GRAM Auditing and integration of it with the LEAD Portal.&lt;br /&gt;&lt;br /&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=60890&amp;doc=teragrids-gram-auditing-accounting-its-integration-with-the-lead-science-gateway-17521&quot; width=&quot;425&quot; height=&quot;348&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=60890&amp;doc=teragrids-gram-auditing-accounting-its-integration-with-the-lead-science-gateway-17521&quot; /&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/8991406026372558020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/8991406026372558020' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/8991406026372558020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/8991406026372558020'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/06/teragrid-2007-day-2.html' title='TeraGrid 2007, Day 2'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-1296787247166012771</id><published>2007-06-05T09:26:00.000-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>TeraGrid 2007, Day 1</title><content type='html'>During most of the first day at &lt;a href=&quot;http://www.union.wisc.edu/teragrid07/&quot;&gt;TeraGrid 07&lt;/a&gt;, I was involved in the TeraGrid Institute tutorial, a kind of &quot;TeraGrid for beginners&quot; tutorial.  We did a demo/tutorial using the LEAD Portal as a way of demonstrating how a science gateway can make effective use of TeraGrid, how the sum of TeraGrid is greater than it&#39;s individual parts.  A &lt;a href=&quot;https://portal.leadproject.org/gridsphere/screencasts/tg07_tutorial.htm&quot;&gt;screencast we developed in support of the tutorial&lt;/a&gt; is available.&lt;br /&gt;&lt;br /&gt;Near the end of the day, I had a talk about the LEAD Portal for the &quot;Build your own science gateway&quot; tutorial.  It&#39;s titled &lt;i&gt;The LEAD Portal: An OGCE based weather science gateway&lt;/i&gt;, and you can see it below.&lt;br /&gt;&lt;br /&gt;&lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=59627&amp;doc=the-lead-portal-an-ogce-based-weather-science-gateway-3447&quot; height=&quot;348&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=59627&amp;amp;doc=the-lead-portal-an-ogce-based-weather-science-gateway-3447&quot;&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;I talked with &lt;a href=&quot;http://www.tacc.utexas.edu/general/staff/milfeld/&quot;&gt;Kent Milfeld&lt;/a&gt; briefly afterward about the difficulty in supporting and managing production and development deployments.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/1296787247166012771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/1296787247166012771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/1296787247166012771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/1296787247166012771'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/06/teragrid-2007-day-1.html' title='TeraGrid 2007, Day 1'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-9153982621499398086</id><published>2007-05-22T15:02:00.001-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Pluto and creation of UserInfo Map</title><content type='html'>Pluto throws a NullPointerException if there is an attribute defined in your portlet.xml that it does not recognize.  Happened to me because I generally have the non-standard attribute &quot;user.name&quot; which is the way to get a GridSphere user&#39;s username (as opposed to PortletRequest.getRemoteUser()).</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/9153982621499398086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/9153982621499398086' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/9153982621499398086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/9153982621499398086'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/05/pluto-and-creation-of-userinfo-map.html' title='Pluto and creation of UserInfo Map'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-5392337021115061223</id><published>2007-04-19T06:41:00.000-04:00</published><updated>2009-06-06T08:09:29.002-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Creating a Portlet Preferences JSF VariableResolver</title><content type='html'>One of the really cool things about JSF is that just about every piece of it is extensible.  One thing I&#39;ve been playing with recently is the VariableResolver and PropertyResolver parts of the JSF API.  I want to create a VariableResolver that is specific to portlet development, so that, for example, when you want to create an EDIT page where a user can specify a preferred nickname, it would look something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;h:inputText value=&quot;#{portletPreferences.nickname}&quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And that&#39;s it, because custom Variable and Property resolvers take care of the getting and setting for us, no backing beans required.&lt;br /&gt;&lt;br /&gt;Turns out this is fairly easy to do.  I started with &lt;a href=&quot;http://www.jroller.com/page/cagataycivici?entry=how_to_write_your_own&quot;&gt;Cagatay Civici&#39;s excellent blog/article on creating a custom VariableResolver and PropertyResolver&lt;/a&gt;.  The first thing to do was to create the VariableResolver.  The trick here is that VariableResolvers follow a &quot;Chain of Responsibility&quot; design pattern, and the parent resolver is passed in via the constructor of the child resolver.  This is an extremely important point.  I rushed ahead on the PortletPreferences part of the variable resolving and forgot to implement the chained part, and you get some interesting results when you do this.  Suddenly, your managed beans just silently are unresolvable.  No error messages, nothing in the logs, and in fact, it appears at first that they are working, but they do not.  So just a heads up, that if you create your own JSF resolvers, do the chaining part first and look out for disappearing managed beans.&lt;br /&gt;&lt;br /&gt;So here&#39;s how my initial PortletVariableResolver looked:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class PortletVariableResolver extends VariableResolver {&lt;br /&gt;&lt;br /&gt;    private static final org.apache.log4j.Logger log = org.apache.log4j.Logger&lt;br /&gt;            .getLogger(PortletVariableResolver.class);&lt;br /&gt;    &lt;br /&gt;    public static final String PORTLET_PREFERENCES = &quot;portletPreferences&quot;;&lt;br /&gt;    private VariableResolver originalResolver;&lt;br /&gt;&lt;br /&gt;    public PortletVariableResolver(VariableResolver originalResolver) {&lt;br /&gt;        this.originalResolver = originalResolver;&lt;br /&gt;    }&lt;b&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public Object resolveVariable(FacesContext facesContext, &lt;br /&gt;                                  String variableName)&lt;br /&gt;            throws EvaluationException {&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;            if (PORTLET_PREFERENCES.equals(variableName)) {&lt;br /&gt;                PortletRequest portletRequest = &lt;br /&gt;                  (PortletRequest)facesContext&lt;br /&gt;                  .getExternalContext().getRequest();&lt;br /&gt;                return portletRequest.getPreferences().getMap();&lt;br /&gt;            }&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            throw new EvaluationException(&lt;br /&gt;              &quot;Failed to resolve variable [&quot; + &lt;br /&gt;               variableName + &quot;]&quot;, e);&lt;br /&gt;        }&lt;br /&gt;        return originalResolver.resolveVariable(facesContext, &lt;br /&gt;           variableName);&lt;br /&gt;    }&lt;/b&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So here we&#39;re resolving the &quot;portletPreferences&quot; variable to the Map of the user&#39;s portlet preferences.  This is nice, but it only gets you read access to the portlet preferences.  For write access as well, we&#39;ll need a custom PropertyResolver.  First, let&#39;s change our variable resolver so that it returns the PortletPreferences object, instead of the map:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;            if (PORTLET_PREFERENCES.equals(variableName)) {&lt;br /&gt;                PortletRequest portletRequest = &lt;br /&gt;                  (PortletRequest)facesContext&lt;br /&gt;                  .getExternalContext().getRequest();&lt;br /&gt;                &lt;b&gt;return portletRequest.getPreferences();&lt;/b&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now for the PropertyResolver.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class PortletPropertyResolver extends PropertyResolver {&lt;br /&gt;&lt;br /&gt;    private static final org.apache.log4j.Logger log = org.apache.log4j.Logger&lt;br /&gt;            .getLogger(PortletPropertyResolver.class);&lt;br /&gt;    &lt;br /&gt;    private PropertyResolver originalPropertyResolver;&lt;br /&gt;    &lt;br /&gt;    public PortletPropertyResolver(PropertyResolver propertyResolver) {&lt;br /&gt;        this.originalPropertyResolver = propertyResolver;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    @Override&lt;br /&gt;    public Class getType(Object obj, int index) throws EvaluationException,&lt;br /&gt;            PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            throw new PropertyNotFoundException(&quot;Cannot reference PortletPreferences by index notation&quot;);&lt;br /&gt;        } else {&lt;br /&gt;            return this.originalPropertyResolver.getType(obj, index);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public Class getType(Object obj, Object obj1) throws EvaluationException,&lt;br /&gt;            PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            return String.class;&lt;br /&gt;        } else {&lt;br /&gt;            return this.originalPropertyResolver.getType(obj, obj1);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public Object getValue(Object obj, int index) throws EvaluationException,&lt;br /&gt;            PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            throw new PropertyNotFoundException(&quot;Cannot reference PortletPreferences by index notation&quot;);&lt;br /&gt;        } else {&lt;br /&gt;            return this.originalPropertyResolver.getValue(obj, index);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;b&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public Object getValue(Object obj, Object obj1)&lt;br /&gt;            throws EvaluationException, PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            // TODO: support access to String[] preference values&lt;br /&gt;            PortletPreferences prefs = (PortletPreferences) obj;&lt;br /&gt;            String prefName = (String) obj1;&lt;br /&gt;            return prefs.getValue(prefName, null);&lt;br /&gt;        } else {&lt;br /&gt;            return this.originalPropertyResolver.getValue(obj, obj1);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public boolean isReadOnly(Object obj, int index)&lt;br /&gt;            throws EvaluationException, PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            throw new PropertyNotFoundException(&quot;Cannot reference PortletPreferences by index notation&quot;);&lt;br /&gt;        } else {&lt;br /&gt;            return this.originalPropertyResolver.isReadOnly(obj, index);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public boolean isReadOnly(Object obj, Object obj1)&lt;br /&gt;            throws EvaluationException, PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            PortletPreferences prefs = (PortletPreferences) obj;&lt;br /&gt;            String prefName = (String) obj1;&lt;br /&gt;            return prefs.isReadOnly(prefName);&lt;br /&gt;        } else {&lt;br /&gt;            return this.originalPropertyResolver.isReadOnly(obj, obj1);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public void setValue(Object obj, int index, Object obj1)&lt;br /&gt;            throws EvaluationException, PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            throw new PropertyNotFoundException(&quot;Cannot reference PortletPreferences by index notation&quot;);&lt;br /&gt;        } else {&lt;br /&gt;            this.originalPropertyResolver.setValue(obj, index, obj1);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;b&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public void setValue(Object obj, Object obj1, Object value)&lt;br /&gt;            throws EvaluationException, PropertyNotFoundException {&lt;br /&gt;        if (obj instanceof PortletPreferences) {&lt;br /&gt;            PortletPreferences prefs = (PortletPreferences) obj;&lt;br /&gt;            String prefName = (String) obj1;&lt;br /&gt;            String prefValue = (String) value;&lt;br /&gt;            try {&lt;br /&gt;                prefs.setValue(prefName, prefValue);&lt;br /&gt;                prefs.store();&lt;br /&gt;            } catch (Exception e) {&lt;br /&gt;                log.error(&quot;Unable to set portlet preference [&quot; + prefName + &quot;] to value [&quot; + prefValue + &quot;]&quot;, e);&lt;br /&gt;            }&lt;br /&gt;        } else {&lt;br /&gt;            this.originalPropertyResolver.setValue(obj, obj1, value);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I&#39;ve highlighted the main two methods here, getValue and setValue, and I think you&#39;ll find them fairly straightforward.  The other issue is that we have to implement the array index part of the property resolving, and we just throw an exception in this case (although, as a further exercise, we might want to implement this so that we can reference multi-valued preferences).&lt;br /&gt;&lt;br /&gt;At this point, you just need to register the VariableResolver and PropertyResolver in your faces-config.xml file, like so:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;application&gt;&lt;br /&gt;    &amp;lt;property-resolver&gt;&lt;br /&gt;      resolver.PortletPropertyResolver&lt;br /&gt;    &amp;lt;/property-resolver&gt;&lt;br /&gt;    &amp;lt;variable-resolver&gt;&lt;br /&gt;      resolver.PortletVariableResolver&lt;br /&gt;    &amp;lt;/variable-resolver&gt;&lt;br /&gt;  &amp;lt;/application&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That&#39;s it.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/5392337021115061223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/5392337021115061223' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/5392337021115061223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/5392337021115061223'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/04/creating-portlet-preferences-jsf.html' title='Creating a Portlet Preferences JSF VariableResolver'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-6753582802186642150</id><published>2007-03-29T17:02:00.000-04:00</published><updated>2009-06-06T08:09:29.003-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Credential renewal with MyProxy and JGlobus</title><content type='html'>I&#39;m currently working on create a service as part of the LEAD project that will be responsible for kept grid credentials fresh for the duration of a workflow or some other user process.  I&#39;ve been experimenting with the capabilities of MyProxy and &lt;a href=&quot;http://dev.globus.org/wiki/CoG_JGlobus_1.4&quot;&gt;JGlobus&lt;/a&gt; to this end.&lt;br /&gt;&lt;br /&gt;First of all, the MyProxy site has &lt;a href=&quot;http://grid.ncsa.uiuc.edu/myproxy/renew.html&quot;&gt;an excellent page on various grid credential renewal issues and MyProxy&lt;/a&gt;.  So to begin, I want to set my credential renewer service as a &quot;default renewer&quot; in the MyProxy configuration.  I do this by adding&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;default_renewers &quot;DN of my renewing service&quot;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to the myproxy-server.config file.  Now my renewing service can renew credentials stored in this MyProxy server.  Next, I store a proxy in MyProxy without a passphrase, so that MyProxy can use it for proxy renewal.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;myproxy-init -n -s myproxy-server.mydomain.org -l myusername&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The -n option says to store the proxy without a passphrase.  Now I can renew this proxy with&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;myproxy-logon -s myproxy-server.mydomain.org -a /tmp/aging_proxy \&lt;br /&gt;           -l myusername -o /tmp/refreshed_proxy&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the previous command, -a specifies the proxy that we want to renew.  For this to work, you either need to have loaded a proxy credential of the renewing service, or you need to set the X509_USER_CERT and X509_USER_KEY environment variables to the locations of the certificate and unencrypted key of your renewing service.  And to do MyProxy renewal using the JGlobus API, it looks like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;MyProxy myproxy = new MyProxy(myproxyHost, myproxyPort);&lt;br /&gt;GetParams getParams = new GetParams();&lt;br /&gt;getParams.setUserName(username);&lt;br /&gt;getParams.setLifetime(24*60*60);&lt;br /&gt;getParams.setAuthzCreds(userCred);&lt;br /&gt;&lt;br /&gt;GSSCredential renewedCredential = myproxy.get(serviceCred, getParams);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that you need a valid MyProxy username as well as a still valid proxy credential.  To load the service credential, do this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;GlobusCredential globusCred = new GlobusCredential(pathToServiceCert,&lt;br /&gt;                                                 pathToServiceKey);&lt;br /&gt;GSSCredential gssCred = new GlobusGSSCredentialImpl(globusCred,&lt;br /&gt;                                GSSCredential.INITIATE_AND_ACCEPT);&lt;br /&gt;&lt;/pre&gt;An important thing to keep in mind (which I forgot halfway through this process) is that the credential stored in MyProxy cannot have a passphrase protecting it for it to be used to renew a proxy credential.  We make use of the &lt;a href=&quot;http://grid.ncsa.uiuc.edu/myproxy/man/myproxy-store.1.html&quot;&gt;grid credential storage feature&lt;/a&gt; of MyProxy in the LEAD project, and for this to work with credential renewal, we first have to unencrypt the private key of the grid credential.  Use openssl to do this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;openssl rsa -in ~/.globus/userkey.pem -out ~/.globus/userkey1.pem&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then store your credential to MyProxy with this key:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;myproxy-store -s myproxy.mydomain.org -l myusername -y .globus/userkey1.pem&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now you&#39;ll be able to use this MyProxy credential for proxy renewal.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/6753582802186642150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/6753582802186642150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6753582802186642150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/6753582802186642150'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/03/credential-renewal-with-myproxy-and.html' title='Credential renewal with MyProxy and JGlobus'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-4612929441640970917</id><published>2007-03-28T05:42:00.000-04:00</published><updated>2009-06-06T08:09:29.003-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Setting the var attribute of dataTable in a facelet, part II</title><content type='html'>This time I take a completely different approach to this problem.  The problem, by the way, is how to apply default Java Portlet API (JSR-168) CSS styles to the dataTable component.  As shown in the &lt;a href=&quot;http://marcus-christie.blogspot.com/2007/03/setting-var-attribute-of-datatable-in.html&quot;&gt;previous post&lt;/a&gt;, this is complicated in Facelets by the fact that we can&#39;t just simply pass through a value for the var attribute of the dataTable component.  But, this time that won&#39;t be an issue because we can simply extend the way Facelets handles the dataTable component and more directly apply the CSS styles we want.&lt;br /&gt;&lt;br /&gt;After grepping through the Facelets source code, I discovered that HtmlComponentHandler is the TagHandler associated with the dataTable component (and all other HTML components as well).  So I extended this with my own class, HtmlDataTableHandler:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package portletfacelets;&lt;br /&gt;&lt;br /&gt;import javax.faces.component.UIComponent;&lt;br /&gt;import javax.faces.component.html.HtmlDataTable;&lt;br /&gt;&lt;br /&gt;import com.sun.facelets.FaceletContext;&lt;br /&gt;import com.sun.facelets.tag.jsf.ComponentConfig;&lt;br /&gt;import com.sun.facelets.tag.jsf.html.HtmlComponentHandler;&lt;br /&gt;&lt;br /&gt;public class HtmlDataTableHandler extends HtmlComponentHandler {&lt;br /&gt;&lt;br /&gt;  public HtmlDataTableHandler(ComponentConfig config) {&lt;br /&gt;      super(config);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Override&lt;br /&gt;  protected void onComponentCreated(FaceletContext ctx,&lt;br /&gt;          UIComponent c, UIComponent parent) {&lt;br /&gt;      super.onComponentCreated(ctx, c, parent);&lt;br /&gt;      if (c instanceof HtmlDataTable) {&lt;br /&gt;          HtmlDataTable table = (HtmlDataTable) c;&lt;br /&gt;          if (table.getFooterClass() == null) {&lt;br /&gt;              table.setFooterClass(&quot;portlet-section-footer&quot;);&lt;br /&gt;          }&lt;br /&gt;          if (table.getHeaderClass() == null) {&lt;br /&gt;              table.setHeaderClass(&quot;portlet-section-header&quot;);&lt;br /&gt;          }&lt;br /&gt;          if (table.getRowClasses() == null) {&lt;br /&gt;              table.setRowClasses(&quot;portlet-section-body,&quot; +&lt;br /&gt;              &quot;portlet-section-alternate&quot;);&lt;br /&gt;          }&lt;br /&gt;          if (table.getStyleClass() == null) {&lt;br /&gt;              table.setStyleClass(&quot;portlet-section-body&quot;);&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I check if the classes are null, to allow the user of the TagHandler to override the styles, but that&#39;s about it.  The facelets taglib entry looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;tag&gt;&lt;br /&gt;   &amp;lt;tag-name&gt;dataTable2&amp;lt;/tag-name&gt;&lt;br /&gt;   &amp;lt;component&gt;&lt;br /&gt;     &amp;lt;component-type&gt;javax.faces.HtmlDataTable&amp;lt;/component-type&gt;&lt;br /&gt;     &amp;lt;renderer-type&gt;javax.faces.Table&amp;lt;/renderer-type&gt;&lt;br /&gt;     &amp;lt;handler-class&gt;portletfacelets.HtmlDataTableHandler&amp;lt;/handler-class&gt;&lt;br /&gt;   &amp;lt;/component&gt;&lt;br /&gt; &amp;lt;/tag&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I&#39;m not sure which method I prefer, but I&#39;m leaning toward the former, since it seems simpler and I like the idea of keeping things like CSS styles in a template file than in Java code, but in some sense this second approach also seems to be the cleaner one.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/4612929441640970917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/4612929441640970917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/4612929441640970917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/4612929441640970917'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/03/setting-var-attribute-of-datatable-in_28.html' title='Setting the var attribute of dataTable in a facelet, part II'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-135317086180254199</id><published>2007-03-28T05:12:00.000-04:00</published><updated>2009-06-06T08:09:29.003-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Running Portlets on Pluto from within Eclipse</title><content type='html'>The Pluto team recently released version 1.1.0 and as part of that release they include &lt;a href=&quot;http://portals.apache.org/pluto/v11/getting-started.html&quot;&gt;a very useful Pluto + Tomcat bundle&lt;/a&gt; that makes it very easy to get started.  So I&#39;ve been playing around with this and trying to figure out how to get it to work with Eclipse + WTP, and initially I ran into some issues.  By default, WTP wants to take your application server and copy its files to a temporary location in which to deploy your webapp.  However, this is fairly disastrous for portlet development because WTP doesn&#39;t copy everything and leaves behind important stuff like shared/lib, the portal webapp, etc.  So I was trying to figure out what was left behind and manually copying the missing bits into the temporary location... aargh!  And then I discovered a nice little feature of WTP.  There is this &quot;Run modules directly from the workspace&quot; checkbox in the server settings for your app server, and unchecking this has the effect that Eclipse will deploy your web applications to the location of your app server and not some temporary location!  So anyways, here are my notes on how to get this to work.&lt;br /&gt;&lt;br /&gt;First, you need to register the Pluto 1.1/Tomcat 5.5.20 bundle with Eclipse as a Tomcat 5.5 server.  Select File &gt; New &gt; Other and select Server, then click Next (or, if in the J2EE perspective, right click in the Servers View and select New &gt; Server).  Select a server type of &quot;Tomcat v5.5&quot;, and click Next.  Name it whatever you like, I call mine &quot;Apache Tomcat v5.5 - Pluto&quot;.  For &quot;Tomcat installation directory:&quot; browse to the location of where you installed the pluto bundle.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz4WPIP84nwFhflUFkbmWXIGr03CzoD1YCwMc8zOy7QLaym6Be6zYATCvGv4AdSZCArByOI4NhlavARk2wUHrqVoYZMdiixHLaD0GzPmH8XhkYCnbk2g-JZvsypwTrwjZp0Y8lCw/s1600-h/new_server_dialog.PNG&quot;&gt;&lt;img style=&quot;cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz4WPIP84nwFhflUFkbmWXIGr03CzoD1YCwMc8zOy7QLaym6Be6zYATCvGv4AdSZCArByOI4NhlavARk2wUHrqVoYZMdiixHLaD0GzPmH8XhkYCnbk2g-JZvsypwTrwjZp0Y8lCw/s400/new_server_dialog.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5046905438066155170&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click Finish.  Now, we need to modify our Server definition for pluto just a bit, so go to the Servers view (if you don&#39;t have it, just switch to the J2EE perspective, or add the view with Window &gt; Show View &gt; Other..., then select Servers).  Double click on your Pluto server defined there.  Uncheck the &quot;Run modules directly from the workspace&quot; checkbox.  We want Eclipse to run Pluto from the location of the pluto-bundle, so that it picks up the pluto webapp, shared/lib, and other bits that are needed because we are working with portlets.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLRC-eVFOdK-TaY_niLxFdpnYmFRbr5FJz24zPOzMg4rscD3UtwQmpMydBO-ewSVpqMleZMa0ALQKFiwIosMNcEhwDBwKn48oewOCN2VoekuwkBuDN9t5TX59w7CfvIWGIewHe1w/s1600-h/config_server.PNG&quot;&gt;&lt;img style=&quot;cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLRC-eVFOdK-TaY_niLxFdpnYmFRbr5FJz24zPOzMg4rscD3UtwQmpMydBO-ewSVpqMleZMa0ALQKFiwIosMNcEhwDBwKn48oewOCN2VoekuwkBuDN9t5TX59w7CfvIWGIewHe1w/s400/config_server.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5046905876152819378&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, in order to run your portlet in Pluto from within Eclipse using WTP, you need to have your web.xml &quot;pluto-ified&quot;.  The Pluto guys have an Ant task called &quot;assemble&quot; which can do this for you, that&#39;s what I use.  Just have it update your web.xml file (probably want to make a backup first).  I&#39;ve been working with a hello-world JSF Facelets sample portlet recently, here&#39;s how I get it running in Pluto:&lt;br /&gt;&lt;br /&gt;Now we just need to get our application running on Pluto/Tomcat as before (right click on the Project, select Run As &gt; Run on Server).  The difference this time is that we will access our application through Pluto.  In your web browser, go to http://localhost:8080/pluto.  Login as user &lt;span style=&quot;font-weight: bold;&quot;&gt;pluto&lt;/span&gt;, password &lt;span style=&quot;font-weight: bold;&quot;&gt;pluto&lt;/span&gt;.  In the upper left hand corner there is a label called &quot;Navigation:&quot;.  Mouse over this label to get a popup menu.  Then select &lt;span style=&quot;font-weight: bold;&quot;&gt;Pluto Admin&lt;/span&gt; from this list.  Under &lt;span style=&quot;font-weight: bold;&quot;&gt;Pluto Pages&lt;/span&gt;, select &lt;span style=&quot;font-weight: bold;&quot;&gt;Pluto Admin&lt;/span&gt; from the drop down list.  Then under &lt;span style=&quot;font-weight: bold;&quot;&gt;Portlet Applications&lt;/span&gt;, select &lt;span style=&quot;font-weight: bold;&quot;&gt;hello-world-jsf-facelets&lt;/span&gt; in the first drop down, and then in the second drop down select &lt;span style=&quot;font-weight: bold;&quot;&gt;HelloWorldSamplePortlet&lt;/span&gt;, and click Add Portlet.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl8GP974XfOd3hizYHMMueSITjYqVtpyruCtqh5FI-pVUVF9Umth0B8ekRasbY-5nL54COkvCbT-iyWwshh0HmGYaNIotYRnVZuX84eBrkV0m4U09XTnJUndFIKfpFHBkza3W6Fg/s1600-h/adding_portlet.PNG&quot;&gt;&lt;img style=&quot;cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl8GP974XfOd3hizYHMMueSITjYqVtpyruCtqh5FI-pVUVF9Umth0B8ekRasbY-5nL54COkvCbT-iyWwshh0HmGYaNIotYRnVZuX84eBrkV0m4U09XTnJUndFIKfpFHBkza3W6Fg/s400/adding_portlet.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5046906348599221954&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, the portlet should be there at the bottom of the page.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWAu_WZgu-1e7R1-mVxvIokF0228DF3JNTM-eQUOaBYxoih1rCO4sDTuJ1cuZR47Wvc0eOuWT0C56AiILyBqEM8Z6uhehAGybACflQ5PkJwPIJzmEjI5imnXJQf-bSh9DFD4BD7w/s1600-h/porlet_added.PNG&quot;&gt;&lt;img style=&quot;cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWAu_WZgu-1e7R1-mVxvIokF0228DF3JNTM-eQUOaBYxoih1rCO4sDTuJ1cuZR47Wvc0eOuWT0C56AiILyBqEM8Z6uhehAGybACflQ5PkJwPIJzmEjI5imnXJQf-bSh9DFD4BD7w/s400/porlet_added.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5046906528987848402&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note that the portlet pages configuration doesn&#39;t persist across restarts of the Pluto server.  Consult the Pluto documentation if you want to persist the portal pages layout and configuration.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;br /&gt;Now that our portlet is deployed to Pluto from within Eclipse, we can develop our portlet and have the changes immediately reflected in Pluto!</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/135317086180254199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/135317086180254199' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/135317086180254199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/135317086180254199'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/03/running-portlets-on-pluto-from-within.html' title='Running Portlets on Pluto from within Eclipse'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz4WPIP84nwFhflUFkbmWXIGr03CzoD1YCwMc8zOy7QLaym6Be6zYATCvGv4AdSZCArByOI4NhlavARk2wUHrqVoYZMdiixHLaD0GzPmH8XhkYCnbk2g-JZvsypwTrwjZp0Y8lCw/s72-c/new_server_dialog.PNG" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-7171564556548736975</id><published>2007-03-22T06:32:00.000-04:00</published><updated>2009-06-06T08:09:29.003-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Setting the var attribute of dataTable in a facelet</title><content type='html'>I&#39;m currently working on a small little facelets suite to aid in portlet development.  Initially, the idea is just to focus on making correct use of the portlet CSS styles implicit.  So, for example, the following is the kind of code needed to set the portlet tables styles for the h:dataTable JSF component: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   &amp;lt;h:dataTable value=&quot;#{mybean.myData}&quot; var=&quot;row&quot;&lt;br /&gt;     styleClass=&quot;portlet-section-body&quot;&lt;br /&gt;     rowClasses=&quot;portlet-section-body,portlet-section-alternate&quot;&lt;br /&gt;     headerClass=&quot;portlet-section-header&quot;&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, I&#39;d like to replace that with a facelet instead, so that it looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   &amp;lt;p:dataTable value=&quot;#{mybean.myData}&quot; var=&quot;row&quot;&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the facelet would be defined once in a .xhtml file as:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;ui:composition&gt;&lt;br /&gt;    &amp;lt;h:dataTable value=&quot;#{value}&quot; var=&quot;#{var}&quot;&lt;br /&gt;      styleClass=&quot;portlet-section-body&quot;&lt;br /&gt;      rowClasses=&quot;portlet-section-body,portlet-section-alternate&quot;&lt;br /&gt;      headerClass=&quot;portlet-section-header&quot;&gt;&lt;br /&gt;        &amp;lt;ui:insert /&gt;&lt;br /&gt;    &amp;lt;/h:dataTable&gt;&lt;br /&gt;&amp;lt;/ui:composition&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;However, this doesn&#39;t quite work.  The problem is that it tries to set the var attribute of the dataTable component to a value expression, but dataTable requires a simple string for var.  So we have to figure out some way of getting the var variable from the facelet into the dataTable component.  What I came up with was a &lt;a href=&quot;https://facelets.dev.java.net/nonav/docs/dev/docbook.html#dev-taghandler&quot;&gt; custom TagHandler&lt;/a&gt; that evaluates the value expression and then sets the var property of the dataTable component directly:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package portletfacelets;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import javax.el.ELException;&lt;br /&gt;import javax.faces.FacesException;&lt;br /&gt;import javax.faces.component.UIComponent;&lt;br /&gt;import javax.faces.component.html.HtmlDataTable;&lt;br /&gt;&lt;br /&gt;import com.sun.facelets.FaceletContext;&lt;br /&gt;import com.sun.facelets.FaceletException;&lt;br /&gt;import com.sun.facelets.tag.TagAttribute;&lt;br /&gt;import com.sun.facelets.tag.TagConfig;&lt;br /&gt;import com.sun.facelets.tag.TagHandler;&lt;br /&gt;&lt;br /&gt;public class SetVarHandler extends TagHandler {&lt;br /&gt;&lt;br /&gt;    private final TagAttribute var;&lt;br /&gt;&lt;br /&gt;    public SetVarHandler(TagConfig config) {&lt;br /&gt;        super(config);&lt;br /&gt;        this.var = this.getAttribute(&quot;var&quot;);&lt;br /&gt;    }&lt;br /&gt;    public void apply(FaceletContext ctx, UIComponent parent)&lt;br /&gt;            throws IOException, FacesException, FaceletException, ELException {&lt;br /&gt;&lt;br /&gt;        System.out.println(&quot;var=&quot; + this.var.getValue(ctx));&lt;br /&gt;        &lt;b&gt;&lt;br /&gt;        if (parent instanceof HtmlDataTable) {&lt;br /&gt;            HtmlDataTable table = (HtmlDataTable) parent;&lt;br /&gt;            table.setVar(this.var.getValue(ctx));&lt;br /&gt;        }&lt;br /&gt;        &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;        this.nextHandler.apply(ctx, parent);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I add this to my facelets taglib.xml file as such:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  &amp;lt;tag&gt;&lt;br /&gt;    &amp;lt;tag-name&gt;setVar&amp;lt;/tag-name&gt;&lt;br /&gt;    &amp;lt;handler-class&gt;portletfacelets.SetVarHandler&amp;lt;/handler-class&gt;&lt;br /&gt;  &amp;lt;/tag&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then use it like this in my facelet:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;ui:composition&gt;&lt;br /&gt;    &amp;lt;h:dataTable value=&quot;#{value}&quot;&lt;br /&gt;      styleClass=&quot;portlet-section-body&quot;&lt;br /&gt;      rowClasses=&quot;portlet-section-body,portlet-section-alternate&quot;&lt;br /&gt;      headerClass=&quot;portlet-section-header&quot;&gt;&lt;br /&gt;        &lt;b&gt;&amp;lt;p:setVar var=&quot;#{var}&quot; /&gt;&lt;/b&gt;&lt;br /&gt;        &amp;lt;ui:insert /&gt;&lt;br /&gt;    &amp;lt;/h:dataTable&gt;&lt;br /&gt;&amp;lt;/ui:composition&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Voila!  However, seeing as this might come in handy in future instances, I wondered if I couldn&#39;t make something a bit more generic.  So I created this TagHandler:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package portletfacelets;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.lang.reflect.Method;&lt;br /&gt;&lt;br /&gt;import javax.el.ELException;&lt;br /&gt;import javax.faces.FacesException;&lt;br /&gt;import javax.faces.component.UIComponent;&lt;br /&gt;&lt;br /&gt;import com.sun.facelets.FaceletContext;&lt;br /&gt;import com.sun.facelets.FaceletException;&lt;br /&gt;import com.sun.facelets.tag.TagAttribute;&lt;br /&gt;import com.sun.facelets.tag.TagConfig;&lt;br /&gt;import com.sun.facelets.tag.TagHandler;&lt;br /&gt;&lt;br /&gt;public class SetValueHandler extends TagHandler {&lt;br /&gt;&lt;br /&gt;    private final TagAttribute methodName;&lt;br /&gt;    private final TagAttribute value;&lt;br /&gt;&lt;br /&gt;    public SetValueHandler(TagConfig config) {&lt;br /&gt;        super(config);&lt;br /&gt;        this.methodName = this.getRequiredAttribute(&quot;methodName&quot;);&lt;br /&gt;        this.value = this.getRequiredAttribute(&quot;value&quot;);&lt;br /&gt;    }&lt;br /&gt;    public void apply(FaceletContext ctx, UIComponent parent)&lt;br /&gt;            throws IOException, FacesException, FaceletException, ELException {&lt;br /&gt;        try {&lt;br /&gt;            &lt;b&gt;&lt;br /&gt;            Method m = parent.getClass().getMethod(this.methodName.getValue(ctx), &lt;br /&gt;                    new Class[]{String.class});&lt;br /&gt;            m.invoke(parent, new Object[]{this.value.getValue(ctx)});&lt;br /&gt;            &lt;/b&gt;&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        this.nextHandler.apply(ctx, parent);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So I&#39;m using reflection to call any method on the parent JSF component and passing in the specified value.  Then I use it in my facelet like so:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;ui:composition&gt;&lt;br /&gt;    &amp;lt;h:dataTable value=&quot;#{value}&quot;&lt;br /&gt;      styleClass=&quot;portlet-section-body&quot;&lt;br /&gt;      rowClasses=&quot;portlet-section-body,portlet-section-alternate&quot;&lt;br /&gt;      headerClass=&quot;portlet-section-header&quot;&gt;&lt;br /&gt;        &lt;b&gt;&amp;lt;p:setValue methodName=&quot;setVar&quot; value=&quot;#{var}&quot; /&gt;&lt;/b&gt;&lt;br /&gt;        &amp;lt;ui:insert /&gt;&lt;br /&gt;    &amp;lt;/h:dataTable&gt;&lt;br /&gt;&amp;lt;/ui:composition&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There you have it.  Turns out there is more than one way to skin this cat, so I&#39;ll also share in a future blog post a different approach to this issue.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/7171564556548736975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/7171564556548736975' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7171564556548736975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/7171564556548736975'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/03/setting-var-attribute-of-datatable-in.html' title='Setting the var attribute of dataTable in a facelet'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-2193419255421050830</id><published>2007-03-22T05:44:00.000-04:00</published><updated>2009-06-06T08:09:29.004-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>How to watch Google Videos on your DivX compatible DVD player</title><content type='html'>Google has put videos of their &lt;a href=&quot;http://video.google.com/videosearch?q=user%3A%22Google+engEDU%22&amp;so=1&amp;amp;num=20&quot;&gt;Tech Talks series online&lt;/a&gt; and I was interested in seeing if I could play these on my &lt;a href=&quot;http://www.amazon.com/Toshiba-SD-3990-Progressive-Scan-Player/dp/B000EBRLHK&quot;&gt;SD-3990 Toshiba DVD player&lt;/a&gt; which is DivX compatible.  All you need to do is:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Find the video at Google Video.  Click the download link.&lt;/li&gt;&lt;li&gt;The Google Video Player comes up and starts buffering the video.  It saves the video into your &lt;code&gt;My Videos/Google Video&lt;/code&gt; directory, or perhaps in a different location, you can check the preferences to see where the location is.&lt;/li&gt;&lt;li&gt;The saved movie file has an extension .gvi (note, this is different than the saved Google Video Player, .gvp, file).  Rename the extension to .avi.&lt;/li&gt;&lt;li&gt;Burn this file to a CD-R disc.  And it&#39;s ready to play.&lt;/li&gt;&lt;/ol&gt;Last night I used this technique to watch part of Bram Moolenaar&#39;s (of &lt;a href=&quot;http://www.vim.org&quot;&gt;Vim &lt;/a&gt;fame) talk on &lt;a href=&quot;http://video.google.com/videoplay?docid=2538831956647446078&amp;amp;q=user%3A%22Google+engEDU%22&quot;&gt;7 Habits For Effective Text Editing 2.0&lt;/a&gt; on my DVD player from the comfort of my living room.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/2193419255421050830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/2193419255421050830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/2193419255421050830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/2193419255421050830'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/03/how-to-watch-google-videos-on-your-divx.html' title='How to watch Google Videos on your DivX compatible DVD player'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-5292752012176632599</id><published>2007-03-07T06:16:00.000-05:00</published><updated>2009-06-06T08:09:29.004-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Custom Tomcat Server Location coming in Eclipse WTP 2.0</title><content type='html'>&lt;a href=&quot;http://www.eclipse.org/webtools/development/news/2.0M5/server.php&quot;&gt;Web Tools Platform 2.0 M5 News&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This looks very cool (scroll down to &quot;Configure Tomcat&#39;s Paths&quot;), especially for us portlet developers.  It&#39;s been challenging using Eclipse WTP to run and debug portlets because WTP wants to take the Tomcat installation you provide, copy the server parts to a temporary location, and then deploy your webapp there.  So it doesn&#39;t matter if the Tomcat installation you tell WTP to use has GridSphere or Pluto installed, they won&#39;t be there in the temporary location (neither the portal webapps nor shared/lib).  Of course, you can manually copy the missing bits into the temp location, restart the server in Eclipse and get something working, but only after much consternation.  So I happily welcome this new development and look forward to using WTP 2.0 when a final release is made.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/5292752012176632599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/5292752012176632599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/5292752012176632599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/5292752012176632599'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/03/custom-tomcat-server-location-coming-in.html' title='Custom Tomcat Server Location coming in Eclipse WTP 2.0'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-4430849264966624649</id><published>2007-02-20T08:59:00.000-05:00</published><updated>2009-06-06T08:09:29.004-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Double Submit Fix with Multiple Submit Buttons</title><content type='html'>In the &lt;a href=&quot;http://portal.leadproject.org/&quot;&gt;LEAD Portal&lt;/a&gt; we have a portlet that allows users to submit weather forecast workflows.  When the user clicks the Launch button, a lot of things have to go on behind the scenes to setup and launch the workflow, and it&#39;s not atypical for a user to wonder if maybe something is amiss and attempt to click the Launch button again.  This double submit is quite problematic for us however.&lt;br /&gt;&lt;br /&gt;I searched the web for a double submit prevention JavaScript code, and found some good starts.  But our portlet has multiple submit buttons and I found that if I disabled the Launch button after it is clicked, for some reason, that buttons name and value are not passed in the POST to the server.  So I have to account for this.  Here&#39;s the JavaScript I used:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;form action=&quot;${actionURL}&quot; method=&quot;POST&quot; name=&quot;wfParamForm&quot;&gt;&lt;br /&gt;&amp;lt;div align=&quot;right&quot;&gt;&lt;br /&gt;      &amp;lt;input type=&quot;submit&quot;&lt;br /&gt;              name=&quot;actionMethod_doExp_wiz&quot; value=&quot;&lt;&gt;&lt;br /&gt;      &amp;lt;input type=&quot;submit&quot;&lt;br /&gt;              name=&quot;actionMethod_doExp_wiz&quot; value=&quot;Next &gt;&quot; disabled=&quot;yes&quot; /&gt;&lt;br /&gt;      &amp;lt;input type=&quot;submit&quot;&lt;br /&gt;              name=&quot;actionMethod_doExp_wiz&quot; value=&quot;Cancel&quot; /&gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;!-- since we have multiple submit buttons, we need to add the&lt;br /&gt;      name value pair of this submit button to the form action.  It&lt;br /&gt;      seems that when the button is disabled that this also prevents&lt;br /&gt;      it from being present in the POST --&gt;&lt;br /&gt;      &amp;lt;input type=&quot;submit&quot;&lt;br /&gt;             name=&quot;actionMethod_doExp_wiz&quot; value=&quot;Launch&quot;&lt;br /&gt;       &lt;b&gt;onClick=&quot;this.disabled=true; this.value=&#39;Please wait...&#39;; this.form.action=this.form.action + &#39;&amp;actionMethod_doExp_wiz=Launch&#39;; this.form.submit()&quot;&lt;/b&gt; /&gt;&lt;br /&gt;&amp;lt;/form&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This is from a Velocity Portlet, and it is creating a wizard like interface with Back, Next, Cancel, and Launch buttons on each page of the wizard.  Look at the JavaScript for the onClick for the Launch button.  Pretty standard stuff (sets the Launch button to disabled, displays &quot;Please wait..&quot; in the button), except that it is also adding the name value pair of the Launch button to the form action.  This works and has been tested with IE and Firefox.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/4430849264966624649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/4430849264966624649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/4430849264966624649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/4430849264966624649'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/02/double-submit-fix-with-multiple-submit.html' title='Double Submit Fix with Multiple Submit Buttons'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31592724.post-3290375478631178302</id><published>2007-01-25T15:25:00.000-05:00</published><updated>2009-06-06T08:09:46.976-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="technology"/><title type='text'>Scripting IFrames in IE and Firefox</title><content type='html'>&lt;b&gt;Update:&lt;/b&gt; Found out Safari requires iframeEl.contentWindow, iframeEl.contentDocument.defaultView doesn&#39;t work (or, at least, it doesn&#39;t work any more).  Turns out that this works for Firefox as well.  I&#39;ve left the other branch for backwards compatibility and also because it is more standard.&lt;br /&gt;&lt;br /&gt;Here&#39;s how to get a reference to an iframe with JavaScript, in Firefox&lt;s&gt; and IE&lt;/s&gt;, IE and Safari:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        var iframeEl = document.getElementById(&quot;iframeId&quot;);&lt;br /&gt;        &lt;s&gt;var iframeDoc = iframeEl.contentDocument&lt;/s&gt;&lt;br /&gt;        var iframeWin;&lt;br /&gt;        &lt;s&gt;if (iframeDoc) { // Firefox&lt;/s&gt;&lt;br /&gt;            &lt;s&gt;iframeWin = iframeDoc.defaultView&lt;/s&gt;&lt;br /&gt;        &lt;s&gt;} else { // IE&lt;/s&gt;&lt;br /&gt;            &lt;s&gt;iframeWin = iframeEl.contentWindow&lt;/s&gt;&lt;br /&gt;        &lt;s&gt;}&lt;/s&gt;&lt;br /&gt;        if (iframeEl.contentWindow) { // IE and Safari require, but works for Firefox too&lt;br /&gt;            iframeWin = iframeEl.contentWindow;&lt;br /&gt;        } else if (iframeEl.contentDocument) { // Works for Firefox, DOM level 2 standard&lt;br /&gt;            iframeWin = iframeEl.contentDocument.defaultView;&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And then you can use iframeWin to get access to JavaScript objects and the DOM of the iframe.&lt;br /&gt;&lt;br /&gt;Also, I learned that getElementById() in IE (version 7 tested) picks up elements by name attribute as well, so names and ids need to be unique for all elements on a page for IE.</content><link rel='replies' type='application/atom+xml' href='http://marcus-christie.blogspot.com/feeds/3290375478631178302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/31592724/3290375478631178302' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/3290375478631178302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31592724/posts/default/3290375478631178302'/><link rel='alternate' type='text/html' href='http://marcus-christie.blogspot.com/2007/01/scripting-iframes-in-ie-and-firefox.html' title='Scripting IFrames in IE and Firefox'/><author><name>Marcus Christie</name><uri>http://www.blogger.com/profile/02331634762593140064</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>