<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Albertromkes&#039;s Weblog</title>
	<atom:link href="http://albertromkes.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://albertromkes.com</link>
	<description>Information about SDL Tridion</description>
	<lastBuildDate>Thu, 18 Apr 2013 06:53:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='albertromkes.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Albertromkes&#039;s Weblog</title>
		<link>http://albertromkes.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://albertromkes.com/osd.xml" title="Albertromkes&#039;s Weblog" />
	<atom:link rel='hub' href='http://albertromkes.com/?pushpress=hub'/>
		<item>
		<title>Domain Driven Development with DD4T and XPM</title>
		<link>http://albertromkes.com/2013/03/18/domain-drive-development-with-dd4t-and-xpm/</link>
		<comments>http://albertromkes.com/2013/03/18/domain-drive-development-with-dd4t-and-xpm/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 19:43:39 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[DD4T]]></category>
		<category><![CDATA[Tridion]]></category>

		<guid isPermaLink="false">http://albertromkes.com/?p=512</guid>
		<description><![CDATA[What a title that is DD4T stands for Dynamic Delivery For Tridion and is a leightweight ASP.NET MVC framework build on top of the SDL Tridion stack. It&#8217;s opensource and you can find more about it here XPM is the WYSIWYG editor (and much more!) that ships with SDL Tridion. Domain Driven Development is&#8230; well, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=512&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>What a title that is <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>DD4T stands for Dynamic Delivery For Tridion and is a leightweight ASP.NET MVC framework build on top of the SDL Tridion stack. It&#8217;s opensource and you can find more about it <a href="http://code.google.com/p/dynamic-delivery-4-tridion/">here</a></p>
<p>XPM is the WYSIWYG editor (and much more!) that ships with SDL Tridion.</p>
<p>Domain Driven Development is&#8230; well, Wikipedia explains it better than I can, so check it <a href="http://en.wikipedia.org/wiki/Domain-driven_design">out!</a></p>
<p>I am a big fan of the MVC framework from Microsoft. No wonder I also love the DD4T framework as it makes building MVC websites with SDL Tridion a LOT easier.<br />
One of the shining features of SDL Tridion is its recently upgraded WYSIWYG editor (Or Experience Manager) that allows editors to edit the content of the website in the context of the website itself, in the browser.<br />
This is a great feature and makes it very easy to adjust content in a natural way.</p>
<p>Of course, before content editors can use the Experience Manager (XPM from now on) the SDL Tridion consultant has to pull some triggers to make this possible. All relatively easy to do.</p>
<p>But with DD4T it&#8217;s not so straight-forward as one would want. And especially if you are doing (a form of) Domain Driven Development, and thus are using (domain)ViewModels.</p>
<p>Before you read on, I highly recommend that you read Kah Tang&#8217;s article on <a href="http://kahwah.me/article/2013/3/viewmodels-in-dd4t">ViewModels in DD4T</a> first. This is how I usually implement DD4T and helps you understand the problem we are trying to solve in this post.   </p>
<p>I&#8217;ve see a few DD4T implementations, and most of them use the OOTB DD4T models as their ViewModels. (Don&#8217;t know what ViewModels are? See: <a href="http://stackoverflow.com/a/11064362/1221887" rel="nofollow">http://stackoverflow.com/a/11064362/1221887</a>)</p>
<p>For example, consider the following razor View (which also renders the XPM markup):</p>
<p><script src="https://gist.github.com/albertromkes/5190145.js"></script></p>
<p>As you can see this View uses the DD4T &#8216;IComponent&#8217; as it&#8217;s ViewModel. And it is using the OOTB DD4T &#8216;SiteEditField&#8217; HtmlHelper to generate the XPM markup.<br />
 While using the IComponent as a ViewModel is valid, it&#8217;s not as nice and clean as it could be. Also, the developer has to know the name of the field in Tridion and there&#8217;s no compile time checking. While it&#8217;s a valid approach, it doesn&#8217;t leverage all the advantages of the MVC framework (for example: no strongly typed views).</p>
<p>I always use (domain) specific ViewModel&#8217;s. Using your own, domain specific ViewModels has many advantages from which &#8216;separation of concerns&#8217; and intellisense are just two of them (IMHO).<br />
 ViewModels only purpose is to display the Model in a certain way. Sometimes they are (almost) identical to your Domain Model, but a ViewModel can/must have extra properties to make displaying it possible. It results in much clear views.</p>
<p>Consider the following example (not rendering the XPM markup):</p>
<p><script src="https://gist.github.com/albertromkes/5190159.js"></script></p>
<p>As you can see it&#8217;s much cleaner and easier to read then the previous View and there is also no logic (checking, etc) involved. (I also could have used an HtmlHelper to write out the tag. It&#8217;s up to you.)</p>
<p>But what if your customer asked you to implement XPM? You cannot use the OOTB Html helper since your ViewModel doesn&#8217;t have the properties this helper expects.<br />
Well, there are a few options.</p>
<p>1. Add the &#8216;IComponent&#8217; as a complex property to your ViewModel.<br />
This would look something like this:</p>
<p><script src="https://gist.github.com/albertromkes/5187099.js"></script></p>
<p>It still requires the developer to know the names in Tridion and it&#8217;s lacking the strongly typed advantages. (Intellisense)</p>
<p>2. Add the XMP MarkUp as separate properties to your ViewModel:</p>
<p><script src="https://gist.github.com/albertromkes/5187121.js"></script></p>
<p>This already looks cleaner and has intellisense. But I don&#8217;t like the added properties to the ViewModel. It clutters the ViewModel. </p>
<p>I struggled with this issue for quite some time. But after trying the above mentioned approaches I wasn&#8217;t happy with the result. Although it works, it isn&#8217;t as nice, clean and intuitive (for a programmer) as it could be. </p>
<p>After spending much time on it I came up with an approach. This approach involved quite some coding, but it&#8217;s for a good cause right? And I liked doing it, because I&#8217;ve learned a lot of new stuff. </p>
<p>I wanted it to be a generic solution, so everyone using DD4T could use it. This is how it looks like:<br />
(It&#8217;s still a work in progress!)</p>
<p>1. Create your ViewModel and decorate it with attributes.<br />
Example:</p>
<p><script src="https://gist.github.com/albertromkes/5187530.js"></script></p>
<p>As you can see there are 2 new Attributes involved.</p>
<ul>
<li>InlineEditable</li>
<li>InlineEditableField</li>
</ul>
<p>The first attribute &#8216;InlineEditable&#8217; marks the class (ViewModel) as inline-editable with XPM. The second attribute marks a single field as inline-editable with XPM. </p>
<p>Of course this is not everything. Once you created your ViewModel, you have to make a call to a method to do the magic. Since all my ViewModel&#8217;s by default are created inside a ModelFactory (a subject for a different post), I made this functionality part of a base-class, but you can implement it any way.<br />
This is how my (simplified) ViewModel builder looks like:</p>
<p><script src="https://gist.github.com/albertromkes/5189838.js"></script></p>
<p>That&#8217;s all. The article is now ready for XPM. It&#8217;s not yet inline editable, but the information from Tridion is added to the class, so we can use it in our View. </p>
<p>Let see how our View would look like if we would make this ViewModel (inline)editable with XPM:</p>
<p><script src="https://gist.github.com/albertromkes/5190027.js"></script></p>
<p>As you can see we have full intellisense and a nice and clean View. Of course, I simplified the example a little, but it proves a point.</p>
<p>The XPM Helper and it&#8217;s &#8216;Editable&#8217; method write out the actual value of the property and its corresponding XPM MarkUp.<br />
There&#8217;s also a &#8216;MarkUp&#8217; method that just write&#8217;s out the XPM MarkUp. This becomes handy when you want to make an image or hyperlink inline-editable:</p>
<p><script src="https://gist.github.com/albertromkes/5190070.js"></script></p>
<p>All this is not yet part of DD4T, but I am planning on integrating it in the framework, as I see it as a valuable addition. (If not: let me know).<br />
It encourages the use of (domain)ViewModel&#8217;s and results in a cleaner solution. </p>
<p>If you want to the XPM helper in you project now, drop me an email and I will send you the source-code and the instructions on how to set it up. In the end there&#8217;s really not much to it, but isn&#8217;t that the case with all challenges?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/512/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=512&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2013/03/18/domain-drive-development-with-dd4t-and-xpm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>
	</item>
		<item>
		<title>Troubleshooting the SDL Tridion Experience Manager with Session Preview</title>
		<link>http://albertromkes.com/2013/01/24/troubleshooting-the-sdl-tridion-experience-manager-with-session-preview/</link>
		<comments>http://albertromkes.com/2013/01/24/troubleshooting-the-sdl-tridion-experience-manager-with-session-preview/#comments</comments>
		<pubDate>Thu, 24 Jan 2013 21:37:03 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Content Delivery]]></category>
		<category><![CDATA[DD4T]]></category>
		<category><![CDATA[Experience Manager]]></category>
		<category><![CDATA[MVC3]]></category>
		<category><![CDATA[Tridion]]></category>

		<guid isPermaLink="false">http://albertromkes.com/?p=528</guid>
		<description><![CDATA[In the past week I had the opportunity to install the Experience Manager with Session Preview on a completely DD4T and SDL Tridion driven website. Configuring the Experience Manager can be quite painful. Especially if you don&#8217;t know how Session Preview (exactly) works and if you have no clue where to start and where to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=528&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In the past week I had the opportunity to install the Experience Manager with Session Preview on a completely<br />
<a href="http://code.google.com/p/dynamic-delivery-4-tridion/">DD4T</a> and SDL Tridion driven website. Configuring the Experience Manager can be quite painful. Especially if you don&#8217;t know how Session Preview (exactly) works and if you have no clue where to start and where to look.</p>
<p>In this post I want to give you some hooks and pointers on where to look if things get interesting <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
In fact, if you are DESPERATE about why your Session Preview isn&#8217;t working, this post is aimed at you!</p>
<p>But first: thanks to Andrew Marchuk, Daniel and Likhan from SDL Tridion for helping me. Without their help I would still be staring at my screen <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Well, let&#8217;s start!</p>
<p>(I&#8217;ll assume you have a basic understanding of SDL Tridion). </p>
<p>First, read this answer and the comments: <a href="http://stackoverflow.com/questions/10788508/continously-update-preview-alert-on-sdl-tridion-ui-2012/10802033#10802033" rel="nofollow">http://stackoverflow.com/questions/10788508/continously-update-preview-alert-on-sdl-tridion-ui-2012/10802033#10802033</a></p>
<p>Meditate it, let it sink, adjust your setup and try again. </p>
<p>Now, if it still doesn&#8217;t work, read on:</p>
<p>First, turn of caching for your website. Just to be sure. After you got Session Preview working, turn on caching again and see what happens. But for troubleshooting the Session Preview I recommend to turn of caching completely. Just to be sure&#8230; </p>
<p>1. Do a basic sanity check and check the following for your staging website:</p>
<p>- Open the cd_storage_conf.xml from your staging website and ensure that:</p>
<ul>
<li>The
<pre class="brush: xml; title: ; notranslate">&lt;Wrapper&gt; </pre>
<p> element exists! Like this:</li>
<pre class="brush: xml; title: ; notranslate">

&lt;Wrappers&gt;
				&lt;Wrapper Name=&quot;SessionWrapper&quot;&gt;
					&lt;Timeout&gt;120000&lt;/Timeout&gt;
					&lt;Storage Type=&quot;persistence&quot; Id=&quot;db-session-webservice&quot; dialect=&quot;MSSQL&quot;
					Class=&quot;com.tridion.storage.persistence.JPADAOFactory&quot;&gt;
					&lt;Pool Type=&quot;jdbc&quot; Size=&quot;5&quot; MonitorInterval=&quot;60&quot; 
					IdleTimeout=&quot;120&quot; CheckoutTimeout=&quot;120&quot; /&gt;
					&lt;DataSource Class=&quot;com.microsoft.sqlserver.jdbc.SQLServerDataSource&quot;&gt;
						&lt;Property Name=&quot;serverName&quot; Value=&quot;WIN-1CJUK3HE34H&quot; /&gt;
						&lt;Property Name=&quot;portNumber&quot; Value=&quot;1433&quot; /&gt;
						&lt;Property Name=&quot;databaseName&quot; Value=&quot;Tridion_SessionPreview&quot; /&gt;
						&lt;Property Name=&quot;user&quot; Value=&quot;TridionBrokerUser&quot; /&gt;
						&lt;Property Name=&quot;password&quot; Value=&quot;PassWord&quot; /&gt;
					&lt;/DataSource&gt;
					&lt;/Storage&gt;
				&lt;/Wrapper&gt;
			&lt;/Wrappers&gt;

</pre>
<p>Of course it should point to your SESSION PREVIEW database! Not to your default, ordinary Broker database.</p>
<li>Check if at least the following StorageBinding is present in the cd_storage_conf.xml of your website:    </li>
<pre class="brush: xml; title: ; notranslate">
&lt;StorageBindings&gt;			
                &lt;Bundle src=&quot;preview_dao_bundle.xml&quot;/&gt;				          
            &lt;/StorageBindings&gt;   
</pre>
<li>Check if you added the AmbientData HttpModule (for .NET Sites!. For java it&#8217;s probably a filter) in the web.config of your website:</li>
<pre class="brush: xml; title: ; notranslate">
&lt;add type=&quot;Tridion.ContentDelivery.AmbientData.HttpModule&quot; name=&quot;AmbientFrameworkModule&quot; preCondition=&quot;managedHandler&quot; /&gt;
</pre>
<li>If you are on a website that is NOT COMPLETELY DYNAMIC (so on a website that&#8217;s NOT ON DD4T) check if you added the following module in the web.config of your staging website: </li>
<pre class="brush: xml; title: ; notranslate">
&lt;add name=&quot;PreviewContentModule&quot; type=&quot;Tridion.ContentDelivery.Preview.Web.PreviewContentModule&quot; /&gt;
</pre>
<p>Again: this module is NOT, I repeat NOT necessary if your website is a completely dynamic website. (e.g. retrieves everything from the broker like DD4T). If you still use this module, you will see that clicking on &#8216;Update Preview&#8217; will generate files on the filesystem! And it will not show you the updated preview!</p>
<li>Open the cd_ambient_conf.xml file of your Staging website and check if the following Cartridge is referenced:
<pre class="brush: xml; title: ; notranslate">
&lt;Cartridge File=&quot;cd_webservice_preview_cartridge.xml&quot;/&gt;
</pre>
</li>
</ul>
<p>2. Check the following for your OData Webservice: (The one that is used by the Session Preview, so the one you configured as the &#8216;Content Delivery Endpoint Url&#8217; on your Publication Target)</p>
<ul>
<li>Copy/paste this &#8216;Content Delivery Endpoint Url&#8217; and paste it into your browser. (Of course inside the company domain&#8230;) and see if it responds.</li>
<p>The url looks like this: <a href="http://localhost:73/odata.svc/" rel="nofollow">http://localhost:73/odata.svc/</a><br />
You should get a response with a listing of all collections that can be retrieved by this OData endpoint. Something along the lines of this:</p>
<pre class="brush: xml; title: ; notranslate">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;service xml:base=&quot;http://localhost:73/odata.svc/&quot; xmlns=&quot;http://www.w3.org/2007/app&quot; xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot; xmlns:edmx=&quot;http://schemas.microsoft.com/ado/2007/06/edmx&quot; xmlns:d=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices&quot; xmlns:m=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&quot;&gt;
    &lt;workspace&gt;
        &lt;atom:title&gt;Default&lt;/atom:title&gt;
        &lt;collection href=&quot;Binaries&quot;&gt;
            &lt;atom:title&gt;Binaries&lt;/atom:title&gt;
        &lt;/collection&gt;
        &lt;collection href=&quot;BinaryVariants&quot;&gt;
            &lt;atom:title&gt;BinaryVariants&lt;/atom:title&gt;
        &lt;/collection&gt;
  	....
	....
    &lt;/workspace&gt;
&lt;/service&gt;
</pre>
<li>Open the cd_storage_conf.xml of your OData webservice and ensure that:</lI>
<ul>
<li>The Wrapper tag is there and is pointing to your SESSION PREVIEW database. So not to your regular Broker Database!</li>
<li>The StorageBinding with the preview dao bundle is there. Like this:
<pre class="brush: xml; title: ; notranslate">
&lt;StorageBindings&gt;			
                &lt;Bundle src=&quot;preview_dao_bundle.xml&quot;/&gt;				          
            &lt;/StorageBindings&gt;   
</pre>
</li>
</ul>
<li>Open the cd_ambient_conf of your OData webservice and verify that:
<ul>
<li>The preview Cartridge is there. Like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;Cartridge File=&quot;cd_webservice_preview_cartridge.xml&quot;/&gt;
</pre>
</li>
</ul>
</li>
</ul>
<p>Now, do an IISReset on your website and for your OData webservice. This makes sure that your changes to the various configuration files are used when the Content Delivery Instance boots up the first time. DO NOT SKIP THIS STEP! In case you are still in doubt: DO NOT SKIP THIS STEP! (Sorry for shouting)</p>
<p>Now, hit &#8216;Update Preview&#8217; again. If it is still not working for whatever reason keep reading:</p>
<p>1. Open the logback.xml file of your Staging website, and set the loglevel to &#8216;VERBOSE&#8217;.<br />
2. Open the logback.xml file of your OData webservice and set the loglevel to &#8216;VERBOSE&#8217;.<br />
3. Clear both logfiles! (So you have a fresh start)<br />
4. Clear the &#8216;Tridion&#8217;, &#8216;Tridion Content Manager&#8217; and &#8216;Application&#8217; Windows Eventlogs on the Content Manager Server<br />
5. Clear the &#8216;Application&#8217; Windows Eventlog on the Staging WebSite server<br />
6. Clear the &#8216;Application&#8217; Windows Eventlog on the Odata webservice server</p>
<p>Do an IISReset (You edited the logback.xml file, so this is necessary!)</p>
<p>Now, hit &#8216;Update Preview&#8217; again and check out the logfiles in this order:</p>
<ul>
<li>cd_core.log of your Staging website<br />
   -&gt; Anything unusual? Especially error&#8217;s and warnings with regard to the Ambient Data Framework are important! Take them seriously and double check the cd_ambient_conf.xml and the cd_storage_conf.xml of your staging Website. Also, check if all HttpModules and/filters are present in the Web.config of your website! (See above)
</li>
<li>
cd_core.log of your OData website. If this file is (almost) empty that means that the &#8216;Update Preview&#8217; request NEVER reached the OData webservice. This could be due to:<br />
- Network issues: are the IIS Bindings of the OData webservice correct?<br />
- Can you connect to the OData webservice using your browser?<br />
- Is your publication target pointing to the correct Content Delivery Endpoint Url (your OData webservice)?
</li>
<li>
If there is data in the cd_core.log of your OData webservice, check to see if there are error&#8217;s or unusual statements.</p>
<ul>
<li>
If you search for your adjusted content do you see it? If so, this means that your changed content is correctly send to the OData webservice. If not, that means that your staging website cannot connect to the OData webservice. Again: Check IIS settings and network settings.
</li>
</ul>
</li>
<li>Open the Session Preview Database using SQL Server Management Studio, and open the table &#8216;Component Presentations&#8217;. After you hit &#8216;Update Preview&#8217;, you SHOULD see something added to this table. If not: check if you referenced the correct Session Preview Broker Database in BOTH of your Wrappers. (In the cd_storage_conf.xml of your Website and in the cd_storage_conf.xml of your OData webservice!)</li>
</li>
</ul>
<p>If you see an HTTP error 400 BAD REQUEST after you click on &#8216;Update Preview&#8217; check the following:</p>
<ul>
<li>Open the Windows EventLog &#8216;Tridion Content Manager&#8217; on the Content Manager server and check if you see the same error here. </li>
</ul>
<p>If so, try the following:</p>
<p>Stop the TcmServiceHost windows service on the Content Manager Server. (Be careful, The SDL Tridion Content Manager stops working now!)<br />
Next, browse to the SDL Tridion install directory\bin with the command prompt and start the TcmServiceHost.exe with the -debug command. Like this:</p>
<p>TcmServiceHost.exe -debug</p>
<p>Now, open Fiddler on the Content Manager server, apply a filter to show only traffic from the TcmServiceHost and hit &#8216;Update Preview&#8217; again. Now you have the request and you can inspect it to see if there&#8217;s anything unusual. E.g. the Content-Lenght is 0. That&#8217;s weird, because that means no data was send! </p>
<p>The last resort consist of tracing everything related to the OData webservice. If everything above failed, do the following:</p>
<p>Open the Web.config of the OData webservice and add the following code:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;system.diagnostics&gt;
    &lt;trace autoflush=&quot;true&quot; /&gt;
    &lt;sources&gt;
      &lt;source name=&quot;System.ServiceModel&quot; switchValue=&quot;All&quot;&gt;
        &lt;listeners&gt;
          &lt;add name=&quot;TraceListeners&quot; type=&quot;System.Diagnostics.XmlWriterTraceListener&quot; initializeData=&quot;C:\Temp\trace.svclog&quot; /&gt;
        &lt;/listeners&gt;
      &lt;/source&gt;
    &lt;/sources&gt;
  &lt;/system.diagnostics&gt;
</pre>
<p>Adjust the &#8216;initializeData&#8217; path to a path of your choosing.</p>
<p>Now, hit &#8216;Update Preview&#8217; again, and after it&#8217;s finished, open the trace by double-clicking on it. (If you don&#8217;t have the tracetool, download it <a href="http://msdn.microsoft.com/en-us/library/ms732023.aspx">here</a>)</p>
<p>Find he first red colored entry, and inspect the error message. In my case the &#8216;maxReceivedMessageSize&#8217; of the OData webservice was too small. </p>
<p>You can adjust this setting in the Web.config of the OData webservice. Here is an example of the updated part of the Web.config:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;system.serviceModel&gt;
    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&quot;true&quot; multipleSiteBindingsEnabled=&quot;True&quot; /&gt;
    &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
        &lt;behavior name=&quot;webHttp&quot; &gt;
          &lt;webHttp/&gt;
        &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;services&gt;
	  &lt;!-- HTTP support. In case of HTTPS these services have to be commented. --&gt;	
      &lt;service name=&quot;Tridion.ContentDelivery.Webservice.ODataService&quot;&gt;
        &lt;endpoint  behaviorConfiguration=&quot;webHttp&quot; binding=&quot;webHttpBinding&quot; bindingConfiguration=&quot;AdustedBindingConfiguration&quot; contract=&quot;Tridion.ContentDelivery.Webservice.IODataService&quot; /&gt;
      &lt;/service&gt;
      &lt;service name=&quot;Tridion.ContentDelivery.Webservice.LinkingService&quot;&gt;
        &lt;endpoint behaviorConfiguration=&quot;webHttp&quot; binding=&quot;webHttpBinding&quot; contract=&quot;Tridion.ContentDelivery.Webservice.Ilinking&quot; /&gt;
      &lt;/service&gt;
	  &lt;service name=&quot;Tridion.ContentDelivery.Webservice.AccessTokenService&quot;&gt;
		&lt;endpoint behaviorConfiguration=&quot;webHttp&quot; binding=&quot;webHttpBinding&quot; contract=&quot;Tridion.ContentDelivery.Webservice.IOAuth2AccessToken&quot; /&gt;
	  &lt;/service&gt;
    &lt;/services&gt;
	&lt;!-- In case of HTTPS support uncomment this block.
	--&gt;
	&lt;bindings&gt;     	  
		&lt;webHttpBinding&gt;      
			&lt;binding name=&quot;AdustedBindingConfiguration&quot; maxReceivedMessageSize=&quot;2097152000&quot; maxBufferSize=&quot;2097152000&quot;&gt;
				&lt;readerQuotas maxArrayLength=&quot;81920&quot; maxBytesPerRead=&quot;5120&quot; maxDepth=&quot;32&quot; maxNameTableCharCount=&quot;81920&quot; maxStringContentLength=&quot;2097152&quot; /&gt;
			&lt;/binding&gt;
	    &lt;/webHttpBinding&gt;
    &lt;/bindings&gt;
	
	
  &lt;/system.serviceModel&gt;

</pre>
<p>Note that &#8216;maxReceivedMessageSize&#8217; and &#8216;maxBufferSize&#8217; should be the same!</p>
<p>Don&#8217;t forget to remove this settings once you resolved all your issues!</p>
<p>Phew! I *really* hope your Session Preview service is now working properly.<br />
If this isn&#8217;t the case consider asking it on StackOverflow (and while you&#8217;re there, consider committing to the <a href="http://area51.stackexchange.com/proposals/38335/tridion">SDL Tridion Exchange Proposal</a>)<br />
The community is really helpful and very knowledgeable. Of course you can also open a support ticket with Customer Support.</p>
<p>Have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/528/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=528&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2013/01/24/troubleshooting-the-sdl-tridion-experience-manager-with-session-preview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>
	</item>
		<item>
		<title>DD4T and caching</title>
		<link>http://albertromkes.com/2012/04/07/dd4t-and-caching/</link>
		<comments>http://albertromkes.com/2012/04/07/dd4t-and-caching/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 18:22:04 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Caching]]></category>
		<category><![CDATA[Content Delivery]]></category>
		<category><![CDATA[DD4T]]></category>
		<category><![CDATA[MVC3]]></category>
		<category><![CDATA[Tridion]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Dynamic]]></category>

		<guid isPermaLink="false">http://albertromkes.wordpress.com/?p=475</guid>
		<description><![CDATA[In this post I will try to describe the caching options that are available to you, to increase the responsiveness and the performance of your dynamic website build on top of the Dynamic Delivery for Tridion (DD4T) framework. In a website build with DD4T (almost) all content comes from the Broker Database. The content is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=475&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In this post I will try to describe the caching options that are available to you, to increase the responsiveness and the performance of your dynamic website build on top of the <a title="DD4T" href="http://code.google.com/p/dynamic-delivery-4-tridion/" target="_blank">Dynamic Delivery for Tridion (DD4T) framework</a>.</p>
<p>In a website build with DD4T (almost) all content comes from the Broker Database. The content is stored as an XML string in the database and is transformed (de-serialized) into .NET objects <strong> at request time.</strong> As you can image this has a huge impact on the performance of your website: on every request the XML is loaded (streamed) from the database and the DD4T framework de-serializes this into usable .NET objects.<br />
This is a time-consuming process and puts a heavy load on your webserver.</p>
<p>Luckily there are a few options/strategies to improve the performance of your website. And the beauty about these options is that they (almost) come for free!</p>
<h3>Output Caching</h3>
<p>The first option is the out-of-the-box <a href="https://www.google.nl/#hl=nl&amp;biw=1680&amp;bih=952&amp;sclient=psy-ab&amp;q=output+caching+mvc3&amp;oq=output+caching+mvc3&amp;aq=f&amp;aqi=g-L1&amp;aql=&amp;gs_l=hp.3..0i19.623l3958l0l4346l20l17l0l3l3l1l229l2477l2j13j2l20l0.frgbld.&amp;pbx=1&amp;bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&amp;fp=17b888525315e542">Output caching from ASP.NET.</a><br />
Just decorate your controller (PageController, ComponentController; your choice) with the OutputCache attribute and your done!</p>
<pre class="brush: csharp; title: ; notranslate">
[OutputCache(CacheProfile = &quot;ControllerCache&quot;)]
public override System.Web.Mvc.ActionResult Page(string pageId)
{
...
}
</pre>
<p>And in your web.config you configure the duration of your ControllerCache:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;caching&gt;
&lt;outputCacheSettings&gt;
&lt;outputCacheProfiles&gt;
&lt;add name=&quot;ControllerCache&quot; duration=&quot;3600&quot; varyByParam=&quot;*&quot;/&gt;
&lt;/outputCacheProfiles&gt;
&lt;/outputCacheSettings&gt;
&lt;/caching&gt;
</pre>
<p>OutputCache caches the output (&#8230;) for the duration you configured in the web.config. If the cache duration is set to 5 minutes, and in these 5 minutes you publish a page, the changes are NOT reflected in your browser if you hit F5. Only after 5 minutes the cache is invalided and on the next request the XML is loaded from the Broker Database. And de-serialized.</p>
<h3>DD4T Caching</h3>
<p>Luckily for us DD4T ships with a build in cache mechanism. This caching-mechanism is build on top of the .NET <a href="http://msdn.microsoft.com/en-us/library/system.runtime.caching.aspx">System Runtime Cache</a> and can be used in conjunction with the Output Cache.</p>
<p>DD4T caching stores de-serialized objects like Components and Pages in the .NET Runtime cache after they are requested for the first time. Every consecutive request for that page/component loads it from the Object cache instead of loading it from the Broker database and de-serializing it into a .NET objects.<br />
As you can imagine, this causes a massive performance improvement. </p>
<p>But how does DD4T &#8216;know&#8217; when to invalidate the item in the cache? Because if you re-publish a page or component, you want your website to show the updated page/component.<br />
The fact is that DD4T never knows when an item is republished, unless it &#8216;asks&#8217; SDL Tridion for it. (Due to the fact that a website is stateless)<br />
Well, this &#8216;asking&#8217; is implemented in DD4T. </p>
<p>DD4T poll&#8217;s every x seconds/minutes/hours/etc (configurable) if the LastPublishDate from an item in the cache has changed. If it has changed (the item was republished) it will invalidate this item. The next time this item is requested, it will be loaded from the Broker databases, de-serialized and stored in the cache.</p>
<p>To configure how often DD4T needs to check the LastPublishDate of the items in the cache, use this setting in your web.config (value must be in seconds)</p>
<pre class="brush: xml; title: ; notranslate">
 &lt;add key=&quot;CacheSettings_CallBackInterval&quot; value=&quot;30&quot;/&gt;
</pre>
<p>In this example, DD4T poll&#8217;s the Broker Database every 30 seconds to check if the items in the cache are still valid.</p>
<p>Also, after a configurable amount of time, the item is -no matter what- invalidated. The amount of time can be configured separately for pages and components.<br />
Use the following configuration settings to accomplish this: </p>
<pre class="brush: xml; title: ; notranslate">
&lt;add key=&quot;DD4T.CacheSettings.Page&quot; value=&quot;3600&quot;/&gt;
&lt;add key=&quot;DD4T.CacheSettings.Component&quot; value=&quot;3600&quot;/&gt;
</pre>
<p>In this example all the pages and components in the cache are invalidated after 1 hour. </p>
<h3>SDL Tridion Object cache</h3>
<p>SDL Tridion comes with a caching solution called &#8216;Object cache&#8217;. To quote the documentation, this is what it does:</p>
<blockquote><p>To improve the performance of your Web site, you can choose to store the most commonly used or resource-intensive objects from your Content Data Store in a cache. The cache keeps these objects available for the applications that request them, rather than reinitializing them each time they are requested. </p></blockquote>
<p>Pretty obvious right? So no need to explain it further.<br />
Read the documentation <a href="http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011/concept_1338647A1392415D845F622D2FAFA425" title="SDL Tridion Object Cache" target="_blank">here</a>. (Login required)</p>
<p>More information about the SDL Tridion Object cache:</p>
<ul>
<li><a href="http://www.sdltridionworld.com/articles/whatisthesdltridionobjectcache.aspx" title="What is the SDL Tridion Object cache" target="_blank">What is the SDL Tridion Object cache</a></li>
<li><a href="http://www.sdltridionworld.com/articles/sdltridion2011/analyzing_object_cache.aspx" title="Analyzing the SDL Tridion Object cache" target="_blank">Analyzing the SDL Tridion Object cache</a></li>
</ul>
<h4>Finale notes</h4>
<p>As we have discussed, there are 3 caching options available out of the box. Used them when needed, and tweak them according to your needs.</p>
<p>A very nice post about caching (and the performance you gain) with a SDL Tridion driven website was written by Nuno Linhares. Read it here: <a href="http://nunolinhares.blogspot.com/2010/11/tridion-content-delivery-and-caching.html" title="Tridion Content Delivery and Caching" target="_blank">Tridion Content Delivery and Caching</a></p>
<p>I hope I gave you some information about caching in a dynamic (DD4T driven) website on top of SDL Tridion to get you started.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/475/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/475/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=475&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2012/04/07/dd4t-and-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>
	</item>
		<item>
		<title>Tridion GUI Extensions : How to load a JavaScript without showing a GUI element</title>
		<link>http://albertromkes.com/2012/01/30/tridion-gui-extensions-how-to-load-a-javascript-without-showing-a-gui-element/</link>
		<comments>http://albertromkes.com/2012/01/30/tridion-gui-extensions-how-to-load-a-javascript-without-showing-a-gui-element/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 19:10:38 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Tridion]]></category>

		<guid isPermaLink="false">http://albertromkes.wordpress.com/?p=463</guid>
		<description><![CDATA[A while ago I was struggling with the above mentioned challenge: I wanted to load some JavaScript into the Tridion Content Manager GUI, but without showing a corresponding GUI element (Button, list, etc). I searched the online documentation portal, the good old forum, searched all the Tridion blogs, but could not find it. With no [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=463&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A while ago I was struggling with the above mentioned challenge: I wanted to load some JavaScript into the Tridion Content Manager GUI, but without showing a corresponding GUI element (Button, list, etc).<br />
I searched the <a href="http://sdllivecontent.sdl.com" target="_blank">online documentation portal</a>, the good old <a href="https://forum.tridion.com" target="_blank">forum</a>, searched all the Tridion blogs, but could not find it.<br />
With no other option left, I turned to the experts. Since not too long, they can also be found <a href="https://powertools.flowdock.com" target="_blank">here</a>.<br />
(And while you&#8217;re there, why not join us?)</p>
<p>It took precisely 3 minutes and I had my answer. Since I could not find it, I assume you also cannot find it. That&#8217;s why I share it here.<br />
But not without mentioning the one who gave me the answer: <a href="https://twitter.com/#!/puf" target="_blank">Frank</a>. Thanks.</p>
<p>For adding a JavaScript to extend the Tridion Content Manager GUI, but without showing a button or list or whatever, the following configuration is needed:</p>
<p>1. Add the following configuration to your &#8216;Editor.config&#8217; (config file to configure your GUI Extension):</p>
<pre class="brush: xml; title: ; notranslate">
&lt;cfg:groups&gt;
&lt;cfg:group name=&quot;MyGroupName&quot;&gt;
&lt;cfg:domainmodel name=&quot;MyName&quot;&gt;
&lt;cfg:fileset&gt;
&lt;cfg:file type=&quot;script&quot; id=&quot;MyId&quot;&gt;/Relative/Path/MyJavaScript.js&lt;/cfg:file&gt;
&lt;/cfg:fileset&gt;
&lt;cfg:services /&gt;
&lt;/cfg:domainmodel&gt;
&lt;/cfg:group&gt;
&lt;/cfg:groups&gt;
</pre>
<p>This piece of configuration makes sure that your javascript file is loaded for the complete GUI. This might not be what you want.<br />
Let&#8217;s say you only want to load your methods/classes for a certain view, let say the Component-edit screen. You can achieve this by adding the following code to your<br />
JavaScript file:</p>
<pre class="brush: jscript; title: ; notranslate">
//If you only want your code to affect certain screens/views, you should listen to Anguilla events like this:
$evt.addEventHandler($display, &quot;start&quot;, onDisplayStarted);

// This callback is called when any view has finished loading
function onDisplayStarted() {

    $evt.removeEventHandler($display, &quot;start&quot;, onDisplayStarted);

    if ($display.getView().getId() == &quot;ComponentView&quot;) {
            //Work your magic!
       }
}
</pre>
<p>It&#8217;s easy once you know how <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/463/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=463&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2012/01/30/tridion-gui-extensions-how-to-load-a-javascript-without-showing-a-gui-element/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>
	</item>
		<item>
		<title>DD4T Continued: rendering component presentations</title>
		<link>http://albertromkes.com/2012/01/20/dd4t-continued-rendering-component-presentations/</link>
		<comments>http://albertromkes.com/2012/01/20/dd4t-continued-rendering-component-presentations/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 09:35:03 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Content Delivery]]></category>
		<category><![CDATA[DD4T]]></category>
		<category><![CDATA[MVC3]]></category>
		<category><![CDATA[Tridion]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Component Presentations]]></category>
		<category><![CDATA[ComponentPresentations]]></category>
		<category><![CDATA[Dynamic Delivery]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://albertromkes.wordpress.com/?p=423</guid>
		<description><![CDATA[In my previous post I discussed how to get started with ASP.NET MVC3 and Tridion using the opensource DD4T framework. In this post I want to show you how DD4T handles the rendering of ComponentPresentations on a page. In my previous example, the whole HTML of the (Tridion)page was rendered by only 1 (razor)view. This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=423&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In my <a title="Getting started with ASP.NET MVC3 and Tridion" href="http://albertromkes.wordpress.com/2011/12/13/getting-started-with-asp-net-mvc3-and-tridion/">previous post</a> I discussed how to get started with ASP.NET MVC3 and Tridion using the opensource <a title="DD4T" href="http://code.google.com/p/dynamic-delivery-4-tridion/" target="_blank">DD4T framework</a>.<br />
In this post I want to show you how DD4T handles the rendering of ComponentPresentations on a page.</p>
<p>In my previous example, the whole HTML of the (Tridion)page was rendered by only 1 (razor)view. This is not a desired scenario, because it leads to big views and re-use is almost impossible.<br />
Tridion handles this quite nicely by using Component Templates. These templates are responsible for rendering their own little piece of content. And this is exactly what you want in your webapplication.</p>
<p>So, how to implement this using the DD4T framework? Lets find out by creating a simple page.</p>
<p>First, create a page in Tridion with 2 (or more) ComponentPresentations and publish the page. (Make sure your Component Templates are DD4T templates and have a metadatafield called &#8216;view&#8217; with the name of an existing view in it!. See my <a title="Getting started with ASP.NET MVC3 and Tridion" href="http://albertromkes.wordpress.com/2011/12/13/getting-started-with-asp-net-mvc3-and-tridion/" target="_blank">previous post</a> on how to create a DD4T Component/Page Template)</p>
<p>DD4T needs to know which (default) Controller to use. This needs to be configured in your Web.config. Add the following 2 lines of code in your Web.config:</p>
<p><code>    &lt;!-- Config values for the DefaultComponentPresentationRenderer--&gt;<br />
&lt;add key="Controller" value="TridionComponent"/&gt;<br />
&lt;add key="Action" value="Component"/&gt;<br />
</code></p>
<p>Next, we have to write some code to handle the rendering of the ComponentPresentations.<br />
1. Create a new controller and name it &#8216;TridionComponentController&#8217;.<br />
2. Add the following code in this controller:</p>
<pre class="brush: csharp; title: ; notranslate">
using System.Web.Mvc;
using DD4T.Mvc.Controllers;
using DD4T.ContentModel;

namespace Sample_WebApplication.Controllers
{
    public class TridionComponentController : TridionControllerBase
    {

        public ActionResult Component(ComponentPresentation componentPresentation)
        {
            return base.ComponentPresentation(componentPresentation.Component.Id);
        }
    }
}
</pre>
<p>This controller is used to render each ComponentPresentation on a page. The TridionControllerBase class reads the metadata from each ComponentPresentation to find out which razorview to use. The result of the Action-method is a rendered componentpresentation.</p>
<p>Now, create a folder &#8216;TridionComponent&#8217; in the &#8216;Views&#8217; folder, and create a new razoriew. Give this view the same name as you defined in the metadata of your ComponentTemplate. So, in my case that is &#8216;Article&#8217;.<br />
Add your HTML to this new View. My Article view looks like this:</p>
<pre class="brush: csharp; title: ; notranslate">
@using DD4T.ContentModel;
@using DD4T.Mvc.Html;
@model IComponentPresentation

Component title: @Model.Component.Title

&lt;h1&gt;@Model.Component.Fields[&quot;title&quot;].Value&lt;/h1&gt;
&lt;p&gt;@Html.Raw(Model.Component.Fields[&quot;summary&quot;].Value)&lt;/p&gt;
&lt;p&gt;
    @Html.Raw(Model.Component.Fields[&quot;body&quot;].Value)
&lt;/p&gt;
</pre>
<p>Now we have to adjust our main view to NOT render the ComponentPresentations inline, but to use our new controller and the DD4T &#8216;ComponentPresentation&#8217; Action method.<br />
Open your Page view (In the folder TridionPage, General.cshtml) and add the following code:</p>
<pre class="brush: csharp; title: ; notranslate">
@using DD4T.ContentModel;
@using DD4T.Mvc.Html;
@model IPage

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;@Model.Title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;
Some info about this page:&lt;br /&gt;
Filename: @Model.Filename&lt;br /&gt;
Title: @Model.Title&lt;br /&gt;
Publication Title: @Model.Publication.Title&lt;br /&gt;
&lt;/p&gt;

&lt;h2&gt;ComponentPresentations on this page&lt;/h2&gt;
@Html.RenderComponentPresentations()
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Notice the @Html.RenderComponentPresentations()? This is a HTML helper from the DD4T framework that renders all the componentpresentations on the page, using our newly created &#8216;TridionComponentController&#8217;.</p>
<p>This &#8216;RenderComponentPresentation&#8217; HTML helper renders ALL the ComponentPresentations, but often you only want to render certain ComponentPresentations. For instance, you want to render &#8216;Banner&#8217; components in another section on your page then your &#8216;Article&#8217; elements.<br />
This can be achieved by using one of the overloads from the &#8216;RenderComponentPresentations&#8217; HTML helper.</p>
<p>To only render ComponentPresentations that are based on a certain schema, you can use this code:</p>
<pre class="brush: csharp; title: ; notranslate">
@Html.RenderComponentPresentationsBySchema(&quot;ArticleSchema&quot;)
</pre>
<p>To render ComponentPresentations based on a certain ComponentTemlate, you can use this code:</p>
<pre class="brush: csharp; title: ; notranslate">
 @Html.RenderComponentPresentationsByView(&quot;Article&quot;)
</pre>
<p>Or, if you want to render ComponentPresentations based on multiple ComponentTemplates, you can use this code:</p>
<pre class="brush: csharp; title: ; notranslate">
 @Html.RenderComponentPresentationsByView(new[] {&quot;Article&quot;, &quot;FullArticle&quot; })
</pre>
<p>I hope this helped you to understand how ComponentPresentations are handled by the DD4T .NET framework.<br />
Let me know if you have more questions or problems using the above code.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/423/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/423/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=423&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2012/01/20/dd4t-continued-rendering-component-presentations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting started with ASP.NET MVC3 and Tridion</title>
		<link>http://albertromkes.com/2011/12/13/getting-started-with-asp-net-mvc3-and-tridion/</link>
		<comments>http://albertromkes.com/2011/12/13/getting-started-with-asp-net-mvc3-and-tridion/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 20:18:11 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Content Delivery]]></category>
		<category><![CDATA[DD4T]]></category>
		<category><![CDATA[MVC3]]></category>
		<category><![CDATA[Tridion]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Dynamic Delivery]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://albertromkes.wordpress.com/?p=352</guid>
		<description><![CDATA[Introduction In this post I am going to explain how to set up and use the Dynamic Delivery For Tridion Framework. If you haven&#8217;t heared of this framework check out this site: http://code.google.com/p/dynamic-delivery-4-tridion/ In short: Dynamic Delivery For Tridion (DD4T) is an ASP.NET MVC3 framework specifically designed to build a web(site) application using SDL Tridion. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=352&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h3>Introduction</h3>
<p>In this post I am going to explain how to set up and use the Dynamic Delivery For Tridion Framework. If you haven&#8217;t heared of this framework check out this site: <a href="http://code.google.com/p/dynamic-delivery-4-tridion/" rel="nofollow">http://code.google.com/p/dynamic-delivery-4-tridion/</a><br />
In short: Dynamic Delivery For Tridion (DD4T) is an ASP.NET MVC3 framework specifically designed to build a web(site) application using <a title="SDL Tridion" href="http://www.sdl.com/en/wcm/" target="_blank">SDL Tridion</a>.</p>
<p>Prerequisites:<br />
1. Visual Studio 2010 (With <a title="Entity Framework 4.1" href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=8363" target="_blank">Entity Framework 4.1</a> installed and <a title="MVC3" href="http://www.asp.net/mvc/mvc3" target="_blank">MVC3</a>)<br />
2. SDL Tridion 2011 Content Management Server<br />
3. SDL Tridion 2011 Content Delivery Instance<br />
(The DD4T Framework also supports SDL Tridion 2009. But in this post I use SDL Tridion 2011)</p>
<p>Also make sure that you are publishing everything to the Tridion Broker Database. (You can configure this in the cd_storage_conf.xml)</p>
<h3>High level overview</h3>
<p>For a highlevel overview of the framework, check out this url: <a href="http://prezi.com/tzxk2w9ic284/developing-with-aspnet-mvc-and-tridion/" rel="nofollow">http://prezi.com/tzxk2w9ic284/developing-with-aspnet-mvc-and-tridion/</a></p>
<p>To get your website up and running using the DD4T framework, the following steps are needed:</p>
<ol>
<li>Upload the Dynamic Delivery Template Building Blocks to your Content Management Server</li>
<li>Create Component Templates and Page Templates using the Dynamic Delivery Template Building Blocks</li>
<li>Create a webapplication that uses the DD4T DLL&#8217;s to show your published page</li>
</ol>
<h3>Getting started</h3>
<p>Download the sources from <a title="code.google.com" href="http://code.google.com/p/dynamic-delivery-4-tridion/source/checkout" target="_blank">code.google.com</a><br />
(Use a SVN Client like <a href="http://tortoisesvn.net/" target="_blank">TortoiseSvn</a> in combination with a Visual Studio plugin like <a href="http://ankhsvn.open.collab.net/" target="_blank">AnkhSvn</a>)</p>
<p>The sources contain the Java version and the .NET MVC3 version of the project. We are only interested in the .NET MVC3 version of the framework.</p>
<h4>Template Building Blocks</h4>
<p>First, we have to upload the Template Building Blocks to the Tridion Content Management Server.<br />
Check out this <a href="http://code.google.com/p/dynamic-delivery-4-tridion/wiki/40_Templates" target="_blank">WIKI</a> page on how to upload the templates</p>
<h4>Component Templates and Page Templates</h4>
<p>Once you uploaded the Template Building Blocks, you can use these to create Page- and Component Templates. To create a Component Template, open up the Templatebuilder tool and create a new Component Template. Drag and drop the following (DD4T) Building Blocks on your template:</p>
<ul>
<li>Generate dynamic component</li>
<li>Publish binaries for component</li>
</ul>
<p><a href="http://albertromkes.files.wordpress.com/2011/12/template-builder2.png"><img class="alignnone size-medium wp-image-372" title="Template Builder" src="http://albertromkes.files.wordpress.com/2011/12/template-builder2.png?w=300&#038;h=206" alt="" width="300" height="206" /></a></p>
<p>Also, create a Page Template with the following (DD4T) Building Blocks:</p>
<ul>
<li>Generate dynamic page</li>
<li>Publish binaries for page</li>
</ul>
<p>Next, create a simple meta-data schema with one single line text (Preferably it&#8217;s a selectlist with values from a category) for usage on the newly created Component- and Page Template.<br />
This schema allows you to tell the DD4T framework which View (visual representation, ASP.NET MVC3 Razor template) to use when this Page/Component is rendered in the browser.<br />
Xml name of the field should be &#8216;view&#8217;.</p>
<p>Component Template for Articles, using the View &#8216;Article&#8217;:<br />
<a href="http://albertromkes.files.wordpress.com/2011/12/article-component-template1.png"><img class="alignnone size-medium wp-image-375" title="Article component template" src="http://albertromkes.files.wordpress.com/2011/12/article-component-template1.png?w=300&#038;h=258" alt="" width="300" height="258" /></a></p>
<p>Do the same for the Page Template: Give it a metadata-schema, with one field called &#8216;view&#8217; and insert which view to use in the framework:<br />
<a href="http://albertromkes.files.wordpress.com/2011/12/page-template.png"><img class="alignnone size-medium wp-image-379" title="Page Template" src="http://albertromkes.files.wordpress.com/2011/12/page-template.png?w=300&#038;h=260" alt="" width="300" height="260" /></a></p>
<h4>Visual Studio Projects setup</h4>
<p>Open up Visual Studio and create new project of type &#8216;ASP.NET MVC3 Web Application&#8217; (Make sure you are using the Razor view engine)<br />
<a href="http://albertromkes.files.wordpress.com/2011/12/new-project-visual-studio.png"><img class="alignnone size-medium wp-image-386" title="New Project Visual Studio" src="http://albertromkes.files.wordpress.com/2011/12/new-project-visual-studio.png?w=300&#038;h=207" alt="" width="300" height="207" /></a></p>
<p>Next, we are going to add some projects (dll&#8217;s) from the just downloaded DD4T framework. Choose from the &#8216;File&#8217; menu for &#8216;Add&#8217; -&gt; &#8216;Existing Project&#8217;. Add the following DD4T projects to your solution:</p>
<ul>
<li>DD4T.ContentModel</li>
<li>DD4T.ContentModel.Contracts</li>
<li>DD4T.Factories</li>
<li>DD4T.Mvc</li>
<li>DD4T.Providers.SDLTridion2011 (Or DD4T.Providers.SDLTridion2009 if you are using SDL Tridion 2009)</li>
</ul>
<p>Your solution looks something like this:<br />
<a href="http://albertromkes.files.wordpress.com/2011/12/projects.png"><img class="alignnone size-medium wp-image-391" title="Projects" src="http://albertromkes.files.wordpress.com/2011/12/projects.png?w=273&#038;h=300" alt="" width="273" height="300" /></a><br />
Remark: in a real life application you don&#8217;t want hard references to all these dlls. You want to load the dependencies by means of Dependency Injection (Unity, MEF, etc)<br />
Next, we have to copy some Tridion dll&#8217;s into the following folder: %DD4T Install Path%\dependencies\Tridion 2011 DLLs. In here you find a file called &#8216;Missing files&#8217;. Read it, and copy-paste all the Tridion Dll&#8217;s into this folder.<br />
Now, add all the DD4T projects as a reference to your MvcApplication. Your solution should build fine now.</p>
<p>The DD4T framework uses the web.config to find out from which publication to request content. Add the following 2 keys to the web.config. (Of course, fill in your publication id)<br />
<code><br />
&lt;add key="Site.ActiveWebsite" value="Corporate.En"/&gt;<br />
&lt;add key="WebSite.Corporate.En.PublicationId" value="7"/&gt;<br />
</code></p>
<h4>Writing *some* code</h4>
<p>Now we have added all the necessary framework parts, it&#8217;s time to wire up our first controller so we can view our page in the browser. Luckily for us, the DD4T framework has already done a lot for us. Al we have to do is to use the right methods and classes!<br />
If you aren&#8217;t familiar with the .NET MVC pattern, this is roughly how it looks like:</p>
<ol>
<li>Url is typed into the browser</li>
<li>Request is fired to the webserver and our webapplication. It goes through a &#8216;rout-engine&#8217; (Global.asax) to find out what to do with this url (request)</li>
<li>This route-engine looks at the url and based on the parts of the url it sends it to a controller</li>
<li>The controller builds up the Model and passes this model on to the View</li>
<li>The (razor)View renders the HTML and pushes the output back to the browser</li>
</ol>
<p>First step is adding a rule to the Global.asax that makes sure that (for now) all requests are handled by the same controller. Add the following code to the &#8216;RegisterRoutes&#8217; method from the Global.asax:</p>
<pre class="brush: csharp; title: ; notranslate">
routes.MapRoute(
               &quot;TridionPage&quot;, // Route name
               &quot;{*PageId}&quot;,
               new { controller = &quot;TridionPage&quot;, action = &quot;Page&quot; }, //Parameter defaults
               new { pageId = @&quot;^(.*)?$&quot; } //Parameter constraints
           );
</pre>
<p>This makes sure that every request is passed on to the TridionPageController.</p>
<p>Time to make the TridionPageController! Go to your MvcApplication and create a new controller. Right click on the &#8216;Controller&#8217; folder in the solution explorer and choose &#8216;Add&#8217;-&gt; &#8216;Controller&#8217;.<br />
Name it: TridionPageController</p>
<p>By default all controllers from ASP.NET MVC inherit from the Microsoft Controller class. We don&#8217;t want this. We want to inherit from the TridionControllerBase class from the DD4T.Mvc project.<br />
Make sure your TridionPageController inherits from the TridionControllerBase:</p>
<pre class="brush: csharp; title: ; notranslate">
public class TridionPageController : TridionControllerBase
{
        public TridionPageController()
        {
            this.PageFactory = new DD4T.Factories.PageFactory();
            this.PageFactory.PageProvider = new DD4T.Providers.SDLTridion2011.TridionPageProvider();
        }
}
</pre>
<p>Remark about the above code: The factories and providers are created here for simplicity. In a real world scenario you don&#8217;t want to do this, but you want to load the Factories and Providers by means of Dependency Injection (Unity, MEF, etc). But for now it&#8217;s ok. </p>
<p>The TridionControllerBase defines a set of useful methods. We want our controller to look up the page (url) we requested in the browser from the Tridion Broker Database. Normally you would write code, using the Tridion dll&#8217;s to retrieve the Pagecontent from the Tridion Broker Database yourself, but the DD4T framework has already done this for us.</p>
<p>Add the following code to the TridionPageController:</p>
<pre class="brush: csharp; title: ; notranslate">
public override ActionResult Page(string pageId)
{
    return base.Page(pageId);
}
</pre>
<p>This method retrieves the PageContent from the Tridion Broker Database by finding the Page by it&#8217;s Url (pageId = Url). So, make sure you published a page to the Tridion Broker Database using the DD4T Templates!</p>
<h4>The View</h4>
<p>The &#8216;Page&#8217; method returns *something*, but we have to define of course how that &#8216;something&#8217; needs to be visualed. In other words: we need to create a (razor) view.<br />
ASP.NET MVC3 uses a pattern to find the right View to visualize this page and it uses (among others) the name of the Controller to find the view. So, in the &#8216;Views&#8217; folder, create a new folder<br />
&#8216;TridionPage&#8217;. In here we have to define the View. Remeber the metadata schema we made for Component- and Page Templates? Well, your Pagetemplate has this metadata on it, and you gave it a meaningfull name. I named mine &#8216;General&#8217;. So I have to create a view named &#8216;General&#8217;. Here is how my folder structure looks like:</p>
<p><a href="http://albertromkes.files.wordpress.com/2011/12/folder-structure.png"><img class="alignnone size-full wp-image-406" title="Folder Structure" src="http://albertromkes.files.wordpress.com/2011/12/folder-structure.png?w=450" alt=""   /></a></p>
<p>Views contain the HTML. Here we define how our page looks like. One of the advantages of the DD4T Framwork is, that you can have strongly typed views. This means that you tell your View that he (she) needs to render HTML for object of type IPage or IComponent or String (not very usefull) or MyArticleObject, etc. This gives you full intellisense when writing your View.</p>
<p>Your view needs to render the HTML for an IPage object. (IPage object comes from the DD4T Framework).<br />
Add the following code to your view:</p>
<pre class="brush: csharp; title: ; notranslate">
@using DD4T.ContentModel;
@model IPage&lt;/pre&gt;
&lt;h2&gt;@Model.Title&lt;/h2&gt;
&lt;pre&gt;
    Some info about this page:

    Filename: @Model.Filename

    Title: @Model.Title

    Publication Title: @Model.Publication.Title

Component presentations on this page:&lt;/pre&gt;
&lt;ul&gt;
&lt;ul&gt;@{&lt;/ul&gt;
&lt;/ul&gt;
&amp;nbsp;
&lt;ul&gt;
&lt;ul&gt;foreach (IComponentPresentation cp in Model.ComponentPresentations)&lt;/ul&gt;
&lt;/ul&gt;
&amp;nbsp;
&lt;ul&gt;
&lt;ul&gt;{&lt;/ul&gt;
&lt;/ul&gt;
&amp;nbsp;
&lt;ul&gt;
&lt;ul&gt;
	&lt;li&gt;@cp.Component.Fields[&quot;title&quot;].Value&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&amp;nbsp;
&lt;ul&gt;
&lt;ul&gt;}&lt;/ul&gt;
&lt;/ul&gt;
&amp;nbsp;
&lt;ul&gt;}&lt;/ul&gt;
&lt;pre&gt;
</pre>
<p>ASP.NET automatically wires up the properties from the IPage to the &#8216;Model&#8217; keyword because we told this View that he (she) is destined to render HTML for an IPage object. (The &#8216;@model IPage&#8217; directive).</p>
<p>And now: RUN! (F5)<br />
Make sure you are requesting an Url that is published to the Tridion Broker Database <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I hope this gives you enough information to get started with the DD4T Framework. The framework is actively developed and it is already running live in at least one big financial organisation.<br />
So far everything runs just fine <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Disclaimer:This example is provided as is and is simplified for the obvious reasons.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/352/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=352&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2011/12/13/getting-started-with-asp-net-mvc3-and-tridion/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2011/12/template-builder2.png?w=300" medium="image">
			<media:title type="html">Template Builder</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2011/12/article-component-template1.png?w=300" medium="image">
			<media:title type="html">Article component template</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2011/12/page-template.png?w=300" medium="image">
			<media:title type="html">Page Template</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2011/12/new-project-visual-studio.png?w=300" medium="image">
			<media:title type="html">New Project Visual Studio</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2011/12/projects.png?w=273" medium="image">
			<media:title type="html">Projects</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2011/12/folder-structure.png" medium="image">
			<media:title type="html">Folder Structure</media:title>
		</media:content>
	</item>
		<item>
		<title>Tridion and ASP.NET MVC3</title>
		<link>http://albertromkes.com/2011/08/24/tridion-and-asp-net-mvc3/</link>
		<comments>http://albertromkes.com/2011/08/24/tridion-and-asp-net-mvc3/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 21:51:41 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Tridion]]></category>

		<guid isPermaLink="false">http://albertromkes.wordpress.com/?p=285</guid>
		<description><![CDATA[My current project involves (re)building a Intranet based on SDL Tridion 2009 and ASP.NET MVC3. In this post I want to share how we set things up and how we build it. The goal was to build a re-usable, flexible and -last but not least- opensource framework  on top of Tridion based on ASP.NET MVC3. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=285&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>My current project involves (re)building a Intranet based on SDL Tridion 2009 and ASP.NET MVC3.<br />
In this post I want to share how we set things up and how we build it.</p>
<p>The goal was to build a re-usable, flexible and -last but not least- opensource framework  on top of Tridion based on ASP.NET MVC3.<br />
Re-usable so Tridion consultants can use it in all their projects. Flexible so functionality can be added easily and opensource so anybody can contribute.<br />
Of course our first concern was to deliver a full-blown website based on SDL Tridion.</p>
<p>As you may know, MVC stands for Model, View, Controller and is a programming principle used in many languages, mostly in java based languages. Microsoft thought they couldn&#8217;t stand<br />
at the sideline and watch, so they came up with their own implementation of MVC, and the called it, well ASP.NET MVC3. (3 being the version number. Version 4 is already in development)</p>
<p>To fulfill the 3 requirements for an MVC3 webapplication, you have to deliver/build the following parts:</p>
<ul>
<li><strong>M</strong>odel          -&gt; Can roughly be seen as the data coming from Tridion (Pages, components, etc.)</li>
<li><strong>V</strong>iew             -&gt; The markup to show the Data (Html)</li>
<li><strong>C</strong>ontroller   -&gt; The way how to get/build-up the Data and pass it to the View. In Tridion words: Connect to the Broker Database and build a Model.</li>
</ul>
<p>To be able to build a Model from the data from Tridion on the Content Delivery side, this data must be stored in the Content Delivery Database. And this should be more than just meta-data because<br />
we need to build a complete page, including &#8216;normal&#8217; field-values to show on your website. To do this, we used the Tridion Dynamic Delivery Templating project. This (compound) templating project is developed by SDL Tridion and<br />
creates XML from the components and pages. We then publish this XML to the broker database. Now the rough Model of our data (content) exists in the database and we need to pull it out in order to build a nice looking content-page.</p>
<p><strong>How to get the data (content) and build a model</strong></p>
<p>An ASP.NET MVC3 application uses a route-engine to route URL&#8217;s to Controllers. (based on the url-parts). In this Controller the Model is build and passed on to the View.<br />
Since this paradigma goes for all URL&#8217;s the Dynamic Delivery Framework has a BaseController (inherits from Controller) which does this for you:<br />
It uses the Factory&#8217;s project (to be precise the &#8216;PageFactory&#8217;) to query the broker for a page with a certain URL (the URL the user entered in the browser).<br />
It then desirializes the XML returned from the broker into a Page (Dynamic Delivery Page) object and voila: you have your page model.<br />
This Page contains all of the data needed to create a nice looking webpage. It contains for instance: Id, Title, FileName and last but not least: Componentpresentations.<br />
The Page object almost looks like the Tridion Object Model Page-object. It contains most of the familiar properties.<br />
Same goes for ComponentPresentation. This object contains the 2 most important properties: ComponentTemplate and Component.</p>
<p><strong>How to visualize the Model</strong></p>
<p>When you have build your Model in the controller, you have to pass it on to a view. A view is the visual representation of your Model.<br />
ASP.NET Mvc3 ships with 2 view-engines: aspx and razor. We used the razor-engine to create our views.<br />
Razor gives you the full power of C# to script your views. One of the main adavantages of razor-views<br />
is that you can have typed-views. This means that you have full intellisense in your view!</p>
<p>You could write something like this in your view:</p>
<pre class="brush: csharp; title: ; notranslate">
@model IComponentPresentation&lt;/pre&gt;
&lt;h1&gt;@Model.Component.Fields[&quot;title&quot;].value&lt;/h1&gt;
&lt;p&gt;
@Model.Component.Fields[&quot;articlebody&quot;].value
&lt;/p&gt;
</pre>
<p>This looks pretty familiar right? This could easily be taken to the next level. It would be nicer if your view is of type, lets say: Article. Well, this could easily be achieved by building your own Model out of the ComponentPresentation Model. In your Controller you would write something like this:</p>
<pre class="brush: csharp; title: ; notranslate">
Article homepageArticle = new Article();
homepageArticle.Title = ComponentPresentation.Component.Fields[&quot;title&quot;].value;
homepageArticle.BodyText = ComponentPresentation.Component.Fields[&quot;articlebody&quot;].value;
</pre>
<p>If you then pass this Article-model into the view,  you can write your View as follows:</p>
<pre class="brush: csharp; title: ; notranslate">
@model IArticle
&lt;h1&gt;@Model.Title&lt;/h1&gt;
&lt;p&gt;
@Model.BodyText
&lt;/p&gt;
</pre>
<p>Pretty nice isn&#8217;t it?</p>
<p><strong>The Framework</strong></p>
<p>The framework we build does almost all of the &#8216;standard ASP.NET MVC3&#8242; actions for you. For instance it does this for you out of the box:</p>
<ul>
<li>Query the broker to find the right page (using the Url)</li>
<li>Ability to render the componentpresentations separately.</li>
<li>Build an ASP.NET sitemap by using the XML published to the broker (template to render sitemap XML not yet included. Can be downloaded from the forum)</li>
<li>Link resolving</li>
<li>and much more.</li>
</ul>
<p>You can download the project here: <a href="http://code.google.com/p/dynamic-delivery-4-tridion/" target="_blank">http://code.google.com/p/dynamic-delivery-4-tridion/</a></p>
<p><strong>Pro&#8217;s and con&#8217;s</strong></p>
<p>Every development approach has it pro&#8217;s and con&#8217;s.</p>
<p><em>Pro&#8217;s</em></p>
<ul>
<li>Separation of concerns (MVC)</li>
<li>Development<br />
Development is made easy because all you need is a Visual Studio environment and you are ready to go. You don&#8217;t need Tridion Content Delivery to be installed on every development machine.<br />
We build a WCF service which query&#8217;s the broker and returns all the XML we need. Developers only have to reference the WCF service and are ready to go. They don&#8217;t have to know much about<br />
Tridion. They can program as they are used to. Making Models, Views, etc.</li>
<li>Releasing<br />
Releasing changes is a copy-paste action. Copy some (versioned!) dll files into the bin-directory and you are done. Most of the time you don&#8217;t have to re-publish your whole site. If you have set up your views in a smart way (using master-views) you can for instance update your website layout by copy-pasting the new dll file and you are done. No need te re-publish.</li>
<li>Familiarity<br />
In ASP.NET MVC3 the same concepts as in Tridion are used. You can have a masterview (PageTemplate). You can have &#8216;partial views&#8217; in a view (Placeholder in Pagetemplate where you render the ComponentPresentations).</li>
</ul>
<p><em>Con&#8217;s</em></p>
<ul>
<li>(Layout)Changes are not applied in the usual way of publishing pages/components. But by copy-ing dll files. This is (very) different from publishing changes with Tridion for instance. (What the business is used too)</li>
<li>Preview in Tridion does not work out of the box. (It is possible, but it requires some work)</li>
</ul>
<p><strong>Contributors</strong></p>
<ul>
<li>Kah Tang (<a href="http://kahwah.me/" target="_blank">http://kahwah.me/)</a></li>
<li>Alfred Creemers (.NET Developer)</li>
<li>SDL Tridion</li>
<li>Me</li>
</ul>
<p>You are free to contribute. Just download the project from GitHub and get started! (There is a Quick start document in the Wiki)</p>
<p>There is a lot I didn&#8217;t tell because nobody wants to read a long, (boring) blogpost. If you need more info or want to ask questions: feel free to mail or make remarks in the comments.<br />
I will add a follow up blogpost describing the framework in more detail if this is necessary. Let me know.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=285&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2011/08/24/tridion-and-asp-net-mvc3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>
	</item>
		<item>
		<title>Updated to GA &#8211; Releasemanagement with SDL Tridion 2011</title>
		<link>http://albertromkes.com/2011/03/04/updated-to-ga-releasemanagement-with-sdl-tridion-2011/</link>
		<comments>http://albertromkes.com/2011/03/04/updated-to-ga-releasemanagement-with-sdl-tridion-2011/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 13:47:58 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Tridion]]></category>

		<guid isPermaLink="false">http://albertromkes.wordpress.com/?p=278</guid>
		<description><![CDATA[Finally I did find the time to update the releasemanagement extension to match the GA requirements. I deleted a bunch of unnecessary files and updated the eXtension.config. Also updated part of the code to perform better. You can download the new version here. There is an updated howto.txt included with install instructions. (My previous post [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=278&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Finally I did find the time to update the releasemanagement extension to match the GA requirements.</p>
<p>I deleted a bunch of unnecessary files and updated the eXtension.config. Also updated part of the code to perform better.</p>
<p>You can download the new version <a title="Releasemanagement extension" href="http://dl.dropbox.com/u/10258660/ReleaseManagerExtensionComplete.zip">here</a>. There is an updated howto.txt included with install instructions.<br />
(My previous post is also updated with the new downloadlink)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=278&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2011/03/04/updated-to-ga-releasemanagement-with-sdl-tridion-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>
	</item>
		<item>
		<title>Releasemanagement with SDL Tridion 2011</title>
		<link>http://albertromkes.com/2010/10/05/releasemanagement-with-sdl-tridion-2011/</link>
		<comments>http://albertromkes.com/2010/10/05/releasemanagement-with-sdl-tridion-2011/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 12:07:30 +0000</pubDate>
		<dc:creator>albertromkes</dc:creator>
				<category><![CDATA[Tridion]]></category>

		<guid isPermaLink="false">http://albertromkes.wordpress.com/?p=255</guid>
		<description><![CDATA[Releasemanagement with SDL Tridion 2011<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=255&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>One thing I always discover (again!) when I work on a Tridion project, is the lack of release management. We develop new schemas, templates, edit existing ones and maybe create (config)components.</p>
<p>Developers have to keep track of all these changed items, because when the release/project/fix is ready, it has to be installed on the other Tridion servers. Normally I kept track of the changed items using an excel sheet. But boy is that tedious.</p>
<p>After finishing development we always use Contentporter to port the new/edited items to the next environment. So I print the excel-sheet, open Contentporter and have to go through the list and select each item individually. This is besides annoying, also error prone.</p>
<p>I thought this could be automated. So I created an extension for the SDL Tridion 2011 CTP. It involves a context-menu extension and a ribbontoolbar extension.</p>
<p><a href="http://albertromkes.files.wordpress.com/2010/10/context-menu.jpg"><img class="alignnone size-medium wp-image-260" title="context-menu" src="http://albertromkes.files.wordpress.com/2010/10/context-menu.jpg?w=300&#038;h=166" alt="Releasemanager context menu extension" width="300" height="166" /></a></p>
<p>You can add an item to a release by right-clicking on it. A popup is shown with all the available releases. You can select the release the item belongs to and you&#8217;re done.</p>
<p>When the release is ready to be installed on the other Tridion servers, all we have to do is create a Contentporter export- and import file. You can do this by clicking on the &#8216;Releasemanager&#8217;  button on the ribbontoolbar. It opens a popup which let you create the Contentporter files.</p>
<p><a href="http://albertromkes.files.wordpress.com/2010/10/managereleases2.jpg"><img class="alignnone size-medium wp-image-263" title="manageReleases2" src="http://albertromkes.files.wordpress.com/2010/10/managereleases2.jpg?w=300&#038;h=254" alt="Releasesmanager SDL Tridion" width="300" height="254" /></a></p>
<p>With Contentporter 2009 you can easily use these Export- and Import settings file to create an export and later import this on the next Tridion environment.</p>
<p>When you open Contentporter 2009 you can choose from 4 options. If you select the 4th option &#8216;Load wizard settings from a file&#8217;, you can use the just created export/import files to create an export for your release.</p>
<p>After you are finished with the release there is an option to finalize the release. The items are removed from the Releasemanager DB (Xml file) and placed into an history folder. There is no functionality to restore the history or to look into the history. If this extension is something people need I will update it with this functionality. Also, the layout is just plain&#8230;well, there is none <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I just wanted this to work.</p>
<p>If you like this extension and you want to use it or you have enhancement request, please let me know. I may update this extension <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Small note: Since Contentporter wasn&#8217;t installed on the CTP image, I could not test it fully. I did test it on another Tridion instance and it seemed to work <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can download the extension <a href="http://dl.dropbox.com/u/10258660/ReleaseManagerExtensionComplete.zip">here</a>. <span style="color:#ff0000;">(Updated link)</span> There is a howto.txt included with install instructions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/albertromkes.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/albertromkes.wordpress.com/255/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=albertromkes.com&#038;blog=4687809&#038;post=255&#038;subd=albertromkes&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://albertromkes.com/2010/10/05/releasemanagement-with-sdl-tridion-2011/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/a637a908b5dc773f4a9dc795131fb97e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">albertromkes</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2010/10/context-menu.jpg?w=300" medium="image">
			<media:title type="html">context-menu</media:title>
		</media:content>

		<media:content url="http://albertromkes.files.wordpress.com/2010/10/managereleases2.jpg?w=300" medium="image">
			<media:title type="html">manageReleases2</media:title>
		</media:content>
	</item>
	</channel>
</rss>
