var isMax = false; //var unMaxH=600; //var unMaxW=600; var findFlags = { wholeWord: false, caseSensitive: false, regExp: false }; function toggleCodeArea(obj){ disableItems(html_GetElement('e').readOnly==false,'P30_REPLACE'); if (html_GetElement('e').readOnly) { html_GetElement('e').readOnly=false; // Commented out toggleLinkText during call with Carl 12 Sept 06 //html_GetElement('toggleLinkText').className = 'editEnabled'; } else { html_GetElement('e').readOnly=true; // Commented out toggleLinkText during call with Carl 12 Sept 06 //html_GetElement('toggleLinkText').className = 'editDisabled'; } } function setMode(objType) { disableItems(html_GetElement('e').readOnly==false,'P30_REPLACE'); html_GetElement('e').readOnly=true; // Commented out toggleLinkText during call with Carl 12 Sept 06 //html_GetElement('toggleLinkText').className = 'editDisabled'; } function saveCode(){ var get = new htmldb_Get(null,4400,'SAVE_CODE',46, null, 'wwv_flow.accept'); var plsqlCode = html_GetElement('e').value; var i=0; // Wrap SQL statement in CREATE VIEW syntax plsqlCode = 'CREATE OR REPLACE VIEW "' + html_GetElement('P30_VIEW_NAME').value + '" AS ' + plsqlCode + ' / '; get.addParam('f02',plsqlCode.length); if (plsqlCode.length<=4000) { get.addParam('f01',plsqlCode); } else { while (plsqlCode.length>4000) { get.addParam('f01',plsqlCode.substr(0,4000)); plsqlCode = plsqlCode.substr(4000,plsqlCode.length-4000); i++; } get.addParam('f01',plsqlCode); } // View name to be saved to the wwv_mig_rev_queries revision table var viewname = html_GetElement('P30_VIEW_NAME').value; //alert('view name is: ' + viewname); get.addParam('f03',viewname); var sqlStmt = html_GetElement('e').value; //alert('sql stmt is : ' + sqlStmt); get.addParam('f04',sqlStmt); get.addParam('f05','VIEW'); var message = get.get('FULL'); var status = message.substr(0,1); var lMessage = html_GetElement('results') if (status=='0') { lMessage.className = 'compileFailure'; lMessage.innerHTML = message.substr(1); }else if (status=='1'){ lMessage.className = 'compileSuccess'; lMessage.innerHTML = message.substr(1); } else { lMessage.className = 'compileFailure'; lMessage.innerHTML = message; } //html_GetElement('results').innerHTML = lMessage; if (status=='0') { html_GetElement('results').className = 'compileFailure'; } else { html_GetElement('results').className = 'compileSuccess'; } } function doCompile() { saveCode(); } function doCompile2(){ saveCode(); // ON_DEMAND process to compile view //var get = new htmldb_Get(null,4400,'APPLICATION_PROCESS=compile_view',0); //var message = get.get('FULL'); //var status = message.substr(0,1); //message = message.substr(1); //message = message.substr(0); //alert('status= :'+status); if (status=='0') { message = message.substr(1); } else if (status=='1') { message = message.substr(1); } else { message = message.substr(0); } //if (message.length>1) { html_GetElement('results').innerHTML = message; //} else { // iscompiled = true; //html_GetElement('results').innerHTML = message; //'
View compiled successfully
'; //} /* if (status=='0') { html_GetElement('results').className = 'compileFailure'; } else { html_GetElement('results').className = 'compileSuccess'; } */ /* html_GetElement('results').innerHTML = message; if (status=='0') { html_GetElement('results').className = 'compileFailure'; } else { html_GetElement('results').className = 'compileSuccess'; } */ } function goToLine(lineID){ var l = html_GetElement('e').getLineByNumber(lineID); var rng = html_GetElement('e').createCodeRange(); rng.moveToLine(l); rng.select("compile-error"); } function downloadCode() { saveCode(); doSubmit('DOWNLOAD_CODE'); } /* function resizeCodeArea(){ var pageId = html_GetElement("pFlowStepId").value; var codeArea = html_GetElement("e"); var iframeEl = window.parent.html_GetElement('dbaseContent'); var parentNode = window.parent.html_GetElement("dbaseContent"); codeArea.style.height = 200; codeArea.style.width = 200; if ( pageId == "30" ) { if ( isMax ) { codeArea.style.width = iframeEl.clientWidth - 75; codeArea.style.height = iframeEl.clientHeight - 190; } else { // codeArea.style.width = iframeEl.scrollWidth*.94; codeArea.style.height = iframeEl.scrollHeight * .70; } } } if ( typeof ( attachEvent ) != "undefined" ) { top.attachEvent("onresize",resizeCodeArea); setTimeout(resizeCodeArea,1000); }else{ top.window.document.body.addEventListener("onresize",resizeCodeArea,false); setTimeout(resizeCodeArea,1000); } */ /* function maximize() { var iframeEl = parent.document.getElementById('dbaseContent'); html_HiddenElement(iframeEl) isMax = true; html_HideElement('func_tab_menu'); document.getElementById('maximizer').className = 'maximized'; html_GetElement('ob_ObjectsDetail').innerHTML = window.parent.html_GetElement('ob_ObjectsDetail').innerHTML html_ShowElement('ob_ObjectsDetail'); var l_Width = '100%'; var l_Height = '100%'; if(document.all){ var l_Width = parent.document.body.offsetWidth; var l_Height = parent.document.body.offsetHeight; } iframeEl.style.position = "absolute"; iframeEl.style.top = "0px"; iframeEl.style.left = "0px"; iframeEl.style.width = l_Width; iframeEl.style.height = l_Height; html_GetElement('ed_PageMargin').style.margin = 0; parent.document.body.style.overflow = 'hidden'; parent.g_SkipResize = true; resizeCodeArea(); html_VisibleElement(iframeEl) } */ /* function restoreSize() { var iframeEl = window.parent.document.getElementById('dbaseContent'); parent.document.body.style.overflow = 'auto'; window.parent.html_ShowElement('obLeftColumn'); if (isMax) { html_GetElement('maximizer').className = 'notMaximized'; html_HideElement('ob_ObjectsDetail'); html_ShowElement('func_tab_menu'); iframeEl.style.position = "relative"; iframeEl.style.top = "0px"; iframeEl.style.left = "0px" iframeEl.style.width = "100%" if(document.all){ iframeEl.style.height = parseInt(window.parent.document.getElementById('obTable').offsetHeight) - parseInt(window.parent.document.getElementById('obRightHeader').offsetHeight) - 200; }else{ iframeEl.style.height = parseInt(window.parent.document.getElementById('obTable').offsetHeight) - parseInt(window.parent.document.getElementById('obRightHeader').offsetHeight) } html_GetElement('ed_PageMargin').style.margin = 10; isMax = false; resizeCodeArea(); } parent.g_SkipResize = false; parent.document.body.style.overflow = ''; } function updateFindFlag(theFlag, findFlag) { if (theFlag.value=='WHOLE'&&findFlag[1].checked) { findFlag[2].checked = false; } if (theFlag.value=='REGEX'&&findFlag[2].checked) { findFlag[1].checked = false; } } */ function findInCodeArea(searchString, codeArea, findFlag, notFound) { if (findFlag[0].checked) { findFlags.caseSensitive = true; } else { findFlags.caseSensitive = false; } if (findFlag[1].checked) { findFlags.wholeWord = true; } else { findFlags.wholeWord = false; } if (findFlag[2].checked) { findFlags.regExp = true; } else { findFlags.regExp = false; } var rng = codeArea.findNext(searchString, findFlags); if (!rng) alert(searchString + ' ' + notFound); else rng.select(); } function replaceInCodeArea(searchString, replaceString, codeArea, findFlag, notFound) { if (codeArea.readOnly==false) { var rng = codeArea.selection; if (!rng.isCollapsed()) { rng.replaceContent(replaceString); rng.select(); } findInCodeArea(searchString,codeArea, findFlag, notFound); } } function replaceAllInCodeArea(searchString, replaceString, codeArea, findFlag) { if (codeArea.readOnly==false) { var rngs = codeArea.findAll(searchString, findFlags); for (var i=0; i < rngs.length; i++) { rngs[i].replaceContent(replaceString); if (rngs.length) rngs[rngs.length-1].select(); }; } } function undoEdit(codeArea) { var undoAction = codeArea.getAction("undo"); if (undoAction.isEnabled()) undoAction.perform(); } function redoEdit(codeArea) { var redoAction = codeArea.getAction("redo"); if (redoAction.isEnabled()) redoAction.perform(); } // // sinlge max / min functions // function isMaximized(node) { return html_GetElement(node).maximized; } function maximizeElement(el) { var node = html_GetElement(el); if (node.maximized) return; /* if (node.elementsHidden) { for (var i=0; i