Skip to main content

Posts

Enforce Anchor Target TBB

This week's TBB is Enforce Anchor Target TBB . The functionality is to enforce a 'system-wide' anchor target policy. Namely, any fully qualified URLs should open in a new ( _blank ) target browser window. All other (relative) URLs should open in the same target. More specifically, if there is a target specified for a relative URL, remove it. Name Enforce Anchor Target TBB Type ·     Template in .NET Assembly Description Used to: ·     Enforces a certain “ target ” attribute for the anchor tags depending on their “ href ” attribute value; Notes: This generic TBB expects an Item called “Output” in the Package. It parses the Output looking for anchor <a> tags. If the anchor’s “ href ” attribute is a fully qualified URL (starts with “ http:// ” or “ https:// ”), then it adds/replaces “ target ” attribute with value “ _blank ”. Otherwise, it removes the “ target ” attribute, if...

A Core Service Java Client

I have seen many times the creation of a .NET client for SDL Tridion's Core Service, but not once a Java client. In .NET / Visual Studio is extremely easy to create the proxy classes based on the service's WSDL. So how hard can it be in Java? The entire code in this example is available in my Google Code project . Which Tool? Doing a bit of research on the multiple ways of creating Java proxy classes for web services left me quite confused as to which framework / utility to use. They are quite a few (AXIS, JAXB, Apache CXF, XFire, NetBeans plugin, IDEA plugin, Eclipse plugin, etc). They seemed to be cumbersome to use, too specific, limited, quirky, buggy, etc. What I wanted was a simple generic too that worked. Enter wsimport.exe ... Generating the Proxies Note: Check out the update post available here  http://yatb.mitza.net/2012/12/java-core-service-trouble-with-datetime.html Wsimport.exe is part of the JDK (mine is located in C:\Progrm Files\Java\jdk1.6.0_33\bin ),...

Executing an ITemplate Inside a JAR TBB

In this post I'll talk a bit about the next functionality of my Java Mediator for SDL Tridion templating -- uploading a JAR containing ITemplate classes into the Content Manager and executing a particular template. JAR Template Building Blocks In a very similar fashion to a .net assembly TBB, I implemented the functionality of having a new Template type for storing JARs inside a TBB, in a binary fashion. These TBBs have a special type, binary, that allows uploading a JAR. A JAR TBB contains Java classes, some of them representing implementations of the ITemplate interface. The actual interface is the TOM.Java proxy tridion.contentmanager.templating.assembly.ITemplate . I created a new Template type in configuration file Tridion.ContentManager.config , under node  < configuration > / < templateTypeRegistry > / < templateTypes > : < add id = " 10 " name = " JAR TBB " mimeType = " application/java-archive " hasBinar...