diff options
-rw-r--r-- | conf/afm-unit.conf | 10 | ||||
-rw-r--r-- | docs/config.xml.md | 16 | ||||
-rw-r--r-- | src/tests/test-unit/config.xml | 6 | ||||
-rw-r--r-- | src/tests/test-unit/sample.unit | 18 | ||||
-rw-r--r-- | src/wgt-json.c | 12 | ||||
-rw-r--r-- | src/wgt-strings.c | 6 | ||||
-rw-r--r-- | src/wgt-strings.h | 6 |
7 files changed, 37 insertions, 37 deletions
diff --git a/conf/afm-unit.conf b/conf/afm-unit.conf index 290c3e1..301bc9d 100644 --- a/conf/afm-unit.conf +++ b/conf/afm-unit.conf @@ -68,11 +68,11 @@ X-AGL-HTTP-port={{:#metadata.http-port}} ConditionSecurity=smack %nl -# Automatic bound to required bindings -{{#required-binding}} +# Automatic bound to required api +{{#required-api}} BindsTo=afm-api-{{name}} After=afm-api-{{name}} -{{/required-binding}} +{{/required-api}} %nl [Service] @@ -104,7 +104,7 @@ ExecStart=/usr/bin/afb-daemon --port={{:#metadata.http-port}} --random-token \ {{#required-permission.urn:AGL:permission::public:applications:read}}\ --alias=/icons:{{:#metadata.icons-dir}} \ {{/required-permission.urn:AGL:permission::public:applications:read}}\ - {{#required-binding}}\ + {{#required-api}}\ {{#value=auto}}\ --ws-client=unix:%t/apis/ws/{{name}} \ {{/value=auto}}\ @@ -120,7 +120,7 @@ ExecStart=/usr/bin/afb-daemon --port={{:#metadata.http-port}} --random-token \ {{#value=cloud}}\ --cloud-client={{name}} \ {{/value=cloud}}\ - {{/required-binding}}\ + {{/required-api}}\ --exec /usr/bin/web-runtime http://localhost:@p/{{content.src}}?token=@t {{/content.type=text/html}} diff --git a/docs/config.xml.md b/docs/config.xml.md index 7f413d5..7eac552 100644 --- a/docs/config.xml.md +++ b/docs/config.xml.md @@ -101,15 +101,15 @@ features. The features planned to be implemented are described below. -### feature name="urn:AGL:widget:required-binding" +### feature name="urn:AGL:widget:required-api" -List of the bindings required by the widget. +List of the api required by the widget. -Each required binding must be explicited using a <param> entry. +Each required api must be explicited using a <param> entry. Example: ```xml -<feature name="urn:AGL:widget:required-binding"> +<feature name="urn:AGL:widget:required-api"> <param name="urn:AGL:permission:A" value="required" /> <param name="urn:AGL:permission:B" value="optional" /> </feature> @@ -117,7 +117,7 @@ Example: This will be *virtually* translated for mustaches to the JSON ```json -"required-binding": { +"required-api": { "param": [ { "name": "urn:AGL:permission:A", "value": "required", "required": true }, { "name": "urn:AGL:permission:A", "value": "optional", "optional": true } @@ -138,7 +138,7 @@ The value is either: isn't required (required="false") and in that case it is optional. - optional: the binding is optional -#### param name=[required binding name] +#### param name=[required api name] The value is either: @@ -160,9 +160,9 @@ The value is either: isn't required (required="false") and in that case it is optional. - optional: the permission is optional -### feature name="urn:AGL:widget:provided-binding" +### feature name="urn:AGL:widget:provided-api" -Use this feature for each provided binding of the widget. +Use this feature for each provided api of the widget. The parameters are: #### param name="subid" diff --git a/src/tests/test-unit/config.xml b/src/tests/test-unit/config.xml index 24a383d..48a7e3c 100644 --- a/src/tests/test-unit/config.xml +++ b/src/tests/test-unit/config.xml @@ -10,7 +10,7 @@ </description> <author>Qt team</author> <license>GPL</license> - <feature name="urn:AGL:widget:required-binding"> + <feature name="urn:AGL:widget:required-api"> <param name="#target" value="main" /> <param name="gps" value="ws" /> <param name="phone" value="dbus" /> @@ -24,13 +24,13 @@ <param name="urn:AGL:permission::public:applications:read" value="required" /> <param name="urn:AGL:permission::public:display" value="required" /> </feature> - <feature name="urn:AGL:widget:provided-binding"> + <feature name="urn:AGL:widget:provided-api"> <param name="#target" value="geoloc" /> <param name="description" value="binding of name geoloc" /> <param name="content.src" value="libs/binding-geoloc.so" /> <param name="content.type" value="application/vnd.agl.service" /> </feature> - <feature name="urn:AGL:widget:required-binding"> + <feature name="urn:AGL:widget:required-api"> <param name="#target" value="geoloc" /> <param name="identity" value="auto" /> </feature> diff --git a/src/tests/test-unit/sample.unit b/src/tests/test-unit/sample.unit index 2ee2a2a..bc65851 100644 --- a/src/tests/test-unit/sample.unit +++ b/src/tests/test-unit/sample.unit @@ -20,11 +20,11 @@ X-Author-email={{author.email}} ConditionSecurity=smack %nl -# Automatic bound to required bindings -{{#required-binding.list}} -BindsTo=afm-binding-{{name}} -After=afm-binding-{{name}} -{{/required-binding.list}} +# Automatic bound to required api +{{#required-api.list}} +BindsTo=afm-api-{{name}} +After=afm-api-{{name}} +{{/required-api.list}} %nl [Service] @@ -55,9 +55,9 @@ ExecStart=/usr/bin/afb-daemon --port=%P --random-token \ {{#required-permission.dict.urn:AGL:permission::public:applications:read}}\ --alias=/icons:{{widget-icons-dir}} \ \{{/required-permission.dict.urn:AGL:permission::public:applications:read}} - {{#required-binding}}\ + {{#required-api}}\ --ws-client=unix:%t/bindings/{{:#target}} - \{{/required-binding}} + \{{/required-api}} --exec /usr/bin/web-runtime http://localhost:@p/{{content.src}}?token=@t {{/content.type=text/html}} @@ -65,7 +65,7 @@ ExecStart=/usr/bin/afb-daemon --port=%P --random-token \ {{#content.type=application/vnd.agl.service}} %systemd-unit user -%systemd-unit service afm-binding-{{:#target}} +%systemd-unit service afm-api-{{:#target}} ExecStart=/usr/bin/afb-daemon \ --rootdir={{widget-install-dir}} \ @@ -79,7 +79,7 @@ ExecStart=/usr/bin/afb-daemon \ # auto generated by wgtpkg-unit for {{id}} version {{version}} target {{:#target}} # %systemd-unit user -%systemd-unit socket afm-binding-{{:#target}} +%systemd-unit socket afm-api-{{:#target}} [socket] diff --git a/src/wgt-json.c b/src/wgt-json.c index cc5ee93..258f151 100644 --- a/src/wgt-json.c +++ b/src/wgt-json.c @@ -314,11 +314,11 @@ static int add_provided(struct json_object *targets, const struct wgt_desc_featu return add_targeted_params(targets, feat, actions); } -static int add_required_binding(struct json_object *targets, const struct wgt_desc_feature *feat) +static int add_required_api(struct json_object *targets, const struct wgt_desc_feature *feat) { static struct paramaction actions[] = { { .name = string_sharp_target, .action = NULL, .closure = NULL }, - { .name = NULL, .action = add_param_array, .closure = (void*)string_required_binding } + { .name = NULL, .action = add_param_array, .closure = (void*)string_required_api } }; return add_targeted_params(targets, feat, actions); } @@ -370,7 +370,7 @@ static struct json_object *to_json(const struct wgt_desc *desc) rc = -EINVAL; } featname += prefixlen; - if (!strcmp(featname, string_provided_binding) + if (!strcmp(featname, string_provided_api) || !strcmp(featname, string_provided_application)) { rc2 = make_target(targets, feat); if (rc2 < 0 && !rc) @@ -390,13 +390,13 @@ static struct json_object *to_json(const struct wgt_desc *desc) rc = rc2; } else if (!strcmp(featname, string_provided_application) - || !strcmp(featname, string_provided_binding)) { + || !strcmp(featname, string_provided_api)) { rc2 = add_provided(targets, feat); if (rc2 < 0 && !rc) rc = rc2; } - else if (!strcmp(featname, string_required_binding)) { - rc2 = add_required_binding(targets, feat); + else if (!strcmp(featname, string_required_api)) { + rc2 = add_required_api(targets, feat); if (rc2 < 0 && !rc) rc = rc2; } diff --git a/src/wgt-strings.c b/src/wgt-strings.c index a359880..f9fe01e 100644 --- a/src/wgt-strings.c +++ b/src/wgt-strings.c @@ -57,14 +57,14 @@ const char string_list[] = "list"; const char string_main[] = "main"; const char string_optional[] = "optional"; const char string_provided_application[] = "provided-application"; -const char string_provided_binding[] = "provided-binding"; -const char string_required_binding[] = "required-binding"; +const char string_provided_api[] = "provided-api"; +const char string_required_api[] = "required-api"; const char string_required_permission[] = "required-permission"; const char string_targets[] = "targets"; const char string_sharp_target[] = "#target"; -const char feature_required_binding[] = FWK_PREFIX "widget:required-binding"; +const char feature_required_api[] = FWK_PREFIX "widget:required-api"; const char feature_required_permission[] = FWK_PREFIX "widget:required-permission"; diff --git a/src/wgt-strings.h b/src/wgt-strings.h index 7609723..504bd16 100644 --- a/src/wgt-strings.h +++ b/src/wgt-strings.h @@ -55,12 +55,12 @@ extern const char string_list[]; extern const char string_main[]; extern const char string_optional[]; extern const char string_provided_application[]; -extern const char string_provided_binding[]; -extern const char string_required_binding[]; +extern const char string_provided_api[]; +extern const char string_required_api[]; extern const char string_required_permission[]; extern const char string_sharp_target[]; extern const char string_targets[]; -extern const char feature_required_binding[]; +extern const char feature_required_api[]; extern const char feature_required_permission[]; |