grid for PleasanterのGFP定義を作成するツールについて説明します。
概要
- GFP定義作成ツールはExcelでGFP定義情報を作成するツールです。
- GFP定義後、GFP定義作成ボタンクリックでGFP定義情報(JSON)が出力されます。
- また、カスタムサイトで新規レコード作成時に初期表示データを表示させたい場合はGFP定義後、初期データ作成行出力ボタンで初期表示データ作成用の行が作成されます。初期表示データを登録後、GFP定義作成ボタンクリックで初期表示データ付でGFP定義情報(JSON)が出力されます。
- HTML・CSSが理解できる方であれば誰でも作成できます。

GFP定義(JSON)
| キー | 仕様 |
|---|---|
| site | GFP実装サイトに関する定義 |
| table | テーブル操作に関する定義 |
| cell | セル操作に関する定義 |
| actions | アクション操作に関する定義 |
| columns | カラム定義 |
| postback | ポストバック定義 |
| initial_data | 初期表示データ定義 |
{
"site":{},
"table":{},
"cell":{},
"actions":{},
"columns":[],
"postback":[],
"initial_data":[]
}
GFP定義:site
| キー | 値 | 仕様 | 例 |
|---|---|---|---|
| id | 123456 | GFP実装サイトID | “id”:”123456″ |
| name | 見積書 | GFP実装サイト名 | “name”:”見積書” |
| item | DescriptionA | GFP実装項目 ※説明項目を指定 | “item”:”DescriptionA” |
| gfp | 見積明細 | GFP実装項目名 | “gfp”:”見積明細” |
| description | 見積明細をGFPで実装 | 説明等 | “description”:”見積明細をGFPで実装” |
{
"site":{"id":"123456","name":"見積書","item":"DescriptionA","gfp":"見積明細","description":"見積明細をGFPで実装"},
}
GFP定義:table
{
"table":{"scroll_rows":"10","scroll_mode":"scroll"},
}
GFP定義:cell
{
"cell":{"border":"solid;","padding":"0;"},
}
GFP定義:columns
| キー | 値 | 仕様 | 例 |
|---|---|---|---|
| name | item-no | ユニーク制約 | “name”:”item-no” |
| label | 品番 | ヘッダーラベル | “label”:”品番” |
| type | text | HTML要素のinput・textarea・selectとGFP独自要素 ※詳細はコチラを参照 | “type”:”text” |
| required | true | true:必須 | “required”:true |
| readonly | true | true:読取専用 | “readonly”:true |
| value | 100 | 初期値 | “value”:”100″ |
| disabled | true | true:無効化 | “disabled”:true |
| options | [“”,”本”,”冊”,”箱”] | type:select時の選択リスト | “options”: [“”,”本”,”冊”,”箱”] |
| data-format | Y/m/d H:i:s | type:gfp_date、gfp_datetime選択時の日時フォーマット ※後述します | “data-format”:”Y/m/d H:i:s |
| sumtarget | “amount”,”tax” | type:gfp_sum選択時の合計対象列 ※詳細はコチラを参照 | “sumtarget”:[“amount”,”tax”] |
| calculation | quantity * unit-price | type:gfp_calc選択時の計算式 ※詳細はコチラを参照 | “calculation”:”quantity * unit-price |
| total | sum count | 合計行(集計) 合計行(カウント) ※詳細はコチラを参照 | “total”:”sum” |
| Key | item-no | ルックアップキー Key=Match ※詳細はコチラを参照 | lookup”:{“Key”:[“gfp-item-no”]} |
| Result | “item-name”,”unit-price” | ルックアップ検索結果 Result=Target ※詳細はコチラを参照 | lookup”:{“Result”:[“item-name”,””unit-price”]} |
| SiteId | 92054 | ルックアップサイトID ※詳細はコチラを参照 | lookup”:{“SiteId”:”92054″} |
| TableName | Users Groups Depts | ルックアップ標準サイト ※詳細はコチラを参照 | lookup”:{“TableName”:”Users”} |
| Match | “Title” | ルックアップサイトキー Key=Match ※詳細はコチラを参照 | lookup”:{“Match”:[“Title”]} |
| Target | ルックアップサイト検索結果 Result=Target ※詳細はコチラを参照 | lookup”:{“Target”:[“ClassB”,”NumB”]} | |
| attributes | “rows”:”5″,”cols”:”33″ | HTML要素のinput・textarea・selectの属性 ※詳細はコチラを参照 | “rows”:”5″,”cols”:”33″ |
| globalAttributes | “draggable”:true | HTML要素のグローバル属性 ※詳細はコチラを参照 | “draggable”:true |
| headerStyle | text-align: center; | ヘッダーのCSS ※詳細はコチラを参照 | “headerStyle”:”text-align: center;” |
| style | background-color: red; color: white; | セルのCSS ※詳細はコチラを参照 | “style”:”background-color: red; color: white;” |
{
"columns":[
{"name":"item-no","label":"品番","type":"text","lookup":{"Key":["item-no"],"Result":["item-name","unit","unit-price"],"SiteId":"92054","Match":["Title"],"Target":["ClassB","ClassC","NumB"]},"headerStyle":"text-align: center;","style":"text-align: center;"},
{"name":"item-name","label":"品名","type":"text","required":true,"readonly":true,"headerStyle":"text-align: center;","style":"text-align: center;"},
{"name":"quantity","label":"数量","type":"number","required":true,"headerStyle":"text-align: center;","style":"text-align: right;"},
{"name":"unit","label":"単位","type":"select","required":true,"readonly":true,"options":["","本","冊","個","箱"],"headerStyle":"text-align: center;","style":"text-align: right;"},
{"name":"unit-price","label":"単価","type":"number","required":true,"readonly":true,"headerStyle":"text-align: center;","style":"text-align: right;"},
{"name":"gfp-amount","label":"金額","type":"gfp_calc","required":true,"readonly":true,"calculation":"quantity * unit-price","total":"sum","headerStyle":"text-align: center;","style":"text-align: right;"},
{"name":"tax","label":"消費税","type":"gfp_calc","required":true,"readonly":true,"calculation":"amount * 0.1","total":"sum","headerStyle":"text-align: center;","style":"text-align: right;"},
{"name":"sum","label":"合計","type":"gfp_sum","required":true,"readonly":true,"sumtarget":["amount","tax"],"total":"sum","headerStyle":"text-align: center;","style":"text-align: right;"}
}
GFP定義:postback
| キー | 値 | 仕様 | 例 |
|---|---|---|---|
| from | amount | 参照元 | |
| row | 1 total | from項目の行番号 from項目の合計行 | |
| to | ClassA | ポストバック先項目 ※詳細はコチラを参照 |
{
"postback":[
["amount","1","ClassA"],
["amount","total","ClassB"]
],
}
GFP定義:initial_data
| キー | 値 | 仕様 | 例 |
|---|---|---|---|
| columnsのname | データ | 初期表示データ作成 ※詳細はコチラを参照 |
{
"initial_data":[
{
"item-no":"10001",
"item-name":"A4用紙(500枚)",
"quantity":"10",
"unit":"箱",
"unit-price":"100",
},
"item-no":"10002",
"item-name":"A5用紙(500枚)",
"quantity":"20",
"unit":"箱",
"unit-price":"100",
}
}
GFP定義:日付フォーマット
- data-formatで指定できる日時フォーマットです。
| 種別 | フォーマット | 説明 | 例 |
|---|---|---|---|
| 日 | d | 日付の数値(2桁、ゼロ埋め有り) | 01~31 |
| j | 日付の数値(ゼロ埋め無し) | 1~31 | |
| D | 曜日のテキスト値(省略形) | 月~日、Mon~Sun | |
| l(小文字のL) | 曜日のテキスト値(フルスペル) | 月曜~日曜、Monday~Sunday | |
| 月 | m | 月の数値(2桁、ゼロ埋め有り) | 01~12 |
| n | 月の数値(ゼロ埋め無し) | 1~12 | |
| M | 月のテキスト値(省略形) | 1月~12月、Jan~Dec | |
| F | 月のテキスト値(フルスペル) | 1月~12月、January~December | |
| 年 | Y | 年の数値(4桁) | 1970、1999、2007等 |
| y | 年の数値(2桁) | 70、99、07等 | |
| 時刻 | a | 午前または午後(小文字) | am、pm |
| A | 午前または午後(大文字) | AM、PM | |
| g | 時の数値(12時間単位、ゼロ埋め無し) | 1~12 | |
| G | 時の数値(24時間単位、ゼロ埋め無し) | 0~23 | |
| h | 時の数値(12時間単位、2桁、ゼロ埋め有り) | 01~12 | |
| H | 時の数値(24時間単位、2桁、ゼロ埋め有り) | 00~23 | |
| i | 分の数値(2桁、ゼロ埋め有り) | 00~59 | |
| s | 秒の数値(2桁、ゼロ埋め有り) | 00~59 | |
| u | マイクロ秒の数値(6桁) | 654321 |
