VDE should provide a way to get last succesfuly exported file.

Use scenario:
We have an online store with more than 6700 product and we need to export to diffrent price compare-tors. The problem is that those price compare-tors are expecting a *.csv file at an specific location but if we are using batch we cannot provide this link.

So, to fix this, we could use cron to export the view once a day and we could provide to price compare-tors a path like:
http://www.example.com/our_export_view_path.csv?eid=last

In this scenario, we could also provide the same feed to more than one site compare-tors without the need of reexport the same file more than once a day.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SilviuChingaru’s picture

Status: Active » Needs review
FileSize
857 bytes
pmusaraj’s picture

Hi fiftyz,
Thanks for this patch! I just used it, and it works well. I hope it gets included in the next release.

One quick question: how did you get cron to export the view once a day? I need to do the same thing, and am wondering how to get my view to be run at cron.

SilviuChingaru’s picture

@pmusaraj I'm afraid that is not possible right now but is next feature of views_data_export that I'm working on. I'll open a new issue for that and update my comment here with link to it. Testing will be definitely needed.

As workaround, until this feature will be ready, you can manually visit the view page to allow the batch to generate a fresh file and use the link with "...&eid=last".

SilviuChingaru’s picture

Status: Needs review » Reviewed & tested by the community

And, according to pmusaraj, the correct status for this issue I think should be R&TBC.

SilviuChingaru’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
1.88 KB

Using patch from #1, we only get the last export from any export view not from current view. So, if for example we have a view A that has an eid of XXX and we run another batch export view B that generate an YYY eid and we request the eid=last on view A will actualy get eid YYY instead of XXX eid.

Fixed this in this patch.

@TODO: We should also provide a test for this scenario.

This patch is included in #2221183: Batch export minimum lifetime.

SilviuChingaru’s picture

Status: Needs work » Needs review
SilviuChingaru’s picture