open ended :: tech

developer works

SCA Java 1.2.1-incubating (June 2008)

leave a comment »

Tuscanyのメーリングリストが活発なので、久々にWebサイトを見に行ったところ、SCA Java 1.2.1-incubating がリリースされていました。4月にSDO Java Release 1.1-incubating もリリースされていたとは。

ここのところ技術以外の勉強を優先させていて、すっかりSCA & SDOに疎くなっています。そろそろまた花火採点アプリに取り組む季節になってきたので、時間を作り、最近よく目にする”blog on the go”って感じにしたいけれど...難しいかもなあ。

Written by junko

2008/06/22 at 21:50

Posted in sca, tuscany

ADF Faces Rich Client Componentsで花火採点アプリケーション

leave a comment »

卒業研究で作成した花火採点アプリケーションは、GUIに時間を割けず、 Tuscany DASのサンプル変更したJSPでした。それを、JDeveloper 11g + ADF Faces Rich Client Componentsを使って作り直しているところです。

とりあえず、このサンプルを作ってみたところで今日は終了。
Developing Ajax-Based User Interfaces with JSF: An Introduction to ADF Faces Rich Client Components

若干チュートリアル通りにいかない箇所もあるけれど、af:tableはすごい。夢のよう。 もう手作りには戻りたくなくなってしまいます。

Written by junko

2007/10/31 at 00:22

Posted in Uncategorized

Tagged with

#1045 – Access denied for user ‘root’@'localhost’ (using password: NO)

with 2 comments

#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdminをインストールしたのにMySQLのエラーが出てしまう、という方は多いようです。というのも、私もこのエラーに悩まされ、日本語のフォーラム、英語のフォーラム、いろいろと読みましたので。私の場合、そこに書いてあることを試しても全く解決せず、本当に嫌になっていたその時...ある間違いに気づいたのです。どのフォーラムでも話題にすらなっていません。なので、念のため書いておこうと思います。

config.inc.phpファイルは、configディレクトリの下ではなく、phpMyAdminのルートディレクトリに配置するんです!

...。
はい、すみませんでした。これを間違えてる人は多くないのでしょう。
Quick Installを斜め読みしたのがいけなかったようです。人の話は最後まで聞く。ドキュメントは最後まで読む。本当に、大事なことだなあと改めて思いました。でも、ファイルが所定の位置にありません&所定の位置はここですよ、というエラーを出してくれたらいいのにとも思います。#1045のほかに、「config.inc.phpファイルを作ってない」というメッセージも出ていましたが、ファイルは作っているし、configディレクトリの下に作られるのだから、それがおかしいとは全く思わず...

Written by junko

2007/10/10 at 21:59

Posted in Uncategorized

Tagged with ,

SCA Java 0.99-incubating

leave a comment »

SCA Java 0.99-incubating

SDO + DASを使ったアプリケーション作成に追われている間に、 SCA Java 0.99-incubatingがリリースされていました。Online Store SCA Composite というチュートリアルもありますね。早速試してみないと。

This release of Apache Tuscany SCA builds on the stability and modularity established with the previous releases and includes more complete implementation of SCA specifications, support for distributed SCA domains, SCA policy, OSGi implementation types, and pub/sub support with notification components. Start up time and memory footprint of the runtime has been reduced and there have been numerous bug fixes. This is expected to be the last point release before the 1.0 final release.

Written by junko

2007/09/07 at 10:24

Posted in sca, tuscany

Apache Tuscany RDB DAS Beta1 Release

leave a comment »

2006年11月のIncubating-M2以来リリースのなかったDASですが、ようやくBeta1がリリースされました。
http://incubator.apache.org/tuscany/latest-release-apache-tuscany-data-access-service.html

What’s new in Apache Tuscany DAS beta1?

  • Support for J2SE connections in DAS config using Driver Manager.
  • Added support for multiple database schemas in queries
  • Enhanced Optimistic Concurrency Control with overqualified updates
  • Multiple enhancements around ApplyChanges API
  • Enhanced support for MySQL
  • Enhanced Documentation: User, Developer and Architect guides as well as javadocs
  • Enhanced and new sample applications

現在、このDAS Beta1とSDO 1.0-incubatingを使い、総合研究発表会用のアプリケーションを鋭意作成中。発表が無事に終わったら詳細を書いていこうと思っています。

Written by junko

2007/08/26 at 08:47

Posted in das, tuscany

Apache Tuscany’s SDO Java Release 1.0-incubating

with one comment

TuscanyのSDOバージョン1.0-incubatingがリリースされました。
http://incubator.apache.org/tuscany/sdo-java-10-incubating.html

Apache Tuscany’s SDO Java Release 1.0-incubating is the first release with full coverage of the SDO 2.1 specification.

In addition to adding the few remaining SDO 2.1 features not included in the 1.0-incubating-beta1 release and fixing a number of bugs there are a number of new features relating to XML serialization, and new support for handling dynamic derivation from static classes. There has also been significant focus on making the SDO sample programs more accessible.

Written by junko

2007/08/11 at 08:10

Posted in sdo, tuscany

ChangeSummary

leave a comment »

ようやくChangeSummaryです。謎のxmlの不具合でやたらと時間がかかってしまいましたが、さっそくDataObjectを編集してみましょう。SDOUtilを使って、xmlからDataGraphを生成します。

元のxml

<?xml version=”1.0″ encoding=”UTF-8″?>
<sdo:datagraph xmlns:fireworks=”fireworksDataGraph.xsd” xmlns:sdo=”commonj.sdo”>
<fireworks:fireworksEvent eventID=”1″ eventName=”全国新作花火競技会” location=”諏訪湖” date=”2007-09-01″>
<comments>雨天決行</comments>
<firework id=”1″ title=”Advanced Technologies” pyrotechnist=”松尾潤子” size=”3″ pattern=”型物” score=”0″/>
</fireworks:fireworksEvent>
</sdo:datagraph>

今年の全国新作花火競技会で、松尾潤子さんという花火師が”Advanced Technologies”というタイトルの花火を上げます。それを審査員が採点するプログラムとなっています。

前準備として、ChangeSummaryのloggingを開始。

ChangeSummary cs = dataGraph.getChangeSummary();
cs.beginLogging();

先ずはルートDataObject (dataObject)から、XPathを指定してfireworkデータオブジェクトのidプロパティの値が1のDataObjectを取得します。pathは操作対象となるDataObjectの構造を知らないと指定できませんが、データソースに関係なく統一的な手法でアクセスできるのはやはり便利です。

DataObject firework = dataObject.getDataObject(“firework[id = 1]“);

次に、scoreを編集。元のxmlで、scoreが要素なのか属性なのかを気にせずにアクセスできています。

firework.setInt(“score”, 99);

DataGraphをファイルに書き出すと、ChangeSummaryは次のようなxmlで表現されていました。

<?xml version=”1.0″ encoding=”UTF-8″?>
<sdo:datagraph xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:fireworks=”fireworksDataGraph.xsd” xmlns:sdo=”commonj.sdo” xmlns:sdo_1=”http://www.apache.org/tuscany/2005/SDO”>
<changeSummary xmlns=”"
logging=”true”>
<objectChanges key=”#//@eRootObject/@firework.0″>
<value xsi:type=”sdo_1:ChangeSummarySetting” featureName=”score” dataValue=”0″/>
</objectChanges>
</changeSummary>
<fireworks:FireworksEventType eventID=”1″
eventName=”全国新作花火競技会” location=”諏訪湖” date=”2007-09-01″>
<comments>雨天決行</comments>
<firework id=”1″ title=”Advanced Technologies” pyrotechnist=”松尾潤子” size=”3″ pattern=”型物” score=”99″/>
</fireworks:FireworksEventType>
</sdo:datagraph>

undoも可能。

cs.undoChanges();

undoした場合、ChangeSummaryは残りません。但し、loggingを開始すると、変更しなくてもchangeSummary要素が追加されます。

<?xml version=”1.0″ encoding=”UTF-8″?>
<sdo:datagraph xmlns:fireworks=”fireworksDataGraph.xsd” xmlns:sdo=”commonj.sdo”>
<changeSummary xmlns=”"
logging=”true”/>
<fireworks:FireworksEventType eventID=”1″
eventName=”全国新作花火競技会” location=”諏訪湖” date=”2007-09-01″>
<comments>雨天決行</comments>
<firework id=”1″ title=”Advanced Technologies” pyrotechnist=”松尾潤子” size=”3″ pattern=”型物” score=”0″/>
</fireworks:FireworksEventType>
</sdo:datagraph>

Written by junko

2007/07/22 at 23:11

Posted in sdo

PropertyのisContainment()とisMany()

leave a comment »

DataGraphとDataObjectを実際にプログラムの中で扱ってみると、直感的にわからないことが多いのに気付きます。TypeとPropertyのメソッドも、何が取得できるのかわかりにくい。

とりあえず、サンプルのUsingTypeAndPropertyWithDataObjects.javaを参考に、DataGraphに格納されている値をSequenceを使わずに全て取り出してみました。余談ですが、SDOのサンプルプログラムはこのように、クラスが何をしているのかわかるようなとても長い名前が付けられています。

先ずは、 getRootObject()メソッドで、DataGraphからルートDataObjectを取得。
次に、getType().getProperties()メソッドで、ルートDataObjectからプロパティを取得。
ここから先が、直感的ではなくなってきます。プロパティがどんな状態なのかを調べなければなりません。

  • 単一の値を保持している
  • 複数の値を保持している -> PropertyのisMany()メソッド
  • 包含関係が定義されている -> PropertyのisContainment()メソッド

包含関係が定義されているプロパティが複数という場合もあるでしょう。
/* (isContainment() == true) && (isMany() == false) という場合もあると思うのですが、TuscanyのSDOで試している限りでは、今のところ包含している要素を1つにしても isMany() == true が返ってきます。 */

isMany() == true の場合は、DataObjectのgetListメソッドでListを取得します。DataObjectのgetメソッドの戻り値は、many-valuedならList型になります。

isContainment() == true の場合は、ObjectをDataObjectにキャストして再帰的に値を取得する、という流れです。

Written by junko

2007/07/20 at 00:04

Posted in sdo

SDOUtil.loadDataGraph()メソッドでxmlファイルからDataGraphを取得する

leave a comment »

本来DataGraphはDASにリクエストして取得しますが、DASはSDOの仕様範囲外です。そこでTuscanyのDASをダウンロードしてみたところ...なんと、TuscanyのDASはRDB DASなのです。XML File DASは見当たらず、RDBを準備している時間もなく。

しかし、TuscanyのSDOは私を見捨てませんでした。
SDOUtil.loadDataGraph()メソッドで、xmlファイルからDataGraphを取得することができます。サンプルあり。このユーティリティはSDOの仕様外です。

明日はいよいよ、DataGraphとChangeSummaryに着手する予定。

[追記]
xmlは<sdo:datagraph xmlns:yournamespace=”yourschema.xsd” xmlns:sdo=”commonj.sdo”></sdo:datagraph>の中に記述します。

Written by junko

2007/07/16 at 23:08

Posted in sdo

What is Data Access Service?

leave a comment »

Written by junko

2007/07/16 at 15:51

Posted in das

Follow

Get every new post delivered to your Inbox.