たちまち。

即席で役に立つこと。

intra-mart開発の現場でよく使うAPIまとめ

f:id:aposke:20111110210334j:plain

intra-mart開発は、一般的にJava開発の知識があればさほど難しいものではありません。

ただ、intra-mart開発に必要なノウハウとしては以下のようなものが挙げられます。

  • 製品機能の仕組みの理解(JugglingとかResinとかeBuilderとか)
  • 標準機能でできる範囲/できない範囲の判断(TableMaintenanceとかViewCreatorとかLogicDesignerとか)
  • 製品内で可能な設定の範囲の理解
  • どのようなAPIがあるのか

今回は、APIのうち「これは現場で使う。」というものをピックアップしたいと思います。

これからintra-mart開発を始めます、という方も、ファーストステップとして「こんなAPIがあるのか」というのを一通り見て、頭の片隅に置いておくことは大切かと思います。

APIでできるのに、自前で実装しては効率が落ちてしまいますからね。

というわけで入門向けでもあり、経験者は復習を兼ねて。

CSJS

intra-mart Accel Platform Client Side JavaScript API - Index

imuiAjaxSend

Ajaxリクエストを送信することができます。CSJS上でサーバ処理呼びたい時に。

コールバック関数を指定することも可能です。imuiTransitionToErrorPageを使うとエラー時の画面遷移もできます。

→APIページ

imuiValidate

入力チェックを実装できます。入力要素の下にエラーメッセージを表示してくれます。必須、型、範囲などの基本的なチェックであればこれで実行できます。

→APIページ

imuiConfirm

はい、いいえを確認するダイアログを表示します。標準のConfirmでも良いのですが、intra-mart風のUIに統一できます。

→APIページ

imuiShowSuccessMessage

画面の上部にふわーっと浮き出るメッセージを表示します。

Success:成功(緑)、Warning:警告(黄色)、Error:エラー(赤)の3種あり。

→APIページ

CSS

見出し

intra-mart風の見た目に統一する場合、タイトルバー関連はよく使います。

https://www.intra-mart.jp/apidoc/iap/imui-css-doc/html/heading.html

テーブル

こちらもintra-mart風のテーブルレイアウトにする場合は利用します。

https://www.intra-mart.jp/apidoc/iap/imui-css-doc/html/table.html

フォーム

フォームの入力項目をintra-mart風のUIに統一する場合。必須チェックなども付けられます。

https://www.intra-mart.jp/apidoc/iap/imui-css-doc/html/form.html

ボタン

intra-mart風のボタンUIにする場合。

https://www.intra-mart.jp/apidoc/iap/imui-css-doc/html/button.html

html/jspタグ

スクリプト開発 intra-mart Accel Platform Tag Documentation

JavaEE開発 https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/index.html

hidden

リクエスト用の隠し項目。

通常のhiddenタグを使っても良いのですが、1タグで複数個の同時指定ができることが特徴です。

スクリプト開発モデルのみ。JavaEEフレームワークに合わせたものを使いましょう。

→APIページ

picture

ストレージ上にある画像を表示する時に使います。画像をWebサーバに配置したくない場合に。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/imart_tag_api/picture/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/pc/imuiPicture/index.html

string

指定した変数を文字列として出力します。データをラベルとして表示する場合などに。

スクリプト開発モデルのみ。JavaEEフレームワークに合わせたものを使いましょう。

→APIページ

condition

条件を満たす場合にタグ内の処理が実行されます。true or falseの指定。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/imart_tag_api/condition/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/standard/condition/index.html

desicion

条件を満たす場合にタグ内の処理が実行されます。任意の値と等しいかどうかの判定。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/imart_tag_api/decision/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/standard/decision/index.html

repeat

タグ内の処理を繰り返します。SELECTした結果を一覧出力する場合などに利用。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/imart_tag_api/repeat/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/standard/repeat/index.html

imACMSearch

ユーザや組織など、IM共通マスタ系の検索画面を表示できます。

これはポップアップ版で、他に画面内ダイアログ版(imACMSearchDialog)があります。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/imart_tag_im_master_api/imACMSearch/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/im_master/imACMSearch/index.html

imuiButton

IM標準の見た目をしたボタンです。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/pc/imuiButton/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/pc/imuiButton/index.html

imuiCalendar

日付入力アイテムに、カレンダーから入力させるためのアイテムです。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/pc/imuiCalendar/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/pc/imuiCalendar/index.html

imuiDialog

画面内のモーダルダイアログを生成できます。確認メッセージや、何かの情報の詳細表示など。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/pc/imuiDialog/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/pc/imuiDialog/index.html

imuiListTable

IM標準のテーブルです。ソート機能やページング機能などが標準でついています。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-jssp-tagdoc/doc/pc/imuiListTable/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/apilist-jsp-tagdoc/doc/pc/imuiListTable/index.html

サーバサイドAPI

isNull

値がNullかどうかを判定できます。スクリプト開発のみ。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/GlobalFunction/index.html#method-isNull_13

isUndefined

値がundefinedかどうかを判定できます。スクリプト開発のみ。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/GlobalFunction/index.html#method-isUndefined_18

Client

セッションに値を格納したい時に使います。スクリプト開発用。JavaEEでは標準のセッションオブジェクトを使いましょう。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/Client/index.html

Contexts

実行ユーザのIDを取得したい、ロールを取得したいなど、主にアカウントコンテキストを取得するために使います。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/Contexts/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/foundation/context/Contexts.html

JavaEEでアカウントコンテキストを取得する例

AccountContext accountContext = Contexts.get(AccountContext.class);

Debug

スクリプト開発のみ。開発時に非常にお世話になるであろうAPIです。Debug.browseを使うと引数に入れた変数の中身を画面表示します。

バッチ処理など画面がない場合は、Debug.consoleを使いましょう。

https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/Debug/index.html

Identifier

ユニークなIDを生成したい場合に使います。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/Identifier/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/foundation/service/client/information/Identifier.html

Logger

標準ログに出力したいときに使います。warn,errorなどのログレベルを設定できます。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/Logger/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/common/platform/log/Logger.html

TenantDatabase

テナントデータベースに接続するときに使います。データベース操作は基本コレ。

シェアードデータベースはテナントをまたがって共通で使えるもので、使うかは用途によります。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/TenantDatabase/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/foundation/database/TenantDatabase.html

PublicStorage

ストレージのファイルに読み書きをするときに使います。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/PublicStorage/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/foundation/service/client/file/PublicStorage.html

SessionScopeStorage

セッションスコープの一時的なストレージで、セッションと共に消えます。ファイル操作中の一時的な格納などに。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/SessionScopeStorage/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/foundation/service/client/file/SessionScopeStorage.html

Module.download

ファイルダウンロードを行うためのAPIです。この処理を走らせると、そこで処理が終了します。

https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/platform/Module.download/index.html

JavaEEの場合は、IMResponseUtilが利用できます。

https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/framework/extension/seasar/struts/util/IMResponseUtil.html

AccountInfoManager

アカウント情報を操作するAPI。ロールやパスワードの取得・設定、アカウントの登録・削除など。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/tenant/AccountInfoManager/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/foundation/admin/account/AccountInfoManager.html

IMMUserManager

IM-共通マスタのユーザ(ユーザ名など)を操作するためのAPI。この他に組織、パブリックグループなどがあります。

スクリプト開発 https://www.intra-mart.jp/apidoc/iap/apilist-ssjs/doc/im_master/IMMUserManager/index.html

JavaEE https://www.intra-mart.jp/apidoc/iap/javadoc/all-dev_apidocs/jp/co/intra_mart/foundation/master/user/UserManager.html

まとめ

以上、intra-mart開発において有用なAPIのまとめでした。

数ある中の一部のみを抜粋していますので、「こんな処理したいな」というのがあったらまずはAPI見たり、検索してみることをお勧めします。

よりよいintra-mart開発ライフが送れますように。