adminjsf.js revision ada1678a4262b208a7b87391f520a7767d25287c
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/*
* Common utility
*/
/* To work around a timing issue where for Firefox 2.0.0.3 on Mac OS X
* We need to put in a little delay before returning the var
*/
return val;
}
return false;
}
if (target) {
// In this case we want the non-ajax behavior, but we still need the indicator
button.form.action += sep + button.name + "=" + encodeURI(button.value) + "&bare=false"; //bug# 6294035
return false;
}
var args = {};
return false;
}
function disableButton(id) {
}
//To disable all buttons in the page.
//TODO: other components maybe of type "submit" even though it is not a button, need to fix this.
function disableAllButtons() {
}
}
}
if (value == null) {
continue;
}
if (helpKeyFieldName == fieldName) {
}
}
return null;
}
// FIXME: suntheme should not be used -- prevents theme from changing
function getTextElement(componentName) {
if (el == null) {
el = document.getElementById(componentName); // This may get too deep inside WS, but it should work as a fall back
}
return el;
}
function getSelectElement(componentName) {
}
function getFileInputElement(componentName) {
if (el == null) {
}
return el;
}
var component = null;
} else {
if (component != null) {
}
}
if (component != null) {
component.setDisabled(true);
} else {
}
}
}
/*
* was trying to see if we can set the timeout in the function itself, instead of
* at the calling time, refer to update.jsf
* but just can't get this working.
* saving the code for now.
function delayDisableComponent(componentName, type, timeouted) {
var func = disableComponent[type] || getTextElement;
var component = func(componentName);
if(component == null && !timeouted) {
window.setTimeout("disableComponent('" + componentName + "','" + type + "', true)", 10);
}
if (component == null){
window.console.log('component is NULL' + componentName);
window.console.debug('component is NULL' + componentName);
}
component.disabled = true;
component.className='TxtFldDis_sun4';
if(func == getTextElement) {
component.value = "";
}
}
disableComponent.file = getFileInputElement;
disableComponent.select = getSelectElement;
*/
function disableBtnComponent(componentName) {
el.setDisabled(true);
disabled: true,
className: 'Btn1Dis_sun4'
});
} else {
}
}
function enableBtnComponent(componentName) {
el.setDisabled(false);
disabled: false,
className: 'Btn1_sun4'
});
} else {
}
}
var component = null;
} else {
}
if (component == null){
return;
}
component.setDisabled(false);
} else {
}
}
function disableDOMComponent(componentName) {
component.setDisabled(true);
disabled: true,
className: 'TxtFldDis_sun4',
value: ' '
});
} else {
//YAHOO.util.Dom.setStyle(el, 'disabled', 'true');
}
}
function enableDOMComponent(componentName) {
disabled: false,
className: 'TxtFld_sun4'
});
} else {
//YAHOO.util.Dom.setStyle(el, 'disabled', 'false');
}
}
function isChecked (elementName) {
if (element != null) {
return true;
} else {
return false;
}
}
return false;
}
function checkForValue(formField) {
if (!formField) {
return false; // No field, so no value
}
// Use Woodstock's api to get correct value
}
if (!result) {
}
return result;
}
//==========================================================
// Set a cookie
{
//alert( c_name + ',' + value + ',' + expiredays);
var exdate=new Date()
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}
var cookieValue = null;
}
if (name == currentName) {
break;
}
}
}
return cookieValue;
}
//===========================================================
function extractName(value) {
var appName="";
var len=-1;
}
else {
//For window platform, use backsplash
}
return appName;
}
if (index == -1)
return fullName;
else
}
if (index == -1)
return "";
else
}
// End of Deployment code
//===========================================================================
// 1. CHECK THIS FRAME (winOrFrame)
// home string is being checked to take care of the complex
// frameset in PE homepage. Need to fix this in a Generic way later.
return winOrFrame;
// 2. SEARCH SUBFRAMES. note: when there are no sub-frames,
// the frames array has 1 entry which is this frame,
// hense this check for 2+ subframes
return null;
// recurse
if ( x )
return x;
}
return null;
}
}
var reasonsHidden = true;
function showRestartReasons() {
if (reasonsHidden) {
//toggle.src = "#{request.contextPath}/theme/woodstock4_3/suntheme/images/table/grouprow_expanded.gif";
} else {
//toggle.src = "#{request.contextPath}/theme/woodstock4_3/suntheme/images/table/grouprow_collapsed.gif";
}
}
//===========================================================================
if (typeof(admingui) === "undefined") {
admingui = {};
}
/*
* The following functions are utility functions.
*/
/**
* This function finds the Woodstock node which has the getProps
* function and returns the requested property. If it does not exist
* on the given object, it will look at the parent.
*/
if (node == null) {
return;
}
}
},
/**
* This function finds an Array[] of nodes matching the (checkFunc),
* which is a JS function that takes two arguments: the HTML node object
* to check, and an optional "argument" (arg) that is passed through.
*/
var results = new Array();
if (node == null) {
return null;
}
// Check for match
}
// Not what we want, walk its children if any
var moreResults;
// Look for more matches...
// Recurse
if (moreResults) {
// Append the results
}
}
}
// Make sure we found something...
results = null;
}
// Return what we found (if anything)
return results;
},
/**
* This function sets the <code>key</code> / <code>value</code> pair as
* a persistent preference in the <code>root</code> path. The root path
* will automatically prefix "glassfish/" to the given String.
*/
});
},
}
}
}
/*
* The following functions provide tree functionality.
*/
TREE_ID: "treeForm:tree",
refreshCluster: function(hasCluster){
// FIXME: This needs the viewId where clusters2 is defined
} else {
//there is a problem in hiding clusters2, it doesn' hide it, maybe because of the
//dynamic treenode under it ? still need to figure this out.
}
},
/**
* <p> This function allows you to provide a clientId of a TreeNode in the
* navigation frame to be "refreshed". This means that it and its
* children will be deleted, recreated, and redisplayed.</p>
* <dl>
* <dd>
* <code>refreshNodeId</code> - The clientId of the tree node to refresh
* </dd>
* </dl>
*/
refreshTree: function(refreshNodeId) {
var refreshNode = null;
if (refreshNodeId) {
if (!refreshNode) {
}
} else {
}
if (refreshNode && updateTreeButton) {
{
type: 'click'
},
refreshNodeId, "",
{
}
);
}
return false;
},
// Ping header to make sure header stays "fresh"
execute: "treeForm treeForm:update",
},
});
},
if (content != null) {
// Woodstock renders a tree node and its children as siblings in the DOM.
// For example, the applications node is treeForm:tree:applications, and the
// deployed applications listed as child nodes are in a DIV with the ID
// treeForm:tree:applications_children. What we do here, then, is take the
// two DOM elements returned from the server when a given treeNode component
// is rerendered.
//
try {
try {
// Copy image src value to correct visual state of the node turner
// TODO: This should be smarter
mainNode.childNodes[0].childNodes[0].childNodes[0].src = oldNode.childNodes[0].childNodes[0].childNodes[0].src;
}catch (err1) {
}
if (childNodes) {
}
} catch (err) {
//alert(err);
// FIXME: Log error
}
} else {
// If the node exists, hide it
if (element != null) {
// If the node has a "children" node, hide it too.
if (element != null) {
}
}
}
}
},
/**
* This function takes the given JSF 2 Ajax response XML and returns the <update>
* node with the given id
*/
//sendError(request, context, "serverError", null, errorName, errorMessage);
return null;
}
});
return null;
}
admingui.util.log("Top level node must be one of: changes, redirect, error, received: " + responseType.nodeName + " instead.");
return null;
}
try {
// join the CDATA sections in the markup
var content = '';
var markup = '';
}
return parserElement;
}
}
}
} catch (ex) {
//sendError(request, context, "malformedXML", ex.message);
return null;
}
return null;
},
/**
*
*/
return;
}
var name = null;
if (name) {
}
}
}
}
}
},
/**
* This function clears all treeNode selections.
*/
clearTreeSelection: function(treeId) {
if (tree) {
}
},
/**
* This function selects a treeNode matching the given URL.
*/
selectTreeNodeWithURL: function(url) {
if (matches) {
var bestMatch = null;
if (qmark > -1) {
var hiscore = 0;
}
}
}
if (bestMatch) {
}
}
},
var score = 0;
if (qmark > -1) {
//admingui.util.log("params = " + params);
continue;
}
score++;
}
}
}
return score;
},
createObjectFromQueryString: function(url) {
var params = null;
if (qmark > -1) {
params = Object();
}
}
return params;
},
/**
* This function selects the given treeNode.
*/
selectTreeNode: function(treeNode) {
if (tree) {
try {
} catch (err) {
//console.log(err);
}
}
},
expandNode: function(treeNode) {
while (index > -1) {
if (toSetStyle) {
}
}
},
/**=
* This function selects the given treeNode.
*/
selectTreeNodeById: function(treeNodeId) {
//admingui.nav.getTreeFrameElementById(treeNodeId));
if (tree) {
}
},
/**
* This function looks for an "A" node with a url equal to the url
* passed in.
*/
var result = null;
}
return result;
},
/**
* This function attempts to obtain the tree frame's tree object and
* return its selected Tree node. It will return null if unable to do
* this. It will <b>not</b> wait for the tree frame to load if it is not
* already loaded.
*/
getSelectedTreeNode: function() {
}
},
/**
* This function provides access to DOM objects in the tree window.
*/
getTreeFrameElementById: function(id) {
},
/**
* This function returns the parent TreeNode for the given TreeNode.
*/
getParentTreeNode: function(treeNode) {
},
getContainingTreeNode: function(href) {
return node;
},
/* @deprecated :) */
if (treeNode) {
}
return null;
}
};
pluginId : null,
if (targetNode) {
if (typeof(targetNode) === 'string') {
// We have a String
}
}
if (targetNode) {
if (req) {
function() {
// Make a tempoary elemnt to contain the help content
// Fix URLs in the help content...
// Show the help content...
}
};
}
}
},
fixTreeOnclick: function(node) {
node.oldonclick = null;
}
if (this.oldonclick != null) {
this.oldonclick();
}
return false;
};
}
} else {
// Not a href, so walk its children
}
}
},
// Walk the DOM looking for "A" nodes, repair their URLs
if (relPath) {
// In-page link...
return;
}
// Full URL or IE7...
// Same Path...
// Not an in-page link, make it one...
}
// Nothing to do here...
return;
}
if (idx != -1) {
// IE7 does not give the real value, but instead tranlates it
// so strip it off...
} else {
// From same host... Assume IE7 messed up URL
} else {
// Must be a real external URL...
// Default external targets to _blank
}
return;
}
}
}
// Fix for Issue #: 11017
// Remove '#' from IE Ajax URLs b/c IE can't handle it!!
}
// Take filename off baseURL
// Remove leading ../'s
if (idx != 0) {
}
}
// Fix href...
node.setAttribute("onclick", "admingui.help.showHelpPage('" + node.href + "', 'helpContent'); return false;");
}
} else {
// Not a href, so walk its children
}
}
},
launchHelp: function(url) {
return false;
}
},
"helpKey");
if (helpKeys !== null) {
url:"url"
},
function(result) {
admingui.help.openHelpWindow(helpLink + "?contextRef=" + "/resource/" + admingui.help.pluginId + result.url);
}, 3, false);
} else {
}
},
openHelpWindow: function (url) {
if (win) {
}
},
//
// Perform an ajax request on the tab panel element
//
// set up the parameters to the ajax request
var props = {};
// launch the request
// Note: in help window, don't ping -- only 1 JSF page
//
//
},
contextRef = "docinfo.html";
}
// Derive the prefix somehow
//contextRef = prefix + contextRef;
},
nav: {
TREE_ID: "tocTree",
lastTreeNodeSelected: null,
/**
* This function selects a treeNode matching the given URL.
*/
selectTreeNodeWithURL: function(url) {
if (matches) {
// FIXME: Find "best" match... this will be needed if the URL
// is ambiguous, which may happen if post requests occur which
// leave off QUERY_STRING data that is needed to identify the
// URL. It's probably best to leave the highlighting alone in
// many of these cases... perhaps search for the nearest match
// to the currently selected node. Anyway, for now I will
// ignore this until we need to fix it...
// FIXME: This really should highlight the selected node.
}
},
/**
* This function selects the given treeNode.
*/
selectTreeNode: function(treeNode) {
var tree = document.getElementById(admingui.help.nav.TREE_ID);// admingui.help.nav.getTree(treeNode);
if (tree) {
try {
} catch (err) {
//console.log(err);
}
}
}
}
};
//============================================================
/**
* Validation functions
*/
return false;
}
if ( getConfirm(this, emptyMsg) ){
return true;
}else{
return false;
}
}
return true;
}
var styleClass = null;
var component = null;
// Find the styleClass for this input
// styleClass = admingui.util.getWoodstockProp(inputs[i], "className"); This is the woodstock 4.4.0.1 style
continue;
}
}
}
continue;
}
}
}
var num = 0;
continue;
}
continue;
}
}
}
}
}
}
}
}
return true;
}
// FIXME: We should combine guiValidate() and guiValidateWithDropDown() these
// FIXME: perform similar operations but b/c of testing reasons we
// FIXME: added two methods. We should combine these in the future.
return false;
}
var component = null;
var styleClass = null;
component = selectFields[i];
// Find the styleClass for this input
// styleClass = admingui.util.getWoodstockProp(selectFields[i], "className"); This is the woodstock 4.4.0.1 style
continue;
}
}
}
}
return true;
}
var val = '';
if (label != null) {
//IE doesn't have textContent, need to use innerText;
//firefox 2.0.0.1 doesn't have innerText, so need to test both.
//val = label.textContent.substring(1);
//val = label.innerText.substring(1);
if (val ==null) {
}
// Need to remove leading newline characters...
// FIXME: Consider using isWhitespace(val.charAt(0))
// FIXME: I didn't add it now b/c isWhitespace is defined in selectElements.js
// FIXME: and I don't have time to test that that file is included everywhere
// FIXME: that this function is called.
}
// Need to remove trailing newline characters...
// FIXME: Consider using isWhitespace(val.charAt(val.length-1))
// FIXME: I didn't add it now b/c isWhitespace is defined in selectElements.js
// FIXME: and I don't have time to test that that file is included everywhere
// FIXME: that this function is called.
}
// Strip off the ':' so that it doesn't show in the alert.
}
}
return val;
}
function checkForIntValueOrEmpty(value) {
if (value == '')
return true;
return checkForIntValue(value);
}
function checkForIntValue(value) {
return result;
}
function checkForPortOrEmpty(value) {
if (value == '')
return true;
return checkForPort(value);
}
function checkForPort(value) {
if (value == '') return false;
if (checkForIntValue(value) == false) return false;
}
return false;
return true;
}
var i;
return false;
}
}
return true;
}
function checkForNumericValueOrEmpty(value) {
if (value == '')
return true;
return checkForNumericValue(value);
}
function checkForNumericValue(value) {
//if (result == false) {
//This comment is by Senthil on Apr 11 2007. I think this is an
//existing bug in this API.
//formField isn't defined, or passed to this method, so just return the
//result for now. Fixing this API now might involve lots of other changes, at this release time, so decided to live with this bug for now.
//formField.select();
//}
return result;
}
//Special check for StatementTimeout for JDBC and connector connection pool
return true;
return false;
}
if (!result) {
}
return result;
}
//component = document.getElementById(componentId);
//var value = component.getProps().value;
if (result == false) {
if (reqMsg == '') {
} else {
}
}
return result;
}
function checkEmpty(componentId){
return false;
}
return true;
}
function isWhitespace(s) {
var i;
var whitespace = " \t\n\r";
// Search through string's characters one by one
// until we find a non-whitespace character.
// When we do, return false; if we don't, return true.
for (i = 0; i < s.length; i++) {
// Check that current character isn't whitespace.
var c = s.charAt(i);
}
// All characters are whitespace.
return true;
}
var endDateSet = false;
var returnValue = true;
if(beginDate == '') {
return false;
}
if(endDate == '') {
endDate = new Date();
endDateSet = true;
}
var endDateArr;
var endDateValue;
if(!endDateSet) {
}
}
if(endDateSet) {
}
//make sure this is in YYYY format
}
if(beginDateValue > endDateValue) {
returnValue = false;
}
return returnValue;
}
var separatorChar;
var format = new Array();
var regExp = new RegExp(/\s+/);
if(delim == '') {
}
else {
}
if(pattern != '') {
if(separatorChar[i] == ' ') {
//split any number of whitespaces
separatorChar[i] = regExp;
}
delim = '/';
return false;
}
pattern = '';
break;
}
}
}
}
}
}
return false;
}
return true;
}
//This API returns the format number for the given date pattern
function getDateFormat(pattern) {
if(pattern == '') {
}
return i+1;
}
}
return 1;
}
//We support only two formats for now
if(startDate != '') {
return false;
}
}
if(endDate != '') {
return false;
}
}
return true;
}
//In US Date format already, no need to convert
return date;
}
else if(format == 2) {
}
else if(format == 3) {
}
else if(format == 4) {
}
else if(format == 5) {
}
else if(format == 6) {
}
return date;
}
var dateValue;
var splitChar;
var separatorChar;
var regExp = new RegExp(/\s+/);
if(delim == '') {
}
else {
}
var dateFound = false;
if(format == '') {
format = 1;
}
if(separatorChar[i] == ' ') {
//split any number of whitespaces
separatorChar[i] = regExp;
}
dateFound = true;
break;
}
}
return false;
}
if(format > 1) {
// We received date in non-us format
}
//make sure this is in YYYY format
}
else {
return false;
}
}
var range = new Array(3);
for(i=0; i < 3; i++) {
if(!checkForNumericValue(dateValue[i])) {
return false;
}
return false;
}
}
return false;
}
return true;
}
if(day < 1) {
return false;
}
return false;
}
(day > 30)) {
return false;
}
if(month == 2) {
return false;
}
else {
if(day > 28) {
return false;
}
}
}
return true;
}
return true;
}
return false;
}
var lastSelectedIndex = 0;
function initLastSelected (objId) {
}
function setLastSelected (value) {
}
function disableUnselect(obj) {
}
}
}
if (!hasOptions(obj)) {
return;
}
}
}
if (!hasOptions(obj)) {
return;
}
if (optionValue == value) {
return i;
}
}
return -1;
}
function hasOptions(obj) {
return true;
}
return false;
}
if (index > -1) {
}
}
/*
* This functions submits the form when user hits enter
*/
var keyCode;
}
else if(e) {
}
else {
return true;
}
if(keyCode == 13) {
return false;
}
else {
return true;
}
}
function getSelectedValue(field) {
var selectedValue;
if(value == null) {
continue;
}
break;
}
}
return selectedValue;
}
var selectedValue = null;
var testField = null;
var name = null;
if (theForm) {
if (name == null) {
continue;
}
break;
}
}
}
return selectedValue;
}
function checkForSelectedValue(fieldId) {
return false;
}
return true;
}
function reloadHeaderFrame() {
}
//
//We need to set a timeout to delay the call to getTextElement inside disable component.
//otherwise getTextElement will always return null, causing JS error.
//disableComponent(dirPathId, 'text');
if ( (dirSelectBtnId != null) && (dirSelectBtnId != '') && (isWhitespace(dirSelectBtnId) == false)){
}
}
},
uploadRdBtnAction : function(dirPathId, dirSelectBtnId, filSelectBtnId, fileuploadId, radioChoosenId) {
//disableDOMComponent(dirPathId);
if ( (dirSelectBtnId != null) && (dirSelectBtnId != '') && (isWhitespace(dirSelectBtnId) == false)){
}
},
fileChooseAction : function(dirPathId, dirSelectBtnId, filSelectBtnId, fileuploadId, radioChoosenId) {
if ( (dirSelectBtnId != null) && (dirSelectBtnId != '') && (isWhitespace(dirSelectBtnId) == false)){
}
},
return true;
},
var cc = null;
var comp = null;
if (comp != null)
}
}else{
if (cc == null){
continue;
}
if (propSheetId == sheets[i]){
}else{
}
}
}
if (typeof(appName) != 'undefined' ) {
//appName should be up to the last dot. eg. tmpName of hello.123.war should be hello.123
if (ix != -1){
}
//may as well set context root if it exist.
if (component != null){
}
}
},
// Fill in application name
// shouldn't be.
}else{
if (comp != null){
}
}
}
},
setFieldValue : function(appNameId, value, dropDownProp, typeId, contextRootId, extensionId, obj, appTypeString) {
var sfex2 = '';
//If no extension for file choosen, or no plugin for that extension, show dropDown type and don't fill in anything, then return;
if (inx == -1){
sfex2 = '';
}
}
//for redeploy, there is no dropdown type to choose from.
if (typeId != ""){
}
},
populateDirAndAppName : function(fileChooserId, dirPathId, appNameId, typeId, dropDownProp, contextRootId, extensionId, appTypeString){
//for redeploy, there is no dropdown for app type, there is no need to fill in any field.
if (dropDownProp != ""){
admingui.deploy.setFieldValue(appNameId, fc, dropDownProp, typeId, contextRootId, extensionId, window.opener, appTypeString);
}
},
if (result == false) {
if (reqMsg == '') {
} else {
}
}
return result;
},
if (onlyDAS=='true') return true;
if (component != null){
return getConfirm(this, confirmMsg);
}
}
return true;
},
if (result == false) {
return false;
}
return true;
}
}
var buttons = new Array();
},
var buttons = new Array();
},
var buttons = new Array();
}
}
},
try {
if (element) {
}
}
} catch (err) {
}
},
initAllRows : function (tableId) {
table.initAllRows();
}
}
lastPageLoaded : '',
ajaxCount: 0,
ajaxTimer: null,
getXMLHttpRequestObject: function() {
var reqObj = null;
if (window.XMLHttpRequest) {
reqObj = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
} catch (ex) {
}
}
return reqObj;
},
// Ping header to make sure header stays "fresh"
}
if (req) {
function() {
/*
// Make a tempoary elemnt to contain the help content
var tmpDiv = document.createElement("div");
tmpDiv.innerHTML = req.responseText;
// Fix URLs in the help content...
admingui.help.fixHelpURLs(url, tmpDiv);
// Show the help content...
targetNode.innerHTML = tmpDiv.innerHTML;
*/
}
};
//IE caches GUI page and many pages are not loaded correctly. So we force the reload
//in IE. Refer to GLASSFISH-15628
if (navigator != null) {
} else {
}
}
}
if (beforesend) {
// Callback that can be used to modify request before it is sent
}
}
},
ajaxStart : function() {
// admingui.ajax._setVisibility('ajaxIndicator', 'visible');
},
_displayAjaxLoadingPanel : function() {
if (ajaxPanel != null) {
};
}
},
if (el != null) {
}
},
_clearAjaxTimer : function() {
}
},
ajaxComplete : function() {
if (ajaxPanel != null) {
}
},
//args.lastPage = document.getElementById(admingui.nav.TREE_ID).getSelectedTreeNode;
//admingui.util.log("Loading " + url + " via ajax.");
// Make cursor spin...
// Make request
if (typeof oldOnClick == 'function') {
// oldOnClick();
}
return false;
},
processPageAjax : function (o) {
if (contentNode == null) {
}
// FIXME: These 2 functions only need to be replaced after a FPR...
// Restore cursor
if (typeof node != 'undefined') {
//admingui.nav.selectTreeNodeById(node.parentNode.parentNode.id);
}
},
if (displayLoading !== false) {
}
respTarget = 'content';
}
var params = {
// I need to do this by default so all form values get processed.
execute: '@all',
bare: true,
render: '@all'
};
}
}
// Don't do this for user-defined render value
// Make cursor spin... (only do this when we're handling the response)
}
// Ping header to make sure header stays "fresh"
},
// May be inside a frame...
}
var contentNode = target;
if (typeof(contentNode) === 'string') {
}
}
if (typeof(webui) !== 'undefined') {
// FIXME: These 2 functions (should) only need be replaced after FPR...
}
var contextObj = {};
// Restore cursor
},
/**
* This function handles JSF2 Ajax responses. It is expected that the
* response will replace the innerHTML of an element rather than the whole
* page. If the content contains JSF2 markup, it will attempt to use the
* content defined in the javax.faces.ViewRoot "update" element. It will
* also attempt to update the ViewState. If this is not found in the
* response, it will try to use the entire response for the value of
* innerHTML.
*/
handleResponse : function () {
//admingui.ajax.updateCurrentPageLink(o.argument.url); <-- find a better way to get the viewId
var contentNode = null;
}
} else if (typeof(contentNode) === 'string') {
}
var viewState = null;
// We have a JSF response... if id="javax.faces.ViewRoot", handle it
if (idx > 0) {
try {
var nodes = this.xmlReq.responseXML.getElementsByTagName("partial-response")[0].childNodes[0].childNodes;
}
// NOTE: see jsf.ajax.doUpdate for more info....
}
}
} catch (ex) {
}
}
}
if (viewState != null) {
if (!form) {
return;
}
if (typeof(field) === 'undefined') {
}
}
// FIXME: These 2 functions (should) only need be replaced after FPR...
var contextObj = {};
// Restore cursor
// Tree select code?? FIXME: broken...
/*
var node = o.argument.sourceNode;
if (typeof node != 'undefined') {
admingui.nav.selectTreeNodeById(node.parentNode.parentNode.id);
}
*/
},
// dump everything for now...
}
},
updateCurrentPageLink : function (url) {
//document.getElementById("currentPageLink").href = url;
},
var recurse = true;
//console.log("nodeName = " + node.nodeName);
// FIXME: For exteral URLs, we should not replace... however, we
// FIXME: may want to ensure they have a _blank target. May need
// FIXME: to compare the host to see if a URL is an external URL
// FIXME: b/c M$ makes it hard to determine relative URLs, and full
// FIXME: URLs to the same host "might" want be valid for
// FIXME: replacement.
if (!admingui.ajax._isTreeNodeControl(node) && (node.target == '')) { // && (typeof node.onclick != 'function'))
var shouldReplace = true;
//admingui.util.log("*NOT* replacing href for " + node.id);
shouldReplace = false;
}
if (shouldReplace) {
//node.href = "#";
});
return false;
};
}
}
recurse = false;
// Submit button w/o any JS, make it a partial page submit
var args = {};
return false;
};
}
/*
} else if (node.nodeName == 'FORM') {
admingui.util.log("***** form action: " + node.action);
if (node.target == '') {
node.onsubmit = function () {
admingui.ajax.submitFormAjax(node);
return false;
};
}
*/
// bareLayout.xhtml handles this for ajax requests...
recurse = false;
recurse = false; // don't walk scripts
if (queueScripts) {
// Queue it...
context.scriptQueue = new Array();
}
}
}
// If recurse flag is true... recurse
}
}
},
_isTreeNodeControl : function (node) {
return isTreeNodeControl = (node.id.indexOf("_turner") > -1); // probably needs some work. This will do for now.
},
processScripts : function(context) {
// Nothing to do...
return;
}
},
// If the url does not start with 'http' (or 'https' by extension), calculate
// the "base" URL based off of window.location
}
return url;
}
var insert = '?bare=true';
insert = "&bare=true"
}
if (hash > 1) {
} else {
}
return changed;
},
/**
* handler - The name of the handler to invoke.
* args - An object containing properties / values for the parameters.
* callback - A JS function that should be notified.
* depth - the max depth of all return variables to be encoded in json
* async - false if a syncronous request is desired, default: true
*/
return;
}
if (typeof(callback) === 'undefined') {
callback = function() {};
}
var params = '';
// Create a String to represent all the parameters
// escape, this will prevent the server-side from (fully)
// urldecoding it. Allowing me to first parse the commas, then
// decode the content.
}
if (typeof(async) === 'undefined') {
async = true;
}
// Warp user's function to make easier to use
if (typeof(respElt) !== 'undefined') {
var result = '';
}
}
}
}
if (typeof(depth) === 'undefined') {
depth = 3;
}
alert("'execButton' not found! Unable to submit JSF2 Ajax Request!");
} else {
// Don't ping b/c this is from the header and therefor is a ping
{
execute: 'execButton',
render: 'execResp',
execButton: 'execButton',
h: handler,
d: depth,
a: params,
});
}
} else {
alert('JSF2+ Ajax Missing!');
}
},
}, callback, 1, true);
},
/**
* This ensure the header "page" (view state data) stays in JSF's history
*/
pingHeader: function() {
// Ping every 6 Ajax requests...
// Reset counter...
// Get element from header form...
var options = {
// noop
execute: '@none',
render: '@none'
};
}
}
}
// Add any extra args that are necessary...
var args = {};
/*
* Not needed we're executing everything anyway
var idx = linkId.indexOf('row');
if (idx > 0) {
idx = linkId.indexOf(':', idx + 3);
if (idx > 0) {
// We have a "*row*:" in the id name, backup the execute id to
// the row portion to ensure an entire table gets executed,
// otherwise it might not get executed at all.
args['execute'] = '@all';//linkId.substring(0, idx);
}
}
*/
//params are name value pairs but all one big string array
//so params[0] and params[1] form the name and value of the first param
if (params != null) {
}
}
// Check target
}
// Retore form
return false;
},
dropDownChanged: function(jumpDropdown) {
if (typeof(jumpDropdown) === "string") {
}
// Force WS "submitter" flag to true
if (!submitterField) {
if (!submitterField) {
+ jumpDropdown.id);
return false;
}
}
// FIXME: Not sure why the following is done...
continue;
// Regardless if the option is currently selected or not,
// the disabled option style should be used when the option
// is disabled. So, check for the disabled item first.
// See CR 6317842.
} else {
}
}
return false;
},
});
}
return false;
}
}
var globalEvalNextScript = function(scriptQueue) {
if (typeof(scriptQueue) === "undefined") {
// Nothing to do...
return;
}
if (typeof(node) == 'undefined') {
// Nothing to do...
return;
}
// use text...
} else {
// Get via Ajax
} );
// This gets a relative URL vs. a full URL with http://... needed
// when we properly serve resources w/ rlubke's recent fix that
// will be integrated soon. We need to handle the response
// differently also.
//admingui.ajax.getResource(node.attributes['src'].value, function(result) { globalEval(result.content); globalEvalNextScript(scriptQueue);} );
}
}
var globalEval = function(src) {
if (window.execScript) {
try {
} catch (error) {
}
}
return;
}
var fn = function() {
};
fn();
};