...
Besides this there are minor API changes. This page contains a step-to-step list to migrate existing projects.
An example project where all these steps are already done is: https://github.com/wcm-io/wcm-io-samples
Step 1 - Update POM dependencies
...
io.wcm:io.wcm.testing.wcm-io-mock.caconfig
org.apache.sling:org.apache.sling.testing.caconfig-mock-plugin
Make sure you have configured the Context-Aware Configuration bnd plugin in your pom hierarchy - or inherit from io.wcm.maven:io.wcm.maven.global-parent
where it is already configured.
Additionally update all other wcm.io Bundles to the latest version - in most cases this involves an update of the major version from 0.x to 1.x. In case of AEM Mocks update to the latest 1.x version for AEM 6.2, and to the latest 2.x version if you are using AEM 6.2 or higher.
...
- The
MediaFormatBuilder.create
method no longer supports the 2nd (Application ID) parameter - call it only with one parameter, the media format name. - Mark all download media formats with
setDownloaddownload(true)
- The abstract class
io.wcm.handler.media.spi.helpers.AbstractMediaFormatProvider
was removed - instead directly extendio.wcm.handler.media.spi.MediaFormatProvider
...
- Remove
@Model
and@Application
annotations. Instead, make it an OSGi service published as and extendingio.wcm.handler.media.spi.MediaHandlerConfig
. - It is not required to set it as immediate
- Check the new default implementation of super classes - perhaps you can remove some of your customization overrides or even remove the whole class
- The method
getDownloadMediaFormats
is no longer supported - instead go the list of defined media formats and add the call setDownloadapplydownload(true)
to all download media formats
...
- Remove all OSGi services you've removed in the previous steps
- Add all OSGi services you've newly created - e.g. the URL, Link and Media Handler Config implementations that were Sling models before
Step 10 - Check for Handler API changes
There are only small API changes between Handler 0.x and 1.x. If you encounter a compile error you have to change your code slightly.
The changes are listed in the changelog for the 1.0.0 version:
- http://wcm.io/handler/url/changes-report.html
- http://wcm.io/handler/media/changes-report.html
- http://wcm.io/handler/link/changes-report.html
Step 11 - Optional: Update CONGA configuration
If you are using CONGA you may have defined a override rule like this in your AEM system configuration template:
No Format |
---|
{{#if configOverrides}}
# Override site configuration
io.wcm.config.core.override.impl.OsgiConfigOverrideProvider-override
enabled=B"true"
description="Site URL Config Overrides"
overrides=[
{{~#each configOverrides ~}}
{{~#each this ~}}
"[{{../@key}}]{{@key}}\={{this}}",
{{~/each ~}}
{{~/each ~}}
]
{{/if}} |
Change it to:
No Format |
---|
{{#if configOverrides}}
# Override site configuration
org.apache.sling.caconfig.impl.override.OsgiConfigurationOverrideProvider-override
enabled=B"true"
description="Site URL Config Overrides"
overrides=[
{{~#each configOverrides ~}}
{{~#each this ~}}
"[{{../@key}}]{{this}}",
{{~/each ~}}
{{~/each ~}}
]
{{/if}} |
and use a syntax like this in the environment definitions to configure overrides:
No Format |
---|
# Force-Override site URLs in all site configs on the system
configOverrides:
"/content/myapp":
- io.wcm.handler.url.SiteConfig/siteUrl="http://www.myapp.net"
- io.wcm.handler.url.SiteConfig/siteUrlSecure="https://www.myapp.net"
- io.wcm.handler.url.SiteConfig/siteUrlAuthor="https://author.myapp.net" |
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...