<?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-1495871755699674954</id><updated>2024-08-29T12:53:47.771+09:00</updated><category term="Java"/><category term="groovy"/><category term="ubuntu"/><category term="Mac"/><category term="Swing"/><category term="コマンド"/><category term="Apache POI"/><category term="Grails"/><category term="MySQL"/><category term="Windows Storage Server"/><category term="CentOS"/><category term="JavaFX"/><category term="NetBeans"/><category term="eclipse"/><category term="iBatis"/><category term="GAE"/><category term="GaeLyk"/><category term="MS-DOS"/><category term="NX3100"/><category term="SpringFramework"/><category term="network"/><category term="velocity"/><category term="インフラ"/><category term="サーバ"/><category term="冗長化"/><category term="Excel"/><category term="GExcelAPI"/><category term="GroupSession"/><category term="JavaWebStart"/><category term="Javadoc"/><category term="Jenkins"/><category term="LAMP環境"/><category term="PHP"/><category term="SwingX"/><category term="VBA"/><category term="VirtualBox"/><category term="Windows"/><category term="Windows Server"/><category term="ant"/><category term="apache"/><category term="samba"/><category term="コールドスタンバイ"/><category term="サーバ製品"/><category term="ファイル共有"/><title type='text'>気分だけはエンジニアの技術メモ</title><subtitle type='html'>日々の作業でつまづいたことや、学習したことなどを書いています。&#xa;テーマは一貫性がなく、本当に適当なブログですが、誰かのお役に立てると幸いです。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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>82</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1495871755699674954.post-5052702127653501718</id><published>2013-05-20T22:24:00.002+09:00</published><updated>2013-05-20T22:27:20.973+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>[groovy] ファイルを特定の行数に分割する</title><content type='html'>絶対にもっといい方法があるんだろうけど、groovyを使ってファイルを特定の行数に分割してみた。&lt;br /&gt;
ちなみに、１分割する毎にファイルを先頭から読み直しているため、分割する毎に処理が遅くなっていく。&lt;br /&gt;
行をスキップできればいいんだけど、途中で調べるのを辞めてしまった。。。&lt;br /&gt;
&lt;br /&gt;
以下ソース&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;class FileUtils {

 /**
  * ファイルの行数を返却する
  * 
  * @param filePath
  * @param encode
  * @return
  */
 static def countLines(def filePath, def encode) {
  def lineCount = 0
  new File(filePath).eachLine(encode) { lineCount++ }
  lineCount
 }

 /** 
  * 指定の行数にファイルを分割する
  * 分割したファイルは分割元ファイルと同じディレクトリに書き出す
  * @return
  */
 static def splitFiles(def dstDir, def filePath, def encode, def lineSplitSize) {
  
  // 行数を取得する
  def lineSize = countLines(filePath, encode)

  // 分割数を計算する
  def splitSize = (lineSize / lineSplitSize).toInteger() + (lineSize % lineSplitSize == 0 ? 0 : 1)
  println &quot;総行数：${lineSize}／分割行数：${lineSplitSize}／分割ファイル数：${splitSize}&quot;
  
  // ファイルを分割する
  (0..&lt;splitsize -=&quot;&quot; each=&quot;&quot; idx=&quot;&quot;&gt;
   def dstFile = new File(&quot;${dstDir}/${new File(filePath).name}.${idx}&quot;).withWriter(encode) { out -&amp;gt;
    
    // 開始行数
    def startLine = idx * lineSplitSize
    def writeLines = 0
    
    def start = new Date().time
    try {
     int procLine = 0
     new File(filePath).eachLine(encode) { line -&amp;gt;      
      
      // 開始行に至ったら、内容を書き込む
      if (procLine &amp;gt;= startLine) {
       out &amp;lt;&amp;lt; &quot;${line}\n&quot;
       writeLines++
       
       // 分割行数に至ったら、ループから抜ける
       if (writeLines == lineSplitSize) {
        throw new RuntimeException()
       }
      }
      procLine++
     }
    } catch (e) {}
    println &quot;実行時間：${new Date().time - start}&quot;
   }
  }
 }
}
&lt;/splitsize&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/5052702127653501718/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2013/05/groovy.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5052702127653501718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5052702127653501718'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2013/05/groovy.html' title='[groovy] ファイルを特定の行数に分割する'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-787969412318244611</id><published>2013-05-16T22:43:00.001+09:00</published><updated>2013-05-16T22:43:19.782+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jenkins"/><title type='text'>Jenkinsで役に立ちそうなプラグイン</title><content type='html'>CIツールとして名高い「Jenkins」。&lt;br /&gt;
プラグインが大量に出回っているので役に立ちそうなのをいくつか紹介します。&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;JOBの横っちょにcronの設定を表示してくれるプラグイン&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Cron+Column+Plugin&quot; target=&quot;_blank&quot;&gt;https://wiki.jenkins-ci.org/display/JENKINS/Cron+Column+Plugin&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
これを入れるとcronの設定が一目で確認できるようになります。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;次に実行されるジョブをサイドバーに表示してくれるプラグイン&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Next+Executions&quot; target=&quot;_blank&quot;&gt;https://wiki.jenkins-ci.org/display/JENKINS/Next+Executions&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
次に実行されるジョブが簡単に確認できるので、タイマー代わりに使用できそうです。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;コンソール出力に時間を表示するプラグイン&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Timestamper&quot; target=&quot;_blank&quot;&gt;https://wiki.jenkins-ci.org/display/JENKINS/Timestamper&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;各プロジェクトの設定を一括変更できるプラグイン&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin&quot; target=&quot;_blank&quot;&gt;https://wiki.jenkins-ci.org/display/JENKINS/Configuration+Slicing+Plugin&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;ファイルをトリガーにジョブを実行できるようにするプラグイン&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Files+Found+Trigger&quot; target=&quot;_blank&quot;&gt;https://wiki.jenkins-ci.org/display/JENKINS/FSTrigger+Plugin&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ファイル監視ジョブを簡単に作れそうです。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;ジョブの上下関係を視覚的に表示できるプラグイン&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin&quot; target=&quot;_blank&quot;&gt;https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
上記の他にも見切れないくらいプラグインがあります。&lt;br /&gt;
jenkinsは組み合わせ次第で様々な使用方法できそうで、ますます依存してしまいそうです。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/787969412318244611/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2013/05/jenkins.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/787969412318244611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/787969412318244611'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2013/05/jenkins.html' title='Jenkinsで役に立ちそうなプラグイン'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-1017104602992519078</id><published>2013-01-09T22:10:00.003+09:00</published><updated>2013-05-16T22:44:17.300+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>[Ubuntu12.04] IPアドレスを固定する方法</title><content type='html'>1. 下記のファイルを編集する。

sudo vi /etc/network/interfaces
&lt;br /&gt;
&lt;pre&gt;auto eth0
iface eth0 inet static
address 192.168.1.200
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
&lt;/pre&gt;
2. ネットワークをrestartする
&lt;br /&gt;
&lt;pre&gt;sudo /etc/init.d/networking restart
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/1017104602992519078/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2013/01/ubuntu1204-ip.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/1017104602992519078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/1017104602992519078'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2013/01/ubuntu1204-ip.html' title='[Ubuntu12.04] IPアドレスを固定する方法'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-9188001995309179806</id><published>2013-01-08T21:19:00.000+09:00</published><updated>2013-05-16T22:44:32.326+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>MacOSXのターミナルでSSH接続してみる</title><content type='html'>こんな感じのコマンドをターミナルで入力すれば接続できた。&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;ssh ログイン名@ホスト名
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/9188001995309179806/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2013/01/macosxssh.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/9188001995309179806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/9188001995309179806'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2013/01/macosxssh.html' title='MacOSXのターミナルでSSH接続してみる'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-621871639416743627</id><published>2012-07-06T08:34:00.000+09:00</published><updated>2012-07-06T08:34:19.080+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>Grailsでファイルアップロードするには</title><content type='html'>リファレンスに記載してあった。&lt;br /&gt;
&lt;a class=&quot;external&quot; href=&quot;http://grails.org/doc/latest/guide/theWebLayer.html#uploadingFiles&quot; style=&quot;background-image: url(http://localhost:10080/redmine/images/external.png); background-position: 0% 60%; background-repeat: no-repeat no-repeat; color: #c61a1a; font-family: Verdana, sans-serif; font-size: 12px; padding-left: 12px;&quot;&gt;http://grails.org/doc/latest/guide/theWebLayer.html#uploadingFiles&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
リファレンスのようにこんな感じで実装すればうまく動作した。&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
GSPに以下のようなタグを記述する。&lt;/div&gt;
&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(218, 218, 218); color: #484848; font-size: 12px; margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 2px 0px; width: auto;&quot;&gt;Upload Form: &amp;lt;br /&amp;gt;
    &amp;lt;g:uploadForm action=&quot;upload&quot;&amp;gt;
        &amp;lt;input type=&quot;file&quot; name=&quot;myFile&quot; /&amp;gt;
        &amp;lt;input type=&quot;submit&quot; /&amp;gt;
    &amp;lt;/g:uploadForm&amp;gt;
&lt;/pre&gt;
&lt;div style=&quot;color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
Controllerを以下のように実装する。&lt;/div&gt;
&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(218, 218, 218); color: #484848; font-size: 12px; margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 2px 0px; width: auto;&quot;&gt;def upload() {
    def f = request.getFile(&#39;myFile&#39;)
    if (f.empty) {
        flash.message = &#39;file cannot be empty&#39;
        render(view: &#39;uploadForm&#39;)
        return
    }
    f.transferTo(new File(&#39;/some/local/dir/myfile.txt&#39;))
    response.sendError(200, &#39;Done&#39;)
}&lt;/pre&gt;
&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(218, 218, 218); color: #484848; font-size: 12px; margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 2px 0px; width: auto;&quot;&gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/621871639416743627/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/07/grails_06.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/621871639416743627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/621871639416743627'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/07/grails_06.html' title='Grailsでファイルアップロードするには'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-5303644313286464643</id><published>2012-07-06T08:30:00.000+09:00</published><updated>2012-07-06T08:30:29.938+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>Grailsのログ設定について</title><content type='html'>&lt;span style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;ここに詳しく掲載されていた。&lt;/span&gt;&lt;br /&gt;
&lt;a class=&quot;external&quot; href=&quot;http://grails.org/doc/latest/guide/single.html#logging&quot; style=&quot;background-color: white; background-image: url(http://localhost:10080/redmine/images/external.png); background-position: 0% 60%; background-repeat: no-repeat no-repeat; color: #2a5685; font-family: Verdana, sans-serif; font-size: 12px; padding-left: 12px; text-decoration: none;&quot;&gt;http://grails.org/doc/latest/guide/single.html#logging&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
プロジェクトの作成時にConfig.groovyに以下のような設定がされているので、&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
あとは適切に設定すればいいみたい。&lt;/div&gt;
&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(218, 218, 218); color: #484848; font-size: 12px; margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 2px 0px; width: auto;&quot;&gt;// log4j configuration
log4j = {
    // Example of changing the log pattern for the default console
    // appender:
    //
    //appenders {
    //    console name:&#39;stdout&#39;, layout:pattern(conversionPattern: &#39;%c{2} %m%n&#39;)
    //}

    error   &#39;org.codehaus.groovy.grails.web.servlet&#39;,  //  controllers
           &#39;org.codehaus.groovy.grails.web.pages&#39;     //  GSP,
           &#39;org.codehaus.groovy.grails.web.sitemesh&#39;, //  layouts
           &#39;org.codehaus.groovy.grails.web.mapping.filter&#39;, // URL mapping
           &#39;org.codehaus.groovy.grails.web.mapping&#39;, // URL mapping
           &#39;org.codehaus.groovy.grails.commons&#39;, // core / classloading
           &#39;org.codehaus.groovy.grails.plugins&#39;, // plugins
           &#39;org.codehaus.groovy.grails.orm.hibernate&#39;, // hibernate integration
           &#39;org.springframework&#39;,
           &#39;org.hibernate&#39;,
           &#39;net.sf.ehcache.hibernate&#39;
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/5303644313286464643/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/07/grails.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5303644313286464643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5303644313286464643'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/07/grails.html' title='Grailsのログ設定について'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-5824054602951506452</id><published>2012-07-03T20:36:00.003+09:00</published><updated>2012-07-03T20:36:41.979+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>[Grails] validationエラー時のメッセージを変更するには</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;
Domainクラスに定義できる制約(validation)でエラーが発生すると以下のようなメッセージが出力されます。
&lt;pre&gt;
[class jp.co.wave.dsam.Test]クラスのプロパティ[name]の空白は許可されません。
&lt;/pre&gt;
これだとユーザーに全然優しくないので、分かりやすいメッセージに変更する方法を照会します。
&lt;hr /&gt;
&lt;h2&gt;検証環境&lt;/h2&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;項目&lt;/th&gt;&lt;th&gt;内容&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OS&lt;/td&gt;&lt;td&gt;Mac OS X 10.06&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Grails&lt;/td&gt;&lt;td&gt;2.0.4&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr /&gt;
&lt;h2&gt;内容&lt;/h2&gt;
リファレンスの7.5節に変更する方法が記載されていました。
抜粋します。
&lt;pre&gt;
If a constraint is violated Grails will by convention look for a message code of the form:

[Class Name].[Property Name].[Constraint Code]
In the case of the blank constraint this would be user.login.blank so you would need a message such as the following in your grails-app/i18n/messages.properties file:

user.login.blank=Your login name must be specified!
The class name is looked for both with and without a package, with the packaged version taking precedence. So for example, com.mycompany.myapp.User.login.blank will be used before user.login.blank. This allows for cases where your domain class message codes clash with a plugin&#39;s.

For a reference on what codes are for which constraints refer to the reference guide for each constraint.
&lt;/pre&gt;

Googleで翻訳してみますと、
&lt;pre&gt;
制約が違反している場合は、Grailsは慣例により、フォームのメッセージコードを探します。
[Class Name].[Property Name].[Constraint Code]

このようなあなたのgrails-app/i18n/messages.propertiesファイルに次のようなメッセージが必要になりますので、空白の制約の場合、これはuser.login.blank次のようになります。

user.login.blank=Your login name must be specified!

クラス名が優先してパッケージ化されたバージョンでは、とと、パッケージなしの両方で検索されます。したがって、たとえば、com.mycompany.myapp.User.login.blankはuser.login.blank前に使用されます。これは、ドメインクラスのメッセージコードは、プラグインのと衝突例が可能になります。

制約は、それぞれの制約のためにリファレンスガイドを参照しているコードが何であるかに参考のため。


&lt;/pre&gt;

これを自分なりに読み解きますと、
&lt;pre&gt;
validationでエラーが発生すると、
grails-app/i18n/messages.propertiesから、
[Class Name].[Property Name].[Constraint Code]
という形式のメッセージコードを探します。

独自に定義することにより、プラグインで表示するメッセージとと異なるメッセージを出力することができます。
&lt;/pre&gt;

試しにやってみると、追加したメッセージが出力されることを確認しました。

&lt;hr /&gt;
&lt;h2&gt;参考情報&lt;/h2&gt;
・&lt;a href=&quot;http://grails.org/doc/latest/guide/validation.html&quot;&gt;7 Validation - Reference Documentation&lt;/a&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;最後に&lt;/h2&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/5824054602951506452/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/07/grails-validation.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5824054602951506452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5824054602951506452'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/07/grails-validation.html' title='[Grails] validationエラー時のメッセージを変更するには'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-6531093266379439914</id><published>2012-06-26T08:17:00.002+09:00</published><updated>2012-06-26T08:17:23.041+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Swing"/><category scheme="http://www.blogger.com/atom/ns#" term="SwingX"/><title type='text'>[Swing] JXTreeTableを試す</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;JXTreeTableを試してみました

&lt;hr /&gt;
&lt;h2&gt;検証環境&lt;/h2&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;項目&lt;/th&gt;&lt;th&gt;内容&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OS&lt;/td&gt;&lt;td&gt;Mac OS X Lion&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;hr /&gt;
&lt;h2&gt;実装例&lt;/h2&gt;


以下を参考に実装してみました。
http://d.hatena.ne.jp/takezoe/20100111



これにボタンとか独自のレンダラとか設定する方法はあるのだろうか。
独自に作ったエディターやら、レンダラーを設定するだけでいいのか、機会があったら調べたい。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/6531093266379439914/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/swing-jxtreetable.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/6531093266379439914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/6531093266379439914'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/swing-jxtreetable.html' title='[Swing] JXTreeTableを試す'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-1880240525487865460</id><published>2012-06-19T23:27:00.001+09:00</published><updated>2012-06-19T23:27:07.328+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache POI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>POIでシート名を変更する</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;Apache POIを使用してExcelのWorkBookのシート名を変更する簡単な例を紹介します。

&lt;hr /&gt;
&lt;h2&gt;検証環境&lt;/h2&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;項目&lt;/th&gt;&lt;th&gt;内容&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OS&lt;/td&gt;&lt;td&gt;Mac OS X Lion&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;POI&lt;/td&gt;&lt;td&gt;3.8&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr /&gt;
&lt;h2&gt;実装例&lt;/h2&gt;


&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.apache.poi.ss.usermodel.Workbook



class ChangeSheetName {



    publicstaticvoid main(String[] args) {

        

        File file = new File(&#39;test.xls&#39;)

        

        file.withInputStream {

            Workbook wb = new HSSFWorkbook(it)

            // 0番目のシートの名前を変更する

            wb.setSheetName(0, &#39;シート名を変更した&#39;)

            

            // 複製した結果を元ファイルに書き込む

            file.withOutputStream {

                wb.write(it)

            }

        }

    }

}

&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/1880240525487865460/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poi_19.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/1880240525487865460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/1880240525487865460'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poi_19.html' title='POIでシート名を変更する'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-2799726137717859224</id><published>2012-06-19T23:21:00.001+09:00</published><updated>2012-06-19T23:27:58.620+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache POI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>POIでシートを複製する</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;
Apache POIを使用してExcelのWorkBookのシートを複製する簡単な例を紹介します。
&lt;hr /&gt;
&lt;h2&gt;検証環境&lt;/h2&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;項目&lt;/th&gt;&lt;th&gt;内容&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OS&lt;/td&gt;&lt;td&gt;Mac OS X Lion&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;POI&lt;/td&gt;&lt;td&gt;3.8&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr /&gt;
&lt;h2&gt;実装例&lt;/h2&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.apache.poi.ss.usermodel.Workbook

class CloneSheet {

    publicstaticvoid main(String[] args) {
        
        File file = new File(&#39;test.xls&#39;)
        
        file.withInputStream {
            Workbook wb = new HSSFWorkbook(it)
            // 0番目のシートを複製する
            wb.cloneSheet(0)
            
            // 複製した結果を元ファイルに書き込む
            file.withOutputStream {
                wb.write(it)
            }
        }
    }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/2799726137717859224/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/2799726137717859224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/2799726137717859224'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/blog-post.html' title='POIでシートを複製する'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-7318501846186861481</id><published>2012-06-15T23:55:00.001+09:00</published><updated>2012-06-15T23:55:48.087+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GroupSession"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>eclipseでGroupSessionの開発環境を構築する</title><content type='html'>&lt;h2&gt;





概要&lt;/h2&gt;
公式サイトに開発環境構築ガイドがあるのですが、思い切りはまりました。。。&lt;br /&gt;
試行錯誤の結果、環境構築することができたので、その方法についてのメモ。&lt;br /&gt;
※WTPで起動し、管理画面を操作できるところまで確認しました。&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;





環境&lt;/h2&gt;
&lt;table border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;項目&lt;/th&gt;&lt;th&gt;内容&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OS&lt;/td&gt;&lt;td&gt;Mac OS X Lion&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Java&lt;/td&gt;&lt;td&gt;Java SE 7 (MacOS X Default)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;eclipse&lt;/td&gt;&lt;td&gt;Eclipse Indigo(3.7)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tomcat&lt;/td&gt;&lt;td&gt;Tomcat6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;GroupSession&lt;/td&gt;&lt;td&gt;4.0.3（訳あって最新版ではないです）&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;hr /&gt;
&lt;h2&gt;





下準備&lt;/h2&gt;
・GroupSessionの入手

&lt;br /&gt;
以下のURLから最新バージョンの「gsession_src.zip」をダウンロードします。&lt;br /&gt;
&lt;a href=&quot;http://www.gs.sjts.co.jp/v4/download/index.html&quot;&gt;http://www.gs.sjts.co.jp/v4/download/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ダウンロードが完了したら適当な場所に解凍します。&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;


構築&lt;/h2&gt;
&lt;div&gt;
公式サイトにある&lt;a href=&quot;http://www.gs.sjts.co.jp/v4/tec/about_eclipse_develop.html&quot;&gt;EclipseでGroup Sessionの開発を行う方法&lt;/a&gt;を参考にやってみましたが、全然うまくいきませんでした。。。&lt;/div&gt;
&lt;div&gt;
Antのタスクを実行すると「BUILD SUCCESSFUL」とかなるのですが&lt;/div&gt;
&lt;div&gt;
WarningLogが出まくっているし、何が何やら。。。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
そこで、以下のような手順を行い環境構築しました。&lt;br /&gt;
&lt;br /&gt;
１．動的Webプロジェクトを作成します&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirYiBoqyV2n5_PXRfKsfFwqA81oh7uHzaVpxY5rNZs-7bDQuc3jDSVX3Cqhc9O5dUy6VwKTEVX_3okIsO-sH1pWn-kTaqc5NOxQfhkHaxViW0hDCktnP7ltPorF6bxhmVbXII4_lQxfp1i/s1600/1.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirYiBoqyV2n5_PXRfKsfFwqA81oh7uHzaVpxY5rNZs-7bDQuc3jDSVX3Cqhc9O5dUy6VwKTEVX_3okIsO-sH1pWn-kTaqc5NOxQfhkHaxViW0hDCktnP7ltPorF6bxhmVbXII4_lQxfp1i/s1600/1.tiff&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
２．WebContent直下に「gsession_src.zip」を解凍してできたファイルをコピーします&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBWB4ZPhrk5FolnnKCgFMFsjGMb-HwdJAzX2tbRmhREehpH6LAG_yVRB6G9JBc89KsXNmE4xr3n4XeKXCgJP7T7AFOlbWHyH7wpDYnQ-nDG8ynxFuYPIFDMDzDUhv3ma09iKmlf0GWjrkZ/s1600/2.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBWB4ZPhrk5FolnnKCgFMFsjGMb-HwdJAzX2tbRmhREehpH6LAG_yVRB6G9JBc89KsXNmE4xr3n4XeKXCgJP7T7AFOlbWHyH7wpDYnQ-nDG8ynxFuYPIFDMDzDUhv3ma09iKmlf0GWjrkZ/s320/2.tiff&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
３．ソースフォルダを指定します&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
/gsession4/WebContent/WEB-INF/plugin直下にpluginがぎっしりあります。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
それらを一つずつ開き、「src」フォルダがあれば、それを一つずつ指定していきます。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
※数が多いので非常に時間がかかります。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
なお、詳細な方法については、公式サイトで詳細に解説していましたので、&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
やり方が分からない場合、そちらを参考にして下さい。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
やり終えるとこんな感じになるはずです。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYsaMzGDfIJLaDxP6H3lhWVibPxxozUrhp_1waB3RBb8w_0TaSpHVdFEXAY36BvitO5Dql2RMUhMV5427XibMqHrJElAW0Q5qxdvRlt4s3oC9LFwyI8b6ra1eTZ3ZW0vI7SY6NiF7FO3IV/s1600/3.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYsaMzGDfIJLaDxP6H3lhWVibPxxozUrhp_1waB3RBb8w_0TaSpHVdFEXAY36BvitO5Dql2RMUhMV5427XibMqHrJElAW0Q5qxdvRlt4s3oC9LFwyI8b6ra1eTZ3ZW0vI7SY6NiF7FO3IV/s320/3.tiff&quot; width=&quot;253&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
４．ビルドパスを編集します&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
１．WEB-INF/libにある全てのJarをビルドパスに追加します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
２．WEB-INF/classesをクラスフォルダとしてビルドパスに追加します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
３．WEB-INF/plugin/licenseとmobileをクラスフォルダとしてビルドパスに追加します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
５．ビルドを実行します&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Ctrl+Bでビルドを実行します。かなり時間がかかります。気長に待ちます。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
６．ServersビューでTomcat6サーバを追加します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
７．追加したサーバに１で作成したプロジェクトを追加します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
８．サーバを起動します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
こんな感じのログが出力されます。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
例外が発行されていなければ正常に動作していると思います。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:35 org.apache.catalina.core.AprLifecycleListener init&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:35 org.apache.tomcat.util.digester.SetPropertiesRule begin&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property &#39;source&#39; to &#39;org.eclipse.jst.jee.server:gsession4&#39; did not find a matching property.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:36 org.apache.coyote.http11.Http11Protocol init&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: Coyote HTTP/1.1を http-8080 で初期化します&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:36 org.apache.catalina.startup.Catalina load&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: Initialization processed in 1062 ms&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:36 org.apache.catalina.core.StandardService start&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: サービス Catalina を起動します&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:36 org.apache.catalina.core.StandardEngine start&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: Starting Servlet Engine: Apache Tomcat/6.0.35&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;log4j:WARN No appenders could be found for logger (jp.groupsession.v2.cmn.GroupSession).&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;log4j:WARN Please initialize the log4j system properly.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:46 org.apache.coyote.http11.Http11Protocol start&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: Coyote HTTP/1.1を http-8080 で起動します&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:46 org.apache.jk.common.ChannelSocket init&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: JK: ajp13 listening on /0.0.0.0:8009&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:46 org.apache.jk.server.JkMain start&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: Jk running ID=0 time=0/64&amp;nbsp; config=null&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;2012/06/15 22:59:46 org.apache.catalina.startup.Catalina start&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;情報: Server startup in 10221 ms&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
正常に動作しているかブラウザで確認します。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://localhost:8080/gsession4/&quot;&gt;http://localhost:8080/gsession4/&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
うまく動作しているとこんな感じの画面が表示されるはずです。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNesqIhbe-4kkpOgkWhjmOoGSmMiI7gCMVNdiJC_rsHuOBAtwe7jDCefysNPE_02hi_nUPiQXkgFu9xuYUAdk8vIqe1rVq7XQjNzNPGcLg1TaQ2OVMTK_rhuRA0ItZizDSSoc-cqFX9VMK/s1600/4.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNesqIhbe-4kkpOgkWhjmOoGSmMiI7gCMVNdiJC_rsHuOBAtwe7jDCefysNPE_02hi_nUPiQXkgFu9xuYUAdk8vIqe1rVq7XQjNzNPGcLg1TaQ2OVMTK_rhuRA0ItZizDSSoc-cqFX9VMK/s320/4.tiff&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/7318501846186861481/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/eclipsegroupsession.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/7318501846186861481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/7318501846186861481'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/eclipsegroupsession.html' title='eclipseでGroupSessionの開発環境を構築する'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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/AVvXsEirYiBoqyV2n5_PXRfKsfFwqA81oh7uHzaVpxY5rNZs-7bDQuc3jDSVX3Cqhc9O5dUy6VwKTEVX_3okIsO-sH1pWn-kTaqc5NOxQfhkHaxViW0hDCktnP7ltPorF6bxhmVbXII4_lQxfp1i/s72-c/1.tiff" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1495871755699674954.post-772112609133996249</id><published>2012-06-14T23:51:00.000+09:00</published><updated>2012-06-14T23:52:52.201+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache POI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>POIで新しいシートを追加する</title><content type='html'>&lt;br /&gt;
&lt;h2&gt;
概要&lt;/h2&gt;
Apache POIを使用してExcelのWorkBookに新しいシートを追加する簡単な例を紹介します。&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
実装例&lt;/h2&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.apache.poi.ss.usermodel.Workbook

class AddNewSheet {

    public static void main(String[] args) {
        
        new File(&#39;test.xls&#39;).withInputStream {
            Workbook wb = new HSSFWorkbook(it)
            
            // シートを５つ追加する
            (0..&lt;5).each {
                wb.createSheet()
            }
            
            wb.createSheet(&#39;てすと&#39;)
        }
    }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/772112609133996249/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poi.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/772112609133996249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/772112609133996249'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poi.html' title='POIで新しいシートを追加する'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-2025176488585413520</id><published>2012-06-13T00:51:00.001+09:00</published><updated>2012-06-13T09:10:33.191+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache POI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>Groovyでdbunit</title><content type='html'>&lt;h2&gt;



概要&lt;/h2&gt;
DBUnitを簡単に使う方法を探していたら、以下のページを見つけました。&lt;br /&gt;
http://d.hatena.ne.jp/kiy0taka/20100109/1262967959&lt;br /&gt;
&lt;br /&gt;
上記はGrabを使い、必要なライブラリをロードしておりましたが、同じように試してみたけどうまくいかず。。。&lt;br /&gt;
何かたんねーんだろう。。。&lt;br /&gt;
そこで普通に必要ライブラリを入手し試してみました。&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;



下準備&lt;/h2&gt;
&lt;hr /&gt;
以下のライブラリを入手し、クラスパスに追加します。
&lt;br /&gt;
・dbunit-2.4.8.jar&lt;br /&gt;
http://www.dbunit.org/&lt;br /&gt;
・slf4j-api-1.6.6.jar&lt;br /&gt;
・slf4j-jcl-1.6.6.jar&lt;br /&gt;
http://www.slf4j.org/&lt;br /&gt;
・mysql-connector-java-5.1.20-bin.jar&lt;br /&gt;
http://dev.mysql.com/downloads/connector/j/&lt;br /&gt;
※mysqlで試しました。&lt;br /&gt;
・commons-logging-1.1.1.jar&lt;br /&gt;
http://commons.apache.org/logging/&lt;br /&gt;
&lt;h2&gt;



実装例&lt;/h2&gt;
ほぼ参考にさせて頂いたサイトそのままですが。。。
こんな感じに実装しました。

&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;package jp.co.indoor.test;

import org.dbunit.Assertion;
import org.dbunit.JdbcDatabaseTester;
import org.dbunit.dataset.xml.FlatXmlDataSet;

import groovy.sql.Sql;
import groovy.util.GroovyTestCase;
import groovy.xml.StreamingMarkupBuilder;

class DbUnitSampleTest extends GroovyTestCase {

    static {
        Sql.newInstance(&#39;jdbc:mysql://localhost:3306/test&#39;, &#39;&#39;, &#39;&#39;, &#39;com.mysql.jdbc.Driver&#39;).executeUpdate(&#39;delete from emp&#39;)
//        .execute(
//            &quot;&quot;&quot;
//            CREATE TABLE emp (
//                empno INTEGER PRIMARY KEY,
//                ename VARCHAR(10),
//                job VARCHAR(9)
//            );
//        &quot;&quot;&quot;)
    }
    
    JdbcDatabaseTester tester
    
    void setUp() {
        tester = new JdbcDatabaseTester(&#39;com.mysql.jdbc.Driver&#39;, &#39;jdbc:mysql://localhost:3306/test&#39;, &#39;&#39;, &#39;&#39;)
    }
    void test() {
        tester.dataSet = dataSet {
            emp empno:7369, ename:&#39;SMITH&#39;, job:&#39;CLERK&#39;
            emp empno:7499, ename:&#39;ALLEN&#39;, job:&#39;SALESMAN&#39;
            emp empno:7521, ename:&#39;WARD&#39;, job:&#39;SALESMAN&#39;
        }
        
        tester.onSetup()

        assert 1 == Sql.newInstance(&#39;jdbc:mysql://localhost:3306/test&#39;, &#39;&#39;, &#39;&#39;, &#39;com.mysql.jdbc.Driver&#39;).executeUpdate(&#39;delete from emp where empno = 7499&#39;)

        Assertion.assertEquals dataSet {
            emp empno:7369, ename:&#39;SMITH&#39;, job:&#39;CLERK&#39;
            emp empno:7521, ename:&#39;WARD&#39;, job:&#39;SALESMAN&#39;
        }, tester.connection.createDataSet()
    }
    
    def dataSet(c) {
        new FlatXmlDataSet(new StringReader(new StreamingMarkupBuilder().bind{dataset c}.toString()))
    }
}
&lt;/pre&gt;
&lt;br /&gt;
動かしたところ、普通に動きました。あっさりと。&lt;br /&gt;
なんか変なログは出ていますが。。。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
6 13, 2012 12:35:18 午前 org.slf4j.impl.JCLLoggerAdapter warn&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
警告: Potential problem found: The configured data type factory &#39;class org.dbunit.dataset.datatype.DefaultDataTypeFactory&#39; might cause problems with the current database &#39;MySQL&#39; (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
6 13, 2012 12:35:18 午前 org.slf4j.impl.JCLLoggerAdapter warn&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
警告: Potential problem found: The configured data type factory &#39;class org.dbunit.dataset.datatype.DefaultDataTypeFactory&#39; might cause problems with the current database &#39;MySQL&#39; (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/2025176488585413520/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/groovydbunit.html#comment-form' title='1 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/2025176488585413520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/2025176488585413520'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/groovydbunit.html' title='Groovyでdbunit'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-6083778104085618526</id><published>2012-06-12T21:16:00.000+09:00</published><updated>2012-06-12T21:16:46.509+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache POI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>POIでWorkbookを読み込む</title><content type='html'>&lt;h2&gt;

概要&lt;/h2&gt;
Apache POIを使用してExcelのWorkBookを読み込む簡単な例を紹介します。&lt;br /&gt;
Javaだと色々面倒なのでGroovyを使っています。&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
実装例&lt;/h2&gt;
以下のようにすればWorkBookを読み込むことができます。

&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;

class ReadWorkbook {

    public static void main(String[] args) {
        
        new File(&#39;test.xls&#39;).withInputStream {
            Workbook wb = new HSSFWorkbook(it)
            println wb.getSheetName(0) // 読み込めたかどうか、確認するためコンソールにシート名を出力しています
        }
    }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/6083778104085618526/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poiworkbook_12.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/6083778104085618526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/6083778104085618526'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poiworkbook_12.html' title='POIでWorkbookを読み込む'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-7776199337875711350</id><published>2012-06-10T14:09:00.001+09:00</published><updated>2012-06-12T21:16:14.617+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache POI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>POIでWorkbookを作成する</title><content type='html'>&lt;h2&gt;
概要&lt;/h2&gt;
Apache POIを使用してExcelのBookを作成する簡単な例を紹介します。&lt;br /&gt;
Javaだと色々面倒なのでGroovyを使っています。&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
下準備&lt;/h2&gt;
POIのサイトからライブラリを入手します。&lt;br /&gt;
http://poi.apache.org/&lt;br /&gt;
※poi-bin-3.8-20120326.zipをダウンロードしました。&lt;br /&gt;
&lt;br /&gt;
適当な場所に解凍して、以下のライブラリをクラスパスに通します。&lt;br /&gt;
poi-3.8-20120326.jar&lt;br /&gt;
&lt;hr /&gt;
&lt;h2&gt;
実装例&lt;/h2&gt;

簡単ですが、こんな感じで実装すれば空のWorkBookを作成することができます。
※例外処理を書いていませんが。。

&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

class StartUp {

    /**
     * エントリーポイント
     * @param args
     */
    public static void main(String[] args) {

        // WORKBOOKを作成する        
        Workbook workbook = new HSSFWorkbook()
        
        // シートを作成する
        Sheet sheet = workbook.createSheet()
        
        // WORKBOOKを保存する
        FileOutputStream out = new FileOutputStream(&quot;test.xls&quot;)
        workbook.write(out)
        out.close()
    }
}
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/7776199337875711350/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poiworkbook.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/7776199337875711350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/7776199337875711350'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/06/poiworkbook.html' title='POIでWorkbookを作成する'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-5144092825153402549</id><published>2012-01-03T23:29:00.001+09:00</published><updated>2012-01-03T23:29:16.770+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Swing"/><title type='text'>JTableのセルを活殺制御する方法について</title><content type='html'>JTableのセルを活殺制御する方法に関するメモ。&lt;br /&gt;
&lt;br /&gt;
JTableのMouseListner、PropertyChangeListenerを以下のように実装したら何とかできた。&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;private void tbl_listPropertyChange(java.beans.PropertyChangeEvent evt) {                                        

        int row = tbl_list.getSelectedRow();
        if (row != -1) {
            for (int col = 1; col &lt; tbl_list.getColumnCount(); col++) {
                Object val = tbl_list.getValueAt(row, col); // (1)
                TableCellEditor editor = tbl_list.getCellEditor(row, col); // (2)
                Component comp = editor.getTableCellEditorComponent(tbl_list, val, true, row, col); // (3)
                comp.setEnabled(!machineList.get(row).getDeleteFlag()); // (4)
            }
        }
    }

    private void tbl_listMouseClicked(java.awt.event.MouseEvent evt) {

        int row = tbl_list.rowAtPoint(evt.getPoint());
        int col = tbl_list.columnAtPoint(evt.getPoint());

        tbl_list.changeSelection(row, col, false, false); // 5)
    }
&lt;/pre&gt;
1)セルに設定されている値を取得する。&lt;br /&gt;
2)セルに設定されているエディターを取得する&lt;br /&gt;
3)エディターに設定されているコンポーネントを取得する。取得時に初期値として変更前の値を取得する&lt;br /&gt;
4)コンポーネントを活殺制御する。&lt;br /&gt;
&lt;br /&gt;
5)マウスがクリックされた位置に確実にフォーカスを移動させる。&lt;br /&gt;
これをしないと編集中に別セルをダブルクリックした際に正常にフォーカス移動しない。&lt;br /&gt;
&lt;br /&gt;
なお、セルにコンボボックスを使用する場合、DafaultCellEditorを以下のように初期化すること。&lt;br /&gt;
&lt;br /&gt;
dCellEditor = new DefaultCellEditor(cmb_seizo_moto);&lt;br /&gt;
dCellEditor.setClickCountToStart(2); // (1)&lt;br /&gt;
(1)セルエディタの起動する回数を２回に変更する。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/5144092825153402549/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2012/01/jtable-jtablemouselistnerpropertychange.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5144092825153402549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5144092825153402549'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2012/01/jtable-jtablemouselistnerpropertychange.html' title='JTableのセルを活殺制御する方法について'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-3475182120077406725</id><published>2011-11-27T01:39:00.000+09:00</published><updated>2011-11-27T01:39:28.043+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GAE"/><category scheme="http://www.blogger.com/atom/ns#" term="GaeLyk"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>GAE/JでWEBアプリを作ってみた</title><content type='html'>最近、gaelykを使ってwebアプリを作って見ました。&lt;br /&gt;
http://topic-research.appspot.com/&lt;br /&gt;
&lt;br /&gt;
ページを作成するのにgaelyk用（？)のファイル「gtpl」っていうものを作らなだめですが、&lt;br /&gt;
びっくりするほど簡単にアプリを作ることができました。&lt;br /&gt;
&lt;br /&gt;
日本語の情報は少ないけど、gaelykの公式サイトにチュートリアルがあったので&lt;br /&gt;
それを辞書的に使い、何とか基本的なこと(データを読んだり、書いたり)はできました。&lt;br /&gt;
&lt;br /&gt;
バックエンド枠を使ったりする方法が分からなかったので、いい日本語サイトがないか、現在調査中。&lt;br /&gt;
&lt;br /&gt;
それにしても、簡単にアプリ作れた。満足。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/3475182120077406725/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/11/gaejweb.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/3475182120077406725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/3475182120077406725'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/11/gaejweb.html' title='GAE/JでWEBアプリを作ってみた'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-5769878928314677053</id><published>2011-10-03T00:06:00.001+09:00</published><updated>2011-10-16T14:09:23.183+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GAE"/><category scheme="http://www.blogger.com/atom/ns#" term="GaeLyk"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>[groovy] eclipseからGAE/J + gaelykの環境構築する方法</title><content type='html'>GAE/J + Grails勉強しようと思ったのですが、自分にはまだ敷居が高かったようなので、&lt;br /&gt;
いろんなサイトでお手軽と謳われている「Gaelyk」を使ってみました。&lt;br /&gt;
&lt;br /&gt;
まずは、使い慣れているeclipseの環境を整えます。&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;OS:Windows7 64bit&lt;/li&gt;
&lt;li&gt;eclipse:3.7&lt;/li&gt;
&lt;li&gt;groovy:1.8.2&lt;/li&gt;
&lt;li&gt;gaelyk:1.0&lt;/li&gt;
&lt;li&gt;GAE:1.5.2&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
1.eclipseにGAEプラグインをインストールする&lt;br /&gt;
　ヘルプ-&gt;新規ソフトウエアのインストールをクリックします。&lt;br /&gt;
　作業対象に、以下URLを入力します。&lt;br /&gt;
　　http://dl.google.com/eclipse/plugin/3.7&lt;br /&gt;
&lt;br /&gt;
　しばらくすると、対象となるプラグインの一覧が表示されるので、&lt;br /&gt;
　「すべて選択」しインストールを開始してください。&lt;br /&gt;
　インストール途中でeclipseに「Androidに関するライブラリがあらへんで」って言われたら、&lt;br /&gt;
　該当するプラグインの選択を解除してください。&lt;br /&gt;
　※私の環境だと上記のようなメッセージがでました。&lt;br /&gt;
&lt;br /&gt;
2.Groovyプラグインのインストール&lt;br /&gt;
　ヘルプ-&gt;新規ソフトウエアのインストールをクリックします。&lt;br /&gt;
　作業対象に、以下URLを入力します。&lt;br /&gt;
　　http://dist.springsource.org/release/GRECLIPSE/e3.7/&lt;br /&gt;
&lt;br /&gt;
　しばらくすると、対象となるプラグインの一覧が表示されるので、&lt;br /&gt;
　「すべて選択」しインストールを開始してください。&lt;br /&gt;
&lt;br /&gt;
3.Gaelykの入手&lt;br /&gt;
　以下より、Gaelykを入手してください。&lt;br /&gt;
　http://gaelyk.appspot.com/download&lt;br /&gt;
&lt;br /&gt;
　上記サイトを見るとこんなことかいてますが、気にせず進めます。&lt;br /&gt;
　&gt;The latest version was tested with Groovy 1.8.1, and with the 1.5.2 version of the App Engine SDK. &lt;br /&gt;
GAE、groovyの最新バージョンではテストされてないようです。&lt;br /&gt;
&lt;br /&gt;
　入手したら適当な場所に解凍します。&lt;br /&gt;
&lt;br /&gt;
4.適当なプロジェクトの作成&lt;br /&gt;
　eclipse上で適当なWebアプリを作成します。&lt;br /&gt;
&lt;br /&gt;
　作成が終わったら、3で展開したファイルの[war]直下のファイルすべてを作成したWebアプリのwarフォルダ直下にすべて上書きします。&lt;br /&gt;
&lt;br /&gt;
　Webアプリを起動して、動作確認できたら、とりあえず環境構築はOK（？）&lt;br /&gt;
&lt;br /&gt;
　この後はJDOつかえるか試してみるか。&lt;br /&gt;
→こんな感じでお手軽に使える模様。&lt;br /&gt;
def entity = new Entity(&quot;てーぶる名&quot;)&lt;br /&gt;
entity.title = &quot;タイトル&quot;&lt;br /&gt;
・・・&lt;br /&gt;
entity.save()</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/5769878928314677053/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/10/groovy-eclipsegaej-gaelyk.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5769878928314677053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5769878928314677053'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/10/groovy-eclipsegaej-gaelyk.html' title='[groovy] eclipseからGAE/J + gaelykの環境構築する方法'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-77088321748834150</id><published>2011-09-29T02:09:00.000+09:00</published><updated>2011-09-29T02:09:00.708+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>[groovy] Grailsを試してみた</title><content type='html'>ちょっと（かなり？）古い記事を参考にGrailsを試してみました。&lt;br /&gt;
http://d.hatena.ne.jp/mottsnite/20090822/1250950657&lt;br /&gt;
&lt;br /&gt;
Grailsを使うと簡単にアプリができるんですね。。。&lt;br /&gt;
過去に苦労して携わった開発は何だったんだろうと思うぐらい驚きました。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/77088321748834150/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-grails.html#comment-form' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/77088321748834150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/77088321748834150'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-grails.html' title='[groovy] Grailsを試してみた'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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><entry><id>tag:blogger.com,1999:blog-1495871755699674954.post-35217867386325488</id><published>2011-09-27T21:51:00.003+09:00</published><updated>2011-09-28T00:49:45.937+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GExcelAPI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>[groovy] GExcelAPIを使ってExcelのデータを取得してみた</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;kimukouさんに教えて頂いた、nobeansさんが開発されたGExcelAPIを使用してExcelのデータを取得してみました。&lt;br /&gt;
&lt;hr&gt;&lt;h2&gt;内容&lt;/h2&gt;nobeansさんが作成したサンプルほぼそのままですが、以下コード例です。&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;import org.jggug.kobo.gexcelapi.GExcel
@GrabResolver(name=&quot;kobo-maven-repo&quot;, root=&quot;https://github.com/kobo/maven-repo/raw/master/release&quot;)
@Grab(&quot;org.jggug.kobo:gexcelapi:0.2&quot;)

class GExcelApiTest {

    void load(String fileName) {

        // Excelファイルを読込む
        def book = GExcel.open(fileName)

        // シートを取得する
        def sheet = book[0]
//        def sheet = book[&quot;Sheet1&quot;] // シート名でも取得可能

        // セルの値を取得する
        println sheet.A1.value
        println sheet.A2.value

        println &quot;-&quot;*20
        def dump = { cell -&gt; println &quot;${cell.label}: ${cell.value} - ${cell.cellType}&quot; }
        sheet.A_.each{ cell -&gt; dump cell }
        println &quot;-&quot;*20
        sheet.B_.each{ cell -&gt; dump cell }
        println &quot;-&quot;*20
        sheet._1.each{ cell -&gt; dump cell }
        println &quot;-&quot;*20
        sheet._2.each{ cell -&gt; dump cell }
        println &quot;-&quot;*20
        sheet.A1_B6.each{ row -&gt; row.each { cell -&gt; dump cell } }
    }
}
&lt;/pre&gt;実行結果&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;123.0
水曜日
--------------------
A1: 123.0 - 0
A2: 水曜日 - 1
A3: true - 4
A4: 40808.0 - 0
A5:   - 1
A6: 1+1 - 2
--------------------
B1: null - 3
B2: null - 3
B3: null - 3
B4: null - 3
B5: null - 3
B6: null - 3
--------------------
A1: 123.0 - 0
B1: null - 3
C1: null - 3
D1: null - 3
--------------------
A2: 水曜日 - 1
B2: null - 3
--------------------
A1: 123.0 - 0
B1: null - 3
A2: 水曜日 - 1
B2: null - 3
A3: true - 4
B3: null - 3
A4: 40808.0 - 0
B4: null - 3
A5:   - 1
B5: null - 3
A6: 1+1 - 2
B6: null - 3
&lt;/pre&gt;様々なイテレーターが用意されており、簡単にセルの値を取得することができました。&lt;br /&gt;
&lt;br /&gt;
cell.valueで簡単にセルの値を取れます。&lt;br /&gt;
POIでやると、セルタイプに沿ったメソッドを実行して値を取らなきゃいけなかったり、&lt;br /&gt;
煩雑な部分が多かったですが、こちらは非常にシンプルで使いやすいです。&lt;br /&gt;
&lt;br /&gt;
Excelデータの中身をさらしてはいませんが、実行結果のA4セルには日付を設定しています。&lt;br /&gt;
日付を出力して欲しかったのですが、数値が表示されました。&lt;br /&gt;
日付が取得できなかったのは少し残念ですが、非常に強力かつ便利なAPIなので今後も使っていきたいです。&lt;br /&gt;
&lt;br /&gt;
これを使って、Excelから情報をDTOに格納し、テンプレートエンジンを使ってソースコードを自動生成するようなスクリプトでも書いてみようと思います。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/35217867386325488/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-gexcelapiexcel.html#comment-form' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/35217867386325488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/35217867386325488'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-gexcelapiexcel.html' title='[groovy] GExcelAPIを使ってExcelのデータを取得してみた'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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><entry><id>tag:blogger.com,1999:blog-1495871755699674954.post-6711441702836227788</id><published>2011-09-21T23:42:00.003+09:00</published><updated>2011-09-22T22:38:17.523+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache POI"/><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>[groovy] POIでExcelのセルの値を取得してみた</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;GroovyからApache POIを使用してExcelのデータを読んでみました。&lt;br /&gt;
Excel持ってないので、OpenOfficeで作成したExcelデータですが。。。&lt;br /&gt;
&lt;hr&gt;&lt;h2&gt;内容&lt;/h2&gt;groovyでPOIを使用してセルのデータを読むコードをこんな感じで書いてみました。&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

class POIUtils {
    static def getCellValue(Sheet sheet, rowNum, colNum) {

        // nullセーフナビゲーションを使用してセルにアクセスする
        Cell cellObj = sheet?.getRow(rowNum)?.getCell(colNum)
        switch (cellObj) {
        case null:
            &quot;&quot;
            break;
        default:
            switch (cellObj.cellType) {
            case Cell.CELL_TYPE_NUMERIC:
                if (DateUtil.isCellDateFormatted(cellObj)) {
                    cellObj.getDateCellValue()
                } else {
                    cellObj.getNumericCellValue()
                }
                break;
            case Cell.CELL_TYPE_BLANK:
                &quot;&quot;
                break;
            case Cell.CELL_TYPE_BOOLEAN:
                cellObj.getBooleanCellValue()
                break;
            case Cell.CELL_TYPE_ERROR:
                &quot;&quot;
                break;
            case Cell.CELL_TYPE_FORMULA:
                cellObj.getCellFormula()
                break;
            case Cell.CELL_TYPE_STRING:
                cellObj.getStringCellValue()
                break;
            }
        }
    }
}
&lt;/pre&gt;&lt;br /&gt;
上記を呼び出すソースは以下。&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

class Startup {
    static void main(args) {

        // ローンパターンを使用し、ストリーム使用後に安全にクローズする
        new FileInputStream(&quot;./resources/test.xls&quot;).withStream {fis -&gt;
            Sheet sheet = WorkbookFactory.create(fis).getSheetAt(0)

            println(POIUtils.getCellValue(sheet, 0, 0));

            // groovy版のループを使用し、1行目から10行目までのセルの値を書き出す
            // TODO クロージャ内でfor文が使えない！！！
            // なぜかorg.codehaus.groovy.control.MultipleCompilationErrorsExceptionが発生。。。
            for (def i in 0..&lt;10) {
                println(i.toString())
            }
        }
    }
}
&lt;/pre&gt;
上記ソース上のコメントにも書きましたが、クロージャ内でfor文を書くと
org.codehaus.groovy.control.MultipleCompilationErrorsExceptionが発生しました。

なんで？？？意味不明です。書き方が悪いのかな。
もう少し調査します。

あと、POIUtilsの部分ももっと（？）groovyチックに書きたいです。
徐々に勉強しながらカスタマイズしていこう。

2011/09/22追記
クロージャ内のfor文はうまくいかなかったですが、以下のようにループを書いてやるとうまくいきました。
原因は不明です。

&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;//            for (def i in 0..&lt;10) {
//                println(i.toString())
//            }
            10.times {
                println(POIUtils.getCellValue(sheet, it, 0));
            }
           for (int i = 0; i &lt; 10; i++) {
                println(POIUtils.getCellValue(sheet, i, 0))
            }
&lt;/pre&gt;
&lt;br /&gt;
クロージャ内の制御文は失敗する仕様なのかも知れない。。。&lt;br /&gt;
原因分かればまた追記します。&lt;br /&gt;
&lt;br /&gt;
ただ単に構文ミスってようです。&lt;br /&gt;
これで動作しました。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/6711441702836227788/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-poiexcel.html#comment-form' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/6711441702836227788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/6711441702836227788'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-poiexcel.html' title='[groovy] POIでExcelのセルの値を取得してみた'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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><entry><id>tag:blogger.com,1999:blog-1495871755699674954.post-5369549746496374665</id><published>2011-09-16T00:35:00.000+09:00</published><updated>2011-09-16T00:35:59.080+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="groovy"/><title type='text'>[groovy] groovyの勉強開始</title><content type='html'>最近ある問題を解決するために、色々調査していたらこの言語に出会った。&lt;br /&gt;
勉強を始めると面白い。&lt;br /&gt;
&lt;br /&gt;
もっと深く勉強したいので、以下を購入してみた。&lt;br /&gt;
早く届かないかなぁ。&lt;br /&gt;
&lt;br /&gt;
&lt;iframe src=&quot;http://rcm-jp.amazon.co.jp/e/cm?t=technos-22&amp;o=9&amp;p=8&amp;l=as1&amp;asins=4774147273&amp;ref=qf_sp_asin_til&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr&quot; style=&quot;width:120px;height:240px;&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
しばらくは、groovyを中心にブログを書こうと思う。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/5369549746496374665/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-groovy.html#comment-form' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5369549746496374665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/5369549746496374665'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/groovy-groovy.html' title='[groovy] groovyの勉強開始'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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><entry><id>tag:blogger.com,1999:blog-1495871755699674954.post-8518517395203999763</id><published>2011-09-15T08:16:00.000+09:00</published><updated>2011-09-15T08:16:29.013+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Swing"/><title type='text'>[Java] Swing：JTableのセルにComboBoxを設定する方法</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;JTableのセルにComboBoxを設定する方法を調査したので、説明します。&lt;br /&gt;
&lt;hr&gt;&lt;h2&gt;内容&lt;/h2&gt;以下のようにテーブル列のセルエディターに対して、生成済のコンボボックスを引数としたDefaultCellEditorを設定してあげれば、テーブルのセルにコンボボックスを設定することができます。&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;jTable1.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(cmb_cell1));
&lt;/pre&gt;&lt;br /&gt;
これがお手軽で簡単です。&lt;br /&gt;
その他の方法としては、CellEdirotを実装したクラスを独自実装し、やる方法があります。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/8518517395203999763/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/java-swingjtablecombobox.html#comment-form' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/8518517395203999763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/8518517395203999763'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/java-swingjtablecombobox.html' title='[Java] Swing：JTableのセルにComboBoxを設定する方法'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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><entry><id>tag:blogger.com,1999:blog-1495871755699674954.post-8950469662455015730</id><published>2011-09-13T22:09:00.000+09:00</published><updated>2011-09-13T22:09:00.103+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Swing"/><title type='text'>[Java] swing：jtableのセルをチェックボックスに変更する方法</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;NetBeansを使えばJTableのセルを簡単にチェックボックスに変更できます。&lt;br /&gt;
&lt;hr&gt;&lt;h2&gt;内容&lt;/h2&gt;セルの型をBooleanに変えれば、表示がチェックボックスに変わります。&lt;br /&gt;
Booleanにしたら、内部的にエディター、レンダラーがJCheckBoxに変わるのかな。</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/8950469662455015730/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/java-swingjtable.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/8950469662455015730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/8950469662455015730'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/java-swingjtable.html' title='[Java] swing：jtableのセルをチェックボックスに変更する方法'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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-1495871755699674954.post-4587977049012748664</id><published>2011-09-11T21:35:00.000+09:00</published><updated>2011-09-11T21:35:30.477+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="velocity"/><title type='text'>[Java] Velocityのログを無効化する方法について</title><content type='html'>&lt;h2&gt;概要&lt;/h2&gt;Velocityを使用すると、「velocity.log」というのが勝手に作成されます。&lt;br /&gt;
それを作成しないようにする方法について説明します。&lt;br /&gt;
&lt;hr&gt;&lt;h2&gt;内容&lt;/h2&gt;以下のようにVelocityの初期処理前にログを設定しないようプロパティを設定すればよいです。&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;java&quot;&gt;        Velocity.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, &quot;org.apache.velocity.runtime.log.NullLogSystem&quot;);
        Velocity.init();
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://hetare-engineer.blogspot.com/feeds/4587977049012748664/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/java-velocity_11.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/4587977049012748664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1495871755699674954/posts/default/4587977049012748664'/><link rel='alternate' type='text/html' href='http://hetare-engineer.blogspot.com/2011/09/java-velocity_11.html' title='[Java] Velocityのログを無効化する方法について'/><author><name>indoor</name><uri>http://www.blogger.com/profile/16026185465219864217</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></feed>