<?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/"
	>

<channel>
	<title>Content on Content Management &#187; Site Studio</title>
	<atom:link href="http://contentoncontentmanagement.com/category/site-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://contentoncontentmanagement.com</link>
	<description></description>
	<lastBuildDate>Tue, 03 Aug 2010 12:57:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<atom:link rel="next" href="http://contentoncontentmanagement.com/category/site-studio/feed/?page=2" />

		<item>
		<title>Auto Fill That Friendly Name</title>
		<link>http://contentoncontentmanagement.com/2009/03/auto-fill-that-friendly-name/</link>
		<comments>http://contentoncontentmanagement.com/2009/03/auto-fill-that-friendly-name/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 22:12:02 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Site Studio]]></category>

		<guid isPermaLink="false">http://contentoncontentmanagement.com/?p=203</guid>
		<description><![CDATA[This is kind of a fun component&#8230;nothing too special, but I think a nice example of something you can do with UCM filter events, specifically the validateCheckinData event.  What is does is automatically assign a friendly web file name to &#8230; <a href="http://contentoncontentmanagement.com/2009/03/auto-fill-that-friendly-name/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is kind of a fun component&#8230;nothing too special, but I think a nice example of something you can do with UCM filter events, specifically the validateCheckinData event.  What is does is automatically assign a friendly web file name to site studio content using the title of the item.  The funtionality I was trying to emulate is pretty similar to what this blog does.  Whenever I post something, WordPress take the title and turns it in to a friendly file name by sort of removing any spaces or funny characters and then adding .htm on the end.  Shouldn&#8217;t be too hard to do in UCM/Site Studio right?</p>
<h3>A little background</h3>
<p>In Site Studio there are two types of pages;  Primary pages, which are essentially the landing pages for a folder(think home, search and listing pages).  They are almost always named index.htm and what&#8217;s unique about them is that when they are called they only refence specific content items.  Secondary pages, which could be viewed as everything else in a folder differ as they are used in more of traditional templated, delivery fashion, where the content is delivered through a reuseable template.  I butchering those descriptions a little for simplicities sack, but for the most part that&#8217;s how they work.</p>
<p>Out of the box, Site Studio lets you reference a content item using it&#8217;s content id in the url.  So if you had a content item called 000525, it would be referenced in a folder with it&#8217;s content id at the end(<a href="http://SiteStudio.com/site/folder/000525">http://SiteStudio.com/site/folder/000525</a> for example).  Since all templates are mapped to thier folder, everything you need to render a page can be found in the URL&#8230;it&#8217;s all pretty simple.  The thing is, what if you aren&#8217;t too crazy about the 000525 name though?  It&#8217;s not really all that intuative of a name; you could make the content id friendly or you could use also take advantage of the SSUrlFieldName property in Site Studio.  The SSUrlFieldName property allows you to map a custom metadata field(perhaps one longer than the 30 characters you get for a content id?) as the file name idenifiier used when reference in a URL.</p>
<p>So content item 000525 can also have a metadata field tagged as &#8220;autofillthatfriendlyname.htm&#8221; and so when refereced as a url, it could look like this: http://SiteStudio.com/site/folder/autofillthatfriendlyname.htm.  That&#8217;s pretty cool, right?  There is a bit of a catch though, like the content id the value used in the friendly name field should be unique.  The only problem though is that there&#8217;s no automatic validation for the values, so there&#8217;s nothing to tell the contributor if they&#8217;ve duplicated a value.</p>
<h3><span style="color: #000000;">What the component does</span></h3>
<p>The code for this component is pretty simple, we&#8217;re hooking in to the validateCheckinData event and then basically updating whatever field is identified in the SSUrlFieldName property with a friendly name.  I like the validateCheckinData filter quite bit for situations like this where I need to update or add some metadata at check in or update time.  If I have to kick a process off or do something to a piece of content that has just been checked in, so after it&#8217;s in the system, I usually prefer the afterLoadRecordWebChange, but that&#8217;s probably for another post.</p>
<p>Getting back on track, once a piece of content is checked in which has a xWebsiteSection value(meaning it&#8217;s been assigned a default URL in a web site), it pulls the dDocTitle value out of the binder and makes it friendly(removes any spaces or special characters I could think of).  It then appends a file extension(set in the environmental config) and checks the value against the database.  If the friendly name has been used before on another content item it goes back and adds a 1 to the end of the title part of the file name(I know&#8230;not very imaginative).  Each time the component assembles a name it checks it against a max character count also found in the component&#8217;s enviornmental config.</p>
<h3>Installing this puppy</h3>
<p>The install on this component is not really unlike any other.  You of course do need to make sure Site Studio is installed on your content server and that the SSUrlFieldName property has been set in the config.cfg file.  I should note that when you set the SSUrlFieldName property, you need to leave the little x prefixing all custom metadata fields off.  So no xFieldName formats&#8230;just FieldName.  You probably will need to tell the component what the size of your friendly name field is.  It&#8217;s defaulted to 80 characters, so if you  plan on using less or more, you might want to update it in the component&#8217;s environmental config file.</p>
<p>You can download the component here:  <a rel="attachment wp-att-209" href="http://contentoncontentmanagement.com/2009/03/auto-fill-that-friendly-name/autofillfriendlyname/">Auto Fill Friendly Name</a></p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2009/03/auto-fill-that-friendly-name/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Eval This!  Creating Reusable Fragments with Site Studio</title>
		<link>http://contentoncontentmanagement.com/2008/06/eval-this-creating-reusable-fragments-with-site-studio/</link>
		<comments>http://contentoncontentmanagement.com/2008/06/eval-this-creating-reusable-fragments-with-site-studio/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 01:25:56 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Fragments]]></category>
		<category><![CDATA[IDOC]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Site Studio]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/?p=83</guid>
		<description><![CDATA[There&#8217;s a pretty clever function used in Site Studio JSP development called evalIdcScp. It&#8217;s a method on the idcserver.ServerBean and if you&#8217;ve worked with or implemented a JSP Site Studio site, you&#8217;ve undoutably run accross it more than once. As &#8230; <a href="http://contentoncontentmanagement.com/2008/06/eval-this-creating-reusable-fragments-with-site-studio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a pretty clever function used in Site Studio JSP development called evalIdcScp.  It&#8217;s a method on the idcserver.ServerBean and if you&#8217;ve worked with or implemented a JSP Site Studio site, you&#8217;ve undoutably run accross it more than once.</p>
<p>As you might guess evalIdcScp stands for &#8220;Evaluate Idoc Script&#8221; and it&#8217;s purpose is to allow IDOC script execution inside of a JSP page.  This is great because even though IDOC/HCSP and JSP sites utilize completely different languages, the general interation with the content server can occur in a similar way.</p>
<p>An example of how evalIdcScp is commonly used is with fragment parameters.  Consider these two examples, one in IDOC the other in JSP:</p>
<address>IDOC</address>
<p><code>BackgroundColor = getValue("#active",ssFragmentInstanceID + "_BackgroundColor")</code></p>
<address>JSP</address>
<p><code>String BackgroundColor = serverbean.evalIdcScp("getValue(\"#active\",ssFragmentInstanceID + \"_BackgroundColor\")");</code></p>
<p>Both examples use the IDOC function getValue to retrieve the background color parameter.  While it might look a little kludgy from a Java perspective, the fact is that there are a number of functions in IDOC that are coded for specific interactions within the content server, being able to leverage those functions in Java and JSP can make things quite a bit easier.</p>
<p><strong>That&#8217;s great and all but are you seriously posting about a method?</strong></p>
<p>Leveraging IDOC functions in JSP is nice but hardly ground breaking.  Where I think things do get a little more interesting is when you realize that evalIdcScp is less of an eval function and more of an IDOC parser.</p>
<p>Here&#8217;s some code for a very simple yet traditional JSP static list fragment.  The fragment will render a little &#8220;call out&#8221; list, basically a vertical group of  link/title and description blocks.</p>
<p><code>//get a count of the number of rows in the list</code><br />
<code>String titleCountRaw = serverbean.evalIdcScp("ssGetXmlNodeCount(SS_DATAFILE, [Root]/Title')");<br />
//convert the count to a number<br />
int titleCount = Integer.parseInt(titleCountRaw);</code></p>
<p><code>//loop through all the nodes of the static list</code><br />
<code>for(int counter=1;counter&lt;= titleCount;counter++){<br />
//get the title<br />
String Title = sb.evalIdcScp("ssIncludeXml(SS_DATAFILE, '[Root]/Title[" + counter + "]/node()')");<br />
//get the link<br />
String Link = sb.evalIdcScp("ssIncludeXml(SS_DATAFILE, '[Root]/Link[" + counter + "]/node()')");<br />
//get the description<br />
String Desc = sb.evalIdcScp("ssIncludeXml(SS_DATAFILE, '[Root]/Desc[" + counter + "]/node()')");<br />
//render the html call out. note the ugly inline html.<br />
%&gt;<br />
&lt;div&gt;&lt;h1&gt;&lt;a href="&lt;%=Link%&gt;"&gt;&lt;%=Title%&gt;&lt;/a&gt;&lt;/h1&gt;&lt;%=Desc%&gt;&lt;/div&gt;<br />
&lt;%<br />
}<br />
</code></p>
<p>Again a pretty basic example, but one which reveals a fundamental weaknesses in many fragment designs; The HTML is often embedded in the code.  This makes creating re-usable fragments much tougher and often when attempted involves just parameterizing CSS or other HTML attributes.</p>
<p>Using the evalIdcpScp method  we may have an additional option in designing a more flexible, reusable fragment.  Using out static list example from before, let&#8217;s also assume we have a BigText fragment parameter called &#8220;CallOutHTML&#8221;.  We&#8217;ll also assume that when the example static list is added to a template the following mark up is placed in the parameter(notice the embedded IDOC):</p>
<p><code> &lt;div&gt;<br />
&lt;h1&gt;&lt;a href="&lt;$Link$&gt;"&gt;&lt;$Title$&gt;&lt;/a&gt;&lt;/h1&gt;<br />
&lt;$Desc$&gt;<br />
&lt;/div&gt;<br />
</code></p>
<p>We&#8217;ll then make some adjustments to the static list code, this time leveraging our new fragment paramter along with the evalIdcScp method.</p>
<p><code>//get the CallOutHTML html parameter</code><br />
<code>String CallOutHTML = sb.evalIdcScp("getValue('#active', ssFragmentInstanceId &amp; '_CallOutHTML')");</code><br />
<code>//get a count of the number of rows in the list</code><br />
<code>String titleCountRaw = serverbean.evalIdcScp("ssGetXmlNodeCount(SS_DATAFILE, [Root]/Title')");<br />
//convert the count to a number<br />
int titleCount = Integer.parseInt(titleCountRaw);</code></p>
<p><code>//loop through all the nodes of the static list</code><br />
<code>for(int counter=1;counter&lt;= titleCount;counter++){<br />
//get the title<br />
String Title = sb.evalIdcScp("ssIncludeXml(SS_DATAFILE, '[Root]/Title[" + counter + "]/node()')");<br />
//get the link<br />
String Link = sb.evalIdcScp("ssIncludeXml(SS_DATAFILE, '[Root]/Link[" + counter + "]/node()')");<br />
//get the description<br />
String Desc = sb.evalIdcScp("ssIncludeXml(SS_DATAFILE, '[Root]/Desc[" + counter + "]/node()')");</code></p>
<p><code>//put the title, link and desc back in to the binder as local values<br />
sb.putLocal("Title",Title);<br />
sb.putLocal("Title",Link);<br />
sb.putLocal("Desc",Desc);</code></p>
<p><code>//and now the cool part...render the list<br />
out.println(sb.evalIdcScp("$&gt;" + CallOutHTML + "&lt;$"));<br />
}</code></p>
<p>So what just happened?</p>
<ul>
<li>We defined a big text parameter called CallOutHTML that contained all the HTML needed to render a call out.  In the spots where we needed output values we placed IDOC variables using the standard IDOC syntax(not the HCSP variety).</li>
<li>We began a standard loop through the static list pulling out our values from the the data file</li>
<li>Rather than rendering the values right away to the page with inline HTML, we put those values back in to the binder as local data.</li>
<li>evalIdcScp was called, passing CallOutHTML in as a parameter along with some funny syntax to close out and then open IDOC script before and after our CallOutHTML string.  We did this because evalIdcScp evaluates the contents of it&#8217;s only argument as IDOC script, so immediately closing out the script allows us to pass HTML through and then only render the scripts inside the string.</li>
<li>The server bean then executes CallOutHTML as IDOC script and since our three values (Title, Link and Desc) are in the local binder, the IDOC parser evaluates them and injectes them in to the HTML.</li>
</ul>
<div>The result is that the static list renders reach row of the static list using the HTML in the CallOutHTML parameter as it&#8217;s &#8220;template&#8221;.</div>
<div>
<p><strong>That looks like security vulnerability</strong></p>
</div>
<p>If this were another system, say one that used PHP or Python as it&#8217;s scripting language, I would have a real problem with this technique.  If you generate presentation via a server side eval function you need to think long and hard about where the data being evaluated comes from because If it can come from a user prompt you&#8217;ve opened your application up to injection attacks.</p>
<p>Fortunately for us IDOC is no python.  It&#8217;s a fundamentally safe language that can&#8217;t do very much other that read values you already have access to (workflow functions being the only exception).  IDOC can call services but they are secured both by permissions as well as by type of use.  As a general rule, if it makes a change in UCM you can&#8217;t script it.</p>
<h3>A Simple MVC Pattern for Fragments?</h3>
<p>In our static list example we&#8217;ve demonstrated how to separate the layer presentation from the fragment code and implemented it in more of a template-specific manner.  The static list code with it&#8217;s generic Title, Link and Desc elements can now be re-used across a many different template and web sites.  Very little consideration needs to be given for how the static list will be displayed, knowing that virtually any presentation requirement can be met with the fragment.  As long as the situation calls for a static list with Title, Link and Description elements this fragment can be used.  While I wouldn&#8217;t start calling this an MVC framework, I think we can start to see the hallmarks and benefits of MVC design.</p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2008/06/eval-this-creating-reusable-fragments-with-site-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Templating with Fragments</title>
		<link>http://contentoncontentmanagement.com/2008/01/templating-with-fragments/</link>
		<comments>http://contentoncontentmanagement.com/2008/01/templating-with-fragments/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 05:13:16 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Fragments]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Site Studio]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2008/01/05/templating-with-fragments/</guid>
		<description><![CDATA[I&#8217;ve been playing around with an idea for a little while, one which I&#8217;m not actually 100% sold on yet, but I figured I would put it out there.  It has to do with Site Studio templates and how one &#8230; <a href="http://contentoncontentmanagement.com/2008/01/templating-with-fragments/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with an idea for a little while, one which I&#8217;m not actually 100% sold on yet, but I figured I would put it out there.  It has to do with Site Studio templates and how one might go about deploying abstracted, consistent HTML across all templates in a site.  Ideally what I&#8217;m really looking for is template inheritance, something to allow me to create a base template that I can then build other templates from and on top of.  Unfortunately Site Studio doesn&#8217;t really provide that kind of functionality, or at least does not have a method described to support it.</p>
<p>The current process for template development goes something like this:  Designers take their HTML and paste it in to a new Site Studio layout template, contributor areas are identified and regions/elements are added.  Functional areas of the page are broken out in to fragment controls.  It&#8217;s a fairly organic way of developing a web page, one which makes sense and is easy to understand by most everyone.  The problem for me though is that as multiple templates are added to the site, they usually employ a common structure and design of which usually a significant portion ends up having to be duplicated on each template.</p>
<p>A big deal?  It&#8217;s certainly not the end of the world, but perhaps there&#8217;s a more elegant method.</p>
<p>I&#8217;ve been tinkering with using fragments or more specifically fragment snippets a little differently then they are more commonly used right now.  Instead of pasting in the HTML directly in to the layout template like I normal, I start by creating a new &#8220;base layout&#8221; and in it I created a series of drop point, reference snippets for each of the opening and closing tags used in the structural formatting for the page.</p>
<p><img src="http://contentoncontentmanagement.com/wp-content/uploads/2008/01/baselayoutfragmentexample.gif" alt="Base Layout Fragment Example" /></p>
<p>As you can see from the table above, the fragment holds seven snippets which house the foundational structure of the template and could be re-used on every page in the site.</p>
<p>With the base layout fragment complete, I then created a sub layout which could be used inside the base layout&#8217;s structure.  Again nothing to fancy, it&#8217;s basically a div that contains a place to put a title and some content.</p>
<p><img src="http://contentoncontentmanagement.com/wp-content/uploads/2008/01/containerfragmentexample.gif" alt="Container Fragment Example" /></p>
<p>This fragment, which I am calling a container fragment, also allows for an ID attribute for the container&#8217;s div to be passed in.  This is cool because when I added the fragment to the page I did it three times; twice next to each other in between the &#8220;Start of Body&#8221; and above &#8220;Body Divider&#8221; snippets and then once after the &#8220;Body Divider&#8221; snippet.  Using CSS I set the two upper container fragments to float side by side and lower one to take up the entire lower portion of the page.</p>
<p>So just to recap, I created two fragments both of which contain only HTML, added them to the page 4 times(1base fragment 3 container fragments) and interspersed the container fragments in beween snippets from the layout fragment.  Looking at the template in design view, you would see that the only HTML present is the HTML,HEAD and BODY tags that the designer adds.  All HTML has been abstracted from the template.</p>
<p>From there I added a region to the page, wrapping it&#8217;s open and closing region tags before and after the &#8220;Start of Main&#8221; and &#8220;End of Main&#8221; snippets.  With the region in place, I then went and added elements in between the various snippets.  Between the &#8220;Start of Title&#8221; and &#8220;End of Title&#8221; snippets(both in the containers and on the page) I added text elements.  In side the container, after the &#8220;End of Title&#8221; snippets, I added WYSIWYG areas.  More traditional functional fragments like static lists or navigation could also be placed in between the layout or container snippets also.</p>
<p>Once the region is in, content can be assigned and the layout template can be used to render pages.  Instead of having 5-10 similar templates with similar HTML though, with this design all HTML is added once and then can be re-used multiple times.  All pages should display in a consistent format and global changes can be made to the design of all pages from a single location.</p>
<p>So what&#8217;s the downside?  Well there <em>might</em> be a performance impact, it&#8217;s just not completely clear if it&#8217;s negligible or at what point it will become noticeable.  Fragment snippets are really just nodes in an XML file which are rendered using a XPATH expression and Site Studio&#8217;s ssIncludeXML IDOC function.  The couple fragments I&#8217;ve used in my example probably aren&#8217;t going to cause a problem, but using this design has the potential to add a great many more snippets to a template then one would normally see.  How many is too many, I&#8217;m just not sure yet&#8230;.so far it doesn&#8217;t seem to be a problem though.</p>
<p>I&#8217;m going to keep evaluating this design and will have some follow up posts down the road.  If anyone has any similar stories, post a comment or send me an email, I&#8217;d be very interested to hear your thoughts.</p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2008/01/templating-with-fragments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Content Server Localization</title>
		<link>http://contentoncontentmanagement.com/2008/01/fun-with-content-server-localization/</link>
		<comments>http://contentoncontentmanagement.com/2008/01/fun-with-content-server-localization/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 14:15:17 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[IDOC]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Site Studio]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2008/01/03/fun-with-content-server-localization/</guid>
		<description><![CDATA[Oracle / Stellent Content Server provides some pretty robust localization support.  I&#8217;m often suprised how much functionality there is to support localized data.  Strings and dates can be returned in a variety of languages and formats all based on the user&#8217;s &#8230; <a href="http://contentoncontentmanagement.com/2008/01/fun-with-content-server-localization/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Oracle / Stellent Content Server provides some pretty robust localization support.  I&#8217;m often suprised how much functionality there is to support localized data.  Strings and dates can be returned in a variety of languages and formats all based on the user&#8217;s locale.  Schema/DCL data also support multiple locales, both through the javascript version of the lc function and also through display rules in the view.  The level of localization support and easy of use reminds me of what we tend to see from some of the European CMS vendors, who for obvious reasons seem to place a greater priority on localization.</p>
<p>The one issue I&#8217;ve run in to though is when developing web sites in Site Studio I find it&#8217;s hard to tap in to all of that wonderful localization functionality without changing the default system locale.  The problem appears to be that the localization is based on the user and since all anonymous users are essentially using the same account, they all appear to have the same locale.  I&#8217;ve read some posts on how to change the user&#8217;s locale by updating a cookie, either server side or by Javascript, but to be honest I&#8217;m not super crazy about that method.  Odds are everything will work fine 99.99% of the time, but what if a user has cookies disable or if the user is actually a search crawler which is ignoring cookies? It&#8217;s probably not going to work so well.</p>
<p><strong>Enter the IdcLocale object</strong></p>
<p>Changing the user&#8217;s locale during a service execution is actually an extremely easy thing to do.  Localization data is held in the IdcLocale object(intradoc.common package), which is stored during exection as a cached object named &#8220;UserLocale&#8221;.  If you wanted to access a user&#8217;s IdcLocale object, the syntax looks something like this:</p>
<p><code>IdcLocale MyLocale = (IdcLocale)context.getCachedObject("UserLocale");</code></p>
<p>Changing the locale take a couple more steps.  You first need load a new IdcLocale object specific to your locale and then you need to overwrite the old one.  Creating a new IdcLocale object is pretty simple, you use the LocaleResources object and call the static method, getLocale.  It takes a single argument, the name of the Locale you&#8217;re loading:</p>
<p><code>IdcLocale ItalianLocale = LocaleResources.getLocale("Italiano");</code></p>
<p>Once you have the new IdcLocale object, you only need to overwrite the old one and your locale is changed :</p>
<p><code>context.setCachedObject("UserLocale", ItalianLocale);</code></p>
<p><strong>Putting it in action</strong></p>
<p>I&#8217;ve put together a sample component which adds functionality for changing the user&#8217;s locale dynamically.  In tinkering with user locales, there are two customizations which I think can come in handy.</p>
<p>The first is customization is a filter attached to the &#8216;afterInitLocale&#8217; event, which is fired right after the user&#8217;s locale is set during a service call and I&#8217;m pretty sure was put there specifically for changing the locale. In the component, the filter looks for a local binder value called ForceUserLocale. If it&#8217;s there and it&#8217;s a valid Locale name, then it swaps out the current user&#8217;s IdcLocale object with a new one. Post-switch, the service continues it&#8217;s execution evaluting the new Locale object.</p>
<p>The other customization basically wraps that same code in a new IDOC script function called setLocale. SetLocale takes a single argument, LocaleName, which is of course the name of a valid locale in the system. Calling the function immediatly switches out the user&#8217;s Locale with a new one. This is pretty cool if you&#8217;re working on a web page or template and wish to show the same or multiple strings in different languages.</p>
<p>Using the new setLocale function, the following code would display the same string on the same page in different languages:<br />
<code>&lt;$setLocale("Italiano")$&gt;<br />
<span>&lt;$lc("wwPoweredBy")$&gt;</span><br />
&lt;$setLocale("Italiano")$&gt;<br />
<span>&lt; $lc("wwPoweredBy")$&gt;</span></code></p>
<p><code>Controllato dal sistema di gestione dei contenuti<br />
Powered by Content Management System</code></p>
<p>Changing the Locale dynamically with a local binder value might not be the best fit for all implementations. If you install the sample component adding <code>ForceUserLocale=Italiano</code> to the URL will change the locale to Italian, which may or may not be undesirable. Nevertheless, I think the component demostrates some of the cool things you can do with the IdcLocale object.</p>
<p>The sample Anonymous User Locale component is can be downloaded here:<br />
<a rel="attachment wp-att-43" href="http://ContentOnContentManagement.com/2008/01/03/fun-with-content-server-localization/anonymous-user-locale-component/">Anonymous User Locale Component</a></p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2008/01/fun-with-content-server-localization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site Studio Tips, Tricks and Hacks</title>
		<link>http://contentoncontentmanagement.com/2007/12/site-studio-tips-tricks-and-hacks/</link>
		<comments>http://contentoncontentmanagement.com/2007/12/site-studio-tips-tricks-and-hacks/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 04:03:23 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Fragments]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Site Studio]]></category>
		<category><![CDATA[Stellent]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/12/05/site-studio-tips-tricks-and-hacks/</guid>
		<description><![CDATA[I thought I would throw together a list of some of the things I do when setting up or even working with Site Studio.  Nothing too crazy or ground breaking, just some things I do to make life a little &#8230; <a href="http://contentoncontentmanagement.com/2007/12/site-studio-tips-tricks-and-hacks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I thought I would throw together a list of some of the things I do when setting up or even working with Site Studio.  Nothing too crazy or ground breaking, just some things I do to make life a little easier while I&#8217;m developing.</p>
<p><strong>Use Real Names for Section IDs</strong></p>
<p>Starting work on a new site, my first step is to go through and set up the known folder structure of the site.  This usually only takes a little while, but it helps me visualize how everything will work as I&#8217;m developing.  One thing that&#8217;s very important to me during this step and really throughout the build is to ensure I&#8217;m using logical names for the section ids and not just the default numerical ones that the designer will assign.  Down the road when debugging fragments or even reviewing content in the repository, numbers as section ids can be very confusing and will probably cost more time the it takes to just give them logical names.</p>
<p><strong>Create a Templates Folder</strong></p>
<p>When I am building out the site&#8217;s folder structure I also like to create a contributor-only templates section.  There I add a section for each template the site will use, actually creating the template and assigning it to the section during the process.  Often I will break up the template sections by how they are used, adding primary and secondary template parent sections.  If I have any html ready, I paste it in to the templates, adjusting any css, javascript or image paths during the process.</p>
<p>The templates folder allows me to get all my templates in and assigned to the site, but in a central location.  Templates can be added as a site asset, so this is a bit redundant, but having them in a folder allows me to assign region content, test custom properties and potentially navigation as well.</p>
<p><strong>Use Fragments for Images, Javascript and CSS</strong></p>
<p>When I start work on a site I usually have the luxury of receiving all of my html, css and some of my javascript pre-built from our user experience group which means I am not doing any serious HTML development in Site Studio other then some simple tweaks.  Since that&#8217;s the case, there&#8217;s no good reason for me to load what could be hundreds of individual site assets in to the content server.  It&#8217;s much easier just to load each set of assets in to fragments and then check them in that way.  In addition you can preserve any folder structure the assets already have, making tweaks to the template html a bit easier too.  Loading each asset individually is perfectly fine, but I thinks far easier and a little cleaner in the content server to load them in fragments.</p>
<p>When you save the fragments it&#8217;s assets are written out to the weblayout/fragments folder.  Once those assets are there, I just create a single &#8220;head&#8221; fragment which references the nessecary items from css and javascript assets, never actually referencing the css or javascript fragments.</p>
<p><strong>One Fragment per Library</strong> </p>
<p>I&#8217;m a fan of creating a new library for each fragment in my site.  I&#8217;ve done this differently in the past, creating more contextual libraries with multiple fragments, but I&#8217;m much happier now with the one fragment per library way.  Right off it&#8217;s much easier to manage fragment development with multiple developers.  Multiple fragments in a single library means that one developer can check out a library at a time thereby preventing other developers from working on other fragments in the same library.  </p>
<p>My biggest reasoning though has to do with change management.  If there are multiple fragments in a library all of them must be production ready to deploy.  You easily can find yourself in a situation where a change is occurring on one fragment, when a bug or another emergency change needs to happen on another.  If all the fragments are in the same library it can become a confusing mess.  If you stick with one per library you may have a few more libraries in the content server, but you&#8217;ll also have a great deal more flexibility.</p>
<p><strong>Debug that JSP</strong></p>
<p>This next part can be a little tricky and from an Oracle perspective is probably a bad practice.  Generally whenever I set up a new development environment also set up eclipse to debug the content server as well.  <a href="http://bexhuff.com/">Bex Huff&#8217;s </a>book &#8220;<a href="http://www.apress.com/book/view/1590596846">The Definitive Guide to Stellent Content Server Development</a>&#8221; details how to configure eclipse for debugging so I am not going to cover that process here.  What I will talk about though is that if you are running a version of Eclipse with JSP support, you can also debug JSP fragments and layout templates just as easily as filters and service handlers.</p>
<p>This sounds great, but you have to remember that if you&#8217;re debugging and editing your fragments through eclipse, ultimately you&#8217;re also doing it in the content server&#8217;s area of the file system.  If you&#8217;re not careful this is an excellent way to loose your work.  If anyone else edits your fragment library or if they deploy your fragment through the Site Studio fragment administration page, any changes you&#8217;ve made on the file system will be immediately overwritten.  To counter the threat of loosing my changes, I make sure I always check out each item I&#8217;m debugging and frequently save my changes back to the fragment using the designer.  All that said, being able to debug with eclipse can make development so much easier the rewards far outweigh the risks. </p>
<p>To set up JSP debugging, first follow the steps in Bex&#8217;s book to set up your eclipse environment and then just link the weblayout folder to your content server project.  From there you&#8217;ll find your fragment JSPs in the weblayout/groups/[your jsp enabled security group]/WEB-INF/fragments/[fragment name] folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2007/12/site-studio-tips-tricks-and-hacks/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>OpenWorld &#8211; Monday</title>
		<link>http://contentoncontentmanagement.com/2007/11/openworld-monday/</link>
		<comments>http://contentoncontentmanagement.com/2007/11/openworld-monday/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 22:10:05 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[OpenWorld]]></category>
		<category><![CDATA[Site Studio]]></category>
		<category><![CDATA[Stellent]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/11/13/openworld-monday/</guid>
		<description><![CDATA[Very fun stuff so far here at OpenWorld.  Not too much to report from Sunday evening, basically the standard kick off stuff.  Monday though was the start of sessions and when we started seeing what the former Stellent folks had &#8230; <a href="http://contentoncontentmanagement.com/2007/11/openworld-monday/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Very fun stuff so far here at OpenWorld.  Not too much to report from Sunday evening, basically the standard kick off stuff.  Monday though was the start of sessions and when we started seeing what the former Stellent folks had been working on.</p>
<p>Some of the highlights so far:</p>
<p>1. There is a new web-based Site Studio editor coming out in the next few months to replace the existing activex one.  Personally this was huge for me as the IE only aspect of the existing editor has always been a pain point with some of my clients who prefer macs.  In general the editor was pretty slick.  It appears as a pop-up when you click the in-context edit button and has a tabbed interface allowing you to contribute content on one tab and update metadata on the other.  They&#8217;ve also added some additional validation which can be configured to require specific standards compliance when contributing.</p>
<p> 2. The WCMA project appears to now be called Open WCM and it looks to be very cool.  Not much of a demo this time, but more of an architectural discussion.  The concept is to allow web content management delivery on any platform, using any language..hence the open part.  In addition they also would like to take the content server out of the delivery environment, moving to more of a hybrid publishing model, which can be consumed by your web app.</p>
<p> 3. During the digital asset management session, we got a nice demo of what you can do with the Folios component that was released just last week.  Folios is very, very cool new feature which allows you to relate several content items together and have them become an additional new item in the system.  You&#8217;re new folio then can be associated with metadata, sent through workflow for approvals or, depending on the formats, published as a compound document.</p>
<p>Also very cool are some of ideas on how they plan on integrating Content Server with the other application in the Fusion Middleware stack.  There seems to be a big focus on delivering personalized, targeted content using Seibel profiles and Oracle&#8217;s Real Time decisioning application(part of the BI suite).  All of that is just conjecture at this point, but still very cool to hear they were working on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2007/11/openworld-monday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script.aculo.us Component for Oracle/Stellent</title>
		<link>http://contentoncontentmanagement.com/2007/09/scriptaculous-component-for-oraclestellent/</link>
		<comments>http://contentoncontentmanagement.com/2007/09/scriptaculous-component-for-oraclestellent/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 12:52:39 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Site Studio]]></category>
		<category><![CDATA[Stellent]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/09/08/scriptaculous-component-for-oraclestellent/</guid>
		<description><![CDATA[About a year ago one of my co-workers introduced me to the Scriptaculous Javascript library.  At the time I have to admit I wasn&#8217;t very impressed by Javascript-anything, but I was working on a project which was going to require &#8230; <a href="http://contentoncontentmanagement.com/2007/09/scriptaculous-component-for-oraclestellent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>About a year ago one of my co-workers introduced me to the <a href="http://script.aculo.us/">Scriptaculous</a> Javascript library.  At the time I have to admit I wasn&#8217;t very impressed by Javascript-anything, but I was working on a project which was going to require a moderate amount of javascript and I decided to give it a try.  I&#8217;ve been hooked ever since.  The thing I like about it is that like any good framework, you write a lot less code but gain a great deal of reliability and functionality.   And at about the time you start to appreciate how much less code you&#8217;re writing you figure out that with just one or two more lines you can make it look cool too.</p>
<p>Scriptaculous is built on <a href="http://www.prototypejs.org/">Prototype</a> which is an independent Javascript framework used by several libraries in addition to Scriptaculous. Prototype&#8217;s claim to fame is the $() function, which is used to reference html elements and is far easier to type than document.getElementById().  The framework is chock full of functionality to make your life easier and also provides an abstraction layer to the browser so Prototype handles any compatibility issues for you.</p>
<p>Here&#8217;s a couple of my favorite Prototype functions:<br />
<code><br />
//returns all elements which have a specified css class<br />
document.getElementsByClassName([class name]);</code></p>
<p><code></code><code>//attaches a function to an object event<br />
Event.observe([object],[event name],[function]);</code></p>
<p><code></code><code>//converts the input fields of a form in to an Ajax compatible query string format<br />
[Form Object].serialize();<br />
</code></p>
<p>The Scriptaculous library then has an additional set of utilities, controls and my favorite the effects.</p>
<p><span id="testdiv">Couple of my favorite Scriptaculous Functions:</span><br />
<code><br />
<a href="Javascript:;" onclick="Javascript:new Effect.Fade($('testdiv'));">Effect.Fade($("testdiv"))</a><br />
<a href="Javascript:;" onclick="Javascript:new Effect.Appear($('testdiv'));">Effect.Appear($("testdiv"))</a><br />
<a href="Javascript:;" onclick="Javascript:new Effect.BlindDown($('testdiv'));">Effect.BlindDown($("testdiv"))</a><br />
</code></p>
<p>All of this brings me to Stellent/Oracle who actually have a Javascript preference of their own, the Yahoo YUI library.  I am also a big fan of YUI, but it&#8217;s much more of a control library then a framework.  This has caused problems for me when working with 3rd party web designers who are not developing HTML specifically for YUI.  Scriptaculous on the other hand often works great regardless of how the HTML is designed.  Both libraries can live harmoniously on the same page and I&#8217;ve often found myself using the Prototype $() function to reference YUI controls.</p>
<p>Oracle/Stellent implements the YUI library using a component which places their Javascriptand CSS files in the weblayout/resources folder.  Using that same concept, I put together a quick and dirty Scriptaculous component which does the same.  In addition there&#8217;s a  resource override of the std_html_head_declarations include, where I&#8217;ve added a reference to the library, making it globally available in the Content Server UI. That component is available for download here and it includes the latest release version of Scriptaculous 1.7.0.</p>
<p>Updated: 11/10/2007 &#8211; The latest Oracle / Stellent Script.aculo.us component(version 1.8) may be downloaded here:</p>
<p><a rel="attachment wp-att-31" href="http://ContentOnContentManagement.com/2007/11/10/scriptaculous-prototype-update/scriptaculous-component-for-oracle-stellent-content-server/" title="Script.aculo.us Component for Oracle / Stellent Content Server">Script.aculo.us Component for Oracle / Stellent Content Server</a></p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2007/09/scriptaculous-component-for-oraclestellent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle/Stellent Site Studio Doc Info Caching</title>
		<link>http://contentoncontentmanagement.com/2007/09/oraclestellent-site-studio-doc-info-caching/</link>
		<comments>http://contentoncontentmanagement.com/2007/09/oraclestellent-site-studio-doc-info-caching/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 01:45:16 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Fragments]]></category>
		<category><![CDATA[IDOC]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Site Studio]]></category>
		<category><![CDATA[Stellent]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/09/04/oraclestellent-site-studio-doc-info-caching/</guid>
		<description><![CDATA[One of the things I&#8217;ve struggled with when developing fragment controls in Site Studio is; what&#8217;s the best way to get the metadata for the content region while in a fragment?  The problem has been that while a fragment is &#8230; <a href="http://contentoncontentmanagement.com/2007/09/oraclestellent-site-studio-doc-info-caching/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the things I&#8217;ve struggled with when developing fragment controls in Site Studio is; what&#8217;s the best way to get the metadata for the content region while in a fragment?  The problem has been that while a fragment is being executed, it&#8217;s metadata overrides the metadata related to the content region.  Logically this make some sense, the content region&#8217;s document and the fragment are both content items in the repository, one would assume that metadata is required to render them both.  But what&#8217;s the best way to get that metadata from the content region&#8217;s document?  I&#8217;ve seen a couple examples where users create a renamed copy of the content region&#8217;s DOC_INFO resultset on the page, but I suspect the most common technique is to simply call the DOC_INFO_BY_NAME service in each fragment using the region id as the dDocName.</p>
<p>Personally I find the renamed DOC_INFO method to be effective, but also a bit clunky.  I don&#8217;t like the idea of needing code on the page in order make my fragment work properly.  I&#8217;m even less of a fan of using the DOC_INFO_BY_NAME service.  The service consists of twelve actions which check, set and return values, 99% of which you will not need, just to get the DOC_INFO resultset, which was already loaded with the page(twice) prior to loading the fragment.  One or two fragments on a page calling the DOC_INFO_BY_NAME service probably won&#8217;t cause much of a problem, but add a few more and you&#8217;ll notice a perceptible delay in your load time.</p>
<p>What I&#8217;ve been looking for is a way to create fragments which can utilize the content region&#8217;s metadata, not cause a preformace drag on my page and also allow me to encapsulate all of my code in the fragment.  I want to just drop the fragment on the page and watch it magically start working.  Bonus:  I need it to work in IDOC or JSP.  Does Stellent have an out of the box way to answer this need?  I haven&#8217;t found one but there really should be, not only because it makes sense, but because they already have most of the code in place to support this functionality.<span id="more-6"></span></p>
<p>In the Site Studio classes folder there&#8217;s a class called SSCommon, which appears to provide a set of common(go figure) functions for Site Studio.  There are quite a few methods in the class, but two of them stand out, &#8220;getDocInfo&#8221; and &#8220;createCachedResultSet&#8221;.  Apply a little deductive logic, a little testing and you&#8217;ll quickly find that calling &#8220;getDocInfo&#8221; will retrieve or create a cached DOC_INFO resultset.</p>
<p>To make calling getDocInfo a bit easier as well as possible in IDoc,  I&#8217;ve created a component which adds an IDoc function called &#8220;ssGetCachedDocInfo&#8221;.  The code is pretty simple, remember Stellent/Oracle has done most of the work for us.</p>
<p><code>//create a new binder so we don't overwrite the fragment's doc_info<br />
DataBinder CacheBinder = new DataBinder();<br />
//call getDocInfo from SSCommon<br />
SSCommon.getDocInfo(dDocName, service, CacheBinder, false, null);<br />
//Retrieve the new DOC_INFO resultset<br />
ResultSet myResultSet = CacheBinder.getResultSet("DOC_INFO");<br />
//Create a dataresultset so we can save it<br />
DataResultSet myResultSetdr = new DataResultSet();<br />
myResultSetdr.copy(myResultSet);<br />
//add it to the binder with a new name<br />
binder.addResultSetDirect("DOC_INFO_" + dDocName, myResultSetdr);</code></p>
<p>As you can see the new Idoc function, ssGetCachedDocInfo, uses the getDocInfo method to retrieve the cached DOC_INFO resultset and then places it back in to the binder named DOC_INFO_ followed by the content id of the item.  I&#8217;ve left out all the code used to support an IDoc function, but the full version is available for <a href="http://ContentOnContentManagement.com/2007/09/04/oraclestellent-site-studio-doc-info-caching/oraclestellent-site-studio-doc-info-caching/" rel="attachment wp-att-7">download.</a></p>
<p>To test the ssGetCachedDocInfo function, create a new IDoc fragment and add the following code to a drop point/reference snippet.</p>
<p><code>Content ID: &lt;!--$dDocName--&gt;<br />
Title: &lt;!--$dDocTitle--&gt;<br />
Security Group: &lt;!--$dSecurityGroup--&gt;<br />
Type: &lt;!--$dDocType--&gt;<br />
&lt;!--$endloop--&gt;</code></p>
<p><code>&lt;!--$result = ssGetCachedDocInfo(region1)--&gt;</code><code><br />
&lt;!--$if rsExists("DOC_INFO_" &amp; region1)--&gt;<br />
&lt;!--$result = rsFirst("DOC_INFO_" &amp; region1)--&gt;<br />
Content ID: &lt;!--$getValue("DOC_INFO_" &amp; region1,"dDocName")--&gt;<br />
Title: &lt;!--$getValue("DOC_INFO_" &amp; region1,"dDocTitle")--&gt;<br />
Security Group: &lt;!--$getValue("DOC_INFO_" &amp; region1,"dSecurityGroup")--&gt;<br />
Comments: &lt;!--$getValue("DOC_INFO_" &amp; region1,"xComments")--&gt;<br />
Type: &lt;!--$getValue("DOC_INFO_" &amp; region1,"dDocType")--&gt;<br />
&lt;!--$endif--&gt;</code></p>
<p>Add the fragment to a page with a content region and you&#8217;ll see the results.  The first block of code will retrieve and display the active DOC_INFO resultset, which will relate to the fragment not the region&#8217;s content item.  The second block executes the new ssGetCachedDocInfo IDoc function and retrieves the region&#8217;s metadata.  If you run a couple of SQL traces before and after adding the fragment to the page, you&#8217;ll note the lack of any additional doc info queries.</p>
<p>Since creating the function, we&#8217;ve found quite a few uses for it.  I&#8217;ve used it to create a related links call out, which uses the content region&#8217;s metadata in a search call to build a dynamic list of links in the site which relate to the content area.  I&#8217;ve also created a title fragment, which builds out the title tag dynamically for my pages, using the content region&#8217;s title.  Most interestingly though was what one of my colleagues did, which was use the function to retrieve cached metadata for items in a static list and therefore not actually found in a region on the page.</p>
<p>Feel free to download the component and the code <a href="http://ContentOnContentManagement.com/2007/09/04/oraclestellent-site-studio-doc-info-caching/oraclestellent-site-studio-doc-info-caching/" rel="attachment wp-att-7">here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2007/09/oraclestellent-site-studio-doc-info-caching/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

