Loading the Element API Element API Dependent Scripts
8.1 About Custom Elements
A custom element is a user-defined Site Studio element. In addition to the other productized Site Studio elements, the custom element provides a way to extend the Site Studio product to suit individual business needs. From a code perspective, custom elements are essentially full HTML type files for example, htm, hcsp, jsp, and so forth that reside within an IFRAME in the contributor form. A custom element uses an API and implements a hand-full of callbacks in order function correctly as a Site Studio element.8.2 Element API
In order for a custom element to function properly in a contributor form, a custom element must utilize an API and implement a hand-full of callbacks. The ElementAPI object is a JavaScript object explicitly loaded into the custom element page that facilitates communication between the Contributor form and the custom element. The ElementAPI provides methods for custom elements to communicate to the Contributor form and a callback mechanism for the Contributor form to pass notifications to the custom element. This section contains the following topics: ■ Section 8.2.1, Loading the Element API ■ Section 8.2.2, Element API Dependent Scripts8.2.1 Loading the Element API
Before the ElementAPI and its supporting libraries can be used; the ElementAPI must first be loaded into the Custom Element page. After the ElementAPI is loaded, the Custom Element should continue with page initialization and notify the Contributor form that the Custom Element is loaded. 8-2 Oracle Fusion Middleware Technical Reference Guide for Site Studio html head titleDefault Custom Element Formtitle script type=textjavascript function Initialize { =========================================================================== TODO: ElementAPI is loaded. Place Custom Element initialization code here. =========================================================================== Let the Contributor Form know that this Custom Element is loaded and ready. ElementAPI.Ready; } Load the ElementAPI and its supporting libraries - then call Initialize Parameter 1: The Custom Elements window object. This parameter uniquely identifies the Custom Element to the Contributor Form. Parameter 2: A function pointer. This function will be executed after the ElementAPI and its supporting libraries are loaded. try { window.top.WCM.InitializeCustomElementwindow, Initialize; } catche { } script head body h3Default Custom Element Formh3 body html8.2.2 Element API Dependent Scripts
When the ElementAPI is loaded into the Custom Element page, so are the ElementAPI dependent scripts. These scripts contain most of the JavaScript WCM library and is also available to use in authoring custom elements. The following is a list of script files loaded into a custom element. ■ wcm.js ■ .basewcm.dhtml.js ■ .basewcm.get.js ■ .basewcm.http.js ■ .basewcm.popup.js ■ .sitestudiowcm.contentserver.popup.js ■ .formelementswcm.elementapi.js ■ .sitestudioelementswcm.sitestudio.elementapi.js ■ .sitestudiowcm.idc.js ■ .formelementselementwcm.element.js ■ .formelementscustomwcm.custom.js As with other custom scripts, you can modify any of these as you need and place the modified script in the custom directory. Custom Elements 8-38.3 Custom Elements within Contributor
Parts
» Oracle Fusion Middleware Online Documentation Library
» About the Site Studio Technical Reference Scope of the Technical Reference About Site Assets
» Page Templates Subtemplates Templates
» Relationship Between Templates and Definitions Serving Web Pages
» xWebsiteSection xWebsites Metadata Fields
» xDontShowInListsForWebsites xRegionDefinition Metadata Fields
» Conversions Definitions About Metadata About Link Formats Using Path-Based Links
» wcmUrl Using Server-Side Script Links
» ssLink ssNodeLink ssWebLayoutUrl Using Server-Side Script Links
» ssLINK ssNODELINK Using Token Links
» sitenavigation.js Runtime Auto-Generated Files
» sitenavigationfunctions.js sitenavigation.xml
» Using JavaScript Links About Runtime Generated Files wcm.toggle.js
» About Fragments Oracle Fusion Middleware Online Documentation Library
» Fragment Libraries Oracle Fusion Middleware Online Documentation Library
» Read-Only Fragment Libraries Fragment Inclusion Using wcmFragment
» Client-Side JavaScript Server-Side Idoc Script
» fragments fragment parameter The Fragment Definition File
» snippet designview element The Fragment Definition File
» Fragment Snippets and the ssIncludeXml Fragment Instance Structure in the ssinfo XML Data Island
» About Native Documents wcmDynamicConversion Document Conversion in the Properties Pane
» Loading the Element API Element API Dependent Scripts
» Communication from a Contributor Form to a Custom Element
» Detecting Legacy Custom Element Forms Upgrading Legacy Custom Elements
» wcmElement wcmListStart wcmListEnd wcmListElement
» wcmUrl ssIncludeXml Oracle Fusion Middleware Online Documentation Library
» ssGetDocInfo ssGetXmlNodeCount ssIncDynamicConversion ssIncDynamicConversionByRule
» ssRandom ssGetNodeProperty ssGetWebsiteNodeType ssGetCoreMajorVersion
» ssSplitString ssGetWebsiteName ssGetSiteProperty ssGetFirstNodeId ssGetRelativeNodeId
» ssLoadSiteNavResultSet ssGetServerRelativeUrl ssGetServerRelativePath ssGetUrlPageName
» ssGetNodeLabel ssGetNodeLabelPath ssGetAllSites ssLink ssNodeLink
» ssWeblayoutUrl About Idoc Script Variables HttpWebsitesRoot HttpRelativeWebsitesRoot
» Services Related to Designer
» SS_ADD_NODE SS_ADD_WEBSITE_ID SS_BATCH_DECODE_LINK SS_CHECKIN_FRAGMENT_LIBRARY
» SS_COMMIT_SITE_CHANGES SS_CREATE_NEW_SITE_EX2 SS_CREATE_SITE_NAV_JS
» SS_DECODE_LINK SS_DELETE_NODE SS_DOC_INFO_LATEST SS_EDIT_NATIVE_DOCUMENT
» SS_GET_DOCUMENT_USAGE SS_GET_ENVIRONMENT_PROPERTY_NAMES SS_GET_FIRST_NODE_ID SS_GET_FRIENDLY_URL
» TARGET SECTION SOURCE SS_GET_PAGE
» SS_GET_NODE_LINK SS_GET_NODE_PROPERTY SS_GET_PLACEHOLDER_SWITCH_CONTENT_CONFIG
» SS_GET_SITE_AS_XML_EX2 SS_GET_SITE_ASSET_CATEGORIES SS_GET_SITE_CHANGE_MONITOR_TOKEN
» SS_PREPARE_PREVIEW SS_PUBLISH_THIS_PAGE SS_REMOVE_WEBSITE_ID SS_SET_ALL_CUSTOM_NODE_PROP_DEFS
» SS_SET_ELEMENT_DATA SS_SET_ENVIRONMENT_PROPERTY_NAMES SS_SET_NODE_PROPERTY SS_SET_NODES_PROPERTIES
» SS_SWITCH_REGION_ASSOCIATION SS_VALIDATE_WEBSITE_OBJECT WCM_PLACEHOLDER
» WCM_EDIT_DATA_FILE WCM_BEGIN_EDIT_SESSION
» Optimization Requirements The Build Process
» Installing the Contributor Console Window Launching the Contributor Console Window
» Contributor Console Window Context Ensuring the Contributor Console Window is Root
» Logging Syntax Time Profiling
» Command Window Helper Functions Keyboard Commands About the Manager Settings File ssm:settings Tag
» ssm:general Tag ssm:addSection Tag
» ssm:primaryLayout Tag ssm:secondaryLayout Tag
Show more