Skip to main content

Posts

Binary Link Samples

Binary links using custom tags < p > Custom tag Binary link: < tridion:BinaryLink binaryURI = "tcm:83-3247" linkText = "Click me" textOnFail = "true" anchor = "" linkAttributes = "" /></ p > Binary links using Java objects <%       BinaryLink binaryLink = new BinaryLink(83);       String linkAsString = binaryLink.getLinkAsString( "tcm:83-3247" , "" , "Click Me" , "" , true );       out.write( "<p>Binary link: " + linkAsString + "</p>" );       Link link = binaryLink.getLink( "tcm:83-3247" , "" ,  "" , "" , false );       if (link.isResolved()) {             out.write( "Binary link resolved: " + link.getURL());       } else {             out.write( "Binary lin...

Page Link Samples

Page link using custom tags < p > Custom tag Page link: < tridion:PageLink pageURI = "tcm:83-3242-64" linkText = "Click me" textOnFail = "true" anchor = "" linkAttributes = "" /></ p > Page link using Java objects       <%             PageLink pageLink = new PageLink(83);             String linkAsString = pageLink.getLinkAsString(3242, "" , "" , "Click Me" , true );             out.write( "<p>Page link: " + linkAsString + "</p>" );             Link link = pageLink.getLink(3242);             if (link.isResolved()) {                   out.write( ...

Component Link Samples

Component link using Tridion custom tags                           i.       Modify web.xml to make a reference to cd_tags.tld                         ii.       Copy cd_tags.tdl to WEB-INF/lib                       iii.       Create JSP file link1.jsp                       iv.       Add tag declaration in the top of file: <%@ taglib uri = "cd_tags" prefix = "tridion" %>          ...

Debugging a Tridion 2011 Event System

OK, so you wrote your Tridion Event System. Now it's time to debug it. I know this is a hypothetical situtation -- your code never needs any kind of debugging ;) but indulge me... Recently, Alvin Reyes ( @nivlong ) blogged about being difficult to know how exactly to debug a Tridion Event System. More exactly, the question was " What process do I attach to for debugging even system code? ". Unfortunately, there is no simple or generic answer for it. Different events are fired by different Tridion CM modules. These modules run as different programs (or services) or run inside other programs (e.g. IIS). This means that you will need to monitor (or debug) different processes, based on which events your code handles. So the usual suspects are: dllhost.exe (or dllhost3g.exe ) - running as the MTSUser is the SDL Tridion Content Manager COM+ application and it fires events on generic TOM objects (e.g. events based on Tridion.ContentManager.Extensibility.Events.CrudEven...

Core Service Client Sample Code

[ This post presents a .NET client for Core Service. If you are looking for a Java client for Core Service, have a look at A Core Service Java Client  ] Let me start by saying this topic is not new, but because it is pretty cool technology, I thought I would also give a sample on it. In Tridion 2011GA, you could create a Core Service client by going to Visual Studio and Add Service Reference... in your project's References. This would generate proxy classes on the "Core Service" Web Service. In Tridion 2011 SP1, you no longer need to generate these classes, as they are already available in a DLL (namely %TRIDION_HOME%\bin\client\Tridion.ContentManager.CoreService.Client.dll ). In a normal scenario, one would need the Core Service configuration endpoints (from %TRIDION_HOME%\bin\client\Tridion.ContentManager.CoreService.Client.dll.config ) be available to the client's runtime (either in app.config or web.config or some dll.config). Alternatively though, we can ...

Capturing A User's Last Login Date Into The CME

Requirement: Indentify a user's last login date into the CME and store it for the purpose of later creating a report with different users and their last login date. This post only covers the storing of a last login and not the report itself. There are several ways of intercepting the when a user logs in: HTTP Module Global.asax Event System I tried the Global.asax and event system approaches with more or less success. I did not try the HTTP Module, which I believe would work the best. For storing the last login date, I used Application Data on the User object. 1. HTTP Module The idea is to write a HTTP Module that intercepts each request made to the CME. The module would check if the session has just been initiated, and if so, it would store the current DateTime in the current User object as AppData. One could get the User object by using the Core Service. 2. Global.asax First of all, this approach doesn't really work :-( The idea is to intercept the session...