Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • DefaultI18NAuthoringSupport#i18nize() wouldn't be needed any longer - all the ugliness could go away.

  • Default values and read-only states would be much better and logically respected during locale changes since FieldFactories would re-apply those on form re-generation.

What to do (initial thoughts)

Default value/read-only state

  • Since TransformedProperty delegates most of the calls to Transformer - the latter should probably aggregate most of the mentioned functionality. 
    • Transformer object could get additional methods on the interface (e.g. get/setReadonly() and get/setDefaultValue())
    • Then transformer could resolve read-only state based on additional info coming from the underlying item (i.e. would still claim it's read-only if the item it is connected to cannot be modified).
    • Transformer would also be capable of setting a default value for any property it creates.
  • i18n 
    • Since we now store the current locale in the sub-app context we could re-generate the form each time the locale changes
      • underlying data wouldn't suffer since the values are propagated to datasource (e.g. JcrNodeAdapter) with Transformer;
      • DefaultI18nAuthoringSupport can be injected into transformer and be used simply to resolve the localised names of properties;
      • locale would be set for Transformer object upon form creation;
      • TransformedProperty's would be re-created.