As things are currently written, only locally-cached remote entities are exposed to Views.
It is possible, however, for users to create views, and have this be converted into a remote query. When executed, the results can be passed back to Views for display.
I've already got this working for a client.
What's needed is the following:
- EntityFieldQuery Views Backend to get around Views' dependency on SQL.
- Remote entity support in EntityFieldQuery Views Backend.
- Documentation here on how to set this up, most notably through implementing a buildFromEFQ() method in your RemoteEntityQuery subclass implementation.
As I posted a patch for item #2 over at #2283083: Add support for remote entities, all we basically have to do here is state that you need EFQ Views, the patch, and an implementation of that method.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | views_remote_querying-2283135-6.patch | 3.1 KB | colan |
| #2 | views_remote_querying-2283135-1.patch | 2.99 KB | colan |
Comments
Comment #1
colanAdded related item in the EFQ Views queue.
Comment #2
colanSee attached patch.
Comment #3
joachim commentedThat looks very nifty!
Though doesn't it need your local entity to have schema fields that match the remote properties you want to query on -- because otherwise, the EFQ will complain when you try to set a propertyCondition() on a property name it doesn't know about?
Comment #4
colanThat's exactly what I'm doing. The local and remote fields/properties are the same. I've got a parseResponse() method in my select query class that returns data in the same form as would be stored locally.
We could, however, add additional remote-entity support to EFQ Views by having it accept remote properties (those defined in the remote entity) as well.
Maybe we should state this limitation in the docs? We can then open an issue for this in the other module.
I just became a maintainer over there so that should make things easier!
Comment #5
joachim commentedI've not used EFQ Views, so I don't know what's possible. Maybe add a mention of that limitation to your patch for the time being, and we can always remove it later on.
Congrats on maintainership :)
Comment #6
colanOkay, adding a note about the limitation.
Comment #7
iamEAP commentedI was able to get everything working quite simply using the documentation provided in #6. RTBC
Comment #8
joachim commentedThanks for the review!
Committed.
git commit -m "Issue #2283135 by colan: Added details to README explaining how to integrate remote querying through Views." --author="colan "