@@ -0,0 +1,1197 @@
+package flyway.paikkis;%0A%0Aimport fi.nls.oskari.db.BundleHelper;%0Aimport fi.nls.oskari.domain.map.view.Bundle;%0Aimport fi.nls.oskari.util.FlywayHelper;%0Aimport org.flywaydb.core.api.migration.jdbc.JdbcMigration;%0A%0Aimport java.sql.Connection;%0Aimport java.util.List;%0A%0A/**%0A * Registers and adds 'telemetry' bundle to default and user views.%0A */%0Apublic class V2_27__add_telemetry_to_default_views implements JdbcMigration %7B%0A    private static final String BUNDLE_ID = %22telemetry%22;%0A%0A    public void migrate(Connection connection) throws Exception %7B%0A%0A        // register bundle%0A        Bundle bundle = new Bundle();%0A        bundle.setName(BUNDLE_ID);%0A        bundle.setStartup(BundleHelper.getBundleStartup(%22/Oskari/packages/paikkatietoikkuna/bundle/%22, BUNDLE_ID, BUNDLE_ID));%0A        BundleHelper.registerBundle(bundle, connection);%0A%0A        // add to default/user views%0A        final List%3CLong%3E views = FlywayHelper.getUserAndDefaultViewIds(connection);%0A        for(Long viewId : views)%7B%0A            if (FlywayHelper.viewContainsBundle(connection, BUNDLE_ID, viewId)) %7B%0A                continue;%0A            %7D%0A            FlywayHelper.addBundleWithDefaults(connection, viewId, BUNDLE_ID);%0A        %7D%0A    %7D%0A%7D%0A

Add Piwik telemetry into views