Skip to main content
Version: 2022.4

Server Tooling - Code snippets

The following code snippets can be imported into IntelliJ to speed up repetitive development tasks, mainly around the declaration of Genesis scripts and configuration.

To import the below live templates, download the Genesis settings.zip file and import this into your IDE. This can be done by selecting File > Manage IDE Settings > Import Settings.

Fields, Tables and Views

Shortcut Snippet
fld
field(name = "$NAME$", type = $TYPE$)
nfld
field(name = "$NAME$", type = $TYPE$, nullable = true)
tbl
table(name = "$NAME$", id = $ID$) {
primaryKey { }
}
vw
view("$NAME$", $TYPE$) {
joins { }
fields { }
}

Server modules

Shortcut Component Snippet
cslConsolidator
consolidator($LISTEN_TABLE$, $AGGREGATION_TABLE$) {
select { }
groupBy { }
where { }
}
dpcsvData Pipeline
csvSource("") {
location = ""
delimiter = ','
hasHeader = true

map("", $TABLE$) {
where { true }
}
}
ehdlEvent Handler
eventHandler<$TYPE$>("$NAME$") {
onCommit { event ->

ack()
}
}
dpjsonData Pipeline
jsonSource("") {
location = ""

map("", $TABLE$) {
where { true }
}
}
dpmssqlData Pipeline
msSqlSource("") {
hostname = ""
port = 1433
username = ""
password = ""
databaseName = ""

table {
}
}
dporacleData Pipeline
oracleSource("") {
hostname = ""
port = 1433
username = ""
password = ""
databaseName = ""

table {
}
}
dppsqlData Pipeline
postgresSource("") {
hostname = ""
port = 5432
username = ""
password = ""
databaseName = ""

table {
}
}
dpxmlData Pipeline
xmlSource("") {
location = ""
tagName = ""

map("", $TABLE$) {
where { true }
}
}

Runtime configuration

Shortcut Snippet
prcs
<process name="$NAME$">
<groupId>$GROUP$</groupId>
<start>true</start>
<options>-Xmx256m -DRedirectStreamsToLog=true -DXSD_VALIDATE=false</options>
<module>$MODULE$</module>
<package>$PACKAGE$</package>
<script>$SCRIPT$</script>
<description>$DESCRIPTION$</description>
<classpath>$CLASS_PATH$</classpath>
<language>pal</language>
</process>

Define and tweak snippets

You can define and tweak Genesis snippets within your JetBrains products. To do so, open the settings for your IDE of choice and search for Live Templates.

Do you have some super fancy snippets that you think colleagues and the Genesis community could benefit from? Get in touch and we can add them to the official settings distribution!