Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Ticket #889 (closed enhancement: fixed)

Opened 1 year ago

Last modified 6 months ago

upgrade dwr to 2.x

Reported by: r0bby Assigned to: nribeka
Priority: trivial Milestone: OpenMRS 1.5
Component: OpenMRS Code Base Keywords: dwr
Cc: djazayeri, jmiranda Introductory Ticket: 0
Code Review Status: Approved

Description

DWR 2.x provides reverse ajax, this can be VERY useful in a lot of cases I found this for example.

Doing this would be a huge undertaking, but useful as we'd be able to take advantage of all that DWR has to offer.

Attachments

patch.patch (74.4 kB) - added by nribeka on 11/03/08 06:49:45.
replace the path
dwr-patch.diff (1.1 kB) - added by nribeka on 11/03/08 06:50:59.
Changes to the dwr's util.js file

Change History

06/29/08 20:16:58 changed by r0bby

er reverse ajax is the proper link

06/29/08 20:20:29 changed by r0bby

  • owner deleted.

(in reply to: ↑ description ) 06/29/08 20:26:34 changed by r0bby

see http://getahead.org/dwr/other/upgrading/dwr20 for information on what needs to be done.

(in reply to: ↑ description ) 06/29/08 20:33:05 changed by r0bby

If anybody takes this on -- please check the README in the lib/dwr file of the core openmrs folder of svn to see if the changes there have been applied in DWR 2.x.

(follow-up: ↓ 7 ) 08/04/08 21:37:32 changed by dthomas

I'd be in favor of 3.x, when fully released, for the following reason:

DWR 3.0 docs

08/05/08 09:20:41 changed by dthomas

To whoever ends up doing this, #955 would be a nice fix to handle as well.

(in reply to: ↑ 5 ) 08/05/08 16:07:28 changed by r0bby

Replying to dthomas:

I'd be in favor of 3.x, when fully released, for the following reason: DWR 3.0 docs

+1

08/27/08 22:06:24 changed by djazayeri

  • cc set to djazayeri.

09/23/08 13:13:24 changed by bwolfe

  • owner set to upul.
  • intro_ticket changed.

Upul, think you can take this on?

10/31/08 20:35:52 changed by nribeka

are we going to wait for 3.0 or go with 2.0? i'm currently working on it. need the reverse ajax capability :)

11/01/08 00:56:06 changed by bwolfe

Is there a need to wait for 3.0? What must-have features will it add? Do they have a timeline for it?

Upul, did you get any work done on this? If you're ok with it, can you reassign it to nribeka?

11/03/08 02:43:20 changed by upul

  • owner changed from upul to nribeka.

11/03/08 06:43:34 changed by nribeka

initial patch of the upgrade. comments please.

11/03/08 06:49:45 changed by nribeka

  • attachment patch.patch added.

replace the path

11/03/08 06:50:59 changed by nribeka

  • attachment dwr-patch.diff added.

Changes to the dwr's util.js file

11/03/08 14:07:34 changed by bwolfe

In a dwr call, does the function /have/ to be at the end now? That will break most modules if it does, because I think most calls will have the callback function as the first parameter.

11/03/08 15:21:25 changed by nribeka

I think they removed the support for first parameter since 2.0.

Taken from dwr website:

The callback-as-first-parameter system has been deprecated since version 0.9 in favor of the callback-as-last-parameter system. In version 2.0 we removed support for the first-parameter option because it caused some hard to detect bugs with null parameters. From version 2.0 the callback must be the last parameter, and can not be the first parameter.

11/03/08 19:40:40 changed by djazayeri

When I read the DWR docs, it seemed like callback-as-last-parameter was the way to go, and I don't think I've ever written it as the first one. I hope that's evidence that others will have read the docs that way also.

11/03/08 20:11:02 changed by bwolfe

I was not one of those. Back when I first wrote most of this it was totally optional for either end. I'm guessing there are a good number of modules that copied from trunk this way. We'll need to warn module writers that they'll need to fix their dwr callbacks.

11/03/08 22:02:07 changed by nribeka

Darius + Ben, I think we also need to warn about the other changes as well. Like DWRUtil to dwr.util and DWREngine to dwr.engine.

As for the callback, I saw some of the callback are in the last param and some other are in the first param. We use the callback as first param in the patient matching module which means we need to change it.

12/01/08 17:58:08 changed by bwolfe

Would it be possible to create an alias in openmrs.js that forwards all calls to DWRUtil and DWREngine to dwr.util and dwr.engine ?

Not sure what to do about the callbacks though. Do you have an idea about how many there are?

12/01/08 18:39:53 changed by nribeka

Ben, i'm not sure the alias works. But the DWRUtil and DWREngine is only deprecated and not completely gone yet. Isn't it going to create some conflicting call?

12/01/08 20:27:54 changed by bwolfe

Ok, so we don't need the alias just yet. I'll bet the move to dwr 3.0 will get rid of those deprecated methods and we'll need to fix everything.

Can you do a little research to see if there is a way to get the callbacks to still work just as they are now? I don't really want to break all the modules that are doing it the "wrong" way in a point release.

12/15/08 20:47:01 changed by bwolfe

  • review_status set to Needs Review.
  • milestone set to OpenMRS 1.5.

Marking as "needs review" and putting it in the 1.5 milestone. This will be reviewed in one of our weekly code reviews.

Do you want to be in on that Win?

12/22/08 19:24:18 changed by bwolfe

The code changes look straight forward, thanks for doing all that Win. I'll test it out on my machine and get this into trunk as soon as possible.

I'll send out a notice to module owners on the dev list to let them know of the callback function parameter switch.

12/22/08 21:56:43 changed by bwolfe

  • cc changed from djazayeri to djazayeri, jmiranda.
  • review_status changed from Needs Review to Approved.
  • status changed from new to closed.
  • resolution set to fixed.

Committed to trunk in revision [6439]. Thanks Win!

Formentry module upgraded to work with trunk in [6440].