[MAGNOLIA-7085] Provide upgrade task for replacing mapping implementations Created: 07/Jul/17  Updated: 07/Aug/17  Resolved: 04/Aug/17

Status: Closed
Project: Magnolia
Component/s: Virtual URI mappings
Affects Version/s: None
Fix Version/s: 5.5.6, 5.6

Type: Task Priority: Neutral
Reporter: Oanh Thai Hoang Assignee: Dai Ha
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 8d 2.75h
Original Estimate: 5d

Issue Links:
dependency
is depended upon by MGNLDEMO-220 Update travel-demo URI mapping config Closed
is depended upon by MGNLGS-134 Update sitemap URI mapping & config a... Closed
is depended upon by MGNLRSSAGG-214 Update RSS module URI mapping config Closed
is depended upon by MGNLUI-4243 Update admincentral URI mapping config Closed
is depended upon by MULTISITE-73 Update multisite URI mapping against ... Closed
supersession
supersedes MAGNOLIA-7016 Improve API of Virtual URI mappings Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: Virtual URI mappings
Sprint: Saigon 104, Saigon 105, Saigon 106, Saigon 107
Story Points: 5

 Description   

Could be in the shape of a groovy script, but ideally also usable as a "regular" version-handling Task.

  • Take one module name as input, and for that module:
  • Rename virtualURIMapping node to virtualUriMappings (plural, camel-case)
  • Visit mapping nodes and upgrade magnolia's known impls
    • Package changed
    • URI is now spelled in camelCase in class-names
    • URI is now spelled in camelCase in fromUri / toUri config properties
    • See table below for mapping replacements
  • Output a warning to install-ctx for custom implementations without replacement
  • Make the task extensible for use by other modules (e.g. multisite)
    • probably expose a protected method to specify additional replacing-mappings
Old mapping New mapping
info.magnolia.cms.beans.config.DefaultVirtualURIMapping info.magnolia.virtualuri.mapping.DefaultVirtualUriMapping
info.magnolia.cms.beans.config.RegexpVirtualURIMapping info.magnolia.virtualuri.mapping.RegexpVirtualUriMapping
info.magnolia.cms.beans.config.RotatingVirtualURIMapping info.magnolia.virtualuri.mapping.RotatingVirtualUriMapping
info.magnolia.cms.beans.config.HostBasedVirtualURIMapping info.magnolia.virtualuri.mapping.HostBasedVirtualUriMapping
info.magnolia.cms.beans.config.HostBasedRegexpVirtualURIMapping info.magnolia.virtualuri.mapping.HostBasedRegexpVirtualUriMapping


 Comments   
Comment by Sang Ngo Huu [ 21/Jul/17 ]

mgeljic

Regarding a point Take one module name as input, and for that module:. I wonder why we don't take mapping path as input?

We have several tickets to handler the update, I think the task should update for one path indeed and it would be:
NodeExistsDelegateTask

  • Task to change classes
  • Task to update URI properties
  • Task to rename mapping node

WDYT?

Comment by Mikaël Geljić [ 25/Jul/17 ]

`moduleName` of `modulePath` as input are both fine. Mapping paths not so much, because if you have a module declaring 100 mappings, you don't want your MVH delta to have 100 more lines / tasks.

Like I suggested on the PR originally:

  • outer task would be an ArrayDelegateTask (again, like ContentAppMigrationTask)
    • first inner task to rename virtualURIMapping folder can be a NodeExistsDelegateTask
    • then for the class & property updates, we should visit (NodeVisitorTask) and operate on the mappings nodes

Additionally, class & property updates may be in the same NodeVisitorTask, that could simplify things a bit.

Generated at Mon Feb 12 04:20:35 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.