src/web/js/acsimpleconfig.js
/**
 * This method will create the storage provider configuration based on the data filled in the UI.
 * 
 * @param nParent The parent node to append the XML structure to.
 *  
 * @return Nothing.
 */
This method will create the storage provider configuration based on the data filled in the UI.

@param nParent The parent node to append the XML structure to.

@return Nothing.
This method will create the storage provider configuration based on the data filled in the UI . @param nParent The parent node to append the XML structure to . @return Nothing .
function createStorageConfiguration(nParent)
{
	var nData = mdlDatabase.getData();
	var nStorage = nParent.selectSingleNode("storage");
	if (nStorage == null)
	{
		nStorage = createElementNS("storage", NS_CONFIGURATION, nParent);
	}
	else
	{
		while (nStorage.firstChild != null)
		{
			nStorage.removeChild(nStorage.firstChild);
		}
	}
	var sValue = cbStorageProvider.getValue();
	if (sValue == "")
	{
		createTextElementWithParentNS("class", txtSPCustomClass.getValue(), nStorage);
	}
	else 
	{
		createTextElementWithParentNS("class", sValue, nStorage);
	}
	var nParameters = createElementWithParentNS("parameters", nStorage);
	if (sValue == "com.cordys.coe.ac.emailio.storage.DBStorageProvider")
	{
		var nTemp = createTextElementWithParentNS("parameter", cCompressData.getValue(), nParameters);
		nTemp.setAttribute("name", "compressdata");
		nTemp.setAttribute("type", "string");
		nTemp = createElementWithParentNS("parameter", nParameters);
		nTemp.setAttribute("name", "dbconfig");
		nTemp.setAttribute("type", "xml");
		nTemp.appendChild(mdlDatabase.getData().selectSingleNode("//component").cloneNode(true));
		var anNodes = nTemp.selectNodes(".//component/password");
    	for (var iCount = 0; iCount < anNodes.length; iCount++)
    	{
    		anNodes[iCount].text = libPassword.encode(anNodes[iCount].text);
    	}
	}
	else if (sValue == "com.cordys.coe.ac.emailio.storage.FileStorageProvider")
	{
		var nTemp = createTextElementWithParentNS("parameter", txtFSErrorFolder.getValue(), nParameters);
		nTemp.setAttribute("name", "errorfolder");
		nTemp.setAttribute("type", "string");
		nTemp = createTextElementWithParentNS("parameter", cFSLogIncomming.getValue(), nParameters);
		nTemp.setAttribute("name", "logincomingmessages");
		nTemp.setAttribute("type", "string");
		nTemp = createTextElementWithParentNS("parameter", cFSLogFolder.getValue(), nParameters);
		nTemp.setAttribute("name", "logfolder");
		nTemp.setAttribute("type", "string");
		nTemp = createTextElementWithParentNS("parameter", txtFSTriggerFolder.getValue(), nParameters);
		nTemp.setAttribute("name", "triggerfolder");
		nTemp.setAttribute("type", "string");
	}
	else if (sValue == "com.cordys.coe.ac.emailio.storage.DefaultMemoryStore")
	{
	}
	else
	{
		var anNodes = mdlCustom.getData().selectNodes("//parameter");
		for (var iCount = 0; iCount < anNodes.length; iCount++) 
		{
			var sName = anNodes[iCount].selectSingleNode("./name").text;
			var sType = anNodes[iCount].selectSingleNode("./type").text;
			var sValue = anNodes[iCount].selectSingleNode("./value").text;
			var nTemp = null;
			if (sType == "xml")
			{
				nTemp = createElementWithParentNS("parameter", nParameters);
				var xmlTemp = createSimpleXMLDocument(sValue);
				nTemp.appendChild(xmlTemp.documentElement.cloneNode(true));
			}
			else
			{
				nTemp = createTextElementWithParentNS("parameter", sValue, nParameters);
			}
			nTemp.setAttribute("name", sName);
			nTemp.setAttribute("type", sType);
		}
	}
}
function createStorageConfiguration ( nParent ) { var nData = mdlDatabase . getData ( ) ; var nStorage = nParent . selectSingleNode ( "storage" ) ; if ( nStorage == null ) { nStorage = createElementNS ( "storage" , NS_CONFIGURATION , nParent ) ; } else { while ( nStorage . firstChild != null ) { nStorage . removeChild ( nStorage . firstChild ) ; } } var sValue = cbStorageProvider . getValue ( ) ; if ( sValue == "" ) { createTextElementWithParentNS ( "class" , txtSPCustomClass . getValue ( ) , nStorage ) ; } else { createTextElementWithParentNS ( "class" , sValue , nStorage ) ; } var nParameters = createElementWithParentNS ( "parameters" , nStorage ) ; if ( sValue == "com.cordys.coe.ac.emailio.storage.DBStorageProvider" ) { var nTemp = createTextElementWithParentNS ( "parameter" , cCompressData . getValue ( ) , nParameters ) ; nTemp . setAttribute ( "name" , "compressdata" ) ; nTemp . setAttribute ( "type" , "string" ) ; nTemp = createElementWithParentNS ( "parameter" , nParameters ) ; nTemp . setAttribute ( "name" , "dbconfig" ) ; nTemp . setAttribute ( "type" , "xml" ) ; nTemp . appendChild ( mdlDatabase . getData ( ) . selectSingleNode ( "//component" ) . cloneNode ( true ) ) ; var anNodes = nTemp . selectNodes ( ".//component/password" ) ; for ( var iCount = 0 ; iCount < anNodes . length ; iCount ++ ) { anNodes [ iCount ] . text = libPassword . encode ( anNodes [ iCount ] . text ) ; } } else if ( sValue == "com.cordys.coe.ac.emailio.storage.FileStorageProvider" ) { var nTemp = createTextElementWithParentNS ( "parameter" , txtFSErrorFolder . getValue ( ) , nParameters ) ; nTemp . setAttribute ( "name" , "errorfolder" ) ; nTemp . setAttribute ( "type" , "string" ) ; nTemp = createTextElementWithParentNS ( "parameter" , cFSLogIncomming . getValue ( ) , nParameters ) ; nTemp . setAttribute ( "name" , "logincomingmessages" ) ; nTemp . setAttribute ( "type" , "string" ) ; nTemp = createTextElementWithParentNS ( "parameter" , cFSLogFolder . getValue ( ) , nParameters ) ; nTemp . setAttribute ( "name" , "logfolder" ) ; nTemp . setAttribute ( "type" , "string" ) ; nTemp = createTextElementWithParentNS ( "parameter" , txtFSTriggerFolder . getValue ( ) , nParameters ) ; nTemp . setAttribute ( "name" , "triggerfolder" ) ; nTemp . setAttribute ( "type" , "string" ) ; } else if ( sValue == "com.cordys.coe.ac.emailio.storage.DefaultMemoryStore" ) { } else { var anNodes = mdlCustom . getData ( ) . selectNodes ( "//parameter" ) ; for ( var iCount = 0 ; iCount < anNodes . length ; iCount ++ ) { var sName = anNodes [ iCount ] . selectSingleNode ( "./name" ) . text ; var sType = anNodes [ iCount ] . selectSingleNode ( "./type" ) . text ; var sValue = anNodes [ iCount ] . selectSingleNode ( "./value" ) . text ; var nTemp = null ; if ( sType == "xml" ) { nTemp = createElementWithParentNS ( "parameter" , nParameters ) ; var xmlTemp = createSimpleXMLDocument ( sValue ) ; nTemp . appendChild ( xmlTemp . documentElement . cloneNode ( true ) ) ; } else { nTemp = createTextElementWithParentNS ( "parameter" , sValue , nParameters ) ; } nTemp . setAttribute ( "name" , sName ) ; nTemp . setAttribute ( "type" , sType ) ; } } }
This method will create the storage provider configuration based on the data filled in the UI.
This method will create the storage provider configuration based on the data filled in the UI .
//Now write the parameters. 
 //Encode the password
 //No parameters to write.
