Beispiel #1
0
void CaReplicationItemList::SetModifyEdit()
{
	CString Tempo,strValue,strErrorMsg;
	POSITION pos = GetHeadPosition();

	while (pos != NULL) {
		CaReplicationItem* obj = GetNext(pos);
		obj->SetValueModifyByUser(FALSE);
	}
}
Beispiel #2
0
BOOL CaReplicationItemList::SetAllFlagsToDefault()
{
	POSITION pos = GetHeadPosition();

	while (pos != NULL) {
		CaReplicationItem* obj = GetNext(pos);
		obj->SetToDefault();
		obj->SetValueModifyByUser(TRUE);
	}
	return TRUE;
}
Beispiel #3
0
BOOL CaReplicationItemList::GetModifyEdit()
{
	CString Tempo,strValue,strErrorMsg;
	POSITION pos = GetHeadPosition();

	while (pos != NULL) {
		CaReplicationItem* obj = GetNext(pos);
		if (obj->IsValueModifyByUser() == TRUE)
			return TRUE;
	}
	return FALSE;
}
Beispiel #4
0
int CaReplicationItemList::fillReplicServerParam( LPCTSTR RetrievedLine)
{
	CString Tempo;
	CString strErrorMsg;

	if (RetrievedLine[0] != _T('\0')) {
		Tempo = RetrievedLine;
		POSITION pos = GetPosOfFlag(Tempo);
		if (pos != NULL) {
			CaReplicationItem* obj = GetAt(pos);
			if (obj->GetType() != CaReplicationItem::REP_BOOLEAN)   {
				CString strValue = Tempo.Mid(4,Tempo.GetLength()-4);
				if (!strValue.IsEmpty())
					obj->SetFlagContent(strValue);
				else    {
					//"%s :No value for this Parameter / will be set to default value"
					strErrorMsg.Format(IDS_F_REP_FLAG_VALUE,(LPCTSTR)Tempo);
					AfxMessageBox(strErrorMsg, MB_ICONEXCLAMATION | MB_OK);
					strValue = obj->GetDefaultValue();
					obj->SetFlagContent(strValue);
				}
			}
			else {
				if ( !ManageBooleanValue(Tempo) ){
					//"%s : Unknown Parameter"
					strErrorMsg.Format(IDS_F_REP_FLAG_UNKNOWN,(LPCTSTR)Tempo);
					AfxMessageBox(strErrorMsg, MB_ICONEXCLAMATION | MB_OK);
				}
			}
		}
		else {
			// Flag not found
			if ( Tempo[0] == _T('*') ) {
				strErrorMsg = Tempo.Mid(1); // Error send by the remote command DDdispf
				if ( Tempo[1] == _T('*') ) {
					strErrorMsg = Tempo.Mid(2);
					CString strMsg; // T("All Parameters will be set to default values.\n")
					strMsg.LoadString (IDS_MSG_ALLPARAMS_SET_2_DEFAULT);
					strErrorMsg += strMsg;
					SetAllFlagsToDefault();
				}
			}
			else
				//"%s : Unknown Parameter"
				strErrorMsg.Format(IDS_F_REP_FLAG_UNKNOWN,(LPCTSTR)Tempo);
			AfxMessageBox(strErrorMsg, MB_ICONEXCLAMATION | MB_OK);
		}
	}
	return TRUE;
}
Beispiel #5
0
void CuDlgReplicationServerPageStartupSetting::OnButtonRestore()
{
	UINT nState = 0;
	CString strMessage;
	int answ, nCount = m_cListCtrl.GetItemCount(),iIndex = -1;

	m_cListCtrl.HideProperty(TRUE);
	iIndex = m_cListCtrl.GetNextItem (-1, LVNI_SELECTED);

	if (iIndex == -1)
		return;
	CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(iIndex);
	if (!pItem)
		return;
	//"Do you want to restore '%s' "
	//"to its default setting ?"
	strMessage.Format(IDS_F_RESTORE_DEFAULT,(LPCTSTR)pItem->GetDescription());
	answ = AfxMessageBox(strMessage , MB_ICONEXCLAMATION | MB_YESNO);
	if ( answ == IDYES ){
		BOOL bNotUsed;
		pItem->SetToDefault();
		pItem->SetValueModifyByUser(TRUE);
		if (pItem->GetType() == CaReplicationItem::REP_BOOLEAN)
		{
			CString strValue = pItem->GetFlagContent(bNotUsed);
			if (strValue.CompareNoCase (_T("TRUE")) == 0)
				m_cListCtrl.SetCheck (iIndex, 1, TRUE);
			else
				m_cListCtrl.SetCheck (iIndex, 1, FALSE);
		}
		else
			m_cListCtrl.SetItemText (iIndex, 1, pItem->GetFlagContent(bNotUsed));
	}
	EnableButtons();
}
Beispiel #6
0
POSITION CaReplicationItemList::GetPosOfFlag(CString strFlag)
{
	POSITION pos = GetHeadPosition();
	while (pos != NULL) {
		CaReplicationItem* obj = GetAt (pos);
		if ( obj->GetFlagName().Compare(strFlag.Left(4)) == 0 )
			return pos;
		else {
			int ret,ret1;
			ret = obj->GetFlagName().Find(_T("-QCD"));
			ret1 = obj->GetFlagName().Find(_T("-QDB"));
			if ( ret != -1 || ret1 != -1 )  {
				if ( obj->GetFlagName().Compare(strFlag) == 0 )
					return pos;
			}
		}
		GetNext(pos);
	}
	return NULL;
}
Beispiel #7
0
void CuDlgReplicationServerPageStartupSetting::OnButtonRestoreAll()
{
	CString strMessage;
	int i,answ, nCount = m_cListCtrl.GetItemCount();
	if (nCount == 0)
		return;
	m_cListCtrl.HideProperty(TRUE);
	answ = AfxMessageBox(IDS_A_RESTORE_ALL , MB_ICONEXCLAMATION | MB_YESNO );
	if ( answ == IDYES ) {
		for (i=0; i<nCount; i++)
		{
			CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(i);
			if ( pItem != NULL)
			{
				BOOL bNotUsed;
				pItem->SetToDefault();
				pItem->SetValueModifyByUser(TRUE);
				if (pItem->GetType() == CaReplicationItem::REP_BOOLEAN)
				{
					CString strValue = pItem->GetFlagContent(bNotUsed);
					if (strValue.CompareNoCase (_T("TRUE")) == 0)
						m_cListCtrl.SetCheck (i, 1, TRUE);
					else
						m_cListCtrl.SetCheck (i, 1, FALSE);
				}
				else
					m_cListCtrl.SetItemText (i, 1, pItem->GetFlagContent(bNotUsed));
			}
		}
	}
	EnableButtons();
}
Beispiel #8
0
void CuDlgReplicationServerPageStartupSetting::OnButtonEditValue()
{
	CRect r, rCell;
	int iNameCol = 1;
	int iIndex = m_cListCtrl.GetNextItem (-1, LVNI_SELECTED);

	if (iIndex == -1)
		return;
	CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(iIndex);
	if (!pItem)
		return;
	if (pItem->GetType() == CaReplicationItem::REP_BOOLEAN)
		return;
	m_cListCtrl.GetItemRect (iIndex, r, LVIR_BOUNDS);
	BOOL bOk = m_cListCtrl.GetCellRect (r, iNameCol, rCell);
	if (bOk)
	{
		rCell.top    -= 2;
		rCell.bottom += 2;
		m_cListCtrl.EditValue (iIndex, iNameCol, rCell);
	}
}
Beispiel #9
0
LONG CuDlgReplicationServerPageStartupSetting::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	ASSERT (lstrcmp (pClass, _T("CaReplicationServerDataPageStartupSetting")) == 0);
	CaReplicationServerDataPageStartupSetting* pData = (CaReplicationServerDataPageStartupSetting*)lParam;
	ASSERT (pData);
	if (!pData)
		return 0L;
	CaReplicationItemList* listItems = &(pData->m_listItems);

	try
	{
		// For each column:
		const int LAYOUT_NUMBER = 3;
		for (int i=0; i<LAYOUT_NUMBER; i++)
			m_cListCtrl.SetColumnWidth(i, pData->m_cxHeader.GetAt(i));

		CaReplicationItem* pItem = NULL;
		while (!listItems->IsEmpty())
		{
			pItem = listItems->RemoveHead();
			if (pItem->IsDisplay())
				AddItem (pItem);
			else
				delete pItem;
		}
		m_cListCtrl.SetScrollPos (SB_HORZ, pData->m_scrollPos.cx);
		m_cListCtrl.SetScrollPos (SB_VERT, pData->m_scrollPos.cy);
	}
	catch (CMemoryException* e)
	{
		theApp.OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Beispiel #10
0
void CuDlgReplicationServerPageStartupSetting::EnableButtons()
{
	BOOL bEnableSaveButton      = FALSE;
	BOOL bEnableEditButton      = FALSE;
	BOOL bEnableRestorButton    = FALSE;
	BOOL bEnableRestoreAllButton= FALSE;

	if (m_cListCtrl.GetItemCount() > 0)
	{
		bEnableRestoreAllButton = TRUE;
		int nCount = m_cListCtrl.GetItemCount();
		for (int i=0; i<nCount; i++)
		{
			CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(i);
			if (pItem->IsValueModifyByUser())
			{
				bEnableSaveButton = TRUE;
				break;
			}
		}
		int nSelected = m_cListCtrl.GetNextItem (-1, LVNI_SELECTED);
		if (nSelected != -1)
		{
			CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(nSelected);
			if (!pItem->IsReadOnlyFlag())
			{
				bEnableRestorButton = TRUE;
				bEnableEditButton   = TRUE;
			}
		}
	}
	GetDlgItem(IDC_BUTTON1)->EnableWindow (bEnableSaveButton);
	GetDlgItem(IDC_BUTTON2)->EnableWindow (bEnableEditButton);
	GetDlgItem(IDC_BUTTON3)->EnableWindow (bEnableRestorButton);
	GetDlgItem(IDC_BUTTON4)->EnableWindow (bEnableRestoreAllButton);
}
Beispiel #11
0
int SetReplicServerParams (CdIpmDoc* pIpmDoc, LPREPLICSERVERDATAMIN lpReplicServerDta , CaReplicationItemList *pList )
{
	TCHAR  tchszCommandLine[200];
	TCHAR* tchszCurLine;
	CString LocalDBNameOnServerNode;
	int ires;
	CString InputString=_T("");

	CString strVName = lpReplicServerDta->RunNode;
	// Verify if vnode name exist before start the remote command.
	VerifyAndUpdateVnodeName (&strVName);
	if (strVName.IsEmpty())
		return RES_ERR;

	GenerateVnodeName_DbName (lpReplicServerDta ,&LocalDBNameOnServerNode);
	_stprintf(tchszCommandLine, _T("ddstoref %s %d"), (LPTSTR)(LPCTSTR) LocalDBNameOnServerNode, lpReplicServerDta->serverno);

	// generate input to be sent to rmcmd
	CString strFormatFlag;
	CString strContent;
	BOOL bDefaultValue;
	POSITION pos;

	pos = pList->GetHeadPosition();
	while (pos != NULL) {
		CaReplicationItem* obj = pList->GetNext(pos);
		strFormatFlag.Empty();
		strContent = obj->GetFlagContent(bDefaultValue);
		if ( obj->IsMandatory() || obj->IsDefaultMandatoryInFile() ) {
			if (obj->GetType() != CaReplicationItem::REP_BOOLEAN)
				if (!strContent.IsEmpty())
					strFormatFlag = obj->GetFlagName() + strContent;
				else {
					CString csError;
					csError.Format(IDS_F_NO_VALUE,(LPCTSTR)obj->GetFlagName());//"Flag %s has no value and is not used."
					AfxMessageBox(csError, MB_ICONEXCLAMATION | MB_OK | MB_TASKMODAL);
				}
			else {
				if ( strContent.Compare(_T("TRUE")) == 0)
					strFormatFlag = obj->GetFlagName();
			}
		}
		else {
			if ( bDefaultValue == FALSE) {
				if (obj->GetType() != CaReplicationItem::REP_BOOLEAN) {
					if ( !strContent.IsEmpty() )
						strFormatFlag = obj->GetFlagName() + strContent;
				}
				else {
					if ( strContent.Compare(_T("TRUE")) == 0)
						strFormatFlag = obj->GetFlagName();
					if (strFormatFlag.Compare(_T("-TPC")) == 0)
						strFormatFlag += _T("0"); // Two phase commit is turned off.
				}
			}
		}
		if (!strFormatFlag.IsEmpty())
			InputString += (strFormatFlag + _T("\n"));
		}
	/* empty line in order to stop the ddstoref command*/
	InputString += _T("\n");

	ires=RES_SUCCESS;
	if (!LIBMON_ExecRmcmdInBackground((TCHAR *)lpReplicServerDta->RunNode, tchszCommandLine, (LPTSTR)(LPCTSTR)InputString)) {
		ires=RES_ERR;
	}
	// display error message lines (starting with a '*' character) from output
	for (tchszCurLine=LIBMON_GetFirstTraceLine();tchszCurLine;tchszCurLine = LIBMON_GetNextSignificantTraceLine()) {
		if (tchszCurLine[0]==_T('*')) {
			tchszCurLine++;
			AfxMessageBox(tchszCurLine, MB_ICONEXCLAMATION | MB_OK | MB_TASKMODAL);
				ires=RES_ERR;
		}
	}
	return ires;
}
Beispiel #12
0
LONG CuDlgReplicationServerPageStartupSetting::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	int iret,ires,irestype, nNodeHdl = -1;
	UCHAR DBAUsernameOntarget[MAXOBJECTNAME];
	UCHAR buf[EXTRADATASIZE];
	UCHAR extradata[EXTRADATASIZE];
	LPUCHAR parentstrings [MAXPLEVEL];
	CString cDefNumSvr,cDefDbName,cLocal;
	CString strMsg,strMsg1;

	LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
	m_pSvrDta = (LPREPLICSERVERDATAMIN)pUps->pStruct;
	EnableButtons();
	//
	// Specialize the OnUpdateData:
	if (!m_pSvrDta->m_bRefresh)
		return 0L;
	m_pSvrDta->m_bRefresh = FALSE;

	CdIpmDoc* pIpmDoc = NULL;
	CfIpmFrame* pIpmFrame = (CfIpmFrame*)GetParentFrame();
	ASSERT(pIpmFrame);
	if (pIpmFrame)
	{
		pIpmDoc = pIpmFrame->GetIpmDoc();
		ASSERT (pIpmDoc);
	}
	if (!pIpmDoc)
		return 0L;

	nNodeHdl  = LIBMON_OpenNodeStruct (m_pSvrDta->LocalDBNode);
	if (nNodeHdl == -1) {
		strMsg.LoadString(IDS_MAX_NB_CONNECT);  // _T("Maximum number of connections has been reached"
		strMsg1.LoadString (IDS_E_READ_FILE);   //    " - Cannot read file."
		strMsg += _T("\n") + strMsg1;
		MessageBox(strMsg ,NULL, MB_ICONHAND | MB_OK | MB_TASKMODAL);
		return 0L;
	}

	// Temporary for activate a session
	ires = DOMGetFirstObject (nNodeHdl, OT_DATABASE, 0, NULL, FALSE, NULL, buf, NULL, NULL);
	cDefDbName.Format(_T("%s::%s"), m_pSvrDta->LocalDBNode,m_pSvrDta->LocalDBName);
	//
	//Get DBA user name for this database
	parentstrings[0]=m_pSvrDta->LocalDBName;
	parentstrings[1]=NULL;
	memset (DBAUsernameOntarget,'\0',sizeof(DBAUsernameOntarget));
	iret = DOMGetObjectLimitedInfo( nNodeHdl,
	                                parentstrings [0],
	                                (UCHAR *)"",
	                                OT_DATABASE,
	                                0,
	                                parentstrings,
	                                TRUE,
	                                &irestype,
	                                buf,
	                                DBAUsernameOntarget,
	                                extradata
	                              );
	if (iret != RES_SUCCESS) {
		LIBMON_CloseNodeStruct(nNodeHdl);
		//wsprintf((char *)buf,"DBA owner on database : %s not found. Read file aborted.",parentstrings[0]);
		strMsg.Format(IDS_F_DB_OWNER,parentstrings[0]);
		MessageBox(strMsg, NULL, MB_ICONEXCLAMATION | MB_OK | MB_TASKMODAL);
		return 0L;
	}
	LIBMON_CloseNodeStruct(nNodeHdl);
	m_csDBAOwner=DBAUsernameOntarget;
	cDefNumSvr.Format(_T("%d"),m_pSvrDta->serverno);
	
	if (m_csDBAOwner.IsEmpty() ||cDefNumSvr.IsEmpty()||cDefDbName.IsEmpty())   {
		return 0L;
	}

	Cleanup();
	m_cListCtrl.DeleteAllItems();

	CString csVnodeAndUsers;
	// Read default flags on "LocalDBNode (user:XXX)"
	csVnodeAndUsers.Format(_T("%s%s%s%s"),  m_pSvrDta->LocalDBNode,
	                                    LPUSERPREFIXINNODENAME,
	                                    (LPCTSTR)m_csDBAOwner,
										LPUSERSUFFIXINNODENAME);
	nNodeHdl  = LIBMON_OpenNodeStruct ((LPUCHAR)(LPCTSTR)csVnodeAndUsers);
	if (nNodeHdl == -1) {
		strMsg.LoadString (IDS_MAX_NB_CONNECT);  // _T("Maximum number of connections has been reached"
		strMsg1.LoadString (IDS_E_READ_FILE);    //    " - Cannot read file."
		strMsg +=  _T("\n") + strMsg1;
		MessageBox(strMsg ,NULL, MB_ICONHAND | MB_OK | MB_TASKMODAL);
		return 0L;
	}
	memset (DBAUsernameOntarget,'\0',sizeof(DBAUsernameOntarget));
	iret = DOMGetObjectLimitedInfo( nNodeHdl,
	                                parentstrings [0],
	                                (UCHAR *)"",
	                                OT_DATABASE,
	                                0,
	                                parentstrings,
	                                TRUE,
	                                &irestype,
	                                buf,
	                                DBAUsernameOntarget,
	                                extradata
	                              );
	if (iret != RES_SUCCESS) {
		LIBMON_CloseNodeStruct(nNodeHdl);
		//wsprintf((char *)buf,"DBA owner on database : %s not found. Read file aborted.",parentstrings[0]);
		strMsg.Format(IDS_F_DB_OWNER,parentstrings[0]);
		MessageBox(strMsg, NULL, MB_ICONEXCLAMATION | MB_OK | MB_TASKMODAL);
		return 0L;
	}
	m_FlagsList.DefineAllFlagsWithDefaultValues(nNodeHdl , cDefNumSvr, cDefDbName, m_csDBAOwner);
	LIBMON_CloseNodeStruct(nNodeHdl);

	// Read Runrepl.opt from "LocalDBNode (user:XXX)" or From "RunNode"
	if (lstrcmp((char *)m_pSvrDta->LocalDBNode,(char *)m_pSvrDta->RunNode) == 0)
		csVnodeAndUsers.Format(_T("%s%s%s%s"), m_pSvrDta->LocalDBNode,
		                                   LPUSERPREFIXINNODENAME,
		                                   (LPCTSTR)m_csDBAOwner,
										   LPUSERSUFFIXINNODENAME);
	else
		csVnodeAndUsers = m_pSvrDta->RunNode;
	nNodeHdl  = LIBMON_OpenNodeStruct ((LPUCHAR)(LPCTSTR)csVnodeAndUsers);
	if (nNodeHdl == -1) {
		strMsg.LoadString(IDS_MAX_NB_CONNECT);  // _T("Maximum number of connections has been reached"
		strMsg1.LoadString (IDS_E_READ_FILE);   //    " - Cannot read file."
		strMsg += _T("\n") + strMsg1;
		MessageBox(strMsg ,NULL, MB_ICONHAND | MB_OK | MB_TASKMODAL);
		return 0L;
	}

	CWaitCursor hourglass;
	// Read file Runrepl.opt and fill m_FlagsList.
	iret = GetReplicServerParams   ( pIpmDoc, m_pSvrDta, &m_FlagsList );
	
	LIBMON_CloseNodeStruct (nNodeHdl);
	CaReplicationItem* pItem = NULL;
	while (!m_FlagsList.IsEmpty())
	{
		pItem = m_FlagsList.RemoveHead();
		if (pItem->IsDisplay())
			AddItem (pItem);
		else
			delete pItem;
	}

	EnableButtons();
	return 0L;
}
Beispiel #13
0
void CaReplicationItemList::DefineAllFlagsWithDefaultValues(int hdl,CString ServerNo, CString dbName, CString dbOwner)
{
	CString csTempo, csNumber, csDescription, csFlagName;

	//  -SVR  |Server Number
	CString strText1, strText2;
	strText1.LoadString(IDS_I_SVR_FLAG_SVR_NUM);
	strText2.LoadString(IDS_I_SVR_FLAG_INTEGER);
	CaReplicationItem* pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_SVR_NUM),
		_T(""), 
		RCGetString(IDS_I_SVR_FLAG_INTEGER),
		_T("-SVR"),
		CaReplicationItem::REP_NUMBER,
		ServerNo);
	pItem->SetMinMax (1 ,999);
	pItem->SetMandatory ();
	pItem->SetDefaultMandatoryInFile();
	pItem->SetReadOnlyFlag ();
	AddTail (pItem);

	//  -IDB  |Local DB Name
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_LOC_DB),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_STRING),
		_T("-IDB"),
		CaReplicationItem::REP_STRING, 
		dbName);

	pItem->SetMandatory ();
	pItem->SetDefaultMandatoryInFile();
	pItem->SetReadOnlyFlag ();
	AddTail ( pItem );

	//  -OWN  |Local Database Owner
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_LOC_DBOWNER),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_STRING),
		_T("-OWN"),
		CaReplicationItem::REP_STRING, 
		dbOwner);
	pItem->SetDefaultMandatoryInFile();
	pItem->SetReadOnlyFlag ();
	AddTail ( pItem );

	//  -NMO  |No Monitor Events   
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_SEND_NOTI),
		_T("FALSE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-NMO"),
		CaReplicationItem::REP_BOOLEAN,
		_T("FALSE"));
	pItem->SetDisplay( TRUE );
	//pItem->SetDefaultMandatoryInFile();
	AddTail ( pItem );

	//  -MON  |Send Monitor Events
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_SEND_MON),
		_T("TRUE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-MON"),
		CaReplicationItem::REP_BOOLEAN,
		_T("TRUE")); 
	pItem->SetDisplay( FALSE );
	//pItem->SetDefaultMandatoryInFile(); // 5/01/98 already default for the Repserver
	AddTail ( pItem );

	//  -PTL  |
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_PRINT_LEV),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_INTEGER),
		_T("-PTL"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (0 ,3);
	//pItem->SetDefaultMandatoryInFile();// 5/01/98 already default for the Repserver
	AddTail ( pItem );

	//  -LGL  |Log Level
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_LOG_LEVEL),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_INTEGER),
		_T("-LGL"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (0 ,3);
	//pItem->SetDefaultMandatoryInFile();// 5/01/98 already default for the Repserver
	AddTail ( pItem );

	//  -TOT  |Time Out
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_TIME_OUT),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_SECONDS),
		_T("-TOT"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (1  ,999);
	//pItem->SetDefaultMandatoryInFile();// 5/01/98 already default for the Repserver
	AddTail ( pItem );

	//  -CTO  |Connection Timeout  
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_CONN_TIMEOUT),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_SECONDS),
		_T("-CTO"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (0  ,-1);
	//pItem->SetDisplay( FALSE );
	AddTail ( pItem );

	//  -EMX  |Maximum Error       
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_MAX_ERR),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_INTEGER),
		_T("-EMX"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (0  ,-1);
	AddTail ( pItem );

	//  -EVT  |Event Time Out
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_EVT_TIME),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_SECONDS),
		_T("-EVT"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (1  ,9999);
	AddTail ( pItem );

	//  -MLE  |Error Mail
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_ERR_MAIL),
		_T("TRUE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-MLE"),
		CaReplicationItem::REP_BOOLEAN,
		_T(""));
	pItem->SetDisplay( FALSE );
	AddTail ( pItem );

	//  -NML  |No Error Mail
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_NO_ERR_MAIL),
		_T("FALSE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-NML"),
		CaReplicationItem::REP_BOOLEAN,
		_T("FALSE"));
	AddTail ( pItem );

	//  -NSR  |Don't Skip Rule Chk 
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_NO_SKIP_RULE),
		_T("TRUE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-NSR"),
		CaReplicationItem::REP_BOOLEAN,
		_T("TRUE"));
	pItem->SetDisplay( FALSE );
	AddTail ( pItem );

	//  -SCR  |Skip Rule Check     
	pItem =   new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_SKIP_RULE),
		_T("FALSE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-SCR"),
		CaReplicationItem::REP_BOOLEAN,
		_T("FALSE"));
	AddTail ( pItem );

	//  -ORT  |Open Retry          
	pItem =   new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_OPEN_RETRY),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_REPL_CYCLES),
		_T("-ORT"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	AddTail ( pItem );

	//  -QBM  |Absolute Memory     
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_ABS_MEM),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_NB_RECORDS),
		_T("-QBM"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (1  ,999999);
	AddTail ( pItem );

	//  -QBT  |Queue Break Transact
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_QUEUE_BREAK),
		_T(""),
		RCGetString(IDS_I_SVR_FLAG_NB_RECORDS),
		_T("-QBT"),
		CaReplicationItem::REP_NUMBER,
		_T(""));
	pItem->SetMinMax (1  ,999999);
	AddTail ( pItem );

	//  -NQTQITSGL this flag manage -QIT(0) -SGL(1) -NQT(2)
	//pItem = new  CaReplicationItem(VDBA_MfcResourceString(IDS_I_SVR_FLAG_QUIET_ONE),"",VDBA_MfcResourceString(IDS_I_SVR_FLAG_QUIET_TWO),"-NQTQITSGL",CaReplicationItem::REP_NUMBER,"");
	//pItem->SetDisplay( FALSE );
	//pItem->SetMinMax (0  ,2);
	//AddTail ( pItem );

	//  -NQT  |Unquiet Server
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_UNQUIET_SVR),
		_T("FALSE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-NQT"),
		CaReplicationItem::REP_BOOLEAN,
		_T(""));
	pItem->SetDisplay( FALSE );
	AddTail ( pItem );

	//  -QIT  |Quiet Server        
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_QUIET_SVR),
		_T("FALSE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-QIT"),
		CaReplicationItem::REP_BOOLEAN,
		_T("FALSE"));
	//pItem->SetDisplay( FALSE );
	AddTail ( pItem );

	//  -SGL  |Single Pass         
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_SINGLE_PASS),
		_T("FALSE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-SGL"),
		CaReplicationItem::REP_BOOLEAN,
		_T("FALSE"));
	//pItem->SetDisplay( FALSE );
	AddTail ( pItem );

	//  -TPC  |Two-Phase Commit    
	pItem = new  CaReplicationItem(
		RCGetString(IDS_I_SVR_FLAG_TWO_PHASE),
		_T("FALSE"),
		RCGetString(IDS_I_SVR_FLAG_BOOLEAN),
		_T("-TPC"),
		CaReplicationItem::REP_BOOLEAN,
		_T("FALSE"));
	AddTail ( pItem );
}
Beispiel #14
0
void CaReplicationItemList::VerifyValueForFlag()
{
	POSITION pos = GetHeadPosition();
	BOOL bDefault;
	int answ;
	CString Tempo,strValue,strErrorMsg,strDefault;
	while (pos != NULL) {

		CaReplicationItem* obj = GetNext(pos);
		Tempo = obj->GetFlagContent( bDefault );
		strDefault = obj->GetDefaultValue();
		if (Tempo.IsEmpty() == TRUE && ( obj->IsMandatory () || obj->IsDefaultMandatoryInFile())) {
			//"%s (mandatory) parameter not found in runrepl.opt. Will be set to Default."
			strErrorMsg.Format(IDS_F_REP_FLAG_DEFAULT,(LPCTSTR)obj->GetFlagName());
			AfxMessageBox(strErrorMsg, MB_ICONEXCLAMATION | MB_OK | MB_TASKMODAL);
			strValue = obj->GetDefaultValue();
			obj->SetFlagContent(strValue);
			obj->SetValueModifyByUser(TRUE);
		}
		if ( obj->IsReadOnlyFlag() && Tempo.Compare(strDefault) !=0 && ( obj->IsMandatory () || obj->IsDefaultMandatoryInFile()))    {
			//"Inconsistent value for %s parameter.\n"
			//"Value in runrepl.opt file  : %s\n"
			//"Required Value : %s\n"
			//"Apply required value?"
			strErrorMsg.Format(
				IDS_F_REP_FLAG_INCONSISTENT, 
				(LPCTSTR)obj->GetDescription(),
				(LPCTSTR)Tempo,
				(LPCTSTR)strDefault);
			answ = AfxMessageBox(strErrorMsg, MB_ICONEXCLAMATION | MB_YESNO | MB_TASKMODAL);
			if ( answ == IDYES ){
				strValue = obj->GetDefaultValue();
				obj->SetFlagContent(strValue);
				obj->SetValueModifyByUser(TRUE);
			}
			else {
				// remove all flags in the list, no modication available.
				MyRemoveAll();
				return;
			}
		}
	}
}