How to create Custom Interface with standard directus interfaces? - directus

How to create a custom interface by using standard directus interfaces as a starter?
an answer in discord uses directus tarball in dependencies and a custom vue.config.js , but the rest of the import statements are still wrong.
Here is my custom interface source code:
Even If all import statements of custom interface's vue file are correct , directus-extension build can't build interface because of other import statements.
Is there a better way to use standard directus interfaces (file-image or input-rich-text) in custom interfaces?

There has not been enough information to provided to help with debugging your issues with the file interface.
Documentation for building interfaces can be found in the Directus Docs. https://docs.directus.io/concepts/interfaces/#interfaces
I have created an interface for Directus that uses the image interface. Perhaps providing the link will be a useful resource to you showing you how I have personally implemented it. https://github.com/resauce-dev/directus-image-scout

Related

Directus custom interface

Can someone explain normally, how i can create directus interface extension? I readed docs, but i didn't understand anything from there. It just says that we can use vue js, but not a word about the implementation itself. I've been sitting for 4 hours and I can't find a normal source. The question is: Сan someone suggest what ш need to learn or read in order to be able to write interface extensions?
Tried:
https://docs.directus.io/extensions/interfaces.html
Dimitrov Adrian github repos..
I would suggest reading all of the extensions documentation from the start.
The page I've linked explains how to begin creating an extension, the page you have linked is a specific type of extension.
https://docs.directus.io/extensions/creating-extensions.html

Spring Data Rest and custom repositories

Is it possible to export REST resources with custom (spring data) repositories?
How does it work?
I cannot find any example. I also have not found any claim that it is impossible.
Spring data rest specifically detects and does not export custom implementations on repositories. See the reference to the codebase here and the reason why here.
If you want to expose a custom repository implementation, you will need to use a custom controller. Documentation for how to appropriately use custom controllers is slated for Spring Data Rest 2.4 .
We used these two methods and both work fine so far:
Implement custom controllers to utilize your custom service layer
Implement a custom repository factory (e.g. extending from RepositoryFactoryBeanSupport), build your own PersistentEntityInformation and take care of CRUD ops manually for your custom data storage type.
UPDATE: Look into this chapter of the documentation: Adding custom behavior to all repositories. The idea is to replace the default storage-specific implementation with your own using #EnableJpaRepositories(repositoryBaseClass = MyRepositoryImpl.class).
If you want to build a custom storage SPI that's a different story. You can use a spring-data-keyvalue and implement your own KeyValueOperations bean that you specify for #EnableMapRepositories. Look into spring-data-redis source as an example of that implementation. That's the easiest solution.
Building a complete SPI for own repositories from scratch needs more code. We followed sources from spring-data-elasticsearch. You might need to implement:
Metadata: CustomEntityInformation, CustomEntityMappingContext, CustomPersistentEntity, CustomPersistentProperty.
Integration: #EnableCustomRepositories, CustomRepositoriesRegistrar, CustomRepositoryConfigurationExtension, CustomRepositoryFactory, CustomRepositoryFactoryBean.
Implementation: CustomRepository (Base interface), CustomRepositoryImpl (Default implementation).
And still needs some extra code for spring-data-rest support, for example, search resources are not exposed automatically, so we build search resources manually. Then you might want to add queries support on top, etc.
Summarizing, the answer is yes, possible by implementing own storage SPI, but not easy. Should first look for other solutions including:
projections
resource processors
custom controllers
other spring data rest customization possibilities

Can I use Ninject Modules in any way in constraining the resolution of a request

In our web project we are using Ninject. Now we are adding plugins to our application. We want plugins to be able to add their own bindings. Ninject modules seems like a logical solution to this problem.
However, I don't see any guidance on how to avoid the following problem. What if a plugin adds a binding to an interface that already had a binding. Now the DependencyResolver will throw an exception when trying to resolve that interface.
I'm trying to make a change to our DependencyResolver that doesn't require rewriting all of the binding statements we've already written in the main application. I don't want a plugin to be able to break my main application. If a plugin needs to apply constraints to make it's bindings work then it is its responsibility.
So here's what I want.
A plugin would not be able to break the core app or another plugin because it added a binding.
It should not be necessary for any change to be made to core application or another plugin when I want to add a new plugin with its own bindings
Where there are multiple instances to choose from it should do the "logical" thing. The core app should get the instance it always would have gotten in the absence of the new plugins. The plugin should get the instance it specifically bound.
It seems like I should be able to override the resolving methods of StandardKernel so that it can implement these rules. It seems like knowing what module a binding was a part of would help resolving. But I can't find module or module name as part of the context, request, bindinginfo, etc.
Any thoughts on how to resolve this issue. I don't see that Ninject seems to answer what seems like a very obvious need for a modular system. A new module shouldn't be able to break an app. (It should only be able to "break" itself.)
You should have a look at Ninject.Extensions.ChildKernel. You could create a ChildKernel per plug-in and then load the plugins' module in their own ChildKernel.
This means that a plugin cannot rely on the bindings of another plugin, but a plugin may rely on the bindings of the Parent Kernel (root / application kernel). So you can provide certain types/services to the plugins.
By the way, if the implementation of Ninject.Extensions.ChildKernel does not match your needs, you might very well choose to implement your own extension. It's not that much code (see ChildKernel source)

OpenERP XML-RPC interface and object definition / interface

Does someone know where can I find the definition of the XML-RPC interfaces (in OpenERP 7)? I want to know which parameters and object attributes I need to create or get objects. Examples of the XML for every element would also be very helpful.
You can always inspect objects interactively with ERPpeek.
With this tool you can use Python REPL on any object and see its fields
XMLRPC or NETSVC services are provided by OpenERP for such needs. Go through the OpenERP XML-RPC Web services document, which explains the protocol implementation.
More discussion is here: How to write a Python script that uses the OpenERP ORM to directly upload to Postgres Database

cocoa-touch dependency injection and loading code dynamically

I'm looking into porting an existing enterprise app to iPad. One of the key requirements is that there is a basic functioning app that needs to be highly customizable/extensible. Also, the people working on the customizations and extensions are not part of the product team and do not have access to the base product's code (only interfaces, docs and the binaries). To achieve this, the current application uses a component based architecture where well defined components are used to compose the UI. For a given customer any of these components can be either extended and used instead of the out of the box ones or simply swapped with a new component that adheres to the interface.
Are there libraries in cocoa-touch that support a component model architecture ? (composing the app through a registry/configuration that can easily edited by others than the team developers)
Sebi
Perhaps you can create a root view controller and inject polymorphic children with: https://github.com/jasperblues/Typhoon