Skip to main content

Posts

Showing posts with the label Extension

sdl-healthcheck as Windows Service

This post describes how to convert the 'sdl-healthcheck' application to a Windows Service. SDL-healthcheck is a Java application that creates a webservice around the SDL Web microservices in order to provide monitoring (heart beat) checks on them. Mark van der Wal wrote the application and provided startup and stop Shell scripts. My requirement was to have the same application installable and executable as Windows Service. Therefore, I had to wrap the Java application inside a service container and provide start, stop hooks for the service. I know that SDL Web Content Delivery microservices are also Java applications using Spring Boot, so my approach was to use the same mechanism to make the Java application run as Windows Service. The service container used is 'procrun.exe' daemon from Apache Commons . Depending on the arguments passed to it, it can perform different Windows Service functionality such as install, remove service, start/stop service. I ended ...

Usage and Configuration of the .NET Cache Invalidation Callback

In the previous post, I described a way to intercept in .NET cache invalidate events generated in Java. This post presents the way to configure, use and write your own code that handles the Java generated invalidate events. The entire code presented here is available on this blog's GIT repository. Link here . Java Stuff Modify your cd_storage_conf.xml (located in your .net website /bin/conf folder), and reference class com.tridion.cache.DD4TDependencyTracker as the Feature inside node ObjectCache : <Configuration Version= "7.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "schemas/cd_storage_conf.xsd" > <Global> <ObjectCache Enabled= "true" > <Policy Type= "LRU" Class= "com.tridion.cache.LRUPolicy" > <Param Name= "MemSize" Value= "512mb" /> </Policy> ...

.Net Callback from Java Cache Invalidate Message

The problem this post solves is as follows: the Content Delivery API has a mechanism called Cache Decorator, which allows the implementor to define custom code that will be called when things are added/removed/flushed from the internal Tridion Broker Cache. This mechanism allows external actors to interact and synchronize with the Tridion Broker Cache. Namely, a DD4T cache should listen to Tridion Broker Cache messages in order to invalidate its own entries. In Java world, this is simply implemented by extending the CacheDecorator Tridion class. However, in a .NET environment, there is no easy way of intercepting Java method execution back in .NET. This is precisely what this post describes. In a .NET architecture, the Tridion Content Delivery API runs as a Java byte code embedded inside the .NET runtime inside IIS worker process. Communication between .NET and Java happens using a standard called JNI (Java Native Interfaces). Namely the .NET runtime calls Java code that is mapped ...

Deployer Extension - Handle Binary Unpublish

In case you have written any SDL Tridion Content Delivery Deployer extensions, you have noticed there is no easy way in intercepting the unpublish/undeploy of a binary. This blog post shows how to intercept such an action and execute your custom code on it. The reason why it is hard to intercept a binary undeploy is because in fact the binary remove does not happen at Deployer level; rather, it takes place in the storage level. So the extension point to be used in not a Deployer extension, but a storage FileSystem or JPA extension. File System The following code implements a storage extension that intercepts the removal of a binary from the File System Content Data Storage (fka the File system broker): package com . tridion . storage . toolkit ; @Component ( "FSBinaryDAOExtension" ) @Scope ( "prototype" ) public class FSBinaryDAOExtension extends FSBinaryContentDAO implements BinaryContentDAO { @Override public void remove ( int publ...

Maven Release Plugin

This post describes the installation and usage of the Maven Release Plugin. The plugin uses behind the scene a GIT repository configured in the SCM (Source Code Management) section of the POM (Project Object Model). In your project's main pom.xml , add the following plugin inside you build / pluginManagement / plugins node. <plugin> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-release-plugin </artifactId> <version> 2.5.3 </version> <configuration> <goals> deploy </goals> <autoVersionSubmodules> true </autoVersionSubmodules> </configuration> <dependencies> <dependency> <groupId> org.apache.maven.scm </groupId> <artifactId> maven-scm-api </artifactId> <version> 1.8.1 </version> </dependency> <dependency> ...

CAS Single Sign-On Integration

The Concept In this post I'll explain how to integrate CAS ( Central Authentication Service ) with Tridion Content Manager. This is a back-end integration, which will allow users with a CAS login access Tridion Content Manager GUI and other back-end modules (e.g. Template Builder, Content Porter, etc) using their CAS login. Explaining the inner workings of CAS is not in the scope of this post (have a look at this wiki for more information ). Also a familiarity with Tridion SSO is recommended, but not necessary. I think the documentation does a good job explaining the basics of SSO and Tridion and how to enable/configure it. Check it out on here (login required). In a nutshell, this is how single sign-on works with Tridion back-end: SSO software authenticates a user and places the login and user name in a request header that is forwarded to Tridion; Tridion GUI (the web application) reads this user name and login and authorizes the user against the Tridion users in the Con...

Yet Another Event System?

In my 9 years of consulting and implementing Tridion, I never wrote the same code twice... Kudos, Tridion -- you awesome beast! But every now and then I find myself needing the same low level handlers and I end up copy pasting them from somewhere. For example, with Event Systems I always prefer putting the configuration in a System Component in Tridion. I put it maybe in the current Publication metadata or current Folder/Structure Group meta. I always end up writing the same code to handle the reading of this Component, checking for modifications, caching it for a few minutes, then making the configuration values available inside some object model. Recently, this annoyed me enough to write an Event System base-project that takes care of this once and for all... Enter the Yet Another Event System framework. Functional requirements: Rapid development -- provide a base ready to be used in actual Event System development System Component is in free format -- provide a consistent A...

Function Support for Queries in OData Extension

In a previous post I was talking about the  URL Syntax for OData Query Extension . In the current installment, I will present an enhancement to the URL  $filter  option parser that will allow us to use custom functions. These functions will give us even more possibilities to specify Criterias in RESTful URLs. The new version is available as JAR distributable ( odata-query-extension-1.2.jar ) and also as source code . One of the limitations in the previous OData Query Extension parser was the inability to specify the CustomMetaValue and CustomMetaKey criteria, as they pretty much need to appear nested in one-another: CustomMetaValue(CustomMetaKey(theKey), theValue[, operator]) Another tricky point are the criterias that accept several parameters, such as TaxonomyKeywordName(publicationId, taxonomyId, keywordName, includeBranches, operator) Therefore, I enhanced the parser logic to allow functions in the following syntax: function(parameter [, field_operato...

URL Syntax for OData Query Extension

In my previous article  Extending OData Query Functionality , I explained an extension mechanism for the Content Delivery Web Service with the goal of having more robust capabilities of querying for content than the out-of-the-box OData service offers. Please read that article first, in order to understand the context, goal and approach. This article follows up on the previous concepts and explains the URL syntax, grammar, and URL parameters accepted by the OData Query Extension. Link to source code and distributable JAR available ( odata-query-extension-1.1.jar ). Query Entity Collections QueryComponents Retrieves Component entities. The query API is applied to Components, only (item type = 16). /odata.svc/QueryComponents QueryComponentPresentations Retrieves  ComponentPresenation  entities. The query API is applied to Components, only (item type = 16), yet the results of the query are used to build Dynamic Component Presentations. /odata.svc/Quer...