webclient.js-i2b2.cells.PM.PM_admin_view.js Maven / Gradle / Ivy
/**
* @projectDescription PM Administration Module
* @inherits i2b2
* @namespace i2b2.PM
* @author Nick Benik, Mike Mendis, Griffin Weber MD PhD
* @version 1.0
*/
i2b2.PM.model.helpMSGS = {};
i2b2.PM.model.helpMSGS.LOADED = "i2b2 Administration
"
+"Welcome to the i2b2 Administration module of the project management interface.
"
+ "The pages within i2b2 Admin are designed to assist with workflow and overall ease of use, individuals can easily save data and parameters for the hive, projects and users.
"
+ "Manage Hive "
+ "View domain information and capture cell data and global parameters. "
+ "Manage Project "
+ "General information about the project as well as project specific cell data, parameters, and user access and roles. "
+ "Manage Users "
+ "General information about a user. "
+ "Manage Approvals "
+ "Captures general information used to authorize projects. "
+ "Project Requests "
+ "View information about submitted project requests.
"
+"
The navigation bar on the left side of the page can be used to access individual pages.";
i2b2.PM.model.helpMSGS.HIVE = "Hive Configuration
Describe what these functions are for.";
i2b2.PM.model.helpMSGS.HIVEDOMAIN = "';
i2b2.PM.model.helpMSGS.PROJECTREQUEST = "';
i2b2.PM.model.helpMSGS.PROJECTUSERS = "Click on \"User\" in the navigation bar to refresh the list of users.
Please select a user on the left to edit it's properties
"+
''+
' ';
i2b2.PM.model.helpMSGS.DBLOOKUP = "Click on \"DBLookup\" in the navigation bar to refresh the list of DB Lookup.
Please select a DB Lookup on the left to edit it's properties
"+
''+
' ';
i2b2.PM.model.helpMSGS.DBLOOKUPREC = ''+
'Name: '+
'Project Path: '+
'DB Schema: '+
'JNDI Data Source: '+
'Tooltip: '+
'Comment: '+
'DB Server: '+
' '+
'
';
i2b2.PM.model.adminButtonsPrimary = {};
i2b2.PM.model.adminButtonsPrimary["HIVEDOMAINS"] = " ";
i2b2.PM.model.adminButtonsPrimary["HIVECELLS"] = " ";
i2b2.PM.model.adminButtonsPrimary["HIVEGLOBALS"] = " ";
i2b2.PM.model.adminButtonsPrimary["USERS"] = " ";
i2b2.PM.model.adminButtonsPrimary["DBLOOKUP"] = " ";
i2b2.PM.model.adminButtonsPrimary["APPROVALS"] = " ";
i2b2.PM.model.adminButtonsPrimary["PROJECTREC-PARAMS"] = " ";
i2b2.PM.model.adminButtonsPrimary["PROJECTREC-CELLS"] = " ";
i2b2.PM.model.adminButtonsPrimary["PROJECTREC-USERS"] = " ";
i2b2.PM.model.adminColumnDef = {};
i2b2.PM.model.adminColumnDef["HIVEDOMAINS"] = [
{key:"domain_id",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"active",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Active"],disableBtns:true})},
{key:"environment", sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["DEVELOPMENT","PRODUCTION", "TEST"],disableBtns:true})},
{key:"domain_name",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"helpURL",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["HIVECELLS"] = [
{key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"method",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["SOAP","REST","OTHER"],disableBtns:true})},
{key:"url",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"project_path",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["HIVEGLOBALS"] = [
{key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"datatype", sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:[{label:"Text", value:"T"}, {label:"Reference Text", value:"M"}, {label:"Reference Binary", value:"C"},{label:"Numeric", value:"N"},{label:"Date", value:"D"}, {label:"Integer", value:"I"}, {label:"Boolean", value:"B"}, {label:"RTF", value:"RTF"}, {label:"Excel", value:"XLS"}, {label:"XML", value:"XML"}, {label:"Word", value:"Doc"}],disableBtns:true})},
{key:"value",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["USERPARAMS"] = [
{key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"datatype", sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:[{label:"Text", value:"T"}, {label:"Reference Text", value:"M"}, {label:"Reference Binary", value:"C"},{label:"Numeric", value:"N"},{label:"Date", value:"D"}, {label:"Integer", value:"I"}, {label:"Boolean", value:"B"}, {label:"RTF", value:"RTF"}, {label:"Excel", value:"XLS"}, {label:"XML", value:"XML"}, {label:"Word", value:"Doc"}],disableBtns:true})},
{key:"value",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["PROJPARAMS"] = [
{key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"datatype", sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:[{label:"Text", value:"T"}, {label:"Reference Text", value:"M"}, {label:"Reference Binary", value:"C"},{label:"Numeric", value:"N"},{label:"Date", value:"D"}, {label:"Integer", value:"I"}, {label:"Boolean", value:"B"}, {label:"RTF", value:"RTF"}, {label:"Excel", value:"XLS"}, {label:"XML", value:"XML"}, {label:"Word", value:"Doc"}],disableBtns:true})},
{key:"value",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["HIVECELLPARAMS"] = [
{key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"datatype", sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:[{label:"Text", value:"T"}, {label:"Reference Text", value:"M"}, {label:"Reference Binary", value:"C"},{label:"Numeric", value:"N"},{label:"Date", value:"D"}, {label:"Integer", value:"I"}, {label:"Boolean", value:"B"}, {label:"RTF", value:"RTF"}, {label:"Excel", value:"XLS"}, {label:"XML", value:"XML"}, {label:"Word", value:"Doc"}],disableBtns:true})},
{key:"value",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["PROJECTREQUESTS"] = [
{key:"id", sortable:true, resizeable:true},
{key:"project_id",sortable:true, resizeable:true},
{key:"title",sortable:true, resizeable:true},
{key:"entry_date",sortable:true, resizeable:true, formatter:YAHOO.widget.DataTable.formatDate},
{key:"submit_char",sortable:true, resizeable:true},
{key:"request_xml",sortable:true, resizeable:true}
];
i2b2.PM.model.adminColumnDef["PROJECTS"] = [
{key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"name",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"description",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"key",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"wiki",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"path",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["APPROVALS"] = [
{key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"name",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"description",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"activation_date",sortable:true, resizeable:true, formatter:"myDate", editor: new YAHOO.widget.DateCellEditor()},
{key:"expiration_date",sortable:true, resizeable:true,formatter:"myDate", editor: new YAHOO.widget.DateCellEditor()}
];
i2b2.PM.model.adminColumnDef["USERS"] = [
{key:"full_name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"user_name",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"email",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"is_admin",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
i2b2.PM.model.adminColumnDef["DBLOOKUP"] = [
{key:"db_nicename", label:"Name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"db_fullschema", label:"DB Schema", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"db_datasource", label:"JNDI Data Source", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"db_servertype", label:"DB Server", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"owner_id", label:"Owner ID", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
{key:"project_path", label:"Project Path", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}
];
// build the columndef for project-user dynamically
var t = i2b2.PM.cfg.config.authRoles;
var l = t.length;
var codes = [];
for (var i=0; i";
i2b2.PM.model.adminButtonsSecondary["HIVECELLS"] = " ";
i2b2.PM.model.adminButtonsSecondary["HIVEDOMAINS"] = " ";
i2b2.PM.model.adminButtonsSecondary["PROJECTREC-CELLS"] = " ";
i2b2.PM.model.adminButtonsSecondary["PROJECTREC-USERS"] = " ";
// visual screen configuration
// --------------------------------------------------------------------------------------------------------------------
i2b2.PM.view.admin.showInfoPanel = function(infoID) {
if (!infoID) {
$('pmAdminHelp').hide();
} else {
if (i2b2.PM.model.helpMSGS[infoID]) {
$('pmAdminHelp').innerHTML = i2b2.PM.model.helpMSGS[infoID];
} else {
$('pmAdminHelp').innerHTML = "Could not find help message ["+infoID+"]";
}
$('pmAdminHelp').show();
}
};
i2b2.PM.view.admin.onCheckedChange = function(items) {
var items = items;
if (items == "MANAGER")
{
document.getElementById("RoleMANAGER").checked = true;
document.getElementById("RoleUSER").checked = true;
} else if (items == "USER")
{
document.getElementById("RoleMANAGER").checked = false;
document.getElementById("RoleUSER").checked = true;
} else if (items == "DATA_PROT")
{
document.getElementById("RoleDATA_PROT").checked = true;
document.getElementById("RoleDATA_DEID").checked = true;
document.getElementById("RoleDATA_LDS").checked = true;
document.getElementById("RoleDATA_AGG").checked = true;
document.getElementById("RoleDATA_OBFSC").checked = true;
} else if (items == "DATA_DEID")
{
document.getElementById("RoleDATA_PROT").checked = false;
document.getElementById("RoleDATA_DEID").checked = true;
document.getElementById("RoleDATA_LDS").checked = true;
document.getElementById("RoleDATA_AGG").checked = true;
document.getElementById("RoleDATA_OBFSC").checked = true;
} else if (items == "DATA_LDS")
{
document.getElementById("RoleDATA_PROT").checked = false;
document.getElementById("RoleDATA_DEID").checked = false;
document.getElementById("RoleDATA_LDS").checked = true;
document.getElementById("RoleDATA_AGG").checked = true;
document.getElementById("RoleDATA_OBFSC").checked = true;
} else if (items == "DATA_AGG")
{
document.getElementById("RoleDATA_PROT").checked = false;
document.getElementById("RoleDATA_DEID").checked = false;
document.getElementById("RoleDATA_LDS").checked = false;
document.getElementById("RoleDATA_AGG").checked = true;
document.getElementById("RoleDATA_OBFSC").checked = true;
} else if (items == "DATA_OBFSC")
{
document.getElementById("RoleDATA_PROT").checked = false;
document.getElementById("RoleDATA_DEID").checked = false;
document.getElementById("RoleDATA_LDS").checked = false;
document.getElementById("RoleDATA_AGG").checked = false;
document.getElementById("RoleDATA_OBFSC").checked = true;
}
};
i2b2.PM.view.admin.configScreenDispay = function(dispLevel) {
var configScreen = i2b2.PM.view.admin.configScreen;
switch(dispLevel) {
case 0:
// no config
Element.hide('pmAdminMainTableview');
Element.hide('pmAdminTableviewButtons');
Element.hide('pmAdminParamTableview');
Element.hide('pmAdminParamTableviewButtons');
break;
case 1:
// only the main grid
$('pmAdminMainTableview').show();
// display action buttons for main grid
/*
if (i2b2.PM.model.adminButtonsPrimary[configScreen]) {
$('pmAdminTableviewButtons').innerHTML = i2b2.PM.model.adminButtonsPrimary[configScreen];
Element.show('pmAdminTableviewButtons');
} else {
Element.hide('pmAdminTableviewButtons');
}
*/
Element.hide('pmAdminParamTableview');
Element.hide('pmAdminParamTableviewButtons');
break;
case 2:
// main grid and parameters grid
Element.show('pmAdminMainTableview');
// display action buttons for main grid
/*
if (i2b2.PM.model.adminButtonsPrimary[configScreen]) {
$('pmAdminTableviewButtons').innerHTML = i2b2.PM.model.adminButtonsPrimary[configScreen];
Element.show('pmAdminTableviewButtons');
} else {
Element.hide('pmAdminTableviewButtons');
}
*/
Element.show('pmAdminParamTableview');
if (i2b2.PM.model.adminButtonsSecondary[configScreen]) {
$('pmAdminParamTableviewButtons').innerHTML = i2b2.PM.model.adminButtonsSecondary[configScreen];
Element.show('pmAdminParamTableviewButtons');
} else {
Element.hide('pmAdminParamTableviewButtons');
}
break;
}
};
//i2b2.PM.view.admin.ProjectRequestViewer = {
// show: function(request_xml) {
i2b2.PM.view.admin.ProjectRequestViewer = function(request_xml) {
var docXML = i2b2.h.parseXml(request_xml);
var c = docXML.getElementsByTagName('project_request'); // YAHOO.DataType.XML.parse(request_xml); //loadXMLString(request_xml);
var l = c.length;
for (var i=0; iTitle: