<?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; IDOC</title>
	<atom:link href="http://contentoncontentmanagement.com/category/idoc/feed/" rel="self" type="application/rss+xml" />
	<link>http://contentoncontentmanagement.com</link>
	<description></description>
	<lastBuildDate>Tue, 16 Mar 2010 04:45:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<atom:link rel="next" href="http://contentoncontentmanagement.com/category/idoc/feed/?page=2" />

		<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>News Items &#8211; Bloggers and Component Updates</title>
		<link>http://contentoncontentmanagement.com/2008/04/news-items-bloggers-and-component-updates/</link>
		<comments>http://contentoncontentmanagement.com/2008/04/news-items-bloggers-and-component-updates/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 23:25:39 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[IDOC]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/?p=70</guid>
		<description><![CDATA[I&#8217;ve got a couple items here that I think are somewhat news-worthy, at least related to this blog.  Instead of several small posts though I thought I would combine them. New Bloggers I&#8217;m adding a couple new bloggers to my &#8230; <a href="http://contentoncontentmanagement.com/2008/04/news-items-bloggers-and-component-updates/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a couple items here that I think are somewhat news-worthy, at least related to this blog.  Instead of several small posts though I thought I would combine them.</p>
<p><strong>New Bloggers</strong></p>
<p>I&#8217;m adding a couple new bloggers to my recommended reading section which just shows as &#8220;recommended&#8221; because of the word wrap.</p>
<p>Alan Evan&#8217;s blog - <a href="http://www.cleverthink.com">www.cleverthink.com</a>.  Alan, as the blog title goes, is a pretty clever guy who writes about technology, business and many of the new trends coming our way.  He&#8217;s a pretty active blogger, posting just about every other day.  It&#8217;s kinda funny because he sits about 30 feet from me at work and I never knew&#8230;now I do and I dig his blog so give it a read.</p>
<p>John Sim - <a href="http://www.bluestudios.co.uk/blog">www.bluestudios.co.uk/blog.</a><span style="color: #000000; text-decoration: none;">  John&#8217;s blog apparently has been around for some time, but it appears he&#8217;s now starting working with Oracle&#8217;s Universal Content Server.  He has quite a bit of content on a variety of subjects, but is also posting some UCM examples.</span></p>
<p><strong>New Component Version</strong></p>
<p>All of my UCM examples and components are developed right here(as if you could see me) on my local laptop.  I&#8217;m running W2K03 server R2, Oracle enterprise 11g and Oracle UCM 10gr3 1.3.3.3(something like that&#8230;just patched so it ends with 3 now).  If your environment is different most of these examples will still work, but ocassionally there are issues.  For instance,  I had a request for a Stellent 7.5.1 and JVM 1.4.2 version of the IDOC Developer interface.  I don&#8217;t have a great 751 test environment, but I managed to dig one up at work.  It needed a couple tweaks, but over all pretty much the same.  Here&#8217;s the link though if you need that earlier version(rememebr you will need <a href="http://contentoncontentmanagement.com/2007/11/10/scriptaculous-prototype-update/">scriptaculous</a>).</p>
<p><a rel="attachment wp-att-71" href="http://ContentOnContentManagement.com/2008/04/09/news-items-bloggers-and-component-updates/idocdeveloper_stellent751_java_142/">idocdeveloper_stellent751_java_142</a></p>
<p><strong>Really, Really old Refinery Example</strong></p>
<p>Way back in the day I had a lot of fun playing with Stellent&#8217;s inbound refinery.  In fact the first project ever posted to content on content management was a .NET example and framework to create a custom conversion engine for the 7.5.1 refinery.  Basically it was two projects; The framework which is just an assembly that provides an abstract class you inherit to create the conversion engine and an example conversion engine using the framework.  I wrote the post, threw it up on the site(then in DotNetNuke..yuck) and proceeded to ignore the blog for the better part of a year(I am pretty sure no one ever visited the site either).  By the time I actually started blogging 10gr3 was out with it&#8217;s whole new refinery and I never re-posted the project.  Then a few weeks ago on the Oracle forums I mentioned the example and there was a bit of intrest in the project.  I&#8217;ve actually had it posted for download for a little while now, but figured I would call some attention to it with this post.</p>
<p>Here&#8217;s the link:</p>
<p><span style="color: #551a8b; text-decoration: underline;"><a rel="attachment wp-att-63" href="http://ContentOnContentManagement.com/?attachment_id=63"></a><a rel="attachment wp-att-72" href="http://ContentOnContentManagement.com/2008/04/09/news-items-bloggers-and-component-updates/dotnet-custom-converters/">.NET Custom Refinery Converter</a></span></p>
<p><a rel="attachment wp-att-63" href="http://ContentOnContentManagement.com/?attachment_id=63"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2008/04/news-items-bloggers-and-component-updates/feed/</wfw:commentRss>
		<slash:comments>3</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>IDOC Developer Interface for Stellent / Oracle Content Server</title>
		<link>http://contentoncontentmanagement.com/2007/11/idoc-developer-interface-for-stellent-oracle-content-server/</link>
		<comments>http://contentoncontentmanagement.com/2007/11/idoc-developer-interface-for-stellent-oracle-content-server/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 02:36:19 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[IDOC]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Stellent]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/11/07/idoc-developer-interface-for-stellent-oracle-content-server/</guid>
		<description><![CDATA[I’ve been a little busy the past few weeks and that’s kept me from posting new stuff on the blog.  This past weekend though I traveled to California for a wedding, leaving me 10 or so hours of time in &#8230; <a href="http://contentoncontentmanagement.com/2007/11/idoc-developer-interface-for-stellent-oracle-content-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’ve been a little busy the past few weeks and that’s kept me from posting new stuff on the blog.  This past weekend though I traveled to California for a wedding, leaving me 10 or so hours of time in the air to work on a new Stellent / Oracle component I’ve been thinking about for a little while.</p>
<p><o></o></p>
<p>The component adds an admin-accessible interface for developing and executing IDOC Script.  Users can enter their script in to the very simple editor(just a textarea) and then execute it.  The resulting HTML is displayed in another area below the script editor.  Where I think it gets a little cooler though, is that it also outputs all local values created in the binder as well all resultset values in to windows-like box areas off to the side.  In addition you can also run the script as another user in the system to test out permissions and security. (NOTE: <strong>nice for development but probably bad for production</strong> so please be careful where you deploy this).</p>
<p><o></o>You essentially get a pretty clear view of what’s occurring with your script, but without restarting the server, saving a resource file or even refreshing a page.  The interface uses AJAX calls to execute the script and the parse the response.  The result is a responsive interface and what I think is a smooth experience…no jumping around to different windows or adding output variables to check values.<o></o></p>
<p style="margin: 0in 0in 0pt" class="MsoNormal"><img width="473" src="http://contentoncontentmanagement.com/wp-content/uploads/2007/11/idocdeveloper.png" alt="IDOC Developer Screen Shot" height="329" /></p>
<address>Screen shot of how a doc info script might look using the interface.</address>
<p>The app leverages the <a href="http://script.aculo.us">script.aculo.us</a>/<a href="http://www.prototypejs.org/">prototype</a> javascript frameworks to handle the AJAX callbacks as well as the parsing and rendering of the data in the windows.  From an application architecture perspective, I basically added an admin only service called RUN_DEV_IDOC, which in turn calls a custom service handler class.  That class then creates and calls a new “stub” service to open up “clean” data binder and pager merger objects under the account of the requested user.  After that the IDOC script is executed, the results are returned and the data binder is parsed for local data and result sets.  All of that data is then wrapped in XML and dropped back in to the RUN_DEV_IDOC’s as a local data field.  The server then sends the response back to the page, where it’s parsed using javascript and used to create the output on the page.<o></o></p>
<p>My sort of grandiose idea on the plane was to create an editor with breakpoints, variable inspecting and watches.  I still may come back to that with a later updated version, but unfortunately the level of effort on that was a little more than two cross country trips.  Still this was a pretty fun app to work on and I personally look at it as unfinished, so check back in a few weeks and hopefully I’ll be able to add more to it.  Also if you have any ideas, I would love to hear them.<o></o></p>
<p>Feel free to download the component here:</p>
<p style="margin: 0in 0in 0pt" class="MsoNormal"><a rel="attachment wp-att-25" href="http://ContentOnContentManagement.com/2007/11/07/idoc-developer-interface-for-stellent-oracle-content-server/idoc-developer-interface/" title="IDOC Developer Interface">IDOC Developer Interface</a></p>
<p>You will also need the script.aculo.us framework, which I’ve already wrapped in a component and can be downloaded here:</p>
<p><a href="http://ContentOnContentManagement.com/2007/11/10/scriptaculous-prototype-update/scriptaculous-component-for-oracle-stellent-content-server/">Script.aculo.us Component for Oracle/Stellent<o></o> </a><o></o> <o></o> </p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2007/11/idoc-developer-interface-for-stellent-oracle-content-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>YUI Pop Up Preview Component</title>
		<link>http://contentoncontentmanagement.com/2007/10/yui-pop-up-preview-component/</link>
		<comments>http://contentoncontentmanagement.com/2007/10/yui-pop-up-preview-component/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 02:59:57 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Dynamic Converter]]></category>
		<category><![CDATA[IDOC]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Stellent]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/10/21/yui-pop-up-preview-component/</guid>
		<description><![CDATA[I&#8217;ve been meaning to put this component together for some time. Whenever I look for a document or even a revision of a document in Stellent, I usually use the (HTML) dynamic conversion link as sort of a preview button &#8230; <a href="http://contentoncontentmanagement.com/2007/10/yui-pop-up-preview-component/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to put this component together for some time. Whenever I look for a document or even a revision of a document in Stellent, I usually use the (HTML) dynamic conversion link as sort of a preview button to see if I have what I&#8217;m looking for. The only problem is that the dynamic conversion link takes you to the output&#8217;s page requiring you to hit the browser&#8217;s back button to get back to the search results or content information pages. What I&#8217;ve been looking for is a little pop up window to appear over those pages letting me preview the dynamic conversion&#8217;s results.</p>
<p>This sample project utilizes the YUI library to create that pop up as well as to provide a &#8220;slide&#8221; effect seen when the pop up appears and disappears. I was hoping to use a variety of YUI features, but unfortunately this example turned out to be extremely simple. It uses a similar &#8220;Panel&#8221; object to the one used in the <a href="http://contentoncontentmanagement.com/2007/10/06/security-overrides-component-introduction/security-overrides-component-for-stellent-oracle/">Security Overrides example</a>, however as you&#8217;ll see from this project it does not make any Connection Manager based AJAX calls like that one does.</p>
<p><span id="more-23"></span>This component has a couple IDOC resource overrides to add Pop Up Preview links to the Stellent UI, but in terms of actual code there&#8217;s a single Javascript class with really just a single major method, callPopUpPreview:<br />
<code><br />
this.callPopUpPreview = function(id,name){<br />
 //set the dID<br />
 _dID = id;<br />
 //set the dDocName<br />
 _dDocName = name;</code><code>//start the build of our URL<br />
 var url = _httpCgiPath + "?IdcService=GET_DYNAMIC_CONVERSION"</code><code>//if we have a dID add it to the url<br />
 if(_dID)<br />
  url += "&amp;dID=" + _dID;</code><code>//if we have a dDocName add it to the url<br />
 if(_dDocName)<br />
  url += "&amp;dDocName=" + _dDocName;</code><code>//if we have a revisionselectionmethod add it to the url<br />
 if(_RevisionSelectionMethod)<br />
  url += "&amp;RevisionSelectionMethod=" + _RevisionSelectionMethod;</code><code>//if we have a conversion template add it to the url<br />
 if(_conversionTemplate)<br />
  url += "&amp;conversionTemplate=" + _conversionTemplate;</code><code>//This line create the panel object<br />
 YAHOO.popUpPreview.container.popupPreview = new YAHOO.widget.Panel("popUpPreviewDiv",<br />
 { //set the width and hieght to the values set in the class<br />
  width : _width + "px",<br />
  height : _height + "px",<br />
  //the pop up should be fixed to the center of the screen<br />
  fixedcenter : true,<br />
  //show a close link<br />
  close:true,<br />
  //don't allow dragging of the pop up<br />
  draggable:false,<br />
  //the panel starts out invisible<br />
  visible:false,<br />
  //this line sets the transision effect, where we are using the slide<br />
  //effect and setting it's duration to .25 seconds.<br />
  effect:[{effect:YAHOO.widget.ContainerEffect.SLIDE,duration:0.25}]<br />
  } );</code><code>//Sets the header / menu bar of the pop up<br />
 YAHOO.popUpPreview.container.popupPreview.setHeader("Dynamic Conversion Preview");<br />
 //Sets the body, note the use of the iframe to load the content. The onload event calls the handleiFrameLoad method to display the pop up<br />
 YAHOO.popUpPreview.container.popupPreview.setBody("&lt;iframe id='popUpPreviewBody' onload='Javascript:" + _objectName + ".handleiFrameLoad();' src='" + url + "'&gt;&lt;/iframe&gt;");<br />
 //render the panel to the page. this just starts the dynamic conversion call<br />
 YAHOO.popUpPreview.container.popupPreview.render(document.body);<br />
}}<br />
</code><br />
The code does not come through so great on the blog, but what&#8217;s occurring is the URL to the dynamic conversion is assembled and then placed in the &#8220;src&#8221; attribute of an iFrame which is then written to a YUI panel object.  Why the iFrame?  Well when I started I intended to make more of a traditional AJAX call to get the dynamic conversion.  The problem though is that the dynamic converter creates a full HTML document complete with head and body elements, which can wreak havoc on the panel&#8217;s divs.  Using the iFrame let&#8217;s us encapsulate the dynamic conversion output in it&#8217;s own private little window and protects the rest of our panel and page from the variety of HTML that may be rendered in it. </p>
<p>The callPopUpPreview method takes care of creating the URL to the dynamic conversion, creating the panel object and adding the iFrame to it, but it does not actually cause the panel display on the page.  Dynamic conversions can sometimes take a second or two to render and it&#8217;s a much nicer effect if we wait for the conversion before displayiing the pop up window.  So instead of just rendering the panel to the page, the onload event for the iFrame is used to call another method(handleiFrameLoad) in the popUpPreview class that can display the pop up once everything is loaded.  This way the pop up window will only appear once the conversion is complete.</p>
<p>Adding the actual links to the content server&#8217;s search results and content information pages requires a couple of resource include overrides: </p>
<p>Append an additional PopupProps row in the extra_setup_search_results_action_popups include to add a links in the Search Results.<code><br />
&lt;@dynamichtml extra_setup_search_results_action_popups@&gt; &lt;$exec rsAppendNewRow("PopupProps")$&gt;<br />
&lt;$exec setValue("PopupProps", "label", "Pop Up Preview")$&gt;<br />
&lt;$exec setValue("PopupProps", "function", "Javascript:popUp.callPopUpPreview('&lt;$url(dID)$&gt;','&lt;$url(dDocName)$&gt;');")$&gt;<br />
&lt;$exec setValue("PopupProps", "ifClause", "dcShowExportLink()")$&gt;<br />
&lt;$exec setValue("PopupProps", "class", "document")$&gt; &lt;$exec setValue("PopupProps","id", "popuppreview")$&gt;<br />
&lt;@end@&gt;<br />
</code><br />
The docinfo_conversion_link include can be used to add a link on the Content Information page<code><br />
&lt;@dynamichtml docinfo_conversion_link@&gt;<br />
&lt;$include super.docinfo_conversion_link$&gt;<br />
&lt;tr&gt;&lt;td nowrap align="right"&gt;&lt;span class="infoLabel"&gt;&lt;/span&gt;&lt;/td&gt;<br />
&lt;td&gt;&lt;span class="tableEntry"&gt;<br />
&lt;a href="Javascript:;" mce_href="Javascript:;" onclick="Javascript:popUp.callPopUpPreview('&lt;$dID$&gt;','&lt;$dDocName$&gt;');"&gt;Pop Up Preview&lt;/a&gt;</code><code>&lt;/span&gt;<br />
&lt;/td&gt;&lt;/tr&gt;<br />
&lt;@end@&gt;<br />
</code></p>
<p>Also of note is that I used a new editor to create the popuppreview.js file. Rather than my standard text editor, I gave Adobe&#8217;s <a href="http://www.interaktonline.com/Products/Eclipse/JSEclipse/Overview/">JSEclipse</a> plug in a try. I am not sure I was using it correctly as the experience was not that much different from my text editor(only in eclipse), but as I figure out how to best use it&#8217;s features I&#8217;ll keep you informed.</p>
<p>The Pop Up Preview component is available for download here:</p>
<p><a rel="attachment wp-att-24" href="http://ContentOnContentManagement.com/2007/10/21/yui-pop-up-preview-component/pop-up-preview-component/" title="Pop Up Preview Component">Pop Up Preview Component</a></p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2007/10/yui-pop-up-preview-component/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Security Overrides Component &#8211; Introduction</title>
		<link>http://contentoncontentmanagement.com/2007/10/security-overrides-component-introduction/</link>
		<comments>http://contentoncontentmanagement.com/2007/10/security-overrides-component-introduction/#comments</comments>
		<pubDate>Sun, 07 Oct 2007 01:26:08 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[IDOC]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Stellent]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/10/06/security-overrides-component-introduction/</guid>
		<description><![CDATA[I believe that IDOC script gets a bad rap.  On more then one occasion I have witnessed eyes roll when we began explaining how the Stellent scripting language can be used during an implementation.  It&#8217;s a natural reaction as most developers would &#8230; <a href="http://contentoncontentmanagement.com/2007/10/security-overrides-component-introduction/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I believe that IDOC script gets a bad rap.  On more then one occasion I have witnessed eyes roll when we began explaining how the Stellent scripting language can be used during an implementation.  It&#8217;s a natural reaction as most developers would probably rather work in a more mainstream language then learning some new proprietary, sort of &#8221;cold-fusion&#8221; looking one.  And while I&#8217;m sure there are quite a few implementations done with 100% IDOC-based customizations, my personal preference is to use Java/JSP as the primary languge, with use of IDOC for presentation and configuration scripting.  In this ancillary role I&#8217;ve grown quite an affinity for the IDOC and as I&#8217;ll demonstrate in the example component(Security Overrides), try to IDOC-enable my Java-based components and customizations.</p>
<p>The concept behind the example component, Security Overrides, is an IDOC enabled version of the Security Filter example, which is part of Stellent&#8217;s HowToComponents Bundle.  Stellent&#8217;s SecurityFilter component is an example of how to use the alterUserCredentials filter to change the rights of a user during a specific service request.  The primary example is the BlackHole check in example which grants everyone write access when checking in an item using the Black Hole service.</p>
<p>Creating security filters or overrides with the alterUserCredentials can be a tricky proposition.  Depending on your implementation, you&#8217;re basically altering the behavior of the content server with no real visible indication that it&#8217;s being done.  In addition the alterUserCredentials filter is called with every service call, so it&#8217;s a great place to cause a performance problem with inefficient code, or just by adding multiple security filter components.</p>
<p>So how does the Security Overrides component and more importantly IDOC help the situation?  The component creates a central, administrator controlled, interface for creating and managing overrides. What&#8217;s more, each service configured has an IDOC script prompt, which is used in the final decisioning of whether to apply the override or not.  For example if an administrator desired to only allow the &#8220;sysadmin&#8221; account access to the providers page, they would configure an override  that removed all permissions for the &#8220;GET_ALL_PROVIDERS&#8221; service.  In the IDOC prompt script would be added to evaluate the dUser variable, ensuring it was the &#8220;sysadmin&#8221; account.</p>
<p>The beautiful thing here is that because the component is processing IDOC for it&#8217;s final decsioning logic, the override becomes extremely simple to alter as well as include addtional actions down the road if desired.  And as you&#8217;ll see in the code, creating a component which can support IDOC scripting takes very little additional work.</p>
<p>In addition to integrating IDOC scripting in a Java-based component, the component also demonstrates:</p>
<ul>
<li>Creating an installation filter, which creates a database table after start up</li>
<li>Working with the YUI library to create a model, pop-up form as well as creating and handling AJAX requests</li>
<li>The run-time creation and altering of environment variables</li>
<li>Customizing the Stellent / Oracle interface</li>
</ul>
<p>As you might have guessed from the word &#8220;Introduction&#8221; in the title, I plan on making the review of this component a multi-part series, rather then one long post.  The component along with it&#8217;s source code will be available for download <a rel="attachment wp-att-16" href="http://ContentOnContentManagement.com/2007/10/06/security-overrides-component-introduction/security-overrides-component-for-stellent-oracle/">here</a>.</p>
<p>I should also mention that Oracle has a fully supported component available for download which has some of the same features as this one.  It&#8217;s called the &#8220;Need to Know&#8221; component and if you are considering using my example in a production system, please take a look at their component first.</p>
<p><a rel="attachment wp-att-16" href="http://ContentOnContentManagement.com/2007/10/06/security-overrides-component-introduction/security-overrides-component-for-stellent-oracle/">Security Overrides Component for Stellent / Oracle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://contentoncontentmanagement.com/2007/10/security-overrides-component-introduction/feed/</wfw:commentRss>
		<slash:comments>0</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>

<!-- Dynamic Page Served (once) in 0.679 seconds -->
