Page tree
Skip to end of metadata
Go to start of metadata

Your Rating: Results: 1 Star2 Star3 Star4 Star5 Star 94 rates

 

Implemented in Magnolia 5.0

Improve link generation

 

With moving to Magnolia 5.0 we can continue with getting rid of old Context/Node Data API replacing it with JCR API, in this case for link generation.

Also this brings an opportunity to refactor the code and its structure, get rid of deprecated code etc. + solving few related tickets (described bellow).

 

Structure and configuration changes

  • info.magnolia.link.LinkFactory should be merged into info.magnolia.link.LinkUtil
    • both contains just static methods so there is no point in having two of them
    • review methods
    • also they make mutual calls
  • Rewrite LinkTransformerManager
    • only way how to customize one of link transformers is to rewrite the class (Link manager can be set in config workspace)
    • /server/rendering/linkManagemet - add transformersholder where transformers will be registered
      • transformers
        • absolute
        • relative
        • editor
        • completeURL
        • browser
    • call registered transformer (as manager does it now), if not then fallback to default (?)
    • LinkTransformer interface - add setter and getter for addContextPath, useURI2RepositoryMapping and useI18N
    • EditorLinkTransformer should be deprecated as it calls just AbsolutePathTransformer
    • also this setting should be possible to configure site-specific
      • implementation in ETKLinkTransformerManager
      • site will get also transformers holder
      • if current site has this holder it overrides general one

 

Functional changes

  • info.magnolia.link.Link - replace Content with Node
    •  add methods which will use Node, deprecate Content related
  • i18n aware links
    • for now internal links are working in set locale (EN -> EN)
    • Link should contain Locale property with possibility to point to certain language version, for example:
      • link to german page from english
      • link list of all existing languages for certain page
    • use default locale if none given
    • add i18nLinkTransformer
      • Locale set in constructor, transform method will do processing
      • based on functionality of DomainNamePathTransformer, just locale won't be added dynamically but via parameter
  • configurable extension
    • MagnoliaTemplatingUtilities.createLink() - add method with extension parameter

 

Jira tickets

  • Error rendering macro 'jira'

    Unable to locate Jira server for this macro. It may be due to Application Link configuration.

    - base ticket for API change
  • Unable to locate Jira server for this macro. It may be due to Application Link configuration. - API improvement, basicly refactoring and merging LinkUtil with LinkFactory as mentioned above
  • Unable to locate Jira server for this macro. It may be due to Application Link configuration. - improved configuration
    • should provide a way to configure Transformers
  • Unable to locate Jira server for this macro. It may be due to Application Link configuration. - add possibility to configure extension when creating the link
  • No labels