Search code examples
angularjswakanda

ds.addToCatalog() for Angular-Wakanda


Is there anything like ds.addToCatalog() in Angular-Wakanda? Problem is that once the DataStore is loaded (ex. init("Employee")), it is not possible to add new DataClasses if needed.

I'm trying to loady only the DataClasses needed for each Angular-Controller.

The reason different access rights for different Angular-Controllers, meaning that if a user with limited acces rights logs in the .init() method would throw the following error because the user has no access to all DataClasses:

GET http://127.0.0.1:8081/rest/$catalog/$all/ 401 (Unauthorized)

Loading only the DataClasses with access rights works fine:

http://127.0.0.1:8081/rest/$catalog/Page,%20Employee,%20News/

Solution

  • There is actually a bug on Angular-Wakanda connector that is causing this issue. When $wakanda.init() is called the first time (whatever the parameter given to the function), the returned dataStore is cached connector-side, and directly returned to further calls to $wakanda.init().

    Wakanda team is aware of this issue and it will be fixed soon.

    There is no possible workaround at this time, unless calling $wakanda.init() without parameter to retrieve the whole catalog. But it won't properly work according to the access rights you have set on your dataClasses.