/**************************************************************** ** Licensed Materials - Property of IBM ** ** IBM Cognos Products: mdsrv ** ** (C) Copyright IBM Corp. 2008, 2010 ** ** US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. *****************************************************************/ //*********************************************************************************************** // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved. // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated). // // Component: Property pane of the Technical view // Comment: class CPropertyMgr contains all the functionality of the property pane // used in the Technical view //*********************************************************************************************** var g_bStandalone = typeof MDSRV_techView_StringManager == "undefined"; function PropertyPair( prop_name, prop_value ) { this.name = prop_name; this.value = prop_value; } function CPropertyPane( id_prop_table ) { this.id = id_prop_table; this.modelObject = null; this.tableAPI = new CPropertyTable ( id_prop_table ); this.loadProperties = function( propTableId ) { // var Page = document.getElementById( "id_property_pane" ); var Table = document.getElementById( this.id ); Table.style.display = ""; } this.show = function( bShow ) { var cssHelper = new CElementStyleHelper ( this.id ); cssHelper.show ( bShow ); } this.updateObject = function( modelObject ) { this.modelObject = modelObject; this.show( this.modelObject ? true : false ); } CPropertyPane.prototype.clearContents = function( ) { this.tableAPI.Clear(); } CPropertyPane.prototype.refreshContents = function() { this.clearContents(); if ( this.modelObject ) { this.tableAPI.AppendObjPropList ( this.modelObject ); /* for ( var i in this.modelObject.propertyList ) { var propPair = new PropertyPair( this.modelObject.getPropertyDisplayName(i), this.modelObject.getPropertyValue(i) ); this.appendRow( propPair ); } */ } } CPropertyPane.prototype.appendRow = function( propertyPair ) { this.tableAPI.AppendRow( propertyPair ); } } //---------------------------------------------------------------------------- // CPropertyMgr //---------------------------------------------------------------------------- function CPropertyMgr ( propertyPaneQuery, propertyPaneItem ) { this.m_propertyPaneQuery = propertyPaneQuery; this.m_propertyPaneItem = propertyPaneItem; this.m_modelSQ = null; this.m_modelQI = null; this.updateObjects = function( modelSQ, modelQI ) { this.m_modelSQ = modelSQ; this.m_modelQI = modelQI; // Update Property Caption var elemObjectName = document.getElementById( "id_property_table_caption_object" ); if ( elemObjectName ) { var dispName = this.m_modelQI ? this.m_modelQI.getName() : ( this.m_modelSQ ? this.m_modelSQ.getName() : "" ); //we need to convert any < > symbols in the string to their html entities, the former formatting to convert &apos to ' was unnecessary as innerHTML processes these entities var escapedDispName = escapeHTML ( dispName ); if ( ! g_bStandalone ) { var lblDispName = MDSRV_techView_StringManager.stringLookup( 'properties_for', escapedDispName ); elemObjectName.innerHTML = lblDispName; } else { elemObjectName.innerHTML = "Properties for " + escapedDispName; } } // Update Property Panes if ( this.m_propertyPaneQuery ) { this.m_propertyPaneQuery.updateObject( this.m_modelSQ ); this.m_propertyPaneQuery.refreshContents(); } if ( this.m_propertyPaneItem ) { this.m_propertyPaneItem.updateObject( this.m_modelQI ); this.m_propertyPaneItem.refreshContents(); } } }