Skip to content

Commit d67389c

Browse files
Fixed few bugs
1 parent 0e7dcdb commit d67389c

9 files changed

Lines changed: 34 additions & 8 deletions

File tree

Demos/Dropwizard/src/main/java/com/groupdocs/ui/comparison/dropwizard/resources/ComparisonResources.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ public ComparisonResources(GlobalConfiguration globalConfiguration) throws Unkno
100100
}
101101
}
102102

103+
@GET
104+
@Path(value = "/app-name")
105+
public String appName() {
106+
return "comparison-dropwizard";
107+
}
108+
103109
@GET
104110
@Path(value = "/loadConfig")
105111
@Produces(APPLICATION_JSON)

Demos/Javalin/src/main/kotlin/com/groupdocs/ui/modules/home/HomeModule.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ fun Javalin.homeModule() {
99
ctx.result(it)
1010
}
1111
}
12+
13+
get("/comparison/app-name") { ctx ->
14+
ctx.result("comparison-javalin")
15+
}
1216
}

Demos/Ktor/src/main/kotlin/com/groupdocs/ui/modules/RootModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ import io.ktor.server.routing.*
88
fun Routing.rootModule() {
99

1010
get("/") {
11-
call.respondRedirect("/comparison")
11+
call.respondRedirect("/comparison/")
1212
}
1313
}

Demos/Ktor/src/main/kotlin/com/groupdocs/ui/modules/compare/CompareController.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class CompareControllerImpl(
9191
comparisonAction = changeInfo.comparisonAction,
9292
sourceText = changeInfo.sourceText,
9393
targetText = changeInfo.targetText,
94-
text = changeInfo.text,
94+
text = changeInfo.text ?: "",
9595
componentType = changeInfo.componentType,
9696
box = ChangeBox(
9797
x = changeInfo.box.x,
@@ -105,13 +105,13 @@ class CompareControllerImpl(
105105
width = changeInfo.pageInfo.width,
106106
height = changeInfo.pageInfo.height
107107
),
108-
styleChanges = changeInfo.styleChanges.map { styleChangeInfo ->
108+
styleChanges = changeInfo.styleChanges?.map { styleChangeInfo ->
109109
StyleChange(
110110
propertyName = styleChangeInfo.propertyName,
111111
oldValue = styleChangeInfo.oldValue,
112112
newValue = styleChangeInfo.newValue
113113
)
114-
}
114+
} ?: listOf()
115115
)
116116
}
117117

Demos/Ktor/src/main/kotlin/com/groupdocs/ui/modules/download/DownloadModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import java.nio.file.Paths
1212
fun Route.downloadModule() {
1313
val downloadController by inject<DownloadController>()
1414

15-
get("/downloadDocument/") {
15+
get("/downloadDocument") {
1616
call.parameters["guid"]?.let { guid ->
1717
val guidAsPath = Paths.get(guid)
1818
call.response.headers.apply {

Demos/Ktor/src/main/kotlin/com/groupdocs/ui/modules/home/HomeModule.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@ package com.groupdocs.ui.modules.home
22

33
import io.ktor.server.application.*
44
import io.ktor.server.html.*
5+
import io.ktor.server.response.*
56
import io.ktor.server.routing.*
67

78

89
fun Route.homeModule() {
9-
route("") {
10+
route("/") {
1011
get {
1112
call.respondHtmlTemplate(HomeTemplate()) {
1213
pageTitle {
13-
+"GroupDocs.Comparison for Java Spring"
14+
+"GroupDocs.Comparison for Java Ktor"
1415
}
1516
}
1617
}
1718
}
19+
20+
get("/app-name") {
21+
call.respondText("comparison-ktor")
22+
}
1823
}

Demos/Micronaut/src/main/kotlin/com/groupdocs/ui/modules/compare/CompareBean.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class CompareBeanImpl(
103103
comparisonAction = changeInfo.comparisonAction,
104104
sourceText = changeInfo.sourceText,
105105
targetText = changeInfo.targetText,
106-
text = changeInfo.text,
106+
text = changeInfo.text ?: "",
107107
componentType = changeInfo.componentType,
108108
box = ChangeBox(
109109
x = changeInfo.box.x,

Demos/Micronaut/src/main/kotlin/com/groupdocs/ui/modules/home/HomeController.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ class HomeController(
3030
setGroupdocsLicense(licensePath)
3131
}
3232
}
33+
34+
@Get("/comparison/app-name")
35+
fun appName(): HttpResponse<String> {
36+
return HttpResponse.ok("comparison-micronaut")
37+
}
3338
}

Demos/Spring/src/main/java/com/groupdocs/ui/comparison/spring/resources/ComparisonResources.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ public void init() {
8181
}
8282
}
8383

84+
@RequestMapping(method = RequestMethod.GET, value = "/app-name")
85+
@ResponseBody
86+
public String appName() {
87+
return "comparison-spring";
88+
}
89+
8490
@RequestMapping(method = RequestMethod.GET, value = "/loadConfig", produces = APPLICATION_JSON_VALUE)
8591
@ResponseBody
8692
public ComparisonConfigurationModel loadConfig() {

0 commit comments

Comments
 (0)