Content Delivery Multi-Value Custom-Meta Querying

vennDiagramIntroduction

I was recently working on a Content Delivery syndication piece for a client so that they could pull various components of varying schema’s based on a variety of metadata values. The client requested that they be able to pass in a list of metadata keys, with each key having an accompanying list of meta-values to be searched on. Continue reading

Deployer output directories & storage configuration

Content Delivery StorageI recently set up a new SDL Tridion publishing environment where a single Content Deployer was used to publish a number of different publications to different broker databases, but to the same location within a web hosting environment.  In doing so I discovered something I wasn’t aware of and though it might be worth sharing with the community.

Continue reading

OData – How to Query Multiple Custom Metas

On a recent implementation, a large site fully driven by OData, we ran into a scenario where we wanted to retrieve DCPs based on multiple custom metadata values. We quickly realized that there are some limitations around this. For instance: a component with the following custom meta fields, color and shape, having values ‘blue’ and ‘round’ respectively cannot be retrieved in one OData call. This is because each CustomMetas Key/Value is exposed as a separate entry in the CustomMetas collection, and the OData protocol is limited – doesn’t allow querying across properties of multiple entries (not as an AND at least). However, if there is a will there is a way, and in the article I will show an approach to doing so.

Contents:

Continue reading

Tridion Search Engine Integration – Stop re-inventing the wheel

On a recent project, it was required to do a quick integration between Tridion and a search engine (in this case Solr). We needed to push content directly in the index, rather than using a crawling approach, and there were a couple of simple search interfaces, including the ubiquitous one-box search to integrate in the web application.

Sound familiar? It may well do… almost every Tridion project requires integration with some kind of search engine, and I have to confess I am guilty of re-inventing the wheel most of the time, hacking some code from the previous project around to create something that suits the requirement of the next project

This time I thought, lets do it differently – wouldn’t it be great if there was a generic framework for search integration, that could be used on any Tridion Search Engine integration project, which you could configure/extend (controlled hacking!) as required for the particular project requirements?

Raimond Kempees and I have created that framework as an open source project and presented it at this weeks Tridion Community Webinar.

I will follow with some more posts on this project, but as a teaser, our goal is to take your existing (Tridion 2011+) implementation and have you indexing content, and a simple one-box-search running on your site in less than 2 hours, using the out-of-the-box features of the framework, and the open source search engine Solr.

Fixing Tridion Content Delivery Deployment Errors: “Unable to load DLL ‘xmogrt’” and “System.BadImageFormatException”

I’ve recently helped a colleague with an issue when trying to deploy our Tridion DD4T .NET project to a Dev machine.   The issue was a “System.BadImageFormatException” related to the Tridion’s Java wrapper Juggernet.  

However, at first we were getting the error: “Unable to load DLL ‘xmogrt’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)”.  It was weird because on my VM, with the exact same files in the bin, it ran fine.  Turns out, it worked on my VM because my %TRIDION_HOME% was set with the file in it.  

We followed the answers in this post (which you’ve probably read already before coming to this article: http://stackoverflow.com/questions/13918310/unable-to-load-dll-xmogrt-from-tridion-metadata-query) and placed the xmogrt.dll and its dependencies in the bin.  However, we now ended with the “System.BadImageFormatException”:

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Server Error in '/' Application.

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Here is how we solved the problem: 

  1. Uninstall all Java (you may have several versions of the JVM installed.  Uninstall all of them)
  2. Install the latest Java 6 JRE (though we installed the JDK 1.6_45).
  3. Check that it’s successfully installed by typing java –version from the command line.
  4. Verify that ‘xmogrt.dll’ is in the bin folder of your app and is not corrupt.  In our case the ‘xmogrt.dll’ file was only 840kb for some reason.  It should be 1630 KB.
  5. Do an iisreset.

Here is the long answer

xmogrt.dll is an unmanaged C++ assembly that is largely the Juggernet Java wrapper used by Tridion (if you’ve wondered about those jar files in the bin/lib).  This compilation version of this DLL must match the CPU instructionset, i.e. x86 or x86-64).  It must also match the latest Tridion-supported Java version, i.e. 1.6_xx x86 or 1.6_xx 64-bit (of java 1.7 for Tridion 2013).  If there is a mismatch in either, then you’ll receive the “System.BadImageFormatException” error.Look at the Juggernet documentation for more details about how Juggernet works and this error here: http://codemesh.com/products/vfour/tutorial/dotnet/v3/L_02_run_app.html, scroll down to the section “Common Runtime Issues You Might Encounter”.  Also, the Juggernet architecture diagram (found here: http://codemesh.com/products/vfour/dotnetruntimes.html) provides a nice deal of insight into understanding how the Tridion CD API is converted to .NET.

 

Issues with the TridionRsaContainer registration!

Scenario

We’d copied a CM instance (VirtualMachine) from the PRD environment and placed this into the UAT environment, all configurations done as we’d tested and expected.

To avoid getting the error stating that the [clientUATdomain]\MTSUser does not have access to the tridion.security configuration setting we executed the TridionRsaContainer command

aspnet_regiis -pa "TridionRsaKeyContainer" "[clientUATdomain]\MTSUser"

This failed with the MTSUser. On confirming we had the correct [domain]/username/password and further investigation we found that no-one knew the actual account that had been used to install SDL Tridion 2011 CM. We needed this account so we could log into the UAT CM machine in order to give the MTSUser access to the tridion.security configuration setting. This is because this config setting is protected using this windows functionality : http://msdn.microsoft.com/en-us/library/yxw286t2(v=vs.100).aspx

Solution
We could see that file in question is actually a file in c:\programdata\microsoft\crypto\rsa

This file is accessible only to a small number of users (the production domain mtsuser had access to it). So we tried this:

  • log in on the PRD machine as the production domain mtsuser
  • export the rsa key via this command
aspnet_regiis -px "TridionRsaKeyContainer" keys.xml -pri

We then placed this keys.xml file onto the UAT CM box and then executed the import command

aspnet_regiis -pi "TridionRsaKeyContainer" c:\temp\keys.xml

and finally, the following command

aspnet_regiis -pa "TridionRsaKeyContainer" "[clientUATdomain]\MTSUser"

So, on booting up the CM Browser… boom… We got an error in the GUI after a quick dig into the respective ‘Tridion Configuration’ error in the Event system … we then executed

aspnet_regiis -pa "TridionRsaKeyContainer" "nt authority\network service"

Quick restart of the services and all is well again.

The motto of the story – DO NOT ‘LET SLIP‘ WHICH USER INSTALLED THE CM - especially if you want to clone the machine during a setup!

If you’ve had a similar experience we’d be very interested to hear if there are other ways around this – other than simply re-installing the CM with a noted user :)

Special thanks to Harald Hoffelinck on this solution!

Extracting Keywords from PDF on Multimedia upload

I came across a nice library that allows you to create and manipulate PDF documents. Apart from creating PDF documents from scratch, you can also read existing ones, convert XML to PDF, fill out interactive PDF forms, stamp new content on existing PDF documents, split and merge existing PDF documents, and much more. The best part of it is that there is a C# port available which is open source, it’s called iTextSharp. Now I haven’t explored all features of it, like PDF creation, but so far it already looks very usable.

Continue reading

Translating Page URLs without Localizing Pages

A piece of advise that I learned from a wise Tridion sensei is that it’s not a good practice to localize pages in Tridion if you have a multi-lingual site (though there is an exception to this rule which I’ll discuss below).  The reason for this is simple: you lose the ability to centrally manage your site from the Master web publication.  Once a page is localized, you have to manage it individually, which is not ideal if you want to centrally update component presentations on a page across all the language sites.  So what do you do if you want to obey the rule of not localizing pages and your customer asks to have localized/translated URLs? 

Continue reading

Creating dynamic labels within SDL Tridion content

Recently a client required a way of creating and storing ‘dynamic’ values within the content managed in SDL Tridion.  By ‘dynamic’, this could be anything from loan rates, petrol prices or the cost of a pint of beer.  So today ‘pint_beer_cost’ could be $3.50, tomorrow it could be $4.50.  Having to go through all stored content and replace $3.50 with $4.50, every time there is a need to change a value would be quite painful.

Continue reading