Table of Contents

Prepare CzechIdM build on projects - with custom module

In this tutorial, I'll be using Eclipse, so if you are using another IDE is possible that some name will be different.

Please follow tutorial in archetype. This tutorial may be obsolete. Archetype tutorial

Step by step Backend

(I'll be using project name CGL)

Aggregator

If you want to be able to build an application with an aggregator, please make sure that pom.xml in aggregator look like this: (Look at comments and change everything where is TODO in the comment!)

```xml <?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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>eu.bcvsolutions.idm</groupId>
  <artifactId>cg-aggregator</artifactId> <!-- TODO This name shold be name of your project -->
  <version>1.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>CG - CzechIdM aggregator</name> <!-- TODO change to chosen name -->
  <description>
      This module serves only as a sub module aggregator - it does not contain any source
      code, but running Maven goals on this project runs Maven goals
      on all of its modules successively.
  </description>
  <modules>
      <module>../idm-cg</module> <!-- TODO change to module of company -->
      <module>../idm-app-cg</module> <!-- TODO change to app module of company -->
  </modules>
  <profiles>
      <profile>
          <!-- Profile is used for releasing product. Usage is described in documentation -->
          <id>release</id>
          <build>
              <plugins>
                  <plugin>
                      <groupId>com.atlassian.maven.plugins</groupId>
                      <artifactId>maven-jgitflow-plugin</artifactId>
                      <version>1.0-m5.1</version>
                      <configuration>
                          <defaultOriginUrl>https://git.bcvsolutions.eu/zak/cg-czechidm-ng.git</defaultOriginUrl> <!-- Here should be https of git project address -->
                          <pushReleases>true</pushReleases>
                          <keepBranch>false</keepBranch>
                          <autoVersionSubmodules>true</autoVersionSubmodules>
                          <noTag>true</noTag>
                          <allowUntracked>true</allowUntracked>
                          <pullDevelop>true</pullDevelop>
                          <pullMaster>true</pullMaster>
                          <allowSnapshots>true</allowSnapshots>
                          <flowInitContext>
                              <masterBranchName>master</masterBranchName> <!-- TODO make sure that both branches are same -->
                              <developBranchName>develop</developBranchName> <!-- TODO make sure that both branches are same -->
                          </flowInitContext>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-deploy-plugin</artifactId>
                      <version>2.8.1</version>
                      <!-- Deploying this module on nexus is not demmanded -->
                      <configuration>
                          <skip>true</skip>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      </profile>
  </profiles>

</project> ```

```xml <artifactId>idm-app-cgl</artifactId>

<packaging>war</packaging>
<name>CzechIdM Application</name>
<description>CzechIdM web application. Contains application modules with rest endpoints , authentication etc.</description>
<repositories>
	<repository>
	    <id>nexus-releases</id>
	    <url>https://nexus.bcvsolutions.eu/repository/maven-releases/</url>
	</repository>
	<!-- After release stable version of CzechIdMng remove repository snapshots -->
	<repository>
	    <id>nexus-snapshots</id>
	    <url>https://nexus.bcvsolutions.eu/repository/maven-snapshots/</url>
	</repository>
</repositories>
<dependencies>
	<dependency>
		<groupId>${project.groupId}</groupId>
		<artifactId>idm-cgl</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</dependency>
	<dependency>
		<groupId>${project.groupId}</groupId>
		<artifactId>idm-core-impl</artifactId>
		<version>${project.version}</version>
	</dependency>
</dependencies>

```

```xml

      <version>1.0.0-SNAPSHOT</version>

<properties>
	<czechidm-version>7.8.4</czechidm-version>
</properties>
<repositories>
	<repository>
	    <id>nexus-releases</id>
	    <url>https://nexus.bcvsolutions.eu/repository/maven-releases/</url>
	</repository>
	<!-- After release stable version of CzechIdMng remove repository snapshots -->
	<repository>
	    <id>nexus-snapshots</id>
	    <url>https://nexus.bcvsolutions.eu/repository/maven-snapshots/</url>
	</repository>
</repositories>

```

```xml

              <dependency>
		<groupId>${project.groupId}</groupId>
		<artifactId>idm-pwdreset</artifactId>
		<version>1.2</version>
	</dependency>

```

@Component
@PropertySource("classpath:module-" + CglModuleDescriptor.MODULE_ID + ".properties")
@ConfigurationProperties(prefix = "module." + CglModuleDescriptor.MODULE_ID + ".build", ignoreUnknownFields = true, ignoreInvalidFields = true)
public class CglModuleDescriptor extends PropertyModuleDescriptor {
 
	public static final String MODULE_ID = "cgl";
 
	@Override
	public String getId() {
		return MODULE_ID;
	}
}

Frontend

czechidm-acc/
czechidm-core/
czechidm-pwdreset/
czechidm-rpt/
czechidm-vs/
node_modules
{
  "module": {
    "name": "Cgl",
    "author": "BCV solutions s.r.o."
  },
  "content": {
  }
}
//
const ManagerRoot = {
};

ManagerRoot.version = '0.0.1';
module.exports = ManagerRoot;
const ServiceRoot = {
};

ServiceRoot.version = '0.1.0';
module.exports = ServiceRoot;
module.exports = {
  'id': 'cgl',
  'name': 'Cgl',
  'description': 'Components for Cgl module',
  'components': [
  ]
};
module.exports = {
  'id': 'cgl',
  'npmName': 'czechidm-cgl',
  'backendId': 'cgl',
  'name': 'CGL module for CzechIdM devstack.',
  'description': 'CGL module',
  // 'mainStyleFile': 'src/css/main.less',
  'mainRouteFile': 'routes.js',
  'mainComponentDescriptorFile': 'component-descriptor.js',
  'mainLocalePath': 'src/locales/',
  'navigation': {
    'items': [
    ]
  }
};
{
  "name": "czechidm-cgl",
  "version": "1.0.0-snapshot",
  "description": "Cgl module",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "CzechIdM",
    "cgl",
    "IdM"
  ],
  "author": "BCV solutions s.r.o",
  "license": "MIT"
}
module.exports = {
  module: 'cgl',
  childRoutes: [
  ]
};