tag:blogger.com,1999:blog-16696254006375721272024-03-13T23:10:07.646+09:00Human SystemNaoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.comBlogger75125tag:blogger.com,1999:blog-1669625400637572127.post-54317274068443079872014-07-05T19:04:00.000+09:002014-07-05T19:04:32.764+09:00GitBucket News launchedA new blog <a href="http://takezoe.github.io/gitbucket/">GitBucket News</a> which provides information about GitBucket is launched on Github Pages.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-QXRiQ_Q6Eqo/U7fNdK-aTOI/AAAAAAAAA-I/v3ZA6JhNyAM/s1600/GitBucketNews.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-QXRiQ_Q6Eqo/U7fNdK-aTOI/AAAAAAAAA-I/v3ZA6JhNyAM/s1600/GitBucketNews.png" height="241" width="320" /></a></div>
<br />
Information about GitBucket such as release announcement and development status will be provided on this blog from now on.<br />
<br />
Please check it!Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-84018876498058611702014-05-31T12:19:00.000+09:002014-05-31T12:21:22.156+09:00GitBucket 2.0 released!Today, we are pleased to announce the availability of new version of Scala based Github clone <a href="https://github.com/takezoe/gitbucket/releases/tag/2.0">GitBucket 2.0</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-e5EeRDDOh0w/U4lHyQuUd0I/AAAAAAAAA9Y/_bwQyflPs3w/s1600/newui.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-e5EeRDDOh0w/U4lHyQuUd0I/AAAAAAAAA9Y/_bwQyflPs3w/s1600/newui.png" height="140" width="320" /></a></div>
<br />
This is a first major version up includes modern Github UI and following new features:<br />
<br />
<b>Preview in AceEditor</b><br />
You can preview Markdown in direct file editing in the repository viewer. And you can also confirm diff for files other than Markdown.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-2-XQ_Gb2RFw/U4lHyYIKCBI/AAAAAAAAA9U/8mHk1v_Ru5A/s1600/preview.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-2-XQ_Gb2RFw/U4lHyYIKCBI/AAAAAAAAA9U/8mHk1v_Ru5A/s1600/preview.png" height="97" width="320" /></a></div>
<br />
<b>Select lines by clicking line number</b><br />
GitBucket has been supported selecting lines by URL hash like #L10 or #L10-L12. In this version, it's possible by clicking in the source viewer.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-U7g3rD2Ck_0/U4lHyayU7II/AAAAAAAAA9Q/Y_D2I7DVOuA/s1600/select_lines.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-U7g3rD2Ck_0/U4lHyayU7II/AAAAAAAAA9Q/Y_D2I7DVOuA/s1600/select_lines.png" height="124" width="320" /></a></div>
<br />
This release contains some improvements and bug fix. See <a href="https://github.com/takezoe/gitbucket/issues?milestone=17&page=1&state=closed">all closed issues</a> in this release to know details. Upgrade your GitBucket and try new UI and these excellent features.<br />
<br />
Enjoy!Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com1tag:blogger.com,1999:blog-1669625400637572127.post-88769839292821355712014-04-29T18:15:00.001+09:002014-04-29T18:23:20.010+09:00GitBucket 1.13 released!<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">Today, we are pleased to announce the availability of new version of Scala based Github clone <a href="https://github.com/takezoe/gitbucket/releases/tag/1.13">GitBucket 1.13</a></span><span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">.</span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">I introduce new features in GitBucket 1.13 in this entry.</span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;"><b>Online file editing</b></span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">Online file editing using <a href="http://ace.c9.io/#nav=about">AceEditor</a> is available. Commiters can create, edit and remove files in repository on the browser.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-ld9R3nG-R-0/U19rpuoKBcI/AAAAAAAAA8E/Nu3PIIf9jGQ/s1600/aceeditor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-ld9R3nG-R-0/U19rpuoKBcI/AAAAAAAAA8E/Nu3PIIf9jGQ/s1600/aceeditor.png" height="172" width="320" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;"><b>File attachment to issues</b></span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">Now, we can attach image to issue and its comment. Drop image file into the area under textarea, or click this area and choose image file.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-q8jw5r4DG_A/U19scRFJtzI/AAAAAAAAA8M/0ftTgU4yolU/s1600/attach.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-q8jw5r4DG_A/U19scRFJtzI/AAAAAAAAA8M/0ftTgU4yolU/s1600/attach.png" height="157" width="320" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;"><b>Atom feed of user activity</b></span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">Atom feed is available in the dashboard and user activity page.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-wDZdCs0VkvY/U19s7__3fQI/AAAAAAAAA8U/j0Km2PpzjtQ/s1600/rss1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-wDZdCs0VkvY/U19s7__3fQI/AAAAAAAAA8U/j0Km2PpzjtQ/s1600/rss1.png" height="103" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-sqJDu6osGoA/U19s76gJzeI/AAAAAAAAA8Y/Bg-pnzmA0C0/s1600/rss2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-sqJDu6osGoA/U19s76gJzeI/AAAAAAAAA8Y/Bg-pnzmA0C0/s1600/rss2.png" height="133" width="320" /></a></div>
<br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">And also this release contains some improvements and many bug fix. See <a href="https://github.com/takezoe/gitbucket/issues?milestone=16&state=closed">all closed issues in this release</a> to know details. We highly recommend upgrading your GitBucket.</span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Georgia, serif; font-size: 13px; line-height: 20.799999237060547px;">Enjoy!</span><br />
<br />Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-35014108179586432462014-03-29T17:21:00.003+09:002014-03-29T17:35:30.340+09:00GitBucket 1.12 released!Today, we are pleased to announce the availability of new version of Scala based Github clone <a href="https://github.com/takezoe/gitbucket/releases/tag/1.12">GitBucket 1.12</a>.<br />
<br />
This release contains some new features as below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<b>SSH repository access is available</b><br />
<div>
SSH repository access can be enabled in system settings:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-n9VJCmbcwYE/UzXH0URyavI/AAAAAAAAA54/J4QZL6ueojI/s1600/ssh.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-n9VJCmbcwYE/UzXH0URyavI/AAAAAAAAA54/J4QZL6ueojI/s1600/ssh.png" height="153" width="320" /></a></div>
<div>
Users can register public keys in account settings:</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-4--zFv3Kow0/UzaBDhyefdI/AAAAAAAAA7A/8s-p3AtxXDY/s1600/pubkey.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-4--zFv3Kow0/UzaBDhyefdI/AAAAAAAAA7A/8s-p3AtxXDY/s1600/pubkey.png" height="100" width="320" /></a></div>
<div>
And ssh repository url can be checked in the repository viewer:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-fow0B1LKqFw/UzXH0cvXrfI/AAAAAAAAA50/x7YCenMkOPA/s1600/ssh-url.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-fow0B1LKqFw/UzXH0cvXrfI/AAAAAAAAA50/x7YCenMkOPA/s1600/ssh-url.png" height="120" width="320" /></a></div>
<div>
<b>Group management enhancement</b></div>
<div>
All users can create new group. User can manage their groups and group repositories.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-fvHV59IQ2Z4/UzXKe46lLTI/AAAAAAAAA6M/YrR-4nns3vs/s1600/group1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-fvHV59IQ2Z4/UzXKe46lLTI/AAAAAAAAA6M/YrR-4nns3vs/s1600/group1.png" height="168" width="320" /></a></div>
<div>
It's possible to configure permission in the group in group settings:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-Gx5KtLRfnwg/UzXKe7q6RiI/AAAAAAAAA6I/KWZwq0tL0lw/s1600/group2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-Gx5KtLRfnwg/UzXKe7q6RiI/AAAAAAAAA6I/KWZwq0tL0lw/s1600/group2.png" height="101" width="320" /></a></div>
<div>
<b>Git submodule support</b><br />
Display the link to the repository for submodules.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-AyPUS7BfxHM/UzXLsAXpx9I/AAAAAAAAA6Y/AP3wtoczbjA/s1600/submodule.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-AyPUS7BfxHM/UzXLsAXpx9I/AAAAAAAAA6Y/AP3wtoczbjA/s1600/submodule.png" height="112" width="320" /></a></div>
<div>
In addition, in the previous version of GitBucket, downloading as the zip file had not been worked if the repository contains submodule. This issue is fixed in this release.</div>
<div>
<ul>
</ul>
<b>Close issues via commit messages</b><br />
Issue can be closed by commit message like <span style="font-family: Courier New, Courier, monospace;">"Fix #123"</span> or <span style="font-family: Courier New, Courier, monospace;">"Close #123"</span>.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br />
<b>Show repository description below the name on repository page</b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-1-qHZ9cNIfY/UzaCT6wPq6I/AAAAAAAAA7I/RNmFGqpwxq4/s1600/repository_desc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-1-qHZ9cNIfY/UzaCT6wPq6I/AAAAAAAAA7I/RNmFGqpwxq4/s1600/repository_desc.png" height="106" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<b>Fix presentation of the source viewer</b><br />
before:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-dAGB7XhHa2I/UzXNe04ZyvI/AAAAAAAAA6o/XJ0LYJ-ziC0/s1600/blob_before.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-dAGB7XhHa2I/UzXNe04ZyvI/AAAAAAAAA6o/XJ0LYJ-ziC0/s1600/blob_before.png" height="211" width="320" /></a></div>
<div>
after:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-o0OmStVbIcQ/UzXNezXclTI/AAAAAAAAA6s/VPR6h7SYLZI/s1600/blob_after.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-o0OmStVbIcQ/UzXNezXclTI/AAAAAAAAA6s/VPR6h7SYLZI/s1600/blob_after.png" height="206" width="320" /></a></div>
<div>
<br />
And also this release contains some improvements and bug fix so we recommend upgrading your GitBucket.<br />
<div>
<br /></div>
<div>
Enjoy!</div>
</div>
</div>
Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-75981226193701136502014-03-01T18:29:00.002+09:002014-03-01T18:29:58.502+09:00GitBucket 1.11 released!Today, we released a new version of Scala based Github clone <a href="https://github.com/takezoe/gitbucket/releases/tag/1.11">GitBucket 1.11</a>.<br />
<br />
This release contains some new features as below:<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<ul>
<li>Base URL for redirection, notification and repository URL box is configurable<br /><a href="http://3.bp.blogspot.com/-5TzRAja6ffs/UxGnikM1QKI/AAAAAAAAA3M/nq4Sg7UU384/s1600/base-url.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-5TzRAja6ffs/UxGnikM1QKI/AAAAAAAAA3M/nq4Sg7UU384/s1600/base-url.png" height="107" width="400" /></a></li>
<li>Remove --https option because it's possible to substitute in the base url</li>
<li>Headline anchor is available for Markdown contents such as Wiki page<br /><a href="http://3.bp.blogspot.com/-AZlrHJlWbaU/UxGnjdFFgwI/AAAAAAAAA3g/tsFBYjdH654/s1600/headline-anchor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-AZlrHJlWbaU/UxGnjdFFgwI/AAAAAAAAA3g/tsFBYjdH654/s1600/headline-anchor.png" height="163" width="320" /></a></li>
<li>Label is available for pull requests not only issues</li>
<li>Delete branch button is added<br /><a href="http://4.bp.blogspot.com/-UNwACQumrJ4/UxGnivwNjBI/AAAAAAAAA3Q/ftHK2DvO6l4/s1600/delete_branch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-UNwACQumrJ4/UxGnivwNjBI/AAAAAAAAA3Q/ftHK2DvO6l4/s1600/delete_branch.png" height="166" width="320" /></a><br /><a href="http://4.bp.blogspot.com/-yZy9DYdSlB8/UxGnjgN3e-I/AAAAAAAAA3o/JWMw6O2ybWw/s1600/pullreq.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-yZy9DYdSlB8/UxGnjgN3e-I/AAAAAAAAA3o/JWMw6O2ybWw/s1600/pullreq.png" height="149" width="320" /></a></li>
<li>Repository icons are updated<br /><a href="http://1.bp.blogspot.com/-7X5sIRX2dvM/UxGniqEbMRI/AAAAAAAAA3Y/yoVYCmrnxRE/s1600/Bg91AfmCYAAD2-y.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://1.bp.blogspot.com/-7X5sIRX2dvM/UxGniqEbMRI/AAAAAAAAA3Y/yoVYCmrnxRE/s1600/Bg91AfmCYAAD2-y.png" height="75" width="200" /></a></li>
<li>Select lines of source code by URL hash like #L10 or #L10-L15 in repository viewer<br /><a href="http://3.bp.blogspot.com/-merwcrX-dWc/UxGnjE32wdI/AAAAAAAAA34/-A-1AojycQ4/s1600/gitbucket_hash.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-merwcrX-dWc/UxGnjE32wdI/AAAAAAAAA34/-A-1AojycQ4/s1600/gitbucket_hash.png" height="92" width="320" /></a></li>
<li>Display reference to issue from others in comment list<br /><a href="http://1.bp.blogspot.com/-ySv1jbQyQ_o/UxGnkNF5yDI/AAAAAAAAA3w/1WmXKZ7TGRc/s1600/refer_issue.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://1.bp.blogspot.com/-ySv1jbQyQ_o/UxGnkNF5yDI/AAAAAAAAA3w/1WmXKZ7TGRc/s1600/refer_issue.png" height="171" width="320" /></a></li>
</ul>
And also this release contains some improvements and bug fix so we recommend upgrading your GitBucket.<br />
<div>
<br /></div>
<div>
Enjoy!</div>
Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-71614257448760624682014-02-01T17:57:00.003+09:002014-02-01T17:59:38.011+09:00GitBucket 1.10 released!Today, we released a new version of Scala based Github clone <a href="https://github.com/takezoe/gitbucket/releases/tag/1.10">GitBucket 1.10</a>.<br />
<br />
This release contains some new features as below:<br />
<ul>
<li>Rename repository<br /><a href="http://1.bp.blogspot.com/-pY8-tDfrSMc/Uuy1BqW2a6I/AAAAAAAAA2o/7no9THsfYA4/s1600/gitbucket_rename_repos.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://1.bp.blogspot.com/-pY8-tDfrSMc/Uuy1BqW2a6I/AAAAAAAAA2o/7no9THsfYA4/s1600/gitbucket_rename_repos.png" height="108" width="320" /></a></li>
<li>Transfer repository owner<br /><a href="http://2.bp.blogspot.com/-YWFyA8MORFI/Uuy1DRnYdfI/AAAAAAAAA2w/FvH1T1KvRyc/s1600/gitbucket_transfer_owner.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-YWFyA8MORFI/Uuy1DRnYdfI/AAAAAAAAA2w/FvH1T1KvRyc/s1600/gitbucket_transfer_owner.png" height="116" width="320" /></a></li>
<li>Change default data directory to HOME/.gitbucket from HOME/gitbucket, but if data directory already exist at HOME/gitbucket, it continues being used.</li>
<li>Add LDAP display name attribute</li>
<li>Response performance improvement</li>
</ul>
Running GitBucket is very easy:<br />
<ol>
<li>Download gitbucket.war from <a href="https://github.com/takezoe/gitbucket/releases/tag/1.10">here</a> and hit <b>java -jar gitbucket.war</b> in console</li>
<li>Access <b>http://localhost:8080/</b> by your browser</li>
</ol>
And also some bugs are fixed in this release. Please upgrade your GitBucket, it's also very easy. You have to only replace gitbucket.war.<br />
<br />
Enjoy!Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-74403850365604864442013-09-08T12:21:00.002+09:002013-09-08T12:21:55.637+09:00GitBucket 1.5 released!<p>
We've released <a href="https://github.com/takezoe/gitbucket/releases/tag/1.5">GitBucket 1.5</a> several days before.
</p>
<p>
GitBucket is a Github clone written with Scala. It's based on Scalatra, Slick and JGit.
</p>
<p>
This release contains many important new features such as:
</p>
<ul>
<li>Fork and pull request</li>
<li>LDAP authentication</li>
<li>Mail notification</li>
</ul>
<p>
See <a href="https://github.com/takezoe/gitbucket#installation">here</a> to know how to setup GitBucket. It's very easy. Please try GitBucket and any feedback is welcome!
</p>
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-B6TLzpGWZYI/Uivs_sQB_rI/AAAAAAAAA1E/YcYNmxmUCaE/s1600/%E5%9B%B32_%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%83%93%E3%83%A5%E3%83%BC%E3%82%A2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-B6TLzpGWZYI/Uivs_sQB_rI/AAAAAAAAA1E/YcYNmxmUCaE/s320/%E5%9B%B32_%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%83%93%E3%83%A5%E3%83%BC%E3%82%A2.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-WEZR2yYTkzY/Uivs_ri8H8I/AAAAAAAAA1I/FuKiunGVkr4/s1600/%E5%9B%B33_%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-WEZR2yYTkzY/Uivs_ri8H8I/AAAAAAAAA1I/FuKiunGVkr4/s320/%E5%9B%B33_%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-UzPAJWGAQxc/Uivs_q4HB4I/AAAAAAAAA1Q/vccU4STasb4/s1600/%E5%9B%B34_Wiki.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-UzPAJWGAQxc/Uivs_q4HB4I/AAAAAAAAA1Q/vccU4STasb4/s320/%E5%9B%B34_Wiki.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-dR-tevOMrAE/UivtAceIE8I/AAAAAAAAA1Y/wQPIYdcYTts/s1600/%E5%9B%B35_%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%9E%E3%83%BC%E3%82%B8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-dR-tevOMrAE/UivtAceIE8I/AAAAAAAAA1Y/wQPIYdcYTts/s320/%E5%9B%B35_%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%9E%E3%83%BC%E3%82%B8.png" /></a></div>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-66468471685105106392013-08-02T03:13:00.003+09:002013-08-31T02:26:48.642+09:00Non-blocking API for Apache Solr<p>
Today, we've released <a href="https://github.com/takezoe/solr-scala-client">solr-scala-client</a> 0.0.8!!
</p>
<p>
This release includes asynchronous and non-blocking API based on <a href="https://github.com/AsyncHttpClient/async-http-client">AsyncHttpClient</a> and Scala 2.10's Future. See the following simple example:
</p>
<pre class="prettyprint">
val client = new AsyncSolrClient("http://localhost:8983/solr")
// Register
client
.register(Map(
"id" -> "005",
"name" -> "ThinkPad X1 Carbon",
"manu" -> "Lenovo"))
.onComplete{
case Success(x) => println("registered!")
case Failure(t) => t.printStackTrace()
}
// Query
client.query("name:%name%")
.fields("id", "manu", "name")
.facetFields("manu")
.sortBy("id", Order.asc)
.getResultAsMap(Map("name" -> "ThinkPad X201s"))
.onComplete {
case Success(x) => println(x)
case Failure(t) => t.printStackTrace()
}
</pre>
<p>
Methods of AsyncSolrClient return Future. You can process result by callback handler. See more example at <a href="https://github.com/takezoe/solr-scala-client/blob/master/src/main/scala/jp/sf/amateras/solr/scala/sample/AsyncSolrClientSample.scala">here</a>.
</p>
<p>
This release also contains some other new features such as recommendation search and automatic transaction management. Check <a href="https://github.com/takezoe/solr-scala-client">the github site</a> to know details of solr-scala-client!
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com1tag:blogger.com,1999:blog-1669625400637572127.post-54049887377179535442013-07-04T16:44:00.001+09:002013-07-04T16:44:14.091+09:00GitBucket 1.0 released!<p>
Today, we released a first public version of <a href="http://localhost:8080/takezoe/gitbucket">GitBucket</a> which is a Github clone by Scala, it very easy to setup.
</p>
<p>
The current version of GitBucket provides a basic features below:
</p>
<ul>
<li>Public / Private Git repository (http access only)</li>
<li>Repository viewer (some advanced features are not implemented)</li>
<li>Wiki</li>
<li>Issues</li>
<li>User management (for Administrators)</li>
</ul>
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-vD7jy97QKeE/UdUmNfpSkWI/AAAAAAAAA0c/WX1pjZaHHhw/s943/gitbucket_repo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-vD7jy97QKeE/UdUmNfpSkWI/AAAAAAAAA0c/WX1pjZaHHhw/s943/gitbucket_repo.png" style="width: 350px;"/></a></div>
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-WAT8i9dRwWY/UdUmMVQXJ8I/AAAAAAAAA0U/849NhOHmjiA/s951/gitbucket_history.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-WAT8i9dRwWY/UdUmMVQXJ8I/AAAAAAAAA0U/849NhOHmjiA/s951/gitbucket_history.png" style="width: 350px;"/></a></div>
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-da_WetevGR4/UdUmL6NhXII/AAAAAAAAA0E/DtZVFjM-pkg/s943/gitbucket_diff.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-da_WetevGR4/UdUmL6NhXII/AAAAAAAAA0E/DtZVFjM-pkg/s943/gitbucket_diff.png" style="width: 350px;"/></a></div>
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-3HGH4nlyous/UdUmMcPA6LI/AAAAAAAAA0Q/vI4BReha_9Q/s953/gitbucket_issues.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-3HGH4nlyous/UdUmMcPA6LI/AAAAAAAAA0Q/vI4BReha_9Q/s953/gitbucket_issues.png" style="width: 350px;"/></a></div>
<p>
Following features are not implemented, but we will make them in the future release!
</p>
<ul>
<li>Fork and pull request</li>
<li>Activity timeline</li>
<li>Search</li>
<li>Notification</li>
<li>Network graph</li>
<li>Statics</li>
<li>Watch / Star</li>
<li>Team management (like Organization in Github)</li>
</ul>
<p>
You can setup GitBucket by only putting war into your servlet container such as Tomcat or Jetty. Please try it and feedback is welcome!
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-71722905853895376862013-04-19T03:22:00.000+09:002013-04-19T03:22:14.383+09:00eclipse-scala-tools 0.0.4 released!<p>
<a href="https://bitbucket.org/takezoe/eclipse-scala-tools/wiki/Home">eclipse-scala-tools</a> is an Eclipse plug-in for sbt.
</p>
<p>
<a href="http://3.bp.blogspot.com/-0sQPknSwrkU/UXA5uA99kYI/AAAAAAAAArY/FGOvRuUvXS8/s1600/sbt_context_menu.png" imageanchor="1" ><img border="0" src="http://3.bp.blogspot.com/-0sQPknSwrkU/UXA5uA99kYI/AAAAAAAAArY/FGOvRuUvXS8/s320/sbt_context_menu.png" /></a>
</p>
<p>
This is a list of new features and changes in this version:
</p>
<ul>
<li>Use system proxy setting</li>
<li>SBT 0.12 Support (SBT 0.7 and 0.10 are removed)</li>
<li>Use sbteclipse to generate Eclipse project configuration files</li>
<li>Outline view</li>
</ul>
<p>
And I have a plan about new features in the future release:
</p>
<ul>
<li>Scala IDE 3.x and sbt 0.13 support</li>
<li>Select some major libraries at the project creation wizard</li>
<li>Multi project support</li>
<li>Wizard to import existing sbt project from out of workspace</li>
</ul>
<p>
I hope this plug-in helps you. Enjoy!
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-8666601225147966632013-04-04T05:09:00.001+09:002013-04-04T05:09:30.046+09:00solr-scala-client 0.0.7 is now available!<p>
<strong>solr-scala-client</strong> is a simple <a href="http://lucene.apache.org/solr/">Apache Solr</a> client for Scala based on SolrJ.
</p>
<ul>
<li><a href="https://github.com/takezoe/solr-scala-client">https://github.com/takezoe/solr-scala-client</a></li>
</ul>
<p>
The list of new features in 0.0.7:
</p>
<ul>
<li>Add build for Scala 2.10</li>
<li>Upgrade to SolrJ 4.2.0</li>
<li>Support search result highlighting</li>
</ul>
<p>
In this entry, I introduce search result highlighting which is a new feature in this release.
</p>
<h4>How to Highlight?</h4>
<p>
You can configure the query to return the highlighted content using QueryBuilder#highlight(). The highlighted field is required, but prefix and suffix is not required. They are optional(default is <em>...</em>).
</p>
<p>
The highlighted content is set as the "highlight" property to the Map or the case class.
</p>
<pre class="prettyprint">
val result = client.query("content: Scala")
// NOTE: unique key field is required.
.fields("id")
// Specify the highlighted field, prefix and postfix (prefix and postfix is optional).
.highlight("content", "<strong>", "</strong>")
.getResultAsMap()
result.documents.foreach { doc: Product =>
println("id: " + doc("id"))
println(doc("highlight")) // highlighted content is set as the "highlight" property
}
</pre>
<p>
In SolrJ, we have to map retrieved documents and highlighted contents using the unique key of the index schema. solr-scala-client expects that the unique key is "id".
</p>
<p>
If your schema has the different field as the unique key, you can specify the unique key name as following:
</p>
<pre class="prettyprint">
val result = client.query("content: Scala")
.id("documentId") // Specify the unique key name
.fields("documentId")
.highlight("content", "<strong>", "</strong>")
.getResultAsMap()
</pre>
Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-62775118574858467202013-02-25T14:13:00.001+09:002013-02-25T16:42:21.039+09:00Accelerate Play2 development mode<p>
Play2 development mode is very heavy because it checks file modification and reload classes for each requests. And it seems to process requests in serial. So loading web pages which contain many resources such as external CSS, JavaScript files or images is stressful.
</p>
<p>
<a href="https://github.com/takezoe/play2-fastassets">play2-fastassets</a> accelerates Play2 development mode by leveraging browser cache.
</p>
<p>
Replace the routing to <code>controllers.Assets.at</code> by <code>jp.sf.amateras.play2.fastassets.FastAssets.get</code> in <code>conf/routes</code>. This method returns a response which has a header: <code>Cache-Control: private, max-age=3600</code>.
</p>
<pre class="prettyprint">
#GET /assets/*file controllers.Assets.at(path="/public", file)
GET /assets/*file jp.sf.amateras.play2.fastassets.FastAssets.get(file)
</pre>
<p>
And add following configurations into <code>conf/application.conf</code>.
</p>
<pre class="prettyprint">
fastassets.urlPath=/assets
fastassets.realPath=/public
</pre>
<p>
Use <code>FastAssets.at</code> instead of <code>routes.Assets.at</code> in HTML templates.
</p>
<pre class="prettyprint">
@(title: String)(content: Html)
@import jp.sf.amateras.play2.fastassets.FastAssets
<!DOCTYPE html>
<html>
<head>
<title>@title</title>
<link rel="stylesheet" media="screen" href="@FastAssets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@FastAssets.at("images/favicon.png")">
<script src="@FastAssets.at("javascripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
</head>
<body>
@content
</body>
</html>
</pre>
<p>
<code>FastAssets.at</code> appends a last modified timestamp to the filename and your browser cache it. When you update the file, this timestamp is also updated. So the browser retrieves a new file from the server instead of the cached contents.
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-14008806945781503162012-08-25T15:23:00.000+09:002012-08-28T02:23:44.409+09:00Jerkson in Play2 development mode<p>
Play2 includes <a href="https://github.com/codahale/jerkson">Jerkson</a> which is a Scala wrapper for the Java based JSON library Jackson.
</p>
<p>
It's very useful and I'm loving it. However when we use it in the Play2 application, it fails to deserialize case classes after reloading in development mode. See the following code:
</p>
<pre class="prettyprint">
import com.codahale.jerkson.Json
val json = Json.generate(UserInfo("Naoki Takezoe"))
val info = Json.parse[UserInfo](json)
</pre>
<p>
After reloading in the development mode, this code throws an exception such as <code>ParsingException: Unable to find a case accessor for models.UserInfo</code>.
</p>
<p>
The reason of this problem is Jerkson hold a class loader in <a href="https://github.com/codahale/jerkson/blob/master/src/main/scala/com/codahale/jerkson/Json.scala">the singleton object</a>.
</p>
<p>
So this problem could be solved to create new instance which is mixed-in <code>com.codahale.jerkson.Json</code> trait for each Json serialization / deserialization as following:
</p>
<pre class="prettyprint">
// This code works in the development mode!
import com.codahale.jerkson.Json
val json = new Json{}.generate(UserInfo("Naoki Takezoe"))
val info = new Json{}.parse[UserInfo](json)
</pre>
<p>
Some of hotswap solutions (reloading recompiled classes) on JVM have similar problem because they are based on classloader swapping. They can make rapid development on JVM and very helpful for our work. However sometimes they trouble us like this.
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-90138281279942917192012-06-24T22:32:00.000+09:002012-06-24T22:35:56.407+09:00Scalagen - A Source Code Generator for ORMs<p>
<a href="https://github.com/takezoe/scalagen">Scalagen</a> is a source code generator for ORMs. In the current version of Scalagen supports <a href="http://scalaquery.org/">ScalaQuery</a> and <a href="http://www.playframework.org/modules/scala-0.9.1/anorm">Anorm</a>.
</p>
<p>
It's possible to use as a sbt plug-in. I show how to use Scalagen as a sbt plug-in for ScalaQuery. Scalagen generates table definition objects and case classes which correnspond to them.
</p>
<p>
In <strong>project/plugins.sbt</strong>, add:
</p>
<pre class="prettyprint">
resolvers += ("amateras snapshot" at "http://amateras.sourceforge.jp/mvn-snapshot/")
addSbtPlugin("jp.sf.amateras.scalagen" % "scalagen-sbtplugin" % "0.1-SNAPSHOT")
libraryDependencies ++= Seq(
// for ScalaQuery
"jp.sf.amateras.scalagen" %% "scalagen-scalaquery" % "0.1-SNAPSHOT",
// for Anorm
//"jp.sf.amateras.scalagen" %% "scalagen-anorm" % "0.1-SNAPSHOT",
// JDBC driver for your database
"org.hsqldb" % "hsqldb" % "2.2.8"
)
</pre>
<p>
In <strong>build.sbt</strong>, add:
</p>
<pre class="prettyprint">
seq(jp.sf.amateras.scalagen.ScalagenPlugin.scalagenSettings: _*)
scalagenConfiguration := jp.sf.amateras.scalagen.Settings(
// for ScalaQuery
generator = new jp.sf.amateras.scalagen.ScalaQueryGenerator(),
// for Anorm
//generator = new jp.sf.amateras.scalagen.ScalaQueryGenerator(),
driver = "org.hsqldb.jdbcDriver",
url = "jdbc:hsqldb:hsql://localhost/",
username = "sa",
password = "",
catalog = null,
schemaPattern = null,
tablePattern = null
)
</pre>
<p>
Execute <strong>sbt scalagen</strong>, source files are generated into <strong>src/main/scala/models</strong>.
</p>
<p>
See more details about Scalagen at the following URL:<br>
<a href="https://github.com/takezoe/scalagen">https://github.com/takezoe/scalagen</a>
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-75044299941684034152012-05-27T11:36:00.003+09:002012-05-27T11:36:55.337+09:00solr-scala-client 0.0.2 is now available!<p>
solr-scala-client is a <a href="http://lucene.apache.org/solr/">Apache Solr</a> client for Scala wrapping SolrJ.
</p>
<ul>
<li><a href="https://github.com/takezoe/solr-scala-client">https://github.com/takezoe/solr-scala-client</a></li>
</ul>
<p>
The list of new features in 0.0.2:
</p>
<ul>
<li>Added initializer which configures SolrClient.</li>
<li>Added basic authentication support as initializer.</li>
<li>Added facet search support.</li>
<li>Added case class support as query results and query parameters.</li>
</ul>
<p>
The query result became to be returned as MapQueryResult or CaseClassQueryResult instead of List[Map[String, Any]]. This object contains both of documents and facet counts.
</p>
<pre class="prettyprint">
val result = client.query("name:%name%")
.fields("id", "manu", "name")
.facetFields("manu")
.sortBy("id", Order.asc)
.getResultAsMap(Map("name" -> "ThinkPad X201s"))
// retreive documents
result.documents.foreach { doc =>
println("id: " + doc("id"))
println(" manu: " + doc("manu"))
println(" name: " + doc("name"))
}
// retreive facet counts
result.facetFields.foreach { case (field, counts) =>
println("field: " + field)
counts.foreach { case (manu, count) =>
println(" " + manu + ": " + count)
}
}
</pre>
<p>
It's possible to use the case class as the query result and the query parameter instead of Map[String, Any]. Note: update operations don't support the case class in 0.0.2. It will be supported in the next version.
</p>
<pre class="prettyprint">
// the case class for the document
case class Product(id: String, manu: Option[String], name: String)
// the case class for the parameter
case class Param(name: String)
// query using case classes
val result = client.query("name:%name%")
.fields("id", "manu", "name")
.facetFields("manu")
.sortBy("id", Order.asc)
.getResultAs[Product](Param("ThinkPad"))
result.documents.foreach { product =>
println(product)
}
</pre>
<p>
As small improvement of SolrClient, it became to accept the initializer function. This function takes CommonsHttpSolrServer and can do any processing for it.
</p>
<pre class="prettyprint">
val client = new SolrClient("http://localhost:8983/solr", {
server: CommonsHttpSolrServer => // initialize...
})
</pre>
<p>
<p>
0.0.2 contains the BASIC authentication support as the initializer. see the following example.
</p>
<pre class="prettyprint">
val client = new SolrClient("http://localhost:8983/solr",
Auth.basic("username", "password"))
</pre>
<p>
I think solr-scala-client does not have enough features to use in production yet. Therefore I will improve it through use in my project.
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-55716687114584580942012-04-29T16:10:00.001+09:002012-05-27T11:16:43.629+09:00The simple Apache Solr client for Scala<p>
I pushed <strong>solr-scala-client</strong> into github. This is a simple <a href="http://lucene.apache.org/solr/">Apache Solr</a> client for Scala wrapping SolrJ.
</p>
<ul>
<li><a href="https://github.com/takezoe/solr-scala-client">https://github.com/takezoe/solr-scala-client</a></li>
</ul>
<p>
The basic concept of solr-scala-client is providing fluent interface and wrapping SolrJ classes by Scala collection API. This is an example to register documents into the Solr server which is working at localhost:8983.
<p>
<pre class="prettyprint">
import jp.sf.amateras.solr.scala._
val client = new SolrClient("http://localhost:8983/solr")
client
.add(Map("id"->"1", "name" -> "ThinkPad X201s"))
.add(Map("id"->"2", "name" -> "ThinkPad X220"))
.add(Map("id"->"3", "name" -> "ThinkPad X121e"))
.commit
</pre>
<p>
add() takes a variable-length argument. So an example above could be rewritten as follows:
</p>
<pre class="prettyprint">
client.add(
Map("id"->"1", "name" -> "ThinkPad X201s"),
Map("id"->"2", "name" -> "ThinkPad X220"),
Map("id"->"3", "name" -> "ThinkPad X121e")
).commit
</pre>
<p>
Next, see the following example to search document using the query.
</p>
<pre class="prettyprint">
// query
val result: List[Map[String, Any]] =
client.query("name:%name%")
.fields("id", "manu", "name")
.sortBy("id", Order.asc)
.getResult(Map("name" -> "ThinkPad"))
result.foreach { doc =>
println("id: " + doc("id"))
println("name: " + doc("name"))
println("--")
}
</pre>
<p>
%VARNAME% in the query is replaced by given parameters as Map and the result is returned as List[Map[String, Any]].
</p>
<p>
The current version of solr-scala-client does not support facet search yet. I wish to support it in the near future. And I'm also planning about using case class to specify document or parameters instead of Map.
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-26561028495255202532012-04-15T20:12:00.002+09:002012-04-15T20:14:19.455+09:00mirage 1.1.5 and mirage-scala 0.0.4 is now available!<p>
Today, we released Mirage 1.1.5 and mirage-scala 0.0.4!
</p>
<p>
Mirage is a simple SQL centric database access library and mirage-scala is the wrapper of Mirage for Scala. See the following URL to know about Mirage:
</p>
<ul>
<li><a href="http://amateras.sourceforge.jp/site/mirage/welcome.html">http://amateras.sourceforge.jp/site/mirage/welcome.html</a></li>
</ul>
<p>
This release contains some important new features for mirage-scala. Mirage update is only small bug fix. So I introduce new features of mirage-scala 0.0.4 in this entry.
</p>
<h4>Improvement of SqlManager interface</h4>
<p>
Some methods of SqlManager had a java.lang.Class parameter which specifies the entity class in the previous version. But in mirage-scala 0.0.4, it modified to the generics type parameter.
</p>
<pre class="prettyprint">
// Until mirage-scala 0.0.3
val books = sqlManager.getResultList(
classOf[Book],
Sql("SELECT * FROM BOOK"))
// In mirage-scala 0.0.4
val books = sqlManager.getResultList[Book](
Sql("SELECT * FROM BOOK"))
</pre>
<h4>Improvement of case class entity</h4>
<p>
mirage-scala can handle case class as the entity. But it required the default constructor as below:
</p>
<pre class="prettyprint">
@Table(name="BOOK")
case class Book(
@(PrimaryKey @field)(generationType = IDENTITY)
bookId: java.lang.Long,
bookName: String,
author: String,
price: Option[Int]) {
// This is not required in mirage-scala 0.0.4
def this() = this(null, null, null, None)
}
</pre>
<p>
The default constructor of case class is not required no longer in mirage-scala 0.0.4.
</p>
<h4>Wrapping primary key by Pk[T]</h4>
<p>
In mirage-scala 0.0.4, Pk[T], Id[T] and Auto are added. You can use Pk[T] to wrap the property which corresponds to the primary key. It is useful when the primary key is set by the database. For example, it's auto incremented column.
</p>
<pre class="prettyprint">
@Table(name="BOOK")
case class Book(
@(PrimaryKey @field)(generationType = IDENTITY)
bookId: Pk[Long],
bookName: String,
author: String,
price: Option[Int])
val book = Book(
Auto,
"Mirage in Action",
"Naki Takezoe",
25)
sqlManager.insertEntity(book)
</pre>
<p>
If you have to set the value of the primary key, you can use Id[T] instead of Auto.
</p>
<pre class="prettyprint">
@Table(name="BOOK")
case class Book(
@(PrimaryKey @field)(generationType = APPLICATION)
bookId: Pk[Long],
bookName: String,
author: String,
price: Option[Int])
val book = Book(
Id(1),
"Mirage in Action",
"Naki Takezoe",
25)
sqlManager.insertEntity(book)
</pre>
<p>
Anyway, mirage-scala became more scalanized database access library in 0.0.4. I hope mirage-scala will help your development with Scala!
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com2tag:blogger.com,1999:blog-1669625400637572127.post-75721560008596899702012-04-08T14:35:00.000+09:002012-04-08T14:36:43.253+09:00Simple wrapper of PicoContainer for Scala<p>
I tried <a href="https://github.com/dickwall/subcut">SubCut</a> to resolve dependency of components in Scala. However I think <a href="http://jonasboner.com/2008/10/06/real-world-scala-dependency-injection-di/">The Cake Pattern</a> might be better than SubCut because it's so complex more than necessary and not transparent.It's similar to the service locator, not the DI container. I need a DI container which is more simple and intuitive. It's sufficient that supports constructor injection.
</p>
<p>
There are <a href="http://picocontainer.org/">PicoContainer</a> in Java World. So I wrote a simple wrapper of PicoContainer for Scala:
</p>
<script src="https://gist.github.com/2329981.js?file=Pico.scala"></script>
<p>
It does not cover all features of PicoContainer. But it might be enough for my current use :-)
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com2tag:blogger.com,1999:blog-1669625400637572127.post-12880061598651634762012-02-12T23:18:00.002+09:002012-02-12T23:18:54.626+09:00Getting Started with mirage-scala<p>
<a href="http://amateras.sourceforge.jp/site/mirage/mirage-scala.html">mirage-scala</a> is the simple and powerful library to access RDBMS from Scala. I introduce how to use mirage-scala with sbt.
</p>
<p>
At first, add the following dependency into your <strong>build.sbt</strong>:
</p>
<script src="https://gist.github.com/1806591.js?file=build.sbt"></script>
<p>
And create the <strong>jdbc.properties</strong> and put it on the root of classpath.
</p>
<script src="https://gist.github.com/1806591.js?file=jdbc.properties"></script>
<p>
Next, you have to create the entity class. mirage-scala supports both of mutable and immutable style as entity class. This is the example of immutable style entity class:
</p>
<script src="https://gist.github.com/1806591.js?file=Book.scala"></script>
<p>
Ready for mirage-scala. Let's try to use it!
</p>
<script src="https://gist.github.com/1806591.js?file=MirageScalaExample1.scala"></script>
<p>
You can insert, update and delete a record using SqlManager and entity classes. And also you can select a record by the primary key.
</p>
<p>
When you must select records by the more complex query, you can do it using <strong>2way-SQL</strong> which is the powerful feature of mirage-scala. I would like to write about it in the next entiry.
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-68611444993753072982012-02-12T13:43:00.001+09:002012-02-12T13:49:05.841+09:00mirage-scala 0.0.3 is now available!<p>
mirage-scala is the wrapper of Mirage for Scala. It provides the best solution to access RDBMS from Scala.
</p>
<ul>
<li><a href="http://amateras.sourceforge.jp/site/mirage/mirage-scala.html">http://amateras.sourceforge.jp/site/mirage/mirage-scala.html</a></li>
</ul>
<p>
New features in mirage-scala 0.0.3:
</p>
<ul>
<li>Case class (immutable model) is available as entity.</li>
<li>Option[T] is available as property type.</li>
</ul>
<p>
By these new features, mirage-scala became the more suitable library for Scala to access RDBMS.
</p>
<p>
mirage-scala is still under preview release. So any request or feedback welcome!
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-54490152752468080182012-02-12T13:32:00.000+09:002012-02-12T13:32:09.110+09:00Mirage 1.1.4 is now available!<p>
Mirage is a simple SQL centric database access library. See the following URL to know about Mirage:
</p>
<ul>
<li><a href="http://amateras.sourceforge.jp/site/mirage/welcome.html">http://amateras.sourceforge.jp/site/mirage/welcome.html</a></li>
</ul>
<p>
New features in Mirage 1.1.4:
</p>
<ul>
<li>Added <a href="http://amateras.sourceforge.jp/site/mirage/apidocs/jp/sf/amateras/mirage/naming/RailsLikeNameConverter.html">RailsLikeNameConverter</a> as an optional NameConverter.</li>
<li>Added <a href="http://amateras.sourceforge.jp/site/mirage/apidocs/jp/sf/amateras/mirage/beans/FieldPropertyExtractor.html">FieldPropertyExtractor</a> as an optional implementation of PropertyExtractor.</li>
<li>BugFix: Avoid depending on JDBC 4.0 (Java6) API in DefaultValueType</li>
<li>Chopping semicolon from the end of the SQL file.</li>
<li>Improve: Avoid using type Exception/RuntimeException to make interfaces intension revealing</li>
<li>Added SqlManagerImpl#setValueTypes to make it easier to configure valueTypes using Spring framework</li>
<li>BugFix: PropertyExtractor extracts static or final field</li>
<li>Improvement: DefaultResultEntityCreator just reqires no-argument constructor. It really doesn't matter if the constructor is public.</li>
<li>Improvement: Make ValueType parameterized. If you implement custom ValueTypes, these is not compatible in this version.</li>
<li>Added <a href="http://amateras.sourceforge.jp/site/mirage/apidocs/jp/sf/amateras/mirage/exception/BreakIterationException.html">BreakIterationException</a> to discontinue iteration search.</li>
<li>BugFix: @Column is available for the select query.</li>
</ul>
<p>
Since this version, we provide a source code cross reference generated by <a href="http://java.net/projects/sorcerer/">Sorcerer</a>. It generates so rich HTML based cross reference which provide references search like Eclipse. See the follwing URL:
</p>
<ul>
<li><a href="http://amateras.sourceforge.jp/site/mirage/sorcerer/index.html">http://amateras.sourceforge.jp/site/mirage/sorcerer/index.html</a></li>
</ul>
<p>
I hope Mirage helps your development. Enjoy!
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-11132283574713476212011-11-03T18:11:00.001+09:002011-11-04T10:36:12.409+09:00Simple HTTP Client for Scala<p>
I'm writing a <a href="https://bitbucket.org/takezoe/scala-utils/src/01436694bc12/src/main/scala/jp/sf/amateras/scala/util/http/SimpleHttpClient.scala">Simple HTTP Client for Scala</a>. This is a simple example of GET request:
</p>
<pre class="prettyprint">
using (new SimpleHttpClient()){ client =>
val content: Option[String] = client.get(
url = "http://localhost:8080/"
)
content match {
case Some(s) => println(s)
case None => println("Request Failed.")
}
}
</pre>
<p>
You can give request parameters to get() method. And it's possible to send POST request to use post() method instead of get() method. The second example shows how to give request parameters with the POST request:
</p>
<pre class="prettyprint">
using (new SimpleHttpClient()){ client =>
val content: Option[String] = client.post(
url = "http://localhost:8080/",
params = Map("q" -> "Scala"),
encode = "UTF-8"
)
...
}
</pre>
<p>
In default SimpleHttpClient returns the response body as Option[String]. You can handle the response to give the your own response handler. The response handler has to be a function has a signature (HttpResponse => T).
</p>
<pre class="prettyprint">
using (new SimpleHttpClient()){ client =>
val content: Array[Byte] = client.post(
url = "http://localhost:8080/",
handler = { r: HttpResponse =>
r.getStatusLine.getStatusCode match {
case HttpStatus.SC_OK =>
EntityUtils.toByteArray(r.getEntity())
case _ =>
throw new RuntimeException("Request Failed.")
}
}
)
...
}
</pre>
<p>
SimpleHttpClient also supports http proxy. You can give proxy settings to the constructor.
</p>
<pre class="prettyprint">
using(new SimpleHttpClient(
"proxy.example.com:8080")){ client =>
...
}
</pre>
<p>
I'm making useful utilities like this HTTP Client for development of general Scala based applications at <a href="https://bitbucket.org/takezoe/scala-utils/overview">scala-utils</a>.
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-84020508368687103282011-10-31T11:09:00.001+09:002011-10-31T11:10:15.758+09:00xsbt-scalate-precompile-plugin 1.6<p>
<a href="https://github.com/zentrope/xsbt-scalate-precompile-plugin">xsbt-scalate-precompile-plugin</a> is a sbt plug-in which makes precompilation <a href="http://scalate.fusesource.org/">Scalate</a> templates in the sbt build process (Scalate is a template engine for Scala).
</p>
<p>
However xsbt-scalate-precompile-plugin 1.5 had one serious problem which does not process templates in the nested directory. For example, it could't handle the layout template (which have to be placed into WEB-INF/scalate/layouts) correctly.
</p>
<p>
I made a <a href="https://gist.github.com/1316239">patch</a> to fix this problem and <a href="https://github.com/zentrope/xsbt-scalate-precompile-plugin/issues/4">send it</a>. It's <a href="https://github.com/zentrope/xsbt-scalate-precompile-plugin/commit/49baba8147906f34154c50bec4d7a204e0b440c9">taken</a> in xsbt-scalate-precompile-plugin 1.6.
</p>
<p>
The fixed version of xsbt-scalate-precompile-plugin 1.6 is already available! Now it can process templates in the nested directory correctly.
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-11034275805989417772011-09-23T02:41:00.000+09:002011-09-23T12:33:29.709+09:00Introduction of CookieSessionFilter<p>
<strong>CookieSessionFilter</strong> is a servlet filter which stores session data into the client cookie for Java based web applications.
</p>
<p>
In using CookieSessionFilter, session replication becomes unnecessary for multiplexing of application servers. You'll be able to make and manage multiplexing environment more easily.
</p>
<p>
It provides HttpSession interface. So any modification in your application is not necessary. Probably, you'll be able to use it with not so large cost.
</p>
<p>
See details about CookieSessionFilter at:<br>
<a href="http://amateras.sourceforge.jp/site/cookie-session-filter/usage.html">http://amateras.sourceforge.jp/site/cookie-session-filter/usage.html</a>
</p>Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0tag:blogger.com,1999:blog-1669625400637572127.post-72658468633499495892011-08-20T16:04:00.006+09:002011-08-21T01:10:39.258+09:00eclipse-scala-tools 0.0.2 is now available!<p>
eclipse-scala-tools provides some small Eclipse plug-ins for Scala. It supplements ScalaIDE for Eclipse. The current version of eclipse-scala-tools provides features that support SBT.
<p>
<p>
See details about eclipse-scala-tools at the following URL:
</p>
<ul>
<li><a href="https://bitbucket.org/takezoe/eclipse-scala-tools/wiki/Home">https://bitbucket.org/takezoe/eclipse-scala-tools/wiki/Home</a></li>
</ul>
<p>
New features in eclipse-scala-tools 0.0.2:
</p>
<ul>
<li>SBT 0.10 Support</li>
<li>Proxy Settings</li>
<li>SBT Console (SBT > Open SBT Shell)</li>
<li>Built-In SBT Runtime</li>
</ul>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-GMdPC3ICYpo/Tk9edpMCwUI/AAAAAAAAADg/D3BeBEH6ZrU/s1600/sbt_context_menu.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 131px;" src="http://2.bp.blogspot.com/-GMdPC3ICYpo/Tk9edpMCwUI/AAAAAAAAADg/D3BeBEH6ZrU/s320/sbt_context_menu.png" border="0" alt="Context menu of the SBT project" id="BLOGGER_PHOTO_ID_5642832721484104002" /></a>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-WnnpmC97-oQ/Tk9elX61OXI/AAAAAAAAADo/W_zU1fG2BNE/s1600/project_property.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 248px;" src="http://4.bp.blogspot.com/-WnnpmC97-oQ/Tk9elX61OXI/AAAAAAAAADo/W_zU1fG2BNE/s320/project_property.png" border="0" alt="Project property page of the SBT project" id="BLOGGER_PHOTO_ID_5642832854287464818" /></a>
<p>
I hope it helps your Scala development!
</p>
Naoki Takezoehttp://www.blogger.com/profile/17770435894928578175noreply@blogger.com0