-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
145 additions
and
96 deletions.
There are no files selected for viewing
54 changes: 27 additions & 27 deletions
54
home/src/main/java/org/dominokit/domino/home/client/views/ui/HomeViewImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"http.port": 8090 | ||
"http.port": 8090, | ||
"app.root.path": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...ain/java/org/dominokit/domino/uidemoserver/server/resources/DynamicIndexPageProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.dominokit.domino.uidemoserver.server.resources; | ||
|
||
import com.google.auto.service.AutoService; | ||
import io.vertx.core.http.HttpServerResponse; | ||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.ext.web.RoutingContext; | ||
import io.vertx.ext.web.templ.freemarker.FreeMarkerTemplateEngine; | ||
import org.dominokit.domino.api.server.PluginContext; | ||
import org.dominokit.domino.api.server.plugins.IndexPageProvider; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
@AutoService(IndexPageProvider.class) | ||
public class DynamicIndexPageProvider implements IndexPageProvider { | ||
|
||
public static final Logger LOGGER = LoggerFactory.getLogger(DynamicIndexPageProvider.class); | ||
private final JsonObject engineContext = new JsonObject(); | ||
|
||
public DynamicIndexPageProvider(JsonObject engineContext) { | ||
this.engineContext.mergeIn(engineContext); | ||
} | ||
|
||
@Override | ||
public HttpServerResponse serveIndexPage(PluginContext context, RoutingContext routingContext, int statusCode) { | ||
LOGGER.info("Loading index page using dynamic index page loader..."); | ||
FreeMarkerTemplateEngine engine = FreeMarkerTemplateEngine.create(context.getVertx()); | ||
|
||
HttpServerResponse response = routingContext | ||
.response() | ||
.setStatusCode(statusCode) | ||
.putHeader("Content-type", "text/html"); | ||
|
||
engine.render(engineContext | ||
, "templates/index.ftl", processedTemplate -> { | ||
if(processedTemplate.succeeded()) { | ||
String content = processedTemplate.result().toString(); | ||
response.putHeader("Content-length", content.length() + "") | ||
.write(content); | ||
response.end(); | ||
}else{ | ||
response.end(); | ||
LOGGER.error("failed to process index page template : ", processedTemplate.cause()); | ||
} | ||
}); | ||
|
||
return response; | ||
} | ||
|
||
} |
Oops, something went wrong.