Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSKINS-201] Replace deprecated DecorationModel#getGoogleAnalyticsAccountId() with custom value #42

Merged
merged 2 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -623,21 +623,6 @@ under the License.
<outputDirectory>${project.build.directory}/site/mskins-72/</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-mskins-75</id>
<phase>site</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${project.build.directory}/it/mskins-75/target/site/</directory>
</resource>
</resources>
<outputDirectory>${project.build.directory}/site/mskins-75/</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-mskins-76</id>
<phase>site</phase>
Expand Down
10 changes: 7 additions & 3 deletions src/it/mskins-143_default/src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@
</body>

<!-- START SNIPPET: skin-custom-config -->
<!-- no custom config -->
<custom>
<fluidoSkin>
<googleAnalytics>
<accountId>FOO-BAR</accountId>
</googleAnalytics>
</fluidoSkin>
</custom>
<!-- END SNIPPET: skin-custom-config -->

<googleAnalyticsAccountId>FOO-BAR</googleAnalyticsAccountId>

</project>
3 changes: 1 addition & 2 deletions src/it/mskins-143_false/src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<custom>
<fluidoSkin>
<googleAnalytics>
<accountId>FOO-BAR</accountId>
<anonymizeIp>false</anonymizeIp>
<forceSSL>false</forceSSL>
</googleAnalytics>
Expand All @@ -49,6 +50,4 @@
</breadcrumbs>
</body>

<googleAnalyticsAccountId>FOO-BAR</googleAnalyticsAccountId>

</project>
3 changes: 1 addition & 2 deletions src/it/mskins-143_true/src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<custom>
<fluidoSkin>
<googleAnalytics>
<accountId>FOO-BAR</accountId>
<anonymizeIp>true</anonymizeIp>
<forceSSL>true</forceSSL>
</googleAnalytics>
Expand All @@ -49,6 +50,4 @@
</breadcrumbs>
</body>

<googleAnalyticsAccountId>FOO-BAR</googleAnalyticsAccountId>

</project>
3 changes: 0 additions & 3 deletions src/it/mskins-177-apache-analytics/src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,4 @@
<head/>
</body>

<!-- empty one to disable inherited from parent -->
<googleAnalyticsAccountId></googleAnalyticsAccountId>

</project>
3 changes: 0 additions & 3 deletions src/it/mskins-177-matomo-no-options/src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,4 @@
<head/>
</body>

<!-- empty one to disable inherited from parent -->
<googleAnalyticsAccountId></googleAnalyticsAccountId>

</project>
76 changes: 0 additions & 76 deletions src/it/mskins-75/pom.xml

This file was deleted.

38 changes: 0 additions & 38 deletions src/it/mskins-75/src/site/apt/index.apt.vm

This file was deleted.

58 changes: 0 additions & 58 deletions src/it/mskins-75/src/site/site.xml

This file was deleted.

35 changes: 0 additions & 35 deletions src/it/mskins-75/verify.groovy

This file was deleted.

36 changes: 8 additions & 28 deletions src/main/resources/META-INF/maven/site-macros.vm
Original file line number Diff line number Diff line change
Expand Up @@ -551,28 +551,8 @@ $indent </ul>##
#**##end
#end
##
#macro ( piwik )
#**##if ( $decoration.getCustomChild( 'fluidoSkin.piwik.piwikUrl' )
&& $decoration.getCustomChild( 'fluidoSkin.piwik.idsite' ) )
#* *##set ( $piwikUrl = $decoration.getCustomValue( 'fluidoSkin.piwik.piwikUrl' ) )
#* *##set ( $idsite = $decoration.getCustomValue( 'fluidoSkin.piwik.idsite' ) )
##
<!-- Piwik -->
<script>
var pkBaseURL = (("https:" == document.location.protocol) ? "https://$piwikUrl/" : "http://$piwikUrl/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js'%3E%3C/script%3E"));
</script><script>
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", $idsite);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://$piwikUrl/piwik.php?idsite=$idsite" style="border: 0;" alt="Piwik" /></p></noscript>
<!-- End Piwik Tag -->
#**##end
#end
##
#macro ( googleAnalytics $accountId )
#macro ( googleAnalytics )
#set ( $accountId = $decoration.getCustomValue( 'fluidoSkin.googleAnalytics.accountId' ) )
#**##if( $accountId && $accountId != "" )
<!-- Google Analytics -->
<script>
Expand All @@ -592,20 +572,20 @@ $indent </ul>##
#**##end
#end

#macro ( matomo $matomoDom )
#macro ( matomo )
#**##if ( $decoration.getCustomValue( 'matomo.url' ) && $decoration.getCustomValue( 'matomo.url' ) != ''
&& $decoration.getCustomValue( 'matomo.siteId' ) && $decoration.getCustomValue( 'matomo.siteId' ) != '')

<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
#* *##foreach( $option in $matomoDom.getChild("options").getChildren() )
#* *##if( $option.value && $option.value != "" )
#* *##foreach( $option in $decoration.getCustomChild( 'matomo.options' ).getChildren() )
#* *##if( $option.value && $option.value != "" )
_paq.push(['$option.name', '$option.value']);
#* *##else
#* *##else
_paq.push(['$option.name']);
#* *##end
#* *##end
#* *##end
#* *##end

(function() {
var u="$decoration.getCustomValue( 'matomo.url' )";
Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/META-INF/maven/site.vm
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
#* *#$render.eval( $decoration.body.head )
#**##end
#**##if( $headContent )$headContent#end
#**##googleAnalytics( $decoration.googleAnalyticsAccountId )
#**##matomo( $decoration.custom.getChild('matomo') )
#**##googleAnalytics()
#**##matomo()
#**##flattrHead()
#**##forkMeOnGitHubHead()
</head>
Expand Down Expand Up @@ -284,7 +284,6 @@
#* *##end
</div>
</footer>
#**##piwik()
#**##anchorJS()
</body>
</html>
2 changes: 0 additions & 2 deletions src/site/apt/ITs.apt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ Maven Fuido Skin ITs

* {{{./mskins-72/index.html}MSKINS-72}}

* {{{./mskins-75/index.html}MSKINS-75}}

* {{{./mskins-76/index.html}MSKINS-76}}

* {{{./mskins-76_topbar/index.html}MSKINS-76 (topbar)}}
Expand Down
Loading