Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

目次

...

Table of Contents
minLevel1
maxLevel4

...

{
"preferenceVersion" :{"major":"1", "minor":"1"},

"preference": [ {"prefName" :"Pref0",
"prefType" :"Boolean",
"appApiAccess" :"ReadWrite",
"webApiAccess" :"ReadWrite",
"defaultValue" :"TRUE" },


{"prefName" :"Pref1",
"prefType" :"Integer",
"appApiAccess" :"Read",
"webApiAccess" :"None",
"defaultValue" :"0"} ,


{"prefName" :"Pref2",
"prefType" :"String",
"defaultValue" :"This is a ¥"String¥"."} ,


{"prefName" :"Pref3",
"prefType" :"Enumeration",
"enumerationList" : ["Item0", "Item1", "Item2"],
"defaultValue" :"Item0"} ,


{"prefName" :"Pref4",
"prefType" :"Binary",
"defaultValue" :" YWJjZGVmZWZn"}
]
}

...

アップデート完了後、preferenceVersionは、アップデートパッケージのものに設定される

設定値Restore時の対応

...

インストール済みアプリ(A)のpreferenceVersionと、リストアファイル(B)のpreferenceVersionを比較し、次の動作を行う

1.Majorバージョンが違う場合
エラー

2.Minorバージョンが違う場合
(A)と(B)の両方に存在するパラメータ : (B)の値を設定
・ただし、 valueのみが変更され、その他の属性値は変更されない
(defaultValueや、appApiAccessなどは変更されない)
・同じパラメータ名で型が違う場合は、何もしない
・EnumerationListの要素に、(B)の値が無ければ、何もしない
(A)のみに存在するパラメータ : 何もしない
(B)のみに存在するパラメータ : 何もしない

3.MajorバージョンもMinorバージョンも同じ場合
(A)と(B)のvalue以外の属性値(defaultValue, webApiAccess, appApiAccess, EnumerationList)が一つでも異なっていればエラー
(A)と(B)の全ての属性値が同じ場合 (B)のvalueを設定

リストア完了後、preferenceVersionは変更されない

API仕様

...

WebAPI仕様については、AdamWebAPI仕様書(AdamWebAPI_Specification_Vx_xx.pdf)を参照してください。

アプリ向け仕様については、AdamAppAPI仕様書(AdamAppAPI_Specification_Vx_xx.pdf)を参照してください。

アプリ向けAPI仕様一覧

...

パラメータ取得API

E_ADAM_ERR ADAM_AppPref_GetBoolean(const char* pPrefName, bool* pValue);
E_ADAM_ERR ADAM_AppPref_GetInteger(const char* pPrefName, int64_t* pValue);
E_ADAM_ERR ADAM_AppPref_GetString(const char* pPrefName, char* pValue, unsigned int size);
E_ADAM_ERR ADAM_AppPref_GetEnumeration(const char* pPrefName, unsigned int* pValue);
E_ADAM_ERR ADAM_AppPref_GetBinary(const char* pPrefName, unsigned char* pValue,
unsigned int size);

パラメータ設定API

E_ADAM_ERR ADAM_AppPref_Lock();
E_ADAM_ERR ADAM_AppPref_Unlock();

E_ADAM_ERR ADAM_AppPref_BeginTransaction();
E_ADAM_ERR ADAM_AppPref_CancelTransaction();
E_ADAM_ERR ADAM_AppPref_SaveTransaction();

E_ADAM_ERR ADAM_AppPref_SetBoolean(const char* pPrefName, bool value);
E_ADAM_ERR ADAM_AppPref_SetInteger(const char* pPrefName, int64_t value);
E_ADAM_ERR ADAM_AppPref_SetString(const char* pPrefName, const char* pValue);
E_ADAM_ERR ADAM_AppPref_SetEnumeration(const char* pPrefName, unsigned int value);
E_ADAM_ERR ADAM_AppPref _SetBinary(const char* pPrefName, unsigned char* pValue,
unsigned int size)
E_ADAM_ERR ADAM_AppPref_Reset();

パラメータ更新通知用API

typedef void (T_ADAM_NOTIFY_APP_PREF_UPDATE_HANDLER)(char const pPrefName[], const
unsigned int prefSize);
typedef struct ST_ADAM_SYSTEM_HANDLERS {
T_ADAM_STOP_HANDLER m_stopHandler;
T_ADAM_NOTIFY_APP_PREF_UPDATE_HANDLER m_notifyAppPrefUpdateHandler;
T_ADAM_SERVER_REQUEST_RECEIVE_HANDLER m_serverRequestReceiveHandler;
} ST_ADAM_SYSTEM_HANDLERS;

パラメータファイルフォーマット

...

アプリパラメータ定義ファイル(PrefDefFile:appPrefs.json)

{
"preferenceVersion": {"major":"1", "minor":"1"},
"preference":[{"prefName" :"Pref0",
"prefType" :"Boolean",
"appApiAccess" :"ReadWrite",
"webApiAccess" :"ReadWrite",
"defaultValue" :"TRUE" },

{"prefName" :"Pref1",
"prefType" :"Integer",
"appApiAccess" :"Read",
"webApiAccess" :"None",
"defaultValue" :"0"} ,

{"prefName" :"Pref2",
"prefType" :"String",
"appApiAccess" :"Read",
"webApiAccess" :"Read",
"defaultValue" :"ABC"} ,

{"prefName" :"Pref3",
"prefType" :"Enumeration",
"enumerationList" :
["Item0", "Item1", "Item2"]
"defaultValue" :"Item0"} ,
}

アプリパラメータ内部管理ファイル(PrefValFile:appPrefs.json)

{
"funcId" :"123",
"preferenceVersion": {"major":"1", "minor":"1"},
"preference":[{"prefName" :"Pref0",
"prefType" :"Boolean",
"appApiAccess" :"ReadWrite",
"webApiAccess" :"ReadWrite",
"defaultValue" :"TRUE" ,
"value" :"TRUE"},


{"prefName" :"Pref1",
"prefType" :"Integer",
"appApiAccess" :"Read",
"webApiAccess" :"None",
"defaultValue" :"0" ,
"value" :"0"},


{"prefName" :"Pref2",
"prefType" :"String",
"appApiAccess" :"Read",
"webApiAccess" :"Read",
"defaultValue" :"ABC" ,
"value" :"ABC"},


{"prefName" :"Pref3",
"prefType" :"Enumeration",
"appApiAccess" :"ReadWrite",
"webApiAccess" :"ReadWrite",
"enumerationList" :
["Item0", "Item1", "Item2"]
"defaultValue" :"Item0" ,
"value" :"Item0"},
}