Ticket #980 (closed Enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

dm4-contacts: suppress automatic geocoding when updating address topics from within a migration

Reported by: Malte Owned by: jri
Priority: Critical Milestone: Release 4.8.3
Component: DeepaMehta Standard Distribution Version: 4.8
Keywords: Cc: jri
Complexity: 2 Area: Application Framework / API
Module: deepamehta-geomaps

Description

From within a migration, it might be necessary to perform manual updates on existing "Address" topics, when updating an address topic the caller (up to my knowledge) can not easily append/create/inject a Cookie (e.g. "dm4_no_geocoding") into its update call.

Thus, when running such a migration i loose all my existing coordinate values in the to new ones from Google.

Change History

comment:1 Changed 5 years ago by Malte

  • Priority changed from Major to Critical
  • Cc jri added

So, as it looks to me, "enhancing" the API this way is important for me updating and installing the kiezatlas2 to 4.8 in the couple of weeks. I know of a "workaround" (since this currently only affects a migration for which i could comment the geo-coder) but what is your take on this, is this easy to do?

comment:2 Changed 5 years ago by Malte

Hi just wanted to ask again, since i will need to deploy this migration during the next week (final demo at 20.7) so: would a fix of this during the next two or three days be feasible? If not, i will find my way to deploy the migration without this, wouldn't be a huge deal.

Thanks for your help.

comment:3 Changed 5 years ago by jri

Today I could implement a runWithoutGeoCoding() mechanism (analogous to runWithoutWorkspaceAssignment()).
Would this be still useful for you?
Sorry for the late reply.

comment:4 Changed 5 years ago by Malte

Thanks, yes, it certainly would be helpful if contained in the 4.8.3 release.
The only requirement i have is that i can make use this feature in a migration.

comment:5 Changed 5 years ago by jri

  • Status changed from new to accepted
  • Complexity changed from 1 to 2
  • Milestone changed from Release 4.8.1 to Release 4.8.3
  • Area set to Application Framework / API

comment:6 Changed 5 years ago by Jörg Richter <jri@…>

In 569dfd1d7f453881e28a4226464d3da965ce2ed6/deepamehta:

Core: add ContextTracker utility (#980).

1 new class in de.deepamehta.core.util:

ContextTracker

See #980.

comment:7 Changed 5 years ago by Jörg Richter <jri@…>

In 4682bbf797180d1b0d588eaf7e8d616ac7d83fc4/deepamehta:

Geomaps: suppress geocoding by code block (#980).

1 new method in GeomapsService:

<V> V runWithoutGeocoding(Callable<V> callable) throws Exception;

Executes the passed codeblock and suppresses geocoding for Address topics created/updated while execution.
Returns the value returned by the codeblock.

Note: suppressing geocoding by adding the dm4_no_geocoding cookie to the request still works.

Geocoding is suppressed if at least one condition is met: the cookie is present, or code executes via runWithoutGeocoding().

The latter is useful e.g. for code running in migrations.

See #980.

comment:8 Changed 5 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.