[MAGNOLIA-1669] new simple virtual uri mapping implementation that can rotate between multiple urls Created: 07/Aug/07  Updated: 23/Jan/13  Resolved: 07/Aug/07

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 3.1 M2
Fix Version/s: 3.1 M3

Type: Improvement Priority: Trivial
Reporter: Fabrizio Giustina Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

A small addition to the virtual URI mapping family:

info.magnolia.cms.beans.config.RotatingVirtualURIMapping

(from class javadoc)

An extension of RegexpVirtualURIMapping that allows a rotation between different destination urls. In order to rotate toURI must contain the * that will be replaced by a random number between start (default is 1) and end (defaults is 3).

An additional property padding can specify the left 0 padding for numbers (defaults is 2). So for example a destination url like forward:/banner/image_*.jpg will randomly forward the request to /banner/image_01.jpg, /banner/image_02.jpg or /banner/image_03.jpg



 Comments   
Comment by Fabrizio Giustina [ 07/Aug/07 ]

in svn for 3.1M3

Comment by Magnolia International [ 07/Aug/07 ]

cool idea

Comment by Magnolia International [ 07/Aug/07 ]

Maybe it should be named Random***VirtualURIMapping, since it's not actually rotating but randomizing the value in the place holder ?

Comment by Philipp Bracher [ 09/Aug/07 ]

Be aware of the fact that the original uri (not reset by the virtual uri filtter is used to generate the cache key). After the first call is cached the image would stop being random I guess.

Generated at Mon Feb 12 03:29:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.