Skip to content
Snippets Groups Projects
Commit e4acfb4a authored by Tim Kluge's avatar Tim Kluge
Browse files

Add quickstart

parent 4067dbce
No related branches found
No related tags found
No related merge requests found
Pipeline #9684 passed
......@@ -4,7 +4,21 @@ Supplementary material for the [COP 2021](https://conf.researchr.org/track/ecoop
The repository contains the source code of a library to be used as a core for systems synchronizing heterogenous object-oriented models.
## Installation
## Prerequisites
* Java SE Development Kit 8 (minimum)
* Maven 3.6.0 (minimum)
## Example
A minimal example project is available in `quickstart`, which just creates a new element at the central hub.
To run it, clone the repository and run `mvn package exec:java` in `quickstart`.
## Development
If you want to work on the actual library:
### Installation
This project is based on Maven, thus building it is simple:
......@@ -13,18 +27,13 @@ This project is based on Maven, thus building it is simple:
3. run mvn -compile
4. run mvn -package
## Setting up IntelliJ
### Setting up IntelliJ
1. Install IntelliJ's Plugin for Scala-Support
2. Clone this maven project
3. Import the project into IntelliJ
4. Wait till all dependencies are downloaded / installed
### Prerequisites
* Java SE Development Kit 8 (minimum)
* Maven 3.6.0 (minimum)
### Example Model Code
* see https://git-st.inf.tu-dresden.de/rosi/parallel-rsync/-/tree/master/crm-example
<?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>de.tudresden.inf.st.rmsc</groupId>
<artifactId>quickstart</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>Role-Model-Sync Conflict-Resolver Quickstart example</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://git-st.inf.tu-dresden.de/api/v4/projects/959/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>https://git-st.inf.tu-dresden.de/api/v4/projects/959/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>https://git-st.inf.tu-dresden.de/api/v4/projects/959/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<!-- SCALA LANGUAGE -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.12.8</version>
</dependency>
<!-- Parallel RSYNC -->
<dependency>
<groupId>de.tudresden.inf.st.rmsc</groupId>
<artifactId>crm-example</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.3</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<mainClass>de.tudresden.inf.st.rmsc.quickstart.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package de.tudresden.inf.st.rmsc.quickstart
import de.tudresden.inf.st.crme.models.MetaModels
import org.rosi_project.model_management.{ClientChangeRecord, ConflictResolution}
import org.rosi_project.model_management.sync.procedures.data.ClientEntireRecord
import scala.collection.mutable.ListBuffer
object Main {
final val MEMBER_MODEL_TYPE = "de.tudresden.inf.st.crme.models.modelB.Member"
def main(args: Array[String]): Unit = {
MetaModels.initCrmMetaModels()
val clientChangeRecords = ListBuffer[ClientChangeRecord]()
val clientEntireRecords = ListBuffer[ClientEntireRecord]()
// Add an example member object
clientChangeRecords.append(ClientChangeRecord(MEMBER_MODEL_TYPE, s"e1", 0, 0,
Map("birthday" -> s"01.01.1995", "lastName" -> s"Member 1", "address" -> "Dresden"), Map(), Map(), s"e1", s"testuser1", refonly = false))
clientEntireRecords.append(ClientEntireRecord(s"e1", 0, 0, MEMBER_MODEL_TYPE))
ConflictResolution.syncModel("creation", clientChangeRecords, clientEntireRecords, 1, s"testuser1")
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment