-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds Google Analytics measurement API integration
- Loading branch information
Showing
33 changed files
with
1,406 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/log4j*.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.../src/main/java/net/savantly/nexus/flow/api/events/submitFormJson/SubmitFormJsonEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.savantly.nexus.flow.api.events.submitFormJson; | ||
|
||
import org.springframework.context.ApplicationEvent; | ||
|
||
import lombok.Getter; | ||
|
||
public class SubmitFormJsonEvent extends ApplicationEvent { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Getter | ||
private final SubmitFormJsonEventData source; | ||
|
||
public SubmitFormJsonEvent(SubmitFormJsonEventData source) { | ||
super(source); | ||
this.source = source; | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
.../main/java/net/savantly/nexus/flow/api/events/submitFormJson/SubmitFormJsonEventData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.savantly.nexus.flow.api.events.submitFormJson; | ||
|
||
import jakarta.servlet.http.HttpServletRequest; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import net.savantly.nexus.flow.dom.formSubmission.FormSubmission; | ||
|
||
@Data | ||
@Builder | ||
public class SubmitFormJsonEventData { | ||
|
||
private final FormSubmission submission; | ||
private final String clientIP; | ||
private final HttpServletRequest request; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>nexus-command</artifactId> | ||
<groupId>net.savantly</groupId> | ||
<version>3.0.9-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>google-analytics-flow-module</artifactId> | ||
<name>Nexus Command - GA Flow Module</name> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
</resource> | ||
<resource> | ||
<filtering>false</filtering> | ||
<directory>src/main/java</directory> | ||
<includes> | ||
<include>**</include> | ||
</includes> | ||
<excludes> | ||
<exclude>**/*.java</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>common-types-module</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>encryption-module</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>organizations-module</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>google-analytics-module</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>flow-module</artifactId> | ||
</dependency> | ||
|
||
<!-- Spring --> | ||
|
||
|
||
<!-- CAUSEWAY API --> | ||
|
||
<dependency> | ||
<groupId>org.apache.causeway.core</groupId> | ||
<artifactId>causeway-applib</artifactId> | ||
</dependency> | ||
|
||
|
||
<dependency> | ||
<groupId>org.apache.causeway.valuetypes</groupId> | ||
<artifactId>causeway-valuetypes-markdown-applib</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.causeway.persistence</groupId> | ||
<artifactId>causeway-persistence-jpa-applib</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.causeway.testing</groupId> | ||
<artifactId>causeway-testing-fixtures-applib</artifactId> | ||
</dependency> | ||
|
||
|
||
<!-- IDE support (optional) --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-configuration-processor</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
|
||
<!-- TESTING --> | ||
|
||
<dependency> | ||
<groupId>org.apache.causeway.testing</groupId> | ||
<artifactId>causeway-testing-integtestsupport-applib</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.causeway.persistence</groupId> | ||
<artifactId>causeway-persistence-jpa-eclipselink</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
|
||
</dependencies> | ||
|
||
|
||
</project> |
61 changes: 61 additions & 0 deletions
61
...gle-analytics-flow/src/main/java/net/savantly/nexus/gaform/GoogleAnalyticsFlowModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package net.savantly.nexus.gaform; | ||
|
||
import org.apache.causeway.applib.services.factory.FactoryService; | ||
import org.apache.causeway.persistence.jpa.applib.CausewayModulePersistenceJpaApplib; | ||
import org.apache.causeway.testing.fixtures.applib.fixturescripts.FixtureScript; | ||
import org.apache.causeway.testing.fixtures.applib.modules.ModuleWithFixtures; | ||
import org.apache.causeway.testing.fixtures.applib.teardown.jpa.TeardownFixtureJpaAbstract; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.boot.autoconfigure.domain.EntityScan; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import net.savantly.nexus.gaform.dom.form.Form_SubmissionListener; | ||
import net.savantly.nexus.organizations.dom.organizationSecret.OrganizationSecrets; | ||
|
||
@Configuration | ||
@Import({ | ||
CausewayModulePersistenceJpaApplib.class, | ||
}) | ||
@ComponentScan | ||
@EnableJpaRepositories | ||
@Slf4j | ||
@EntityScan(basePackageClasses = { GoogleAnalyticsFlowModule.class }) | ||
@RequiredArgsConstructor | ||
public class GoogleAnalyticsFlowModule implements ModuleWithFixtures { | ||
|
||
public static final String NAMESPACE = "nexus.google.analytics.flow"; | ||
public static final String SCHEMA = "google_analytics_flow"; | ||
|
||
@Override | ||
public FixtureScript getTeardownFixture() { | ||
return new TeardownFixtureJpaAbstract() { | ||
@Override | ||
protected void execute(ExecutionContext executionContext) { | ||
// deleteFrom(FranchiseLocation.class); | ||
} | ||
}; | ||
} | ||
|
||
@Bean | ||
public Form_SubmissionListener gaFormSubmissionListener(FactoryService factoryService, | ||
OrganizationSecrets secrets) { | ||
return new Form_SubmissionListener(factoryService, secrets); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public ObjectMapper objectMapper() { | ||
var mapper = new ObjectMapper(); | ||
mapper.findAndRegisterModules(); | ||
return mapper; | ||
} | ||
|
||
} |
Oops, something went wrong.