User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:devel:corebos_sse [2017/07/30 18:01]
joebordes
en:devel:corebos_sse [2021/08/26 18:26] (current)
joebordes
Line 1: Line 1:
 ===== Server Side Events ===== ===== Server Side Events =====
 +
 +[[en:​adminmanual:​businessactions#​business_actionlaunch_script|See how coreBOS does it!]]
  
 Server side events in coreBOS are very easy to implement. Since you have control of many ways to add javascript code to the application and also many ways to add PHP code, you can insert your EventSource javascript code and call a PHP script via ajax in order for it to send the header and subsequent messages. Server side events in coreBOS are very easy to implement. Since you have control of many ways to add javascript code to the application and also many ways to add PHP code, you can insert your EventSource javascript code and call a PHP script via ajax in order for it to send the header and subsequent messages.
Line 5: Line 7:
 You can find an example of this in the [[https://​github.com/​tsolucio/​coreBOSIERelations|Import/​Export Relations Extension]] which uses SSE to launch the import process and inform the user of the progress of the operation. You can find an example of this in the [[https://​github.com/​tsolucio/​coreBOSIERelations|Import/​Export Relations Extension]] which uses SSE to launch the import process and inform the user of the progress of the operation.
  
-In that code you can see that the launchImportProcess() function in coreBOSIERelations.js creates the EventSource object against an AJAX URL to the module, which calls the PHP script cbierelate.php. The messages sent by this script are read by the EventSource object and updated on screen accordingly.+In that codeyou can see that the launchImportProcess() function in coreBOSIERelations.js creates the EventSource object against an AJAX URL to the module, which calls the PHP script cbierelate.php. The messages sent by this script are read by the EventSource object and updated on the screen accordingly.
  
-There is a lot of information and many examples of how SSE works in the internet, but I {{ :​en:​devel:​sse.zip |add here a standalone example}} upon which I constructed the code in coreBOSIERelations+There is a lot of information and many examples of how SSE works on the internet, but I {{ :​en:​devel:​sse.zip |add here a standalone example}} upon which I constructed the code in coreBOSIERelations
  
 **es.html** **es.html**