Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found how Anguilla takes care of this. When you implement a Data Extender, you are extending the information regarding the items displayed in the list, which basically means that you are extending the Data (Model) behind the item in question.</p> <p>Each Item in Tridion has its own class in the Anguilla Framework, for example a Component has its own Tridion.ContentManager.Component javascript "class". </p> <p>Having said this, and going back to the example that shows the schema name of the component, we are not actually extending the model, since that information is already available in the component. However, we need to overwrite the methods exposed on each used for displaying information in the lists the item is in, in this case a Component.</p> <p>So, when we deal with a Data Extender, if we want a full implementation of this functionality, we not only need to define the data extender:</p> <pre><code>&lt;ext:dataextender name="IntelligentDataExtender" type="Com.Tridion.PS.Extensions.IntelligentDataExtender,PS.GUI.Extensions"&gt; &lt;ext:description&gt;Shows extra info&lt;/ext:description&gt; &lt;/ext:dataextender&gt; </code></pre> <p>But also we need to define what's the column we are adding:</p> <pre><code>&lt;ext:lists&gt; &lt;ext:add&gt; &lt;ext:extension name="IntelligentColumnExtender" assignid="IntelligentDataColumnExtender"&gt; &lt;ext:listDefinition&gt; &lt;ext:selectornamespaces/&gt; &lt;ext:columns&gt; &lt;column xmlns="http://www.sdltridion.com/2009/GUI/extensions/List" id="IntelligentData" type="data" title="Additional Info" selector="@ExtendedInfo" translate="String"/&gt; &lt;/ext:columns&gt; &lt;/ext:listDefinition&gt; &lt;ext:apply&gt; &lt;ext:view name="DashboardView" /&gt; &lt;/ext:apply&gt; &lt;/ext:extension&gt; &lt;/ext:add&gt; &lt;/ext:lists&gt; </code></pre> <p>Once we have this, the GUI will display the column we just added: "Additional Info"</p> <p>Well, now we need to achieve the list refreshing when the item is edited/checked-out and in, etc...</p> <p>For that, we need to extend the model and implement a few methods in the Object we are extending. In this example I am extending the Page object, so whenever a page is edited, the row in the list we want to update gets refreshed, together with the rest of the cells in the table. </p> <p>To extend the model we need to define what types are we extending, in this example I am going to use the "Page" class as an example. First of all you need to define the model extension in the config file of your Editor:</p> <pre><code>&lt;cfg:group name="Com.Tridion.PS.Extensions.UI.Model" merger="Tridion.Web.UI.Core.Configuration.Resources.DomainModelProcessor" merge="always"&gt; &lt;cfg:domainmodel name="Com.Tridion.PS.Extensions.UI.Model"&gt; &lt;cfg:fileset&gt; &lt;cfg:file type="script"&gt;/Scripts/PSPage.js&lt;/cfg:file&gt; &lt;/cfg:fileset&gt; &lt;cfg:services /&gt; &lt;/cfg:domainmodel&gt; &lt;/cfg:group&gt; </code></pre> <p>and </p> <pre><code>&lt;ext:modelextensions&gt; &lt;cfg:itemtypes&gt; &lt;cfg:itemtype id="tcm:64" implementation="Com.Tridion.PS.Extensions.UI.PSPage" /&gt; &lt;/cfg:itemtypes&gt; &lt;/ext:modelextensions&gt; </code></pre> <p>As you can see I am extending the Page by using the "Com.Tridion.PS.Extensions.UI.PSPage" class that is defined in the Javascript file "/Scripts/PSPage.js". </p> <p>The only method that handles the row refreshing is the following:</p> <pre><code>Com.Tridion.PS.Extensions.UI.PSPage.prototype.getListItemXmlAttributes = function PSPage$getListItemXmlAttributes(customAttributes) { var attribs = {}; var p = this.properties; if (customAttributes) { for (var attr in customAttributes) { attribs[attr] = customAttributes[attr]; } } //This adds my custom column back when the item is updated attribs["ExtendedInfo"] = p.extendedInfo; return this.callBase( "Tridion.ContentManager.Page", "getListItemXmlAttributes", [attribs]) }; </code></pre> <p>As you can see I am implementing the "ExtendedInfo" attribute which is the one displayed in my additional column.</p> <p>There's more than just adding a Data Extender when dealing with adding a column to our lists. I will write a post in <a href="http://jaimesantosalcon.blogspot.com/2012/04/sdl-tridion-2011-data-extenders-real.html" rel="nofollow">my blog here</a> to provide with a fully working example.</p> <p>I hope it makes sense. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload