Hi @Putzich_Andreas, sorry for the delay in response. Let me try to help you.
In the Sparkle documentation, there is a topic about how to create an Apache module:
In step 4, it provides the code example where it adds the Sparkle module to the dispatcher:
procedure(const C: THttpServerContext)
C.Response.StatusCode := 200;
C.Response.ContentType := 'text/html';
Of course, you will add the desired module to the dispatcher, in this example it's an anonymous module, but it can be a XData module (as you said, an instance of
TXDataServerModule) or any other.
Those are objects of the "module layer" of Sparkle system. In more recent years, we added a "RAD layer", which are non-visual components that you can drop in the form and use them together to build a Sparkle server in an easier way than before.
Thus, there is not only
TXDataServerModule now, but also a
TXDataServer, which under the hood encapsulates the module.
And, as you said, there is a
TSphinxServer and a
TSphinxServerModule. Indeed, the "RAD layer" is easier to use and more straightforward, while the "Module layer" is non-visual, code-only and sometimes more complex to setup, but also more flexible. It's a fallback in case the "RAD layer" is not flexible enough.
Again, indeed, as you noted, the way to build a Sparkle server using an Apache module only uses the "Module layer". Then, in case you have a component of the "RAD layer" and want to use the "Module layer", you can simply use the method
CreateModule from the component. This will create an instance of the "Module layer" with everything correctly setup based on the properties and events configured in the "RAD layer".
In summary, this is what you should do to add the module to dispatcher from an existing
TSphinxServer instance you have previously configured:
I hope this helps.