Page 1 of 1

Custom data domain for Aimeos 20216

Posted: 24 Nov 2016, 22:06
by chadd25
I was wondering if its possible create my own data domain. As a result I would be able to create my custom associate item for that domain and have access to in the expert mode of my admin.

-Thanks

Re: Custom data domain

Posted: 25 Nov 2016, 09:45
by aimeos
Sure! The first step is to create the new data domain itself.

After you've created your own Aimeos extension (https://aimeos.org/developer/extensions/), you should set up the tables you need. Each table needs some default columns:
- id
- siteid
- ctime
- mtime
- editor

The tables can be automatically created during the setup phase if you create a setup task:
https://aimeos.org/docs/Developers/Library/Setup_tasks

The easiest way is to let Doctrine DBAL do the work. Then, it will also work with other database servers. Take the setup task in the ai-laravel extension as reference:
- https://github.com/aimeos/ai-laravel/bl ... aravel.php
- https://github.com/aimeos/ai-laravel/bl ... stomer.php

If you implemented that part and the tables are created when running aimeos:setup, we can continue to with the necessary item and manager.

Re: Custom data domain

Posted: 28 Nov 2016, 21:23
by chadd25
The other question I have, is how you I add my own custom tab in the panel of expert data domain. This tab will linked to information that I have within the database.

Re: Custom data domain

Posted: 28 Nov 2016, 22:25
by aimeos
You need to create the item/manager/controller first before you can add a tab for the new data domain.

Re: Custom data domain

Posted: 29 Nov 2016, 00:00
by chadd25
Is this the right directory for the controller ; ext\ai-admin-extadm\controller\extjs\src\Controller ?

Re: Custom data domain

Posted: 29 Nov 2016, 09:32
by aimeos
Yes, there are the ExtJS controllers of the core. The same structure exists in your own extension for the project and there you can store your own controllers.

Re: Custom data domain

Posted: 29 Nov 2016, 16:53
by chadd25
I have made the item + Manager classes and made the extjs controller. What is the next step?

Re: Custom data domain

Posted: 29 Nov 2016, 18:49
by aimeos
You need the code for the list and item UI as well as the item picker. Have a look at the tags implementation:
https://github.com/aimeos/ai-admin-exta ... /panel/tag

Afterwards, you also need the item pickers for the domains you want your items to associate to, e.g. for the product domain:
https://github.com/aimeos/ai-admin-exta ... ickerUi.js

Re: Custom data domain

Posted: 29 Nov 2016, 23:06
by chadd25
I also did that. But the tab still hasn't appeared.

Re: Custom data domain

Posted: 30 Nov 2016, 09:41
by aimeos
The last step is to add your new files to the manifest.jsb2 of your own extension like in the core:
https://github.com/aimeos/ai-admin-exta ... ifest.jsb2