Score:0

Views Bulk Operations - Custom Action Functionality

cn flag

I am working on functionality that allows a user to view a list of inventory copies, and a custom action to 'bulk print barcodes'.

I am using Views Bulk Operations.

I created the custom action for VBO, and use the executeMultiple() to generate the barcodes into a pdf, but I can't send the PDF to the browser for viewing/download.

I downloaded the 'export to csv' custom action for VBO to take a look at it's implementation, but in looking at the code it does everything in batch, creates a file on the filesystem, then provides a link on the page afterwards to download it. I am trying to bypass the link and go directly to streaming the rendered PDF (generated in memory) to the browser via the method I have provided in the controller.

Is there an additional method or etc that I can use to stream the results of executeMultiple()?

The controller that handles inventory copies already has a generate barcode and print barcode method which returns a header of the contents of the file, but when triggering the method inside of executeMultiple() it just submits the form and provides the actions confirmation and doesn't actually send the headers from the printBarcode() method.

It may also work to redirect to a separate route that handles the generation and printing of the barcode, if there is a way to tell VBO to redirect after processing the items.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.