Skip to content

Commit d1e380f

Browse files
Create Comparison sample using popular Kotlin web framework Javalin
1 parent 21698ae commit d1e380f

71 files changed

Lines changed: 273689 additions & 8 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Demos/Javalin/DocumentSamples/.gitkeep

Whitespace-only changes.

Demos/Javalin/DocumentSamples/ResultFiles/.gitkeep

Whitespace-only changes.

Demos/Javalin/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 GroupDocs.Comparison Product Family
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Demos/Javalin/Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: ./build/install/comparison-javalin/bin/comparison-javalin

Demos/Javalin/README.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
![GroupDocs.Comparison](https://raw.githubusercontent.com/groupdocs-comparison/groupdocs-comparison.github.io/master/resources/image/banner.png "GroupDocs.Comparison")
2+
# GroupDocs.Comparison Javalin Example
3+
New GroupDocs.Comparison for Java UI Example
4+
###### version 22.3
5+
6+
[![GitHub license](https://img.shields.io/github/license/groupdocs-comparison/GroupDocs.Comparison-for-Java-Spring.svg)](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/blob/master/Demos/Javalin/LICENSE)
7+
8+
## System Requirements
9+
- Java 11+ (JDK 11+)
10+
11+
12+
## Compare documents with Java API
13+
14+
**GroupDocs.Comparison** is a library that allows you to **compare PDF, DOCX, PPT, XLS,** and over 90 other document formats. With GroupDocs.Comparison you will be able to compare two or more files, perform style and text comparison and generate a detailed report with changes.
15+
16+
This application allows you to compare multiple documents and can be used as a standalone application or integrated as part of your project.
17+
18+
**Note:** without a license application will run in trial mode, purchase [GroupDocs.Comparison for Java license](https://purchase.groupdocs.com/order-online-step-1-of-8.aspx) or request [GroupDocs.Comparison for Java temporary license](https://purchase.groupdocs.com/temporary-license).
19+
20+
21+
## Demo Video
22+
23+
<p align="center">
24+
<a title="Document comparison" href="https://www.youtube.com/watch?v=82RuvtV2qpw">
25+
<img src="https://raw.githubusercontent.com/groupdocs-comparison/groupdocs-comparison.github.io/master/resources/image/comparison.gif" width="100%" style="width:100%;">
26+
</a>
27+
</p>
28+
29+
30+
## Features
31+
#### GroupDocs.Comparison
32+
- Clean, modern and intuitive design
33+
- Easily switchable colour theme (create your own colour theme in 5 minutes)
34+
- Responsive design
35+
- Mobile support (open application on any mobile device)
36+
- HTML and image modes
37+
- Fully customizable navigation panel
38+
- Compare documents
39+
- Multi-compare several documents
40+
- Compare password protected documents
41+
- Upload documents
42+
- Display clearly visible differences
43+
- Download comparison results
44+
- Print comparison results
45+
- Smooth document scrolling
46+
- Preload pages for faster document rendering
47+
- Multi-language support for displaying errors
48+
- Cross-browser support (Safari, Chrome, Opera, Firefox)
49+
- Cross-platform support (Windows, Linux, MacOS)
50+
51+
52+
## How to run
53+
54+
You can run this sample by one of following methods
55+
56+
57+
#### Run using IDE
58+
59+
Download [source code](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/releases/download/v22.3/groupdocs-comparison-javalin-22.3.0.zip) from github or clone this repository.
60+
61+
```bash
62+
git clone https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java.git
63+
cd GroupDocs.Comparison-for-Java/Demos/Javalin
64+
```
65+
Open project in IDE. Open `Application.kt` file and run `main` method inside it. Then open [http://localhost:8080/comparison/](http://localhost:8080/comparison/) in your favorite browser.
66+
67+
#### Run from command line
68+
69+
Download [source code](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/archive/refs/heads/master.zip) from github.
70+
71+
Alternatively you can clone this repository using next command
72+
```bash
73+
git clone https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java.git
74+
```
75+
76+
Run sample from Windows PowerShell or Linux Terminal using next commands
77+
78+
```bash
79+
cd GroupDocs.Comparison-for-Java/Demos/Javalin
80+
.\gradlew.bat :run
81+
```
82+
83+
Open [http://localhost:8080/comparison/](http://localhost:8080/comparison/) in your favorite browser.
84+
85+
#### Build distribution archive
86+
87+
Download [source code](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/archive/refs/heads/master.zip) from github.
88+
89+
Alternatively you can clone this repository using next command
90+
```bash
91+
git clone https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java.git
92+
```
93+
94+
Run sample from Windows PowerShell or Linux Terminal using next commands
95+
96+
```bash
97+
cd GroupDocs.Comparison-for-Java/Demos/Javalin
98+
.\gradlew.bat :build
99+
```
100+
101+
After that, go to `.\build\distributions\` directory to get distribution files.
102+
103+
#### Binary release (with all dependencies) for Linux
104+
105+
Download [latest release](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/releases/latest) from [releases page](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/releases).
106+
107+
**Note**: This method is **recommended** for running this sample behind firewall.
108+
109+
```bash
110+
curl -J -L -o release.tar.gz https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/releases/download/v22.3/groupdocs-comparison-javalin-22.3.0.tar
111+
tar -xvzf release.tar.gz
112+
cd release/comparison-javalin-22.3
113+
## Make `bin/comparison-javalin` file to be runnable
114+
bin/comparison-javalin
115+
## Open http://localhost:8080/comparison/ in your favorite browser.
116+
```
117+
118+
## Configuration
119+
You can adjust settings in `/src/main/resources/application.conf`. Specify relative/absolute path to license file by setting `licensePath` value in `/src/main/resources/application.conf` or by setting up `LIC_PATH` environment variable
120+
121+
### Comparison configuration options
122+
123+
| Option | Type | Default value | Description |
124+
|------------------------| ------- |:---------------------:|:---------------------------------------------------------------------------------------------------------------------|
125+
| **`filesDirectory`** | String | `DocumentSamples` | Files directory path. Indicates where uploaded and predefined files are stored. It can be absolute or relative path |
126+
| **`tempDirectory`** | String | system temp directory | Absolute or relative path to directory to save temporary files |
127+
| **`resultDirectory`** | String | `ResultFiles` | Result files directory path. Directory must be created before app starts |
128+
129+
## License
130+
The MIT License (MIT).
131+
132+
Please have a look at the LICENSE.md for more details
133+
134+
## GroupDocs Comparison on other platforms & frameworks
135+
136+
- [Compare documents](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/tree/master/Demos/Compose) with Kotlin in Compose Desktop application
137+
- [Compare documents](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/tree/master/Demos/Dropwizard) with JAVA Dropwizard
138+
- [Compare documents](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/tree/master/Demos/Ktor) with Ktor application
139+
- [Compare documents](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java/tree/master/Demos/Spring) with Spring application
140+
- [Compare documents](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET-MVC) with .NET MVC
141+
- [Compare documents](https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-.NET-WebForms) with .NET WebForms
142+
143+
144+
[Home](https://www.groupdocs.com/) | [Product Page](https://products.groupdocs.com/comparison/java) | [Documentation](https://docs.groupdocs.com/comparison/java/) | [Demos](https://products.groupdocs.app/comparison/family) | [API Reference](https://apireference.groupdocs.com/java/comparison) | [Examples](https://github.com/groupdocs-comparison/GroupDocs.comparison-for-Java/tree/master/Examples) | [Blog](https://blog.groupdocs.com/category/comparison/) | [Free Support](https://forum.groupdocs.com/c/comparison) | [Temporary License](https://purchase.groupdocs.com/temporary-license)

Demos/Javalin/build.gradle.kts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
val kotlin_version: String by project
2+
val koin_version: String by project
3+
val logback_version: String by project
4+
5+
plugins {
6+
application
7+
kotlin("jvm") version "1.6.21"
8+
id("org.jetbrains.kotlin.plugin.serialization") version "1.6.21"
9+
}
10+
11+
group = "com.groupdocs.ui"
12+
version = "22.3"
13+
14+
repositories {
15+
mavenCentral()
16+
maven("https://repository.groupdocs.com/repo/")
17+
}
18+
19+
application {
20+
mainClass.set("com.groupdocs.ui.ApplicationKt")
21+
}
22+
23+
tasks {
24+
create("stage").dependsOn("installDist")
25+
}
26+
27+
dependencies {
28+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
29+
30+
implementation("com.groupdocs:groupdocs-comparison:$version")
31+
32+
implementation("io.insert-koin:koin-core:$koin_version")
33+
34+
implementation("io.javalin:javalin:4.6.1")
35+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3")
36+
implementation("io.github.config4k:config4k:0.4.2")
37+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2")
38+
39+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.3.3")
40+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-hocon:1.3.3")
41+
42+
implementation("org.slf4j:slf4j-simple:1.7.36")
43+
// implementation("ch.qos.logback:logback-classic:$logback_version")
44+
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
45+
}

Demos/Javalin/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kotlin_version=1.6.21
2+
koin_version=3.2.0
3+
logback_version=1.2.11
4+
kotlin.code.style=official
58.4 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)