BeepPadUI/Workflow/shared/messaging.js
//  retrieve all messages from the messaging system and populate the array of message objects
retrieve all messages from the messaging system and populate the array of message objects
retrieve all messages from the messaging system and populate the array of message objects
function initMessaging()
{
	var nMessageCount = 0;
	var strMessageIDList = window.external.GetMessageIDList();
	var aMessageID = strMessageIDList.split(";");
	for(var itr = 0 ; itr < aMessageID.length ; itr++)
	{
		var strMsgID = aMessageID[itr];
		if ((strMsgID != null) && (strMsgID.length > 0))
		{
			var xmlMessage = window.external.GetMessage(strMsgID);
			if(xmlMessage != null)
			{
				var bMessageViewed = false;
				if ( window.external.HasMessageBeenTracked(strMsgID, "Archive", "Click") 
				    || window.external.HasMessageBeenTracked(strMsgID, "Center", "Click") 
				    || window.external.HasMessageBeenTracked(strMsgID, "HTMLWnd", "Click") )
				{
				    bMessageViewed = true;
				}
				var strMessageTitle = xmlMessage.getAttribute("title");
				var strMessageType = xmlMessage.getAttribute("type");
				var strMessageWidth = "190";
				var elmWidthNode = xmlMessage.selectSingleNode("contents/content[@type='body']/@width");
				if (null != elmWidthNode)
				{
				    strMessageWidth = elmWidthNode.text;
				}
				var strMessageHeight = "190";
				var elmHeightNode = xmlMessage.selectSingleNode("contents/content[@type='body']/@height");
				if (null != elmHeightNode)
				{
				    strMessageHeight = elmHeightNode.text;
				}
				var strURL = "about:blank";
				var elmUrlNode = xmlMessage.selectSingleNode("contents/content[@type='body']/@localpath");
				if(null != elmUrlNode)
				{
					strURL = elmUrlNode.text;
				}
				var strDetail = "";
				elmUrlNode = xmlMessage.selectSingleNode("contents/content[@type='detail']/@localpath");
				if(null != elmUrlNode)
				{
					strDetail = elmUrlNode.text;
				}
				var strSubTypeLevel1 = xmlMessage.getAttribute("subtypelevel1");
				var objMessage = new message(strMsgID, bMessageViewed, strMessageTitle, strMessageType, strURL, strDetail, strMessageWidth, strMessageHeight, strSubTypeLevel1);
				if(null != objMessage)
				{
					aMessages.push(objMessage);
					nMessageCount++;
				}
			}
		}	
	}
	return nMessageCount;
}
function initMessaging ( ) { var nMessageCount = 0 ; var strMessageIDList = window . external . GetMessageIDList ( ) ; var aMessageID = strMessageIDList . split ( ";" ) ; for ( var itr = 0 ; itr < aMessageID . length ; itr ++ ) { var strMsgID = aMessageID [ itr ] ; if ( ( strMsgID != null ) && ( strMsgID . length > 0 ) ) { var xmlMessage = window . external . GetMessage ( strMsgID ) ; if ( xmlMessage != null ) { var bMessageViewed = false ; if ( window . external . HasMessageBeenTracked ( strMsgID , "Archive" , "Click" ) || window . external . HasMessageBeenTracked ( strMsgID , "Center" , "Click" ) || window . external . HasMessageBeenTracked ( strMsgID , "HTMLWnd" , "Click" ) ) { bMessageViewed = true ; } var strMessageTitle = xmlMessage . getAttribute ( "title" ) ; var strMessageType = xmlMessage . getAttribute ( "type" ) ; var strMessageWidth = "190" ; var elmWidthNode = xmlMessage . selectSingleNode ( "contents/content[@type='body']/@width" ) ; if ( null != elmWidthNode ) { strMessageWidth = elmWidthNode . text ; } var strMessageHeight = "190" ; var elmHeightNode = xmlMessage . selectSingleNode ( "contents/content[@type='body']/@height" ) ; if ( null != elmHeightNode ) { strMessageHeight = elmHeightNode . text ; } var strURL = "about:blank" ; var elmUrlNode = xmlMessage . selectSingleNode ( "contents/content[@type='body']/@localpath" ) ; if ( null != elmUrlNode ) { strURL = elmUrlNode . text ; } var strDetail = "" ; elmUrlNode = xmlMessage . selectSingleNode ( "contents/content[@type='detail']/@localpath" ) ; if ( null != elmUrlNode ) { strDetail = elmUrlNode . text ; } var strSubTypeLevel1 = xmlMessage . getAttribute ( "subtypelevel1" ) ; var objMessage = new message ( strMsgID , bMessageViewed , strMessageTitle , strMessageType , strURL , strDetail , strMessageWidth , strMessageHeight , strSubTypeLevel1 ) ; if ( null != objMessage ) { aMessages . push ( objMessage ) ; nMessageCount ++ ; } } } } return nMessageCount ; }
retrieve all messages from the messaging system and populate the array of message objects
retrieve all messages from the messaging system and populate the array of message objects
/* return the number of messages found */ /* itterate over the list of messages and create objects that we'll use to populate the list ctrl */ /* use the message id to get the message from the host application */ /* get the viewed state for the message */ /* get the message title */ /* get the message type */ /* get the message width */ /* get the message height */ /* get the local URL to the message */ /* get the detail URL */ /* get the message subtypelevel1 */ /* construct a message object and store the object in the global array */