Class SendWebAnalyticsEventsEngine
java.lang.Object
org.ametys.plugins.newsletter.workflow.SendWebAnalyticsEventsEngine
- All Implemented Interfaces:
Runnable
Send a web analytics event for every newsletter e-mail sent.
-
Field Summary
Modifier and TypeFieldDescriptionprotected CategoryProviderExtensionPoint
The category provider extension point.protected Context
The avalon context.protected Context
The cocoon environment context.protected I18nUtils
The i18n utils component.protected boolean
Is the engine initialized ?protected ServiceManager
The service manager.protected AmetysObjectResolver
The resolverprotected SiteManager
The site Manager.protected WebAnalyticsProviderExtensionPoint
The web analytics provider extension point -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
consumeQuietly
(InputStream input) Consume a stream, reading all its data and ignoring errors.void
initialize
(ServiceManager manager, Context context) Initialize the engine.void
parametrize
(String siteName, WebContent newsletterContent, Category category, int eventCount) Parameterize enginevoid
run()
protected void
Send the event request, given the full GIF URL.protected void
Send web analytics events for a given web analytics user account.
-
Field Details
-
_context
The avalon context. -
_environmentContext
The cocoon environment context. -
_manager
The service manager. -
_initialized
Is the engine initialized ? -
_categoryProviderEP
The category provider extension point. -
_siteManager
The site Manager. -
_webAnalyticsProviderEP
The web analytics provider extension point -
_i18nUtils
The i18n utils component. -
_resolver
The resolver
-
-
Constructor Details
-
SendWebAnalyticsEventsEngine
public SendWebAnalyticsEventsEngine()
-
-
Method Details
-
initialize
public void initialize(ServiceManager manager, Context context) throws ContextException, ServiceException Initialize the engine.- Parameters:
manager
- the avalon service manager.context
- the avalon context.- Throws:
ContextException
- if an error occurred during initializationServiceException
- if an error occurred during initialization
-
parametrize
public void parametrize(String siteName, WebContent newsletterContent, Category category, int eventCount) Parameterize engine- Parameters:
siteName
- The site namenewsletterContent
- the newsletter contentcategory
- the newsletter categoryeventCount
- the number of events
-
run
-
sendEvents
Send web analytics events for a given web analytics user account. -
sendEvent
Send the event request, given the full GIF URL.- Parameters:
eventUrl
- the full event GIF URL (with parameters).- Throws:
IOException
- if an error occurs sending the GIF HTTP request.
-
consumeQuietly
Consume a stream, reading all its data and ignoring errors.- Parameters:
input
- the input stream to consume.
-