net.sf.mgaip
Class AdInserterMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.reporting.AbstractMavenReport
          extended by net.sf.mgaip.AdInserterMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.apache.maven.reporting.MavenMultiPageReport, org.apache.maven.reporting.MavenReport

public final class AdInserterMojo
extends org.apache.maven.reporting.AbstractMavenReport

Inserts Google Ads in the generated Maven site.

Control Version

Since:
1.0
Version:
1.0 20110507
Author:
Andres Gomez Casanova (AngocA)

Field Summary
(package private)  String customPoweredBy
          Custom script to insert in the vertical zone as a powered by.
(package private)  String facebookLink
          Link to associate in the I like Facebook button.
(package private)  String googleId
          Identifier of the Google Account.
(package private)  boolean googlePlusOne
          Adds a Google Plus one script in the pages.
(package private)  int horizontalAdHeight
          Height of the horizontal ad.
(package private)  String horizontalAdId
          Identifier of the Horizontal Ad.
(package private)  int horizontalAdWidth
          Width of the horizontal ad.
(package private)  int logoAdHeight
          Height of the logo ad.
(package private)  String logoAdId
          Identifier of the Logo Ad.
(package private)  int logoAdWidth
          Width of the logo ad.
private  File outputDirectory
          Directory where reports will go.
private  org.apache.maven.project.MavenProject project
           
private  org.apache.maven.doxia.siterenderer.Renderer siteRenderer
           
(package private)  int uniqueAdHeight
          Height of the unique ad.
(package private)  String uniqueAdId
          Identifier of the Unique Ad.
(package private)  int uniqueAdWidth
          Width of the unique ad.
(package private)  int verticalAdHeight
          Height of the vertical ad.
(package private)  String verticalAdId
          Identifier of the Vertical Ad.
(package private)  int verticalAdWidth
          Width of the vertical ad.
 
Fields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AdInserterMojo()
           
 
Method Summary
private  void createReport()
          Creates the report via Sink.
 void executeReport(Locale locale)
           
 String getDescription(Locale locale)
           
 String getName(Locale locale)
           
protected  String getOutputDirectory()
           
 String getOutputName()
           
protected  org.apache.maven.project.MavenProject getProject()
           
protected  org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
           
(package private)  void log(int level, String message)
          Writes in the log in the given level.
(package private)  void log(Throwable exception)
          Prints the content of an exception.
private  void replaceFiles(String directory)
          Creates a list of files to modify and then replace the tags of them.
 
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
canGenerateReport, closeReport, execute, generate, generate, generate, getCategoryName, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectory
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customPoweredBy

String customPoweredBy
Custom script to insert in the vertical zone as a powered by.


facebookLink

String facebookLink
Link to associate in the I like Facebook button.

The link has to be in this form:

https%3A%2F%2Fwww.facebook.com%2Fpages%2FZemucan%2F138284808329

Replacing the ':' by %3A, '/' by %2F


googleId

String googleId
Identifier of the Google Account. This is the google_ad_client field.


googlePlusOne

boolean googlePlusOne
Adds a Google Plus one script in the pages.


horizontalAdHeight

int horizontalAdHeight
Height of the horizontal ad.


horizontalAdId

String horizontalAdId
Identifier of the Horizontal Ad. This is the google_ad_slot field.

This is placed everywhere in the text.


horizontalAdWidth

int horizontalAdWidth
Width of the horizontal ad.


logoAdHeight

int logoAdHeight
Height of the logo ad.


logoAdId

String logoAdId
Identifier of the Logo Ad. This is the google_ad_slot field.

This could be used as a logo replacement.


logoAdWidth

int logoAdWidth
Width of the logo ad.


outputDirectory

private File outputDirectory
Directory where reports will go.


project

private org.apache.maven.project.MavenProject project

siteRenderer

private org.apache.maven.doxia.siterenderer.Renderer siteRenderer

uniqueAdHeight

int uniqueAdHeight
Height of the unique ad.


uniqueAdId

String uniqueAdId
Identifier of the Unique Ad. This is the google_ad_slot field.

Placed inline the text.


uniqueAdWidth

int uniqueAdWidth
Width of the unique ad.


verticalAdHeight

int verticalAdHeight
Height of the vertical ad.


verticalAdId

String verticalAdId
Identifier of the Vertical Ad. This is the google_ad_slot field.

This is placed at the vertical left side of the site, as a powered by icon.


verticalAdWidth

int verticalAdWidth
Width of the vertical ad.

Constructor Detail

AdInserterMojo

public AdInserterMojo()
Method Detail

createReport

private void createReport()
Creates the report via Sink.


executeReport

public void executeReport(Locale locale)
Specified by:
executeReport in class org.apache.maven.reporting.AbstractMavenReport

getDescription

public String getDescription(Locale locale)

getName

public String getName(Locale locale)

getOutputDirectory

protected String getOutputDirectory()
Specified by:
getOutputDirectory in class org.apache.maven.reporting.AbstractMavenReport

getOutputName

public String getOutputName()

getProject

protected org.apache.maven.project.MavenProject getProject()
Specified by:
getProject in class org.apache.maven.reporting.AbstractMavenReport

getSiteRenderer

protected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()
Specified by:
getSiteRenderer in class org.apache.maven.reporting.AbstractMavenReport

log

void log(int level,
         String message)
Writes in the log in the given level.

Parameters:
level - Level of the log to write: 1 debug, 2 info, 3 warn, 4 error.
message - Message to print.

log

void log(Throwable exception)
Prints the content of an exception.

Parameters:
exception - Exception to print.

replaceFiles

private void replaceFiles(String directory)
Creates a list of files to modify and then replace the tags of them.



AngocA 2011 Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.