[MAGNOLIA-1160] i18n, testing: MessagesManager should use FactoryUtil Created: 25/Oct/06  Updated: 23/Jan/13  Resolved: 30/Dec/08

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: 4.0

Type: Improvement Priority: Major
Reporter: Philipp Bärfuss Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File MessagesManagerFactory.patch    
Issue Links:
dependency
depends upon MAGNOLIA-1857 Review MessagesManager and make it a ... Closed
is depended upon by MAGNOLIA-2528 Remove dependency to admincentral mes... Closed
relation
is related to MAGNOLIA-1516 SystemContext could be aware of the S... Closed
is related to MAGNOLIA-2273 Make MessagesManager easier to extend... Closed
is related to MAGNOLIA-2531 SystemContext.locale duplicates Messa... Closed
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   

Currently it is not possible to replace the i18n mechanism.
Perhpas we keep the static methods, but use a replaceble manager Object instance in the background



 Comments   
Comment by Magnolia International [ 02/May/07 ]

I'd like to fix this for 3.1, as it prevents to test page handlers properly.

Comment by Magnolia International [ 02/May/07 ]

See magnolia-module-forum//ForumControlerTest for an example of an ugly to go around this (hack which shouldn't be used in the main magnolia tests, since it completely messes the MessagesManager static variables)

Comment by Philipp Bracher [ 03/May/07 ]

It is indeed one of the last so called Manager we have to change. But to not loosing to much time we could initialize the map by default.

Comment by Magnolia International [ 08/May/07 ]

Here's a patch that (partially) "de-static-ize" MessagesManager and adds some tests.
Requires more work:

  • removing(deprecated) methods that are duplicated in the context classes
  • cleaning up
  • moving some methods to a util class?
  • more tests
  • make it an actual ObservedManager ?
Comment by Magnolia International [ 28/Aug/07 ]

here's another spike at a factory which would initialize the MessagesManager and allow passing a ServletContext to it.

Comment by Magnolia International [ 30/Dec/08 ]

The various getMessages() and get(key) methods are still static, which is probably ok, as all they do is delegate to an internal instance method.
See MAGNOLIA-2273, MAGNOLIA-2530 and MAGNOLIA-2531 for further cleanup/refinement of the api.

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