API リファレンス
ダウンロード
- RSSの取り出しに失敗しました:http://sourceforge.jp/projects/paraselene/releases/rss
まずはスケルトンを生成します。パッケージ名は tutorial2、コンテキストパスも tutorial2 とします。
| No | モックアップファイル名 | ページタイトル | クラス名 | PageID | 実行時URL ※getAliasURI()が優先されます。 |
特記 |
|---|---|---|---|---|---|---|
| 1 | /menu.html | メニュー | tutorial2.logic.MenuHtml | tutorial2.base.PageType. MENU_HTML |
on.svvxoa.na | |
| 2 | user/edit.html | 編集 | tutorial2.logic.user.EditHtml | tutorial2.base.PageType. USER_EDIT_HTML |
on.b18bs1.na | name=sexのタグは配列化されました。 |
| 3 | user/seek.html | ユーザー一覧 | tutorial2.logic.user.SeekHtml | tutorial2.base.PageType. USER_SEEK_HTML |
on.xjmhm9.na |
| No | モックアップファイル名 | 解決パス |
|---|---|---|
| 1 | image/wallpaper.gif | .//image/wallpaper.gif |
今回は user と image というサブディレクトリがありますが、 URL パスは以下のようになります。
このように、モックアップHTMLとは、静的コンテンツとの相対位置関係が変わりますので注意が必要です。
もう1つ、user/edit.html の特記欄に「name=sexのタグは配列化されました。」とあります(性別入力用ラジオボタンとして男女2個を準備しました)。
Paraselene は、1つの HTML 中に複数個の同一 name が登場すると配列として管理します。
tutorial2.logic.user.EditHtml の親クラスである tutorial2.view.user.EditHtml には以下のアクセッサが存在します。
| 1 | public paraselene.tag.form.SingleTextBox getUserIdInput() | ユーザーID |
| 2 | public paraselene.tag.Tag[] getUserIdTags() | |
| 3 | public paraselene.tag.form.Button getOkInput() | 決定ボタン |
| 4 | public paraselene.tag.Tag[] getOkTags() | |
| 5 | public paraselene.tag.form.Button getCancelInput() | キャンセルボタン |
| 6 | public paraselene.tag.Tag[] getCancelTags() | |
| 7 | public paraselene.tag.form.SingleTextBox getNameInput() | 名前 |
| 8 | public paraselene.tag.Tag[] getNameTags() | |
| 9 | public paraselene.tag.form.SingleTextBox getAddressInput() | 住所 |
| 10 | public paraselene.tag.Tag[] getAddressTags() | |
| 11 | public paraselene.tag.Tag getErrorFont() | エラー |
| 12 | public paraselene.tag.Tag[] getErrorTags() | |
| 13 | public paraselene.tag.Tag[] getSexTags() | 性別 |
今回は別途、ユーザー情報用のクラスを準備しておきます。この db 変数を検索結果として使用します。
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
package tutorial2; import java.util.ArrayList; public class User { public String user_id; public String name; public String sex; public String address; public User( String u, String n, String s, String a ) { user_id = u; name = n; sex = s; address = a; } public static ArrayList<User> db = new ArrayList<User>(); static { db.add( new User( "user0", "チュートリアル", "m", "京都" ) ); db.add( new User( "user1", "康介", "m", "北京" ) ); db.add( new User( "user2", "宮里", "f", "沖縄" ) ); db.add( new User( "user3", "中田", "m", "イタリア" ) ); db.add( new User( "user4", "堀江", "m", "六本木" ) ); db.add( new User( "user5", "東国原", "m", "宮崎" ) ); db.add( new User( "user6", "小倉", "f", "こりん星" ) ); db.add( new User( "user7", "白石", "m", "生協" ) ); } }