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:

  1. EntityFieldQuery Views Backend to get around Views' dependency on SQL.
  2. Remote entity support in EntityFieldQuery Views Backend.
  3. 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.

Comments

colan’s picture

Added related item in the EFQ Views queue.

colan’s picture

Status: Active » Needs review
StatusFileSize
new2.99 KB

See attached patch.

joachim’s picture

That 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?

colan’s picture

Issue summary: View changes

That'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!

joachim’s picture

Status: Needs review » Needs work

I'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 :)

colan’s picture

Status: Needs work » Needs review
StatusFileSize
new3.1 KB

Okay, adding a note about the limitation.

iamEAP’s picture

Status: Needs review » Reviewed & tested by the community

I was able to get everything working quite simply using the documentation provided in #6. RTBC

joachim’s picture

Status: Reviewed & tested by the community » Fixed

Thanks 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 "

  • joachim committed 77c872d on 7.x-1.x authored by colan
    Issue #2283135 by colan: Added details to README explaining how to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.