Reminder: Create & find trunk-related issues here. Legacy Trac tickets are still available. Problems? Workflow feedback? Need a module project? Open a support ticket.

OpenMRS Trunk

upgrade dwr to 2.x

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Non-Essential Non-Essential
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: OpenMRS 1.5.0
  • Component/s: None
  • Keywords:
  • Description:
    Hide

    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.

    Show
    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.
  1. dwr-patch.diff
    (1 kB)
    Burke Mamlin
    2008-11-03 06:50:59 EST
  2. patch.patch
    (74 kB)
    Burke Mamlin
    2008-11-03 06:49:45 EST

Activity

Hide
Robert O'Connor added a comment - 2008-06-29 20:16:58 EDT

er reverse ajax is the proper link

Show
Robert O'Connor added a comment - 2008-06-29 20:16:58 EDT er reverse ajax is the proper link
Hide
Robert O'Connor added a comment - 2008-06-29 20:26:34 EDT

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

Show
Robert O'Connor added a comment - 2008-06-29 20:26:34 EDT see http://getahead.org/dwr/other/upgrading/dwr20 for information on what needs to be done.
Hide
Robert O'Connor added a comment - 2008-06-29 20:33:05 EDT

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.

Show
Robert O'Connor added a comment - 2008-06-29 20:33:05 EDT 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.
Hide
Dave Thomas added a comment - 2008-08-04 21:37:32 EDT

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

DWR 3.0 docs

Show
Dave Thomas added a comment - 2008-08-04 21:37:32 EDT I'd be in favor of 3.x, when fully released, for the following reason: DWR 3.0 docs
Hide
Dave Thomas added a comment - 2008-08-05 09:20:41 EDT

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

Show
Dave Thomas added a comment - 2008-08-05 09:20:41 EDT To whoever ends up doing this, TRAC-955 would be a nice fix to handle as well.
Hide
Robert O'Connor added a comment - 2008-08-05 16:07:28 EDT

Replying to [dthomas|comment:5]:
> I'd be in favor of 3.x, when fully released, for the following reason:
>
> DWR 3.0 docs
+1

Show
Robert O'Connor added a comment - 2008-08-05 16:07:28 EDT Replying to [dthomas|comment:5]: > I'd be in favor of 3.x, when fully released, for the following reason: > > DWR 3.0 docs +1
Hide
Ben Wolfe added a comment - 2008-09-23 13:13:24 EDT

Upul, think you can take this on?

Show
Ben Wolfe added a comment - 2008-09-23 13:13:24 EDT Upul, think you can take this on?
Hide
Nyoman Ribeka added a comment - 2008-10-31 20:35:52 EDT

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

Show
Nyoman Ribeka added a comment - 2008-10-31 20:35:52 EDT are we going to wait for 3.0 or go with 2.0? i'm currently working on it. need the reverse ajax capability
Hide
Ben Wolfe added a comment - 2008-11-01 00:56:06 EDT

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?

Show
Ben Wolfe added a comment - 2008-11-01 00:56:06 EDT 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?
Hide
Nyoman Ribeka added a comment - 2008-11-03 06:43:34 EST

initial patch of the upgrade. comments please.

Show
Nyoman Ribeka added a comment - 2008-11-03 06:43:34 EST initial patch of the upgrade. comments please.
Hide
Nyoman Ribeka added a comment - 2008-11-03 06:49:45 EST

replace the path

Show
Nyoman Ribeka added a comment - 2008-11-03 06:49:45 EST replace the path
Hide
Nyoman Ribeka added a comment - 2008-11-03 06:50:59 EST

Changes to the dwr's util.js file

Show
Nyoman Ribeka added a comment - 2008-11-03 06:50:59 EST Changes to the dwr's util.js file
Hide
Ben Wolfe added a comment - 2008-11-03 14:07:34 EST

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.

Show
Ben Wolfe added a comment - 2008-11-03 14:07:34 EST 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.
Hide
Nyoman Ribeka added a comment - 2008-11-03 15:21:25 EST

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.

Show
Nyoman Ribeka added a comment - 2008-11-03 15:21:25 EST 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.
Hide
Darius Jazayeri added a comment - 2008-11-03 19:40:40 EST

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.

Show
Darius Jazayeri added a comment - 2008-11-03 19:40:40 EST 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.
Hide
Ben Wolfe added a comment - 2008-11-03 20:11:02 EST

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.

Show
Ben Wolfe added a comment - 2008-11-03 20:11:02 EST 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.
Hide
Nyoman Ribeka added a comment - 2008-11-03 22:02:07 EST

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.

Show
Nyoman Ribeka added a comment - 2008-11-03 22:02:07 EST 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.
Hide
Ben Wolfe added a comment - 2008-12-01 17:58:08 EST

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?

Show
Ben Wolfe added a comment - 2008-12-01 17:58:08 EST 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?
Hide
Nyoman Ribeka added a comment - 2008-12-01 18:39:53 EST

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?

Show
Nyoman Ribeka added a comment - 2008-12-01 18:39:53 EST 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?
Hide
Ben Wolfe added a comment - 2008-12-01 20:27:54 EST

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.

Show
Ben Wolfe added a comment - 2008-12-01 20:27:54 EST 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.
Hide
Ben Wolfe added a comment - 2008-12-15 20:47:01 EST

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?

Show
Ben Wolfe added a comment - 2008-12-15 20:47:01 EST 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?
Hide
Ben Wolfe added a comment - 2008-12-22 19:24:18 EST

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.

Show
Ben Wolfe added a comment - 2008-12-22 19:24:18 EST 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.
Hide
Ben Wolfe added a comment - 2008-12-22 21:56:43 EST

Committed to trunk in revision rev:6439. Thanks Win!

Formentry module upgraded to work with trunk in rev:6440.

Show
Ben Wolfe added a comment - 2008-12-22 21:56:43 EST Committed to trunk in revision rev:6439. Thanks Win! Formentry module upgraded to work with trunk in rev:6440.

People

Dates

  • Created:
    2008-06-29 20:15:39 EDT
    Updated:
    2010-07-08 16:21:59 EDT
    Resolved:
    2010-07-01 22:42:03 EDT