Skip to main content

Posts

Showing posts with the label Tridion 2013GA

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...

Simple XML/XSLT Breadcrumb

This post presents an example on how to transform a navigation XML with a parameterized XSLT in order to produce a simple breadcrumb. Navigation XML The navigation XML is produced using one of the TBBs described in earlier posts: Generate Structure Group Navigation - Recursive TBB ; Generate Structure Group Navigation - GetItems TBB ; Generate Structure Group Navigation - Reorder TBB ;  Navigation XML format: <tcm:ListItems  ID="tcm:1-1-4" Title="Root" >   <tcm:Item ID="tcm:1-2-4" Title="010 About Us" DisplayTitle="About Us" Url="/about-us">     < tcm:Item ID="tcm:1-3-64" Title="010 Who are we?" DisplayTitle="Who are we?" Url="/about-us/who-are-we.html"/ >   </tcm:Item>   < tcm:Item ID="tcm:1-4-64" Title="020 Contact Us" DisplayTitle="Contact Us" Url="/contact-us.html"/ > </tcm:ListItems> Bread...

Simple XML/XSLT Navigation

This post presents an example on how to transform a navigation XML with a parameterized XSLT in order to produce a simple site navigation. Navigation XML The navigation XML is produced using one of the TBBs described in my earlier posts: Generate Structure Group Navigation - Recursive TBB ; Generate Structure Group Navigation - GetItems TBB ; Generate Structure Group Navigation - Reorder TBB ;  Navigation XML format: <tcm:ListItems  ID="tcm:1-1-4" Title="Root" >   <tcm:Item ID="tcm:1-2-4" Title="010 About Us" DisplayTitle="About Us" Url="/about-us">     < tcm:Item ID="tcm:1-3-64" Title="010 Who are we?" DisplayTitle="Who are we?" Url="/about-us/who-are-we.html"/ >   </tcm:Item>   < tcm:Item ID="tcm:1-4-64" Title="020 Contact Us" DisplayTitle="Contact Us" Url="/contact-us.html"/ > </tcm:ListItems>...

.GetItems() Slower than .GetListItems() - Is It Not?

An old-school Tridion best practice says " whenever possible try to use GetListItems over GetItems due to significant performance degradation on the latter ". Now that might have been very well possible on the old TOM (Tridion Object Model). But is it still the case with TOM.NET? Let's see... In my previous three posts, I have been playing with several ways of generating navigation XML based on Structure Groups and Pages: Generate Structure Group Navigation - GetItems TBB  - gets all SGs and Pages in one call to .GetItems() using a filter with Recursive=true . It then iterates the list of objects and creates an XML document using the hierarchy given by the items' OrganizationalItem property; Generate Structure Group Navigation - Reorder TBB - gets all SGs and Pages in one call to .GetListItems() using a filter with Recursive=true . It then iterates the flat XML, instantiates SG and Page objects using the Engine.GetObject() method, and uses the .Organizationa...

Generate Structure Group Navigation - Recursive TBB

This TBB Generates an XML containing all Structure Groups and Pages whose title abides to a naming convention, in hierarchical structure. The naming convention is given by regular expression (e.g. title starts with 3 digits followed by underscore or space). This TBB is available on my Google Code project yet-another-tridion-blog / Template Repository  (file / PT / Navigation / GenerateStructureGroupNavigationRecursive.cs ). Description Name Generate Structure Group Navigation Reorder TBB Type ·     Template in .NET Assembly Description Used to: ·    Generate navigation XML; Notes: This TBB reads the Publication's Root Structure Group and retrieves all child SGs and Pages using the .GetListItems() method in a recursive way. The template retrieves the SG/Pages directly under the given SG and it then iterates each node, invoking a recursive step for each SG it encounters, thus ensuring the entire hierarchical structure is...

Generate Structure Group Navigation - Reorder TBB

This TBB Generates an XML containing all Structure Groups and Pages whose title abides to a naming convention, in hierarchical structure. The naming convention is given by regular expression (e.g. title starts with 3 digits followed by underscore or space). This TBB is available on my Google Code project yet-another-tridion-blog / Template Repository  (file / PT / Navigation / GenerateStructureGroupNavigationReorder.cs ). Description Name Generate Structure Group Navigation Reorder TBB Type ·     Template in .NET Assembly Description Used to: ·    Generate navigation XML; Notes: This TBB reads the Publication's Root Structure Group and retrieves all child SGs and Pages using the .GetListItems() method. The template reorders each node in the retrieved XML and it places it in a hierarchical structure that matches the SG/Page nesting. Each SG object is represented as a  tcm:Item  node that has potential sub-nod...

Generate Structure Group Navigation - GetItems TBB

This TBB Generates an XML containing all Structure Groups and Pages whose title abides to a naming convention, in hierarchical structure. The naming convention is given by regular expression (e.g. title starts with 3 digits followed by underscore or space). This TBB is available on my Google Code project yet-another-tridion-blog / Template Repository  (file / PT / Navigation / GenerateStructureGroupNavigationGetItems.cs ). Description Name Generate Structure Group Navigation GetItems TBB Type ·     Template in .NET Assembly Description Used to: ·    Generate navigation XML; Notes: This TBB reads the Publication's Root Structure Group and retrieves all child SGs and Pages using the .GetItems() method. It creates an XmlDocument object and start building its nodes. Each SG object is represented as a  tcm:Item  node that has potential sub-nodes (other SGs and Pages). The Page objects are represented also as tcm:...