Extending PrimeRadiant

Model

Same settings as PrimeRadiant’s TomEE-based ApplicationInstance.

applicationInstanceOption("persistence.useGlobalSequence")
applicationInstanceOption("experimental.cruds.failOnProjectionNotFound")
applicationInstanceOption("disableStrictLinkMode")

componentOption("enableIoXml")
componentOption("enableComposites")

Expansion

E/**/ComponentMetaData.java

  // anchor:custom-methods:start
  static {
    DEPLOYMENT_NAME = "primeRadiant";
  }
  // anchor:custom-methods:end

E/war/pom.xml

  <!-- anchor:custom-project:start -->
  <profiles>
    <profile>
      <id>primeRadiant-extension</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.2.3</version>
            <configuration combine.self="override">
              <webResources>
                <resource>
                  <directory>../struts/</directory>
                  <targetPath>merge</targetPath>
                  <includes>
                    <include>**/struts.xml</include>
                    <include>**/struts.properties</include>
                  </includes>
                </resource>
                <resource>
                  <directory>../components/extension/view/gen/knockout/</directory>
                  <targetPath>copy</targetPath>
                </resource>
                <resource>
                  <directory>../components/extension/view/ext/knockout/</directory>
                  <targetPath>copy</targetPath>
                </resource>
                <!-- STRUTS2 CONTROL -->
                <resource>
                  <directory>../control/gen/struts2/resources</directory>
                  <targetPath>copy/WEB-INF/classes</targetPath>
                </resource>
              </webResources>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <!-- anchor:custom-project:end -->

Merging

WAR (custom)

E/WAR/merge/* see *WAR (default)(

)

WAR (default)

PR/WAR/WEB-INF/classes/struts.xml

  <!-- anchor:custom-includes:start -->
  <include file='<extensionComp>.xml'/>
  <!-- anchor:custom-includes:end -->

PR/WAR/WEB-INF/classes/struts.properties

struts.custom.i18n.resources=...,<extensionComp>

copy:

E/WAR/WEB-INF/classes/menu
E/WAR/WEB-INF/classes/mindmap
E/WAR/WEB-INF/lib/<extensionComp>*.java` -> `P/WAR/WEB-INF/lib
E/WAR/html
E/WAR/js

EAR

copy all but META-INF

PR/EAR/META-INF/application.xml

  <module>
    <ejb>extension.jar</ejb>
  </module>

TomEE

tomee.xml

for every E/**/persistence.xml

  <!-- anchor:custom-database-resources:start -->
  <Resource id="jdbc_<extensionApp>_<extensionComp>" type="DataSource">
    JdbcDriver  org.hsqldb.jdbcDriver
    JdbcUrl     jdbc:hsqldb:file:hsqldb/db_<extensionApp>
    UserName    SA
    Password=
  </Resource>
  <!-- anchor:custom-database-resources:end -->

Database of PrimeRadiant itself can be used, but will need to be provisioned.

References