[jira] [Commented] (COCOON3-75) REST and asynchronous server side operations
[ https://issues.apache.org/jira/browse/COCOON3-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13092823#comment-13092823 ] Hudson commented on COCOON3-75: --- Integrated in Cocoon-trunk #66 (See [https://builds.apache.org/job/Cocoon-trunk/66/]) COCOON3-75 Adding example of the usage of the component thorsten : http://svn.apache.org/viewvc/?view=revrev=1162777 Files : * /cocoon/cocoon3/trunk/cocoon-rest-optional * /cocoon/cocoon3/trunk/cocoon-rest-optional/pom.xml * /cocoon/cocoon3/trunk/cocoon-rest-optional/rcl-config * /cocoon/cocoon3/trunk/cocoon-rest-optional/rcl-config/WEB-INF * /cocoon/cocoon3/trunk/cocoon-rest-optional/rcl-config/WEB-INF/classes * /cocoon/cocoon3/trunk/cocoon-rest-optional/rcl-config/WEB-INF/classes/logback.xml * /cocoon/cocoon3/trunk/cocoon-rest-optional/rcl.properties * /cocoon/cocoon3/trunk/cocoon-rest-optional/src * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org/cocooon * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org/cocooon/rest * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org/cocooon/rest/optional * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org/cocooon/rest/optional/AbstractAsyncronService.java * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org/cocooon/rest/optional/App.java * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org/cocooon/rest/optional/sample * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/java/org/cocooon/rest/optional/sample/ProgressService.java * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_diagonals-thick_20_66_40x40.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_flat_10_00_40x100.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_glass_100_f6f6f6_1x400.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_glass_100_fdf5ce_1x400.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_glass_65_ff_1x400.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_highlight-soft_100_ee_1x100.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-icons_22_256x240.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-icons_228ef1_256x240.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-icons_ef8c08_256x240.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-icons_ffd27a_256x240.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/images/ui-icons_ff_256x240.png * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/css/jquery-ui-1.8.13.custom.css * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/js * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/js/jquery-1.6.2.min.js * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/js/jquery-ui-1.8.13.custom.min.js * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/js/progress.js * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/sitemap.xmap * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/COB-INF/welcome.html * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/META-INF * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/META-INF/cocoon * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/META-INF/cocoon/spring * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/META-INF/cocoon/spring/block-application-context.xml * /cocoon/cocoon3/trunk/cocoon-rest-optional/src/main/resources/META-INF/cocoon/spring/block-servlet-service.xml * /cocoon/cocoon3/trunk/pom.xml REST and asynchronous server side operations Key: COCOON3-75
[jira] [Commented] (COCOON3-75) REST and asynchronous server side operations
[ https://issues.apache.org/jira/browse/COCOON3-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088753#comment-13088753 ] Thorsten Scherler commented on COCOON3-75: -- In the abstract class we provide the infrastructure to In POST: Create a progress object and store it in the session context with a unique id. In GET: retrieve object and get the current progress In our code we do the following as implementation: public class ProcessService extends AbstractAsyncronService { public RestResponse doGet() throws Exception { Object progress = getProgress(); return new TextResponse({\progress\:+progress.toString()+ }, application/json); } public RestResponse doPost() throws Exception { setId(this.getClass().getCanonicalName()+name); // execute business logic in background super.bidExecutor.execute(this); // Answer the client, reporting we have done 2% return new TextResponse({\progress\:2}, application/json); } // long running action that will be done in a seperate thread public void run() { // if we reach here we have done 5% progress this.updateProgress(5); //... do business logic and finish progress with this.updateProgress(100); } Our client is based on jquery ui progress bar. Where we post the form $.post('rest/ProcessService', { name: input }, function(data){ onSuccess(data); }, json); and in the onSuccess we invoke a loop to get the status like window.progressIntervalId = window.setInterval(function(){ //Getting current operation progress $.get('rest/ProcessService', { name: input }, function(data){ //Updating progress $(#progressbar).progressbar('value', data.progress); //If operation is complete if (data.progress == 100) { //Clear timer window.clearInterval(window.progressIntervalId); } }); }, 500); If you see this useful I can add the class and an example to the cocoon-rest module. REST and asynchronous server side operations Key: COCOON3-75 URL: https://issues.apache.org/jira/browse/COCOON3-75 Project: Cocoon 3 Issue Type: New Feature Components: cocoon-rest Reporter: Thorsten Scherler Assignee: Thorsten Scherler Attachments: AbstractAsyncronService.java I am looking into implementing reporting server side operation progress with jQuery UI Progressbar with our REST framework. My basic idea as starting point is to use the GET to ask for the progress of the processing and POST to invoke the work which reports the progress. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira