<?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; Javascript</title>
	<atom:link href="http://contentoncontentmanagement.com/category/javascript/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/javascript/feed/?page=2" />

		<item>
		<title>Script.aculo.us / Prototype Update</title>
		<link>http://contentoncontentmanagement.com/2007/11/scriptaculous-prototype-update/</link>
		<comments>http://contentoncontentmanagement.com/2007/11/scriptaculous-prototype-update/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 13:35:40 +0000</pubDate>
		<dc:creator>David Roe</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Stellent]]></category>

		<guid isPermaLink="false">http://ContentOnContentManagement.com/2007/11/10/scriptaculous-prototype-update/</guid>
		<description><![CDATA[Script.aculo.us has a released a new version of it&#8217;s popular Javascript framework.  They are now on version 1.8, but most importantly they bundle a new Prototype version, 1.6. From what I read in the change log, Script.aculo.us has added some &#8230; <a href="http://contentoncontentmanagement.com/2007/11/scriptaculous-prototype-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://Script.aulo.us">Script.aculo.us</a> has a released a new version of it&#8217;s popular Javascript framework.  They are now on version 1.8, but most importantly they bundle a new <a href="http://www.prototypejs.org">Prototype </a>version, 1.6.</p>
<p>From what I read in the change log, Script.aculo.us has added some pretty cool features, but what I am most excited about is that Prototype 1.6 includes a <a href="http://www.prototypejs.org/learn/json">JSON parser</a> which was not available in the previous version.</p>
<p>I&#8217;ve updated the Oracle / Stellent Content Server script.aculo.us component available on this site.</p>
<p>Feel free to download it 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/11/scriptaculous-prototype-update/feed/</wfw:commentRss>
		<slash:comments>0</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>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>
	</channel>
</rss>

