Backward Compatibility and Upgrading Sample Custom Elements

11-12 Oracle Fusion Middleware Users Guide for Site Studio Designer WCM.DHTML.SetStylecontainer, height, viewPortHeight + px; WCM.DHTML.SetStylecontainer, width, viewPortWidth + px; WCM.DHTML.SetStyleinput-value, height, viewPortHeight - 15 + px; WCM.DHTML.SetStyleinput-value, width, viewPortWidth - WCM.IS_IE ? 15 : 15 + px; }; ResizeHandler; WCM.DHTML.AddWindowResizeEventwindow, ResizeHandler; Custom.originalData = Custom.GetData; ElementAPI.Ready; }; Custom.GetData = function { return IDinput-value.value; }; try { window.top.WCM.InitializeCustomElementwindow, Custom.Initialize; } catche { } script head body div id=container nowrap textarea id=input-value class=controls type=text title=URLtextarea div body html

11.3.2 Backward Compatibility and Upgrading

All custom element forms compatible with Site Studio releases before Site Studio 10gR3 10.1.3.3.3 are not compatible with Site Studio 10gR4 10.1.4 and later releases, and they must be manually upgraded re-authored. The primary reason for not maintaining backward compatibility is due to Site Studios prior dependency upon Internet Explorers proprietary window.external functionality. This is because Contributor used an ActiveX control. The window.external functionality blocked at the point of code execution and is not easily duplicated in a cross-browserplatform DHTML solution. The upside to breaking backward compatibility is that the new custom elements are much more flexible and better integrated into the Contributor application architecture in addition to being a cross-browserplatform solution. Detecting Legacy Custom Element Forms A legacy custom element form that is, pre-10gR3, 10.1.3.3.3, if loaded into the new Contributor application, is detected by default and an error message is displayed in its place within the Contributor form. The Contributor application does this by first downloading the custom element form, parsing the source code, and ascertaining whether the custom element form is compatible with the new Contributor application. The functionality and overhead to detect legacy custom element forms is unnecessary on production installations and is turned off by default. If you have legacy custom element forms to upgrade, you need to turn the flag on. To turn on legacy custom element form detection, add the following line to the Oracle Content Servers config.cfg file and restart the server: SSValidateCustomElements=true Working With Scripts and Forms 11-13

11.3.3 Sample Custom Elements

Site Studio 11gR1 comes with eleven sample custom forms or elements. These sample forms are example implementations of custom elements that work within the Contributor form framework. These samples are checked into the content server with the xWebsiteObjectType metadata value of Custom Element Form upon installation of the Site Studio component. ss_boolean_checkbox_form.htm This sample form is an example of a simple custom element with a check box. ss_boolean_radio_form.htm This sample form is an example of a simple custom element with a radio button. ss_docname_form.htm This sample form is an example of a custom element that enables a content server search to select a Content ID. ss_option_form.htm This sample form is an example of a custom element that enables you to build an option list. This example is a very simple example. It more complex instances, the list could be populated from many other sources, such as content server metadata. ss_query_form.htm This sample form is an example of a custom element that enables you to capture a content server query. ss_url_form.htm This sample form is an example of a custom element that enables a content server search to return a weblayout URL. ss_textarea_form.htm This sample form is an example of a simple custom element with minimal amount of code. This particular example implements a text-only custom element utilizing a TEXTAREA HTML element, which is a very lightweight method of providing a text-only editor. ss_integer_form.htm This sample form is an example of a custom element for capturing an integer value. This is useful for capturing a parameter to use elsewhere. ss_simple_form.htm This sample form is an example of a simple custom element with minimal amount of code. This particular example implements a text-only custom element utilizing a TEXTAREA HTML element, which is a very lightweight method of providing a text-only editor. ss_flash_form.htm This sample form is an example of a custom element that enables Contributor users to select a FLASH object from the content server. 11-14 Oracle Fusion Middleware Users Guide for Site Studio Designer ss_sample_form.htm This sample form is an example of a custom element that uses all available ElementAPI methods. A complete list of these methods is available in Implementing a Custom Element on page 11-5

11.4 Custom Configuration Scripts