From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95397 Path: news.gmane.org!not-for-mail From: Pavneet Arora Newsgroups: gmane.comp.tex.context Subject: Re: Invoking ConTeXt from inside php web appliction Date: Mon, 11 Jul 2016 12:14:48 -0400 Message-ID: <20160711121449.B16DE86C0E5@charkha.pavastupa.com> References: <20160709230210.E52DA86C0F0@charkha.pavastupa.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1104662452851431719==" X-Trace: ger.gmane.org 1468239353 20692 80.91.229.3 (11 Jul 2016 12:15:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2016 12:15:53 +0000 (UTC) To: luigi scarso , ConTeXt Mailing list Original-X-From: ntg-context-bounces@ntg.nl Mon Jul 11 14:15:41 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bMa7g-0008Fr-RS for gctc-ntg-context-518@m.gmane.org; Mon, 11 Jul 2016 14:15:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 912E3115BF; Mon, 11 Jul 2016 14:15:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id znNCj5sZ7rDO; Mon, 11 Jul 2016 14:15:03 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id CAE9D115C0; Mon, 11 Jul 2016 14:15:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AA745115BA for ; Mon, 11 Jul 2016 14:15:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rjyYuEp1DSoY for ; Mon, 11 Jul 2016 14:15:01 +0200 (CEST) Original-Received: from charkha.pavastupa.com (unknown [173.230.253.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 982A8115B7 for ; Mon, 11 Jul 2016 14:14:51 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by charkha.pavastupa.com (Postfix) with ESMTP id B16DE86C0E5; Mon, 11 Jul 2016 08:14:49 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at charkha.pavastupa.com Original-Received: from charkha.pavastupa.com ([127.0.0.1]) by localhost (charkha.pavastupa.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xzcDrACbTxfw; Mon, 11 Jul 2016 08:14:48 -0400 (EDT) Original-Received: from [IPv6:::ffff:192.168.11.117] (bas5-toronto47-1176439065.dsl.bell.ca [70.31.9.25]) (Authenticated sender: pavneet_arora@waroc.com) by charkha.pavastupa.com (Postfix) with ESMTPSA id BF7C286C0A8; Mon, 11 Jul 2016 08:14:47 -0400 (EDT) Importance: normal X-Priority: 3 In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:95397 Archived-At: --===============1104662452851431719== Content-Type: multipart/alternative; boundary="_3EC389A4-F562-4B5D-B7EB-6EE257DC3B32_" --_3EC389A4-F562-4B5D-B7EB-6EE257DC3B32_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In principle this is workable up to the point that the output PDF needs to = be handed off to the user. In my case, it is the (authenticated) parent wh= o is requesting their child=E2=80=99s report card in one of two forms each = of which is created dynamically at any point along the school =E2=80=9Cterm= =E2=80=9D. The user is waiting for the output PDF from the browser. In La= ravel this is accomplished by using: return response()->download($full_output_filename)->deleteFileAfterSend(tru= e); whereupon the end user sees the familiar Open, Save, =E2=80=A6 dialogue. But the dispatcher pattern is very useful, and I like it very much. In ano= ther area, I use it to monitor a directory for forms input, which are done = off-line on W10 tablets using a browser and the Mongoose lightweight httpd,= and then uploaded using sftp (under Cygwin).=20 Thanks, again, for the suggestions. Pavneet Arora m: +1 (647) 406-6843 e: pavneet_arora@waroc.com From: luigi scarso= --_3EC389A4-F562-4B5D-B7EB-6EE257DC3B32_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

In principle this is workable up to = the point that the output PDF needs to be handed off to the user.=C2=A0 In = my case, it is the (authenticated) parent who is requesting their child=E2= =80=99s report card in one of two forms each of which is created dynamicall= y at any point along the school =E2=80=9Cterm=E2=80=9D.=C2=A0 The user is w= aiting for the output PDF from the browser.=C2=A0 In Laravel this is accomp= lished by using:

 

return response()->download($full_output_filename)->de=
leteFileAfterSend(true);

 

whereupon the end u= ser sees the familiar Open, Save, =E2=80=A6 dialogue.

 

But the dispatcher = pattern is very useful, and I like it very much.=C2=A0 In another area, I u= se it to monitor a directory for forms input, which are done off-line on W1= 0 tablets using a browser and the Mongoose lightweight httpd, and then uplo= aded using sftp (under Cygwin).

&n= bsp;

Thanks, again, for the suggestions.=

 

Pa= vneet Arora
m: +1 (647) 406-6843
e: pavneet_arora@waroc.com

luigi scarso
Sent: Monday,= July 11, 2016 04:38
To: Pavneet Arora
Subject: Re: [NTG-context] Invoking ConTeXt = from inside php web appliction

 

 

You can also decuple in this way : 

1) the httpd server put the request on a= , input  folder shared with a dispatcher process

=

2) the dispatcher continuously  watch the fo= lder,  take the request *when it' completed* (this is a critical point= )

and spawn the  the ri= ght context process

3) when = the context process ends, the pdf is sent again into an out  shared fo= lder, where the dispatcher checks it (again the same critical point) and th= e tells to the httpd to

put = the pdf in the right place.

=  

Problems

1)=      = you need at least two server --- the httpd and th= e dispatcher

=E2=80=A6

 

= --_3EC389A4-F562-4B5D-B7EB-6EE257DC3B32_-- --===============1104662452851431719== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1104662452851431719==--