src/web/js/mgtArchiveOptions.js
/**
 * This method will create the archiver 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 archiver 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 archiver configuration based on the data filled in the UI . @param nParent The parent node to append the XML structure to . @return Nothing .
function createArchiverConfiguration(nParent)
{
	var nData = mdlDatabase.getData();
	var nArchiver = nParent.selectSingleNode("ns:archiver");
	if (nArchiver == null)
	{
		nArchiver = createElementNS("archiver", NS_DYNAMIC, nParent);
	}
	else
	{
		while (nArchiver.firstChild != null)
		{
			nArchiver.removeChild(nArchiver.firstChild);
		}
	}
	var sValue = txtArchivingOption.getValue();
	if (sValue == "")
	{
		createTextElementWithParentNS("class", txtSPCustomClass.getValue(), nArchiver);
	}
	else 
	{
		createTextElementWithParentNS("class", sValue, nArchiver);
	}
	var nParameters = createElementWithParentNS("parameters", nArchiver);
	if (sValue == "com.cordys.coe.ac.emailio.archive.DatabaseArchiver")
	{
		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");
		var nDBConfig = mdlDatabase.getData().selectSingleNode("//component").cloneNode(true);
		var anNodes = nDBConfig.selectNodes("password");
	   	for (var iCount = 0; iCount < anNodes.length; iCount++)
	   	{
	   		anNodes[iCount].text = libPassword.encode(anNodes[iCount].text);
	   	}
		nTemp.appendChild(nDBConfig);
	}
	else if (sValue == "com.cordys.coe.ac.emailio.archive.FileArchiver")
	{
		var nTemp = createTextElementWithParentNS("parameter", txtZipMethod.getValue(), nParameters);
		nTemp.setAttribute("name", "ziplevel");
		nTemp.setAttribute("type", "string");
		nTemp = createTextElementWithParentNS("parameter", txtFBLocation.getValue(), nParameters);
		nTemp.setAttribute("name", "location");
		nTemp.setAttribute("type", "string");
	}
	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 createArchiverConfiguration ( nParent ) { var nData = mdlDatabase . getData ( ) ; var nArchiver = nParent . selectSingleNode ( "ns:archiver" ) ; if ( nArchiver == null ) { nArchiver = createElementNS ( "archiver" , NS_DYNAMIC , nParent ) ; } else { while ( nArchiver . firstChild != null ) { nArchiver . removeChild ( nArchiver . firstChild ) ; } } var sValue = txtArchivingOption . getValue ( ) ; if ( sValue == "" ) { createTextElementWithParentNS ( "class" , txtSPCustomClass . getValue ( ) , nArchiver ) ; } else { createTextElementWithParentNS ( "class" , sValue , nArchiver ) ; } var nParameters = createElementWithParentNS ( "parameters" , nArchiver ) ; if ( sValue == "com.cordys.coe.ac.emailio.archive.DatabaseArchiver" ) { 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" ) ; var nDBConfig = mdlDatabase . getData ( ) . selectSingleNode ( "//component" ) . cloneNode ( true ) ; var anNodes = nDBConfig . selectNodes ( "password" ) ; for ( var iCount = 0 ; iCount < anNodes . length ; iCount ++ ) { anNodes [ iCount ] . text = libPassword . encode ( anNodes [ iCount ] . text ) ; } nTemp . appendChild ( nDBConfig ) ; } else if ( sValue == "com.cordys.coe.ac.emailio.archive.FileArchiver" ) { var nTemp = createTextElementWithParentNS ( "parameter" , txtZipMethod . getValue ( ) , nParameters ) ; nTemp . setAttribute ( "name" , "ziplevel" ) ; nTemp . setAttribute ( "type" , "string" ) ; nTemp = createTextElementWithParentNS ( "parameter" , txtFBLocation . getValue ( ) , nParameters ) ; nTemp . setAttribute ( "name" , "location" ) ; nTemp . setAttribute ( "type" , "string" ) ; } 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 archiver configuration based on the data filled in the UI.
This method will create the archiver configuration based on the data filled in the UI .
//Remove old data if needed or create a new tag
 //Now write the parameters. 
 //Encode the password
