JDriven Blog

Awesome Asciidoctor: Use Counters in Markup

Posted on by  
Hubert Klein Ikkink

In Asciidoctor we can create a document attribute as a counter attribute. The attribute is automatically incremented each time we use it in our markup. We can choose to use numbers or characters. Only latin characters from 'a' to 'z' or 'A' to 'Z' are allowed. By default the counter will start at 1, but we can define another start value when we use the counter attribute for the first time.

To define a counter attribute we must prefix the attribute name with counter:. Each time we use this syntax with the counter: prefix the value is incremented and displayed. To only display the current value, without incrementing, we simply refer to the document attribute without the counter: prefix. For example if we want to add a counter attribute with the name steps we would use the following markup in Asciidoctor: {counter:steps}.

Continue reading →

Integrate Angular in Spring Boot with Gradle

Posted on by  
Willem Cheizoo

Having a Angular HTML5 single page application and a Spring Boot application, we would like to serve the complete Angular app from Spring Boot. This blog shows you a couple simple steps to get everything up and running: run NPM from Gradle, integrate the Gradle frontend build in the main build and support HTML5 mode in the ResourceHandler of Spring Boot.

Create a subdirectory called frontend with the frontend code and build scripts (webpack, npm). Let's assume our npm start and npm run watch output to the /frontend/dist/ directory. First we need to make sure the frontend code is build when we run gradle build on our project. We can use the plugin gradle-node-plugin for this. Go ahead and create a /frontend/build.gradle file.

Continue reading →

Caching HTTP requests in AngularJS

Posted on by  
Niels Dommerholt

In AngularJS, especially when you’re using a 'modern' Web Component like approach, you often have directives request the same information from your services multiple times. Since we’d rather not do round-trips we don’t need to to save on server resources caching is our go-to solution. In this post I will show two different approaches to caching resources: the built-in angular way using $resource and a home-grown solution.

Original post

Continue reading →

Gradle Goodness: Change Gradle Wrapper Script Name

Posted on by  
Hubert Klein Ikkink

With the Gradle Wrapper task we can specify the name of the generated script files. By default the names are gradlew and gradlew.bat. The Wrapper task has the property scriptFile. We can set a different value for this property to let Gradle generate the script files with a different name.

In the following example we use the value mvnw (they will be surprised the build is so fast... ;-)) as the value:

Continue reading →

Baking a Blog

Posted on by  
Niels Dommerholt

One of my 2015 New Year’s resolutions was to finally turn my "I should write about this" notes into actual writing. So here we are! My first ever blog post! One of the things holding me back when it came to creating a blog is picking one of the many available blog frameworks, there’s just too many to choose from!  I wanted something that’s easy to use and easy to back-up. Original post

Just this week I ran into JBake completely by accident (we were working with GVM and I just clicked all the links I didn’t know on that page to see what it was about). Before I hadn’t even thought of using a static blog genererator but when I started reading about it, it made perfect sense!

Continue reading →

Gradle Goodness: Lazy Project Property Evaluation

Posted on by  
Hubert Klein Ikkink

Sometime we need to define a project property in our Gradle build file for which the value must be evaluated later than the assignment. We can do this in different ways in Gradle. For example for a String type property we can rely on Groovy's support for lazy String evaluation. If the property is of a different type we can use Closure to define the value. The Closure code is not executed during the configuration phase directly, but we can write code to invoke the Closure at the right moment and get the value. Finally we can use the afterEvaluate method of the Project class to define a lazy property. Let's look at the different options we have with some code samples.

First we look at a lazy String property. We illustrate this with an example of a multi-project build with the following layout:

Continue reading →

Het ontstaan van de passie voor het moderne maken

Posted on by  
Rob Brinkman

Als JDriven ervaren we elke dag hoe schaars het talent is dat nodig is om onze klanten optimaal te ondersteunen. Deels omdat we op zoek zijn naar echte specialisten maar vooral omdat we verwachten dat collega’s een passie hebben voor hun vak en erg gemotiveerd zijn om mooie dingen te maken. Deze passie is voor ons essentieel en wat mij betreft is dit de basis van succesvol software ontwikkelen oftewel het moderne maken. Het ontwikkelen van een specialisme vergt tijd. Het vindt eigenlijk pas plaats tijdens een studie en wordt continu ontwikkeld tijdens je verdere carrière. Maar de passie voor het vak, dat wat mijn collega’s uniek maakt, wordt al veel eerder gelegd. Zonder uitzondering blijkt het ontstaan van deze passie te herleiden naar één of twee toevallige gebeurtenissen in hun jeugd: een ouder met een passie voor electronica, een vriendje (of vriendinnetje) met een computer etc..

Zelf heb ik het geluk gehad dat ik ook als kind de passie voor het maken heb mee gekregen. Door mijn opa al timmerend aan het werk te zien; een speelgoed tractor, een bed, een klimrek. Daarna werd het al snel mee timmeren en samen een vogelhuisje maken. Toen er via het werk van mijn vader een computer bij ons in huis kwam kreeg ik de kans om met het moderne maken in aanraking te komen. Samen met mijn vader de eerste programma’s schrijven zoals een muziekspeler, een spelletje en een catalogus om mijn muziek-verzameling in vast te leggen. De optelsom van deze ervaringen is van grote invloed geweest op mijn toekomst. Niet omdat ik destijds uitstekend heb leren programmeren, maar omdat mijn passie voor het vak daar is ontstaan en ik me op basis van die passie verder heb kunnen en mogen ontwikkelen.

Continue reading →

shadow-left