Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SDL Tridion GetListKeywords using Anquilla Framework

I'm writing a GUI extension and using the Anquilla framework to get a list of Keywords within a Category. I'm obtaining an XML document for the list of keywords then working with that document within my extension.

My problem is that the returned XML doesn't contain the Keyword's 'Description' value. I have the Title and Key etc.

My original code looks like this:

var category = $models.getItem("CATEGORYTCMID:);
var list = category.getListKeywords();
list.getXml();

A typical node returned is this:

<tcm:Item ID="tcm:4-1749-1024" 
Type="1024" Title="rate_one" Lock="0" IsRoot="true" 
Modified="2012-12-17T23:01:59" FromPub="010 Schema" 
Key="rate_one_value" IsAbstract="false" 
CategoryTitle="TagSelector" 
CategoryID="tcm:4-469-512" Icon="T1024L0P0" 
Allow="268560384" Deny="96" IsNew="false" 
Managed="1024"/></tcm:ListKeywords>

So I've tried using a Filter to give me additional column information:

var filter = new Tridion.ContentManager.ListFilter();
filter.columns = Tridion.Constants.ColumnFilter.EXTENDED;
var list = category.getListKeywords(filter);

Unfortunately this only gives the additional XML attributes:

IsShared="true" IsLocalized="false"

I'd really like the description value to be part of this XML without having to create a Keyword object from the XML. Is such a thing possible?

cough any ideas? cough

like image 241
johnwinter Avatar asked Dec 19 '12 17:12

johnwinter


2 Answers

I'm afraid you'll have to load the Keyword itself to get the Description. It's not used in any lists, so it's not returned in the XML.

like image 156
Peter Kjaer Avatar answered Sep 22 '22 05:09

Peter Kjaer


You could always create a List Extender to add this information to the list, but try to be smart about it since this extender will execute everytime a GetList is called.

Won't save you from having to open every keyword in the list, but you'll be doing it server-side (with Core Service/NetTcp for instance) which will probably be easier and faster than opening each keyword with Anguilla.

like image 37
Nuno Linhares Avatar answered Sep 22 '22 05:09

Nuno Linhares