Adding a Configuration Options without default Options
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Adding a Configuration Options without default Options
Hello all,
Im searching a better way to do this, maybe you guys can help me.
I wrote a new subpart which has it's own data Domain.
Then i wrote the jsonadm files for it and register these files for my new data Domain under Admin Config File from my extension.
This is working fine via config, but i have to rewrite the default domains and resources.
Means if i update the aimeos lib and you change the default domains im running into an error.
The default domains and ressources, i've found under jsonadm/src/Admin/JsonAdm/Base.php getDomains() and getResources(). These are protected functions which i can't override in my jsonadm child class to dinamically add mynewdatadomain.
Therefore i've done it with the config file but im not really happy with it.
Do you know how i can do it better?
PS: i found nothing in the documentations about admin/jsonadm/domains & admin/jsonadm/resources, maybe i dont found it but i believe its not documented.
Many thanks,
tenkraD
Im searching a better way to do this, maybe you guys can help me.
I wrote a new subpart which has it's own data Domain.
Then i wrote the jsonadm files for it and register these files for my new data Domain under Admin Config File from my extension.
Code: Select all
return[
....
'jsonadm' => [
/**
* admin/jsonadm/domains
* A list of domain names whose clients are available for the JSON API
*/
'domains' => [
/* DEFAULT DOMAINS */
'attribute', 'catalog', 'coupon', 'customer', 'locale', 'media', 'order',
'plugin', 'price', 'product', 'service', 'supplier', 'stock', 'tag', 'text',
/* MY NEW DOMAIN */
'mynewdatadomain'
],
/**
* admin/jsonadm/resources
* A list of additional resources name whose clients are available for the JSON API
*/
'resources' => [
/* DEFAULT Additional RESOURCE */
'coupon/config', 'plugin/config', 'service/config',
/* MY NEW Additional RESOURCE */
'mynewdatadomain/config',
],
....
]
Means if i update the aimeos lib and you change the default domains im running into an error.
The default domains and ressources, i've found under jsonadm/src/Admin/JsonAdm/Base.php getDomains() and getResources(). These are protected functions which i can't override in my jsonadm child class to dinamically add mynewdatadomain.
Therefore i've done it with the config file but im not really happy with it.
Do you know how i can do it better?
PS: i found nothing in the documentations about admin/jsonadm/domains & admin/jsonadm/resources, maybe i dont found it but i believe its not documented.
Many thanks,
tenkraD
Re: Adding a Configuration Options without default Options
You can add the required configuration in your own extension (./config/admin.php) by using:
This adds your domain and resource only without overwriting the existing ones.
You are right, there's currently no documentation for that.
Code: Select all
return [
'jsonadm' => [
'domains' => [
'mynewdatadomain' => 'mynewdatadomain'
],
'resources' => [
'mynewdatadomain/config' => 'mynewdatadomain/config'
],
],
];
You are right, there's currently no documentation for that.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Adding a Configuration Options without default Options
nope sorry you are wrong, this doesn't work for ressources and domains.
The additional resources 'coupon/config', 'plugin/config', 'service/config', are not setted if i only add
And the default domains are not setted if i only write
in my config.
The additional resources 'coupon/config', 'plugin/config', 'service/config', are not setted if i only add
Code: Select all
...
'resources' => [
"mynewdatadomain/config"
],
Code: Select all
...
'domains' => [
'mynewdatadomain',
],
Re: Adding a Configuration Options without default Options
It will work now if you use aimeos/ai-admin-jsonadm 2019.10.x-dev
But remember that the keys must be unique (non-integer) to add configuration only!
But remember that the keys must be unique (non-integer) to add configuration only!
Code: Select all
return [
'jsonadm' => [
'domains' => [
'mynewdatadomain' => 'mynewdatadomain'
],
'resources' => [
'mynewdatadomain/config' => 'mynewdatadomain/config'
],
],
];
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Adding a Configuration Options without default Options
Moved domains and resource configuration to config file - thanks for that!
Greets tenkraD
Greets tenkraD
Re: Adding a Configuration Options without default Options
Hello Admin,
I am using an old aimeos distribution so i can't check if these configurations are set correct in 2019.10.x Version.
In https://github.com/aimeos/ai-admin-json ... /admin.php you are setting template files without the extension "php". In my version it was neccesarry to set the file extension for template files.
Code: Select all
return [
'jsonadm' => [
'partials' => [
'catalog' => [
'template-data' => 'partials/catalog/data-standard.php',
],
....
Re: Adding a Configuration Options without default Options
https://github.com/aimeos/ai-client-jso ... d.php#L104
Same behavior for jsonapi.
Would be great if you can add domains and ressources without default one's by config, since the config option "client/jsonapi/resources" exist.
Greets tenkraD
Same behavior for jsonapi.
Would be great if you can add domains and ressources without default one's by config, since the config option "client/jsonapi/resources" exist.
Greets tenkraD
Re: Adding a Configuration Options without default Options
OK, the default config is now in the config file (master and 2019.10.x-dev):
https://github.com/aimeos/ai-client-jso ... 903d46dc2e
https://github.com/aimeos/ai-client-jso ... 903d46dc2e
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Adding a Configuration Options without default Options
As usually, thanks for your fast support and your great work.
Hail to opensource!
Thanks tenkraD
Hail to opensource!
Thanks tenkraD