void   ImageResizeCB (Widget w, XtPointer clientData, XtPointer callData)
/* resize image canvas */
{
    ImageDisplay  *IDdata = (ImageDisplay *)clientData;

    if (!IDdata) return;
    if (!IDdata->canvas) return;

/*fprintf(stderr,"ImageResizeCB: window resized\n "); debug */

/* reset display */
     ResetDisplay(IDdata);
/* redraw exposed area from ImageData */
/*    PaintImage (IDdata); */
  } /* end of ImageResizeCB */
Example #2
0
LONG CuDlgIpmDetailLockList::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	BOOL bOK = FALSE;
	LPIPMUPDATEPARAMS  pUps = (LPIPMUPDATEPARAMS)lParam;
	ASSERT (pUps);
	switch (pUps->nIpmHint)
	{
	case 0:
	case FILTER_IPM_EXPRESS_REFRESH:
		break;
	default:
		return 0L;
	}

	try
	{
		CdIpmDoc* pDoc = (CdIpmDoc*)wParam;
		ResetDisplay();
		if (pUps->nIpmHint != FILTER_IPM_EXPRESS_REFRESH)
		{
			memset (&m_llStruct, 0, sizeof (m_llStruct));
			m_llStruct.locklistdatamin = *(LPLOCKLISTDATAMIN)pUps->pStruct;
		}
		CaIpmQueryInfo queryInfo(pDoc, OT_MON_LOCKLIST);
		bOK = IPM_QueryDetailInfo (&queryInfo, (LPVOID)&m_llStruct);

		if (!bOK)
		{
			InitClassMembers (TRUE);
		}
		else
		{
			InitClassMembers ();
		}
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		theApp.OutOfMemoryMessage ();
		e->Delete();
	}
	catch (CeIpmException e)
	{
		InitClassMembers ();
		AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK);
	}
	return 0L;
}
Example #3
0
/* Can be called from any thread */
EGLBoolean AndroidEGL::SetCurrentContext(EGLContext InContext, EGLSurface InSurface)
{
	//context can be null.so can surface from PlatformNULLContextSetup
	EGLBoolean Result = EGL_FALSE;
	EGLContext CurrentContext = GetCurrentContext();

	// activate the context
	if( CurrentContext != InContext)
	{
		if (CurrentContext !=EGL_NO_CONTEXT )
		{
			glFlush();
		}
		if(InContext == EGL_NO_CONTEXT && InSurface == EGL_NO_SURFACE)
		{
			ResetDisplay();
		}
		else
		{
			//if we have a valid context, and no surface then create a tiny pbuffer and use that temporarily
			EGLSurface Surface = InSurface;
			if (!bSupportsKHRSurfacelessContext && InContext != EGL_NO_CONTEXT && InSurface == EGL_NO_SURFACE)
			{
				checkf(PImplData->auxSurface == EGL_NO_SURFACE, TEXT("ERROR: PImplData->auxSurface already in use. PBuffer surface leak!"));
				EGLint PBufferAttribs[] =
				{
					EGL_WIDTH, 1,
					EGL_HEIGHT, 1,
					EGL_TEXTURE_TARGET, EGL_NO_TEXTURE,
					EGL_TEXTURE_FORMAT, EGL_NO_TEXTURE,
					EGL_NONE
				};
				PImplData->auxSurface = eglCreatePbufferSurface(PImplData->eglDisplay, PImplData->eglConfigParam, PBufferAttribs);
				if (PImplData->auxSurface == EGL_NO_SURFACE)
				{
					checkf(PImplData->auxSurface != EGL_NO_SURFACE, TEXT("eglCreatePbufferSurface error : 0x%x"), eglGetError());
				}
				Surface = PImplData->auxSurface;
			}

			Result = eglMakeCurrent(PImplData->eglDisplay, Surface, Surface, InContext);
			checkf(Result == EGL_TRUE, TEXT("ERROR: SetCurrentSharedContext eglMakeCurrent failed : 0x%x"), eglGetError());
		}
	}
	return Result;
}
Example #4
0
LONG CuDlgIpmDetailLocation::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	int ires = RES_ERR, nNodeHandle = (int)wParam;
	LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;

	ASSERT (pUps);
	switch (pUps->nIpmHint)
	{
	case 0:
	case FILTER_IPM_EXPRESS_REFRESH:
		break;
	default:
		return 0L;
	}
	try
	{
		ResetDisplay();
		if (pUps->nIpmHint != FILTER_IPM_EXPRESS_REFRESH)
		{
			memset (&m_locStruct, 0, sizeof (m_locStruct));
			m_locStruct = *(LPLOCATIONDATAMIN)pUps->pStruct;
		}

		CuStatisticPieDoc* pDoc   =  (CuStatisticPieDoc*)m_pDlgFrame->GetDoc();
		CuPieInfoData* pPieInfo = pDoc->GetPieInfo();
		if (Pie_Create(pPieInfo, nNodeHandle, (LPLOCATIONDATAMIN)&m_locStruct, TRUE))
		{
			m_pDlgFrame->DrawLegend (&m_cListLegend, TRUE);
		}
		else
		{
			//CString strMsg = _T("Location Space Statistic error");
			BfxMessageBox (VDBA_MfcResourceString(IDS_E_LOCATION_SPACE), MB_ICONEXCLAMATION|MB_OK);
			pPieInfo->Cleanup();
			m_cListLegend.ResetContent();
		}
		pDoc->UpdateAllViews (NULL);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Example #5
0
LONG CuDlgDomPropIceSecRole::OnLoad (WPARAM wParam, LPARAM lParam)
{
  // Precheck consistency of class name
  LPCTSTR pClass = (LPCTSTR)wParam;
  ASSERT (lstrcmp (pClass, "CuDomPropDataIceSecRole") == 0);
  ResetDisplay();
  // Get class pointer, and check for it's class runtime type
  CuDomPropDataIceSecRole* pData = (CuDomPropDataIceSecRole*)lParam;
  ASSERT (pData->IsKindOf(RUNTIME_CLASS(CuDomPropDataIceSecRole)));

  // Update current m_Data using operator = overloading
  m_Data = *pData;

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #6
0
LONG CuDlgIpmIceDetailHttpServerConnection::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	SESSIONDATAMIN* pStruct = (SESSIONDATAMIN*)lParam;
	ASSERT (lstrcmp (pClass, _T("CaIpmPropertyDataIceDetailHttpServerConnection")) == 0);
	memcpy (&m_Struct, pStruct, sizeof (m_Struct));
	try
	{
		ResetDisplay();
		InitClassMembers ();
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		theApp.OutOfMemoryMessage ();
		e->Delete();
	}
	return 0L;
}
Example #7
0
LONG CuDlgIpmDetailLockList::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	LPLOCKLISTDATAMAX pLl = (LPLOCKLISTDATAMAX)lParam;
	ASSERT (lstrcmp (pClass, _T("CuIpmPropertyDataDetailLockList")) == 0);
	memcpy (&m_llStruct, pLl, sizeof (m_llStruct));
	try
	{
		ResetDisplay();
		InitClassMembers ();
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		theApp.OutOfMemoryMessage ();
		e->Delete();
	}
	return 0L;
}
Example #8
0
LONG CuDlgIpmPageClient::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	LPSESSIONDATAMAX pSess = (LPSESSIONDATAMAX)lParam;
	ASSERT (lstrcmp (pClass, "CuIpmPropertyDataPageClient") == 0);
	memcpy (&m_ssStruct, pSess, sizeof (m_ssStruct));
	try
	{
		ResetDisplay();
		InitClassMembers ();
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Example #9
0
LONG CuDlgIpmPageClient::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
	int res = RES_ERR;
	LPIPMUPDATEPARAMS  pUps = (LPIPMUPDATEPARAMS)lParam;
	ASSERT (pUps);
	switch (pUps->nIpmHint)
	{
	case 0:
	case FILTER_INTERNAL_SESSIONS:
	case FILTER_IPM_EXPRESS_REFRESH:
		break;
	default:
		return 0L;
	}
	//
	// Initialize the member variables: ...and call UpdateData();
	try
	{
		ResetDisplay();
		if (pUps->nIpmHint != FILTER_IPM_EXPRESS_REFRESH)
		{
			memset (&m_ssStruct, 0, sizeof (m_ssStruct));
			m_ssStruct.sessiondatamin = *(LPSESSIONDATAMIN)pUps->pStruct;
		}
		res = MonGetDetailInfo((int)wParam, &m_ssStruct, OT_MON_SESSION, 0);
		if (res != RES_SUCCESS)
		{
			InitClassMembers (TRUE);
		}
		else
		{
			InitClassMembers ();
		}
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Example #10
0
LONG CuDlgDomPropTblPages::OnLoad (WPARAM wParam, LPARAM lParam)
{
  // Precheck consistency of class name
  LPCTSTR pClass = (LPCTSTR)wParam;
  ASSERT (_tcscmp (pClass, _T("CuDomPropDataPages")) == 0);
  ResetDisplay();
  // Get class pointer, and check for it's class runtime type
  CuDomPropDataPages* pData = (CuDomPropDataPages*)lParam;
  ASSERT (pData->IsKindOf(RUNTIME_CLASS(CuDomPropDataPages)));

  // Update current m_Data using operator = overloading
  m_Data = *pData;

  // flag loaded object that it must delete the array itself
  pData->SetMustDeleteArray();

  // Refresh display
  RefreshDisplay();

  return 0L;

}
Example #11
0
LONG CuDlgIpmDetailLocation::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	CuPieInfoData* pData = (CuPieInfoData*)lParam;
	ASSERT (lstrcmp (pClass, "CuIpmPropertyDataDetailLocation") == 0);
	if (!pData)
		return 0L;
	try
	{
		ResetDisplay();
		CuStatisticPieDoc* pDoc =  (CuStatisticPieDoc*)m_pDlgFrame->GetDoc();
		pDoc->SetPieInfo (pData);
		pDoc->UpdateAllViews (NULL);
		m_pDlgFrame->DrawLegend (&m_cListLegend, TRUE);
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
Example #12
0
LONG CuDlgDomPropLocationSpace::OnLoad (WPARAM wParam, LPARAM lParam)
{
    LPCTSTR pClass = (LPCTSTR)wParam;
    CaPieInfoData* pData = (CaPieInfoData*)lParam;
    ASSERT (_tcscmp (pClass, _T("CuIpmPropertyDataPageLocation")) == 0);
    ResetDisplay();
    if (!pData)
        return 0L;
    try
    {
       if (!m_pDlgFrame)
           return 0;
        m_pDlgFrame->SetPieInformation(pData);
        m_pDlgFrame->UpdatePieChart();
        m_pDlgFrame->UpdateLegend();
    }
    catch (CMemoryException* e)
    {
        VDBA_OutOfMemoryMessage();
        e->Delete();
    }
    return 0L;
}
Example #13
0
LONG CuDlgDomPropView::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_clistCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the object
  VIEWPARAMS ViewParams;
  memset (&ViewParams, 0, sizeof (ViewParams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get Detail Info
  //
  x_strcpy ((char *)ViewParams.objectname, RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->objName)));
  x_strcpy ((char *)ViewParams.szSchema, (const char *)lpRecord->ownerName);
  x_strcpy ((char *)ViewParams.DBName, (const char *)lpRecord->extra);
  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_VIEW,
                               &ViewParams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataView tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  // update member variables, for display/load/save purpose
  m_Data.m_csText = ViewParams.lpViewText;

  // liberate detail structure
  FreeAttachedPointers (&ViewParams, OT_VIEW);

  //
  // Get list of view components
  //
  m_Data.m_acsViewComponents.RemoveAll();
  m_Data.m_acsSchema.RemoveAll();
  m_Data.m_awCompType.RemoveAll();

  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));

  // prepare parenthood with schema where relevant
  aparentsTemp[0] = lpRecord->extra;  // DBName

  UCHAR bufParent1[MAXOBJECTNAME];
  aparentsTemp[1] = bufParent1;
  x_strcpy((char *)buf, (const char *)lpRecord->objName);
  StringWithOwner(buf, lpRecord->ownerName, aparentsTemp[1]); // schema.name

  aparentsTemp[2] = NULL;

  iret =  DOMGetFirstObject(nNodeHandle,
                            OT_VIEWTABLE,
                            2,                           // level,
                            aparentsTemp,                // Temp mandatory!
                            pUps->pSFilter->bWithSystem, // bwithsystem
                            NULL,                        // owner
                            buf,
                            bufOwner,
                            bufComplim);
  if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
    // Erroneous case!
    CString csUnavail;
    csUnavail.LoadString(IDS_TM_ERR_ERR);// = "< Data Unavailable >";
    m_Data.m_acsViewComponents.Add(csUnavail);
    m_Data.m_acsSchema.Add(_T(""));
    m_Data.m_awCompType.Add(OT_VIEWTABLE);    // unresolved view component
  }
  else {
    while (iret == RES_SUCCESS) {
      m_Data.m_acsViewComponents.Add((LPCTSTR)buf);
      m_Data.m_acsSchema.Add((LPCTSTR)bufOwner);

      // Solve type on the fly
      int viewCompType;
      UCHAR resBuf[MAXOBJECTNAME];
      UCHAR resBuf2[MAXOBJECTNAME];
      UCHAR resBuf3[MAXOBJECTNAME];
      LPUCHAR aparentsSolve[MAXPLEVEL];
      aparentsSolve[0] = lpRecord->extra;  // DBName
      aparentsSolve[1] = aparentsSolve[2] = NULL;
      int res = DOMGetObjectLimitedInfo(nNodeHandle,
                                        buf,
                                        bufOwner,
                                        OT_VIEWTABLE,
                                        1,     // level
                                        aparentsSolve,  // parentstrings,
                                        TRUE,
                                        &viewCompType,
                                        resBuf,
                                        resBuf2,
                                        resBuf3);
      if (res != RES_SUCCESS)
        viewCompType = OT_VIEWTABLE;

      m_Data.m_awCompType.Add(viewCompType);    // OT_TABLE or OT_VIEW, or OT_VIEWTABLE if error

      iret = DOMGetNextObject(buf, bufOwner, bufComplim);
    }
  }
  if (m_Data.m_acsViewComponents.GetUpperBound() == -1) {
    CString csNoViewComp;
	csNoViewComp.LoadString(IDS_VIEW_COMPONENTS);// = "< No View Components>";
    m_Data.m_acsViewComponents.Add(csNoViewComp);
    m_Data.m_acsSchema.Add(_T(""));
    m_Data.m_awCompType.Add(OT_VIEWTABLE);    // unresolved view component
  }

  // Get comment
  TCHAR *lpObjComment = NULL;
  LPOBJECTLIST lpObjCol = NULL;

  iret = VDBAGetCommentInfo ( (LPTSTR)(LPUCHAR)GetVirtNodeName(nNodeHandle),
                       (LPTSTR)ViewParams.DBName, (LPTSTR)ViewParams.objectname,
                       (LPTSTR)ViewParams.szSchema, &lpObjComment, lpObjCol);

  if (iret!=RES_SUCCESS)
  {
    CString csMsg;
    csMsg.LoadString(IDS_NOT_AVAILABLE);
    m_ctrlEditComment.SetWindowText(csMsg);
    m_Data.m_csComment = csMsg;
  }
  else if (lpObjComment)
  {
      m_ctrlEditComment.SetWindowText(lpObjComment);
      m_Data.m_csComment = lpObjComment;
      ESL_FreeMem(lpObjComment);
  }
  else
  {
    m_ctrlEditComment.SetWindowText(_T(""));
    m_Data.m_csComment.Empty();
  }

  //
  // Refresh display
  //
  RefreshDisplay();

  return 0L;
}
Example #14
0
LONG CuDlgDomPropTblPages::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get pages of table, even if system object (lpRecord->ownerName is "$ingres" )
  //
  INGRESPAGEINFO pageinfo;
  memset(&pageinfo, 0, sizeof(INGRESPAGEINFO));
  BOOL bOK = GetIngresPageInfo(nNodeHandle, lpRecord->extra, lpRecord->objName, lpRecord->ownerName, &pageinfo);
  if (!bOK) {
    // Need to reset pageinfo since has been partially filled by GetIngresPageInfo
    memset(&pageinfo, 0, sizeof(INGRESPAGEINFO));
    // "Cannot Access Page Information"
    MessageWithHistoryButton(m_hWnd, VDBA_MfcResourceString (IDS_E_PAGE_INFORMATION));
  }

  ASSERT (m_pPieCtrl && m_pPieCtrlHashTable);
  if (m_pPieCtrl && m_pPieCtrlHashTable)
  {
     //
     // Hash Table or Non-Hash Table. This value should be changed
     // upon the table's structure:
   //  BOOL bHashTable = TRUE; 
     ShowPieChartCtrl ((LPVOID)&pageinfo, pageinfo.bNewHash);

  /*
    double dPercent = 0.0;
    CString strTitle;
    CaPieInfoData* pData = m_pPieCtrl->GetPieInformation();
    pData->Cleanup();
    pData->SetCapacity ((double)pageinfo.ltotal, _T(""));
    if (pageinfo.linuse > 0)
    {
        dPercent = ((double)pageinfo.linuse / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("In Use"), dPercent, RGB(0, 0, 192), (double)pageinfo.linuse);
    }
    else
        pData->AddLegend (_T("In Use"), RGB(0, 0, 192));

    if (pageinfo.lfreed > 0)
    {
        dPercent = ((double)pageinfo.lfreed / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("Freed"), dPercent, RGB(0, 192, .0), (double)pageinfo.lfreed);
    }
    else
        pData->AddLegend (_T("Freed"), RGB(0, 192, .0));

    if (pageinfo.lneverused > 0)
    {
        dPercent = ((double)pageinfo.lneverused / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("Never Used"), dPercent, RGB(255, 255, 0), (double)pageinfo.lneverused);
    }
    else
        pData->AddLegend (_T("Never Used"), RGB(255, 255, 0));

    if (pageinfo.loverflow > 0)
    {
        dPercent = ((double)pageinfo.loverflow / (double)pageinfo.ltotal) * 100.00;
        pData->AddPie2 (_T("Overflow"),  dPercent, RGB(255, 0, 0), (double)pageinfo.lneverused);
    }
    else
        pData->AddLegend (_T("Overflow"), RGB(255, 0, 0));

    strTitle.Format (_T("Total = %d"), pageinfo.ltotal);
    pData->SetTitle(strTitle);
    m_pPieCtrl->UpdateLegend();
    m_pPieCtrl->UpdatePieChart();
   */
  }
  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  CopyData (&m_Data, &pageinfo, TRUE); // pageinfo -> m_Data

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #15
0
LONG CuDlgDomPropTblInteg::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      case FILTER_DOM_SYSTEMOBJECTS:    // eligible
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH:
      // eligible if UpdateType is compatible with DomGetFirst/Next object type,
      // or is ot_virtnode, which means refresh for all whatever the type is
      if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
          pUps->pSFilter->UpdateType != OT_INTEGRITY)
        return 0L;
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get list of Tbl for the replication
  //
  m_Data.m_uaTblInteg.RemoveAll();

  int     iret;
  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  //
  // CHECK EXISTENCE SINCE REGISTERED TABLE MIGHT NOT REALLY EXIST YET
  //
  int   resultType;
  UCHAR resultObjectName[MAXOBJECTNAME];
  UCHAR resultOwnerName[MAXOBJECTNAME];
  UCHAR resultExtraData[MAXOBJECTNAME];
  char* parentStrings[3];
  parentStrings[0] = (char*)lpRecord->extra;  // DBName
  parentStrings[1] = parentStrings[2] = NULL;

  // preparation for get limited info - added static type - added all related granted types
  LPUCHAR lpName = NULL;
  LPUCHAR lpOwner = NULL;
  int basicType = GetBasicType(lpRecord->recType);
  m_Data.m_objType = basicType;
  switch (basicType) {
    case OT_TABLE:
    case OT_SCHEMAUSER_TABLE:
      lpName = (LPUCHAR)lpRecord->objName;
      lpOwner = (LPUCHAR)lpRecord->ownerName;
      break;
    case OT_STATIC_INTEGRITY:
      lpName = (LPUCHAR)lpRecord->extra2;
      lpOwner = (LPUCHAR)lpRecord->tableOwner;
      break;
    default:
      ASSERT(FALSE);
      return 0L;
  }

  iret = DOMGetObjectLimitedInfo(nNodeHandle,
                                 lpName,                           // object name,
                                 lpOwner,                          // object owner
                                 OT_TABLE,                         // iobjecttype
                                 1,                                // level
                                 (unsigned char **)parentStrings,  // parenthood
                                 TRUE,                             // bwithsystem
                                 &resultType,
                                 resultObjectName,
                                 resultOwnerName,
                                 resultExtraData
                                 );
  if (iret == RES_ENDOFDATA)
    iret = RES_ERR;           // Non-existent: ERROR !!!
  if (iret == RES_SUCCESS) {
    LPUCHAR aparentsTemp[MAXPLEVEL];

    // prepare parenthood with schema where relevant
    aparentsTemp[0] = lpRecord->extra;  // DBName

    UCHAR bufParent1[MAXOBJECTNAME];
    aparentsTemp[1] = bufParent1;
    x_strcpy((char *)buf, (const char *)resultObjectName);
    StringWithOwner(buf, resultOwnerName, aparentsTemp[1]); // schema.name

    aparentsTemp[2] = NULL;

    memset (&bufComplim, '\0', sizeof(bufComplim));
    memset (&bufOwner, '\0', sizeof(bufOwner));
    iret =  DOMGetFirstObject(nNodeHandle,
                              OT_INTEGRITY,
                              2,                            // level,
                              aparentsTemp,                 // Temp mandatory!
                              pUps->pSFilter->bWithSystem,  // bwithsystem
                              NULL,                         // lpowner
                              buf,
                              bufOwner,
                              bufComplim);
  }
  if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
    // Erroneous case!
    CuNameWithOwner errItem(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));//"<Data Unavailable>"
    m_Data.m_uaTblInteg.Add(errItem);
  }
  else {
    while (iret == RES_SUCCESS) {
      CuNameWithOwner item((const char*)buf, _T(""));   // no owner
      m_Data.m_uaTblInteg.Add(item);

      iret = DOMGetNextObject(buf, bufOwner, bufComplim);
    }
  }
  if (m_Data.m_uaTblInteg.GetCount() == 0) {
    CuNameWithOwner noItem(VDBA_MfcResourceString (IDS_E_NO_INTEGRITY));//"<No Integrity>"
    m_Data.m_uaTblInteg.Add(noItem);
  }

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #16
0
LONG CuDlgDomPropRoleXGrantedDb::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      case FILTER_DOM_SYSTEMOBJECTS:  // can be system objects (replicator dd_xyz)
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH:
      // eligible if UpdateType is compatible with DomGetFirst/Next object type,
      // or is ot_virtnode, which means refresh for all whatever the type is
      if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
          pUps->pSFilter->UpdateType != OT_DATABASE)
        return 0L;
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get list of granted objects
  //
  m_Data.m_uaRoleXGrantedDb.RemoveAll();

  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));

  // Xref return code
  LPUCHAR aparentsResult[MAXPLEVEL];
  UCHAR   bufParResult0[MAXOBJECTNAME];
  UCHAR   bufParResult1[MAXOBJECTNAME];
  UCHAR   bufParResult2[MAXOBJECTNAME];
  aparentsResult[0] = bufParResult0;
  aparentsResult[1] = bufParResult1;
  aparentsResult[2] = bufParResult2;

  // prepare parenthood with schema where relevant
  aparentsTemp[0] = lpRecord->objName;
  aparentsTemp[1] = aparentsTemp[2] = NULL;

  BOOL bError = FALSE;
  for (int index = 0; index < NBDBGRANTED; index++) {
    iret =  DOMGetFirstRelObject(nNodeHandle,
                                 aGrantedType[index],
                                 1,                           // level,
                                 aparentsTemp,                // Temp mandatory!
                                 pUps->pSFilter->bWithSystem, // bwithsystem
                                 NULL,                        // base owner
                                 NULL,                        // other owner
                                 aparentsResult,
                                 buf,
                                 bufOwner,
                                 bufComplim);
     if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
       bError = TRUE;
       continue;
    }
    else {
      while (iret == RES_SUCCESS) {
        CuGrantedDb grantedDb((const char *)buf,                // obj name
                              (const char *)_T(""),             // No obj owner
                              (const char *)_T(""),             // No obj parent
                              aGrantedType[index]               // grant type
                              );
        CuMultFlag *pRefGrantedDb = m_Data.m_uaRoleXGrantedDb.Find(&grantedDb);
        if (pRefGrantedDb)
          m_Data.m_uaRoleXGrantedDb.Merge(pRefGrantedDb, &grantedDb);
        else
          m_Data.m_uaRoleXGrantedDb.Add(grantedDb);

        iret = DOMGetNextRelObject(aparentsResult, buf, bufOwner, bufComplim);
      }
    }
  }

  // Manage error case
  if (bError)
  {
    /* "<Data Unavailable>" */
    CuGrantedDb grantedDb1(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));
    m_Data.m_uaRoleXGrantedDb.Add(grantedDb1);
  }

  // Manage no granted object
  if (m_Data.m_uaRoleXGrantedDb.GetCount() == 0)
  {
    CuGrantedDb grantedDb2(VDBA_MfcResourceString (IDS_E_NO_GRANTED_DB));
    m_Data.m_uaRoleXGrantedDb.Add(grantedDb2);
  }

  ASSERT (m_Data.m_uaRoleXGrantedDb.GetCount() > 0 );

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #17
0
LONG CuDlgDomPropIndexLinkSource::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
    //case FILTER_DOM_SYSTEMOBJECTS:
    //case FILTER_DOM_BASEOWNER:
    //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the object
  STARSOURCEINFO sSrcInfo;
  memset (&sSrcInfo, 0, sizeof (sSrcInfo));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();

  x_strcpy ((char *)sSrcInfo.DBName,     (const char *)lpRecord->extra);
  x_strcpy ((char *)sSrcInfo.objectname, (const char *)lpRecord->objName);
  x_strcpy ((char *)sSrcInfo.szSchema,   (const char *)lpRecord->ownerName);

  // Index registered as link
  sSrcInfo.bRegisteredAsLink  = TRUE;
  sSrcInfo.objType = 'I';

  int iResult = GetStarObjSourceInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle), &sSrcInfo);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataIndexLinkSource tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  // update member variables, for display/load/save purpose
  m_Data.m_csLdbObjName   = sSrcInfo.szLdbObjName  ;
  m_Data.m_csLdbObjOwner  = sSrcInfo.szLdbObjOwner ;
  m_Data.m_csLdbDatabase  = sSrcInfo.szLdbDatabase ;
  m_Data.m_csLdbNode      = sSrcInfo.szLdbNode     ;
  m_Data.m_csLdbDbmsType  = sSrcInfo.szLdbDbmsType ;

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #18
0
LONG CuDlgDomPropIntegrity::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the object
  INTEGRITYPARAMS IntegrityParams;
  memset (&IntegrityParams, 0, sizeof (IntegrityParams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get Detail Info
  //
  IntegrityParams.number = lpRecord->complimValue;
  x_strcpy ((char *)IntegrityParams.DBName, (const char *)lpRecord->extra);
  x_strcpy ((char *)IntegrityParams.TableName, RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->extra2)));
  x_strcpy ((char *)IntegrityParams.TableOwner, (const char *)lpRecord->tableOwner);
  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_INTEGRITY,
                               &IntegrityParams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataIntegrity tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  // update member variables, for display/load/save purpose
  m_Data.m_lNumber = IntegrityParams.number;
  m_Data.m_csText  = IntegrityParams.lpIntegrityText;

  // liberate detail structure
  FreeAttachedPointers (&IntegrityParams, OT_INTEGRITY);


  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #19
0
LONG CuDlgDomPropIceSecRole::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }


  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  // double check type
  int objType = lpRecord->recType;
  ASSERT (objType == OT_ICE_BUNIT_SEC_ROLE);

  // Get Info
  ICEBUSUNITROLEDATA  iceStruct;
  memset (&iceStruct, 0, sizeof(iceStruct));
  x_strcpy((LPSTR)iceStruct.icerole.RoleName, (LPCSTR)lpRecord->objName);
  x_strcpy((LPSTR)iceStruct.icebusunit.Name, (LPCSTR)lpRecord->extra);
  int iResult = GetICEInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                            objType,
                            &iceStruct);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataIceSecRole tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  //
  // update member variables, for display/load/save purpose
  //
  m_Data.m_bExecDoc   = iceStruct.bExecDoc;
  m_Data.m_bCreateDoc = iceStruct.bCreateDoc;
  m_Data.m_bReadDoc   = iceStruct.bReadDoc;

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #20
0
LONG CuDlgDomPropReplicConn::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH:
      // eligible if UpdateType is compatible with DomGetFirst/Next object type,
      // or is ot_virtnode, which means refresh for all whatever the type is
      if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
          pUps->pSFilter->UpdateType != OT_REPLIC_CONNECTION)
        return 0L;
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();

  //
  // Get list of Conn for the replication
  //
  m_Data.m_uaReplicConn.RemoveAll();

  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));
  aparentsTemp[0] = lpRecord->extra;
  aparentsTemp[1] = aparentsTemp[2] = NULL;

  iret =  DOMGetFirstObject(nNodeHandle,
                            OT_REPLIC_CONNECTION,
                            1,                            // level,
                            aparentsTemp,                 // Temp mandatory!
                            pUps->pSFilter->bWithSystem,  // bwithsystem
                            NULL,                         // lpowner
                            buf,
                            bufOwner,
                            bufComplim);
  if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
    // Erroneous case!
    CuNameWithNumber unavail(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));//_T("<Data Unavailable>")
    m_Data.m_uaReplicConn.Add(unavail);
  }
  else {
    while (iret == RES_SUCCESS) {
      int iNumber = (int)(long)getint(bufOwner);
      CString cs = buf;
      int idxSpace = cs.Find(_T(' '));
      ASSERT (idxSpace != -1);
      if (idxSpace != -1) {
        int len = cs.GetLength();
        CString cs2 = cs.Right(len - idxSpace);
        cs2.TrimLeft();
        ASSERT (!cs2.IsEmpty());
        cs = cs2;
      }
      CuNameWithNumber conn(cs, iNumber);
      m_Data.m_uaReplicConn.Add(conn);

      iret = DOMGetNextObject(buf, bufOwner, bufComplim);
    }
  }
  if (m_Data.m_uaReplicConn.GetCount() == 0) {
    CuNameWithNumber noConn(VDBA_MfcResourceString (IDS_E_NO_CONNECTION));//"<No Connection>"
    m_Data.m_uaReplicConn.Add(noConn);
  }

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #21
0
LONG CuDlgDomPropProcLink::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the object
  PROCEDUREPARAMS ProcedureParams;
  memset (&ProcedureParams, 0, sizeof (ProcedureParams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();

  //
  // Get Detail Info
  //
  x_strcpy ((char *)ProcedureParams.objectname, (const char *)lpRecord->objName);
  x_strcpy ((char *)ProcedureParams.objectowner, (const char *)lpRecord->ownerName);
  x_strcpy ((char *)ProcedureParams.DBName, (const char *)lpRecord->extra);
  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_PROCEDURE,
                               &ProcedureParams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataProcedure tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  // update member variables, for display/load/save purpose
  m_Data.m_csText = ProcedureParams.lpProcedureText;


  // liberate detail structure
  FreeAttachedPointers (&ProcedureParams, OT_PROCEDURE);

  //
  // No list of Rules executing procedure
  //
  m_Data.m_acsRulesExecutingProcedure.RemoveAll();    // For serialization only

  //
  // Refresh display
  //
  RefreshDisplay();

  return 0L;
}
Example #22
0
LONG CuDlgDomPropStaticProfile::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      case FILTER_DOM_SYSTEMOBJECTS:    // eligible
      case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH:
      // eligible if UpdateType is compatible with DomGetFirst/Next object type,
      // or is ot_virtnode, which means refresh for all whatever the type is
      if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
          pUps->pSFilter->UpdateType != OT_PROFILE)
        return 0L;
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the current item
  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Get list of Profiles
  //
  m_Data.m_uaStaticProfile.RemoveAll();

  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  // parent preparation
  aparentsTemp[0] = aparentsTemp[1] = aparentsTemp[2] = NULL;

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));
  iret =  DOMGetFirstObject(nNodeHandle,
                            OT_PROFILE,
                            0,                            // level,
                            aparentsTemp,                 // Temp mandatory!
                            pUps->pSFilter->bWithSystem,  // bwithsystem
                            NULL,                         // lpowner
                            buf,
                            bufOwner,
                            bufComplim);
  if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
    // Erroneous case!
    CuNameOnly errItem(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE), TRUE);   // Special"<Data Unavailable>"
    m_Data.m_uaStaticProfile.Add(errItem);
  }
  else {
    while (iret == RES_SUCCESS) {
      CuNameOnly item((const char*)buf, FALSE);   // Not special, but regular
      m_Data.m_uaStaticProfile.Add(item);

      iret = DOMGetNextObject(buf, bufOwner, bufComplim);
    }
  }
  if (m_Data.m_uaStaticProfile.GetCount() == 0) {
    CuNameOnly noItem(VDBA_MfcResourceString (IDS_E_NO_PROFILE), TRUE);//"<No Profile>"
    m_Data.m_uaStaticProfile.Add(noItem);
  }

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #23
0
LONG CuDlgDomPropDDb::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
      //case FILTER_DOM_SYSTEMOBJECTS:
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }

  ResetDisplay();
  // Get info on the object
  DATABASEPARAMS DbParams;
  memset (&DbParams, 0, sizeof (DbParams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);

  //
  // Get Detail Info
  //
  lstrcpy ((LPTSTR)DbParams.objectname, (LPCTSTR)lpRecord->objName);
  DbParams.DbType = lpRecord->parentDbType;
  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_DATABASE,
                               &DbParams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataDDb tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  // update member variables, for display/load/save purpose
  m_Data.m_csOwner  = DbParams.szOwner ;
  m_Data.m_csLocDb  = DbParams.szDbDev ;
  m_Data.m_csLocChk = DbParams.szChkpDev;
  m_Data.m_csLocJnl = DbParams.szJrnlDev;
  m_Data.m_csLocDmp = DbParams.szDmpDev;
  m_Data.m_csLocSrt = DbParams.szSortDev;

  // liberate detail structure
  FreeAttachedPointers (&DbParams, OT_DATABASE);

  //
  // Get name of Coordinator Database
  //
  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  LPUCHAR aparentsResult[MAXPLEVEL];
  UCHAR   bufParResult0[MAXOBJECTNAME];
  UCHAR   bufParResult1[MAXOBJECTNAME];
  UCHAR   bufParResult2[MAXOBJECTNAME];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  aparentsResult[0] = bufParResult0;
  aparentsResult[1] = bufParResult1;
  aparentsResult[2] = bufParResult2;

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));
  aparentsTemp[0] = lpRecord->objName;
  aparentsTemp[1] = aparentsTemp[2] = NULL;

  iret =  DOMGetFirstRelObject(nNodeHandle,
                               OTR_CDB,
                               1,                           // level,
                               aparentsTemp,                // Temp mandatory!
                               TRUE,                        // bwithsystem
                               NULL,                        // base owner
                               NULL,                        // other owner
                               aparentsResult,
                               buf,
                               bufOwner,
                               bufComplim);
  if (iret != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataDDb tempData;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }
  m_Data.m_csCoordinator = buf;

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #24
0
LONG CuDlgDomPropRole::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
    case FILTER_DOM_SYSTEMOBJECTS:    // because list of grantees can contain "$ingres"
      //case FILTER_DOM_BASEOWNER:
      //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;

    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the object
  ROLEPARAMS roleParams;
  memset (&roleParams, 0, sizeof (roleParams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  //
  // Manage "Public" special case
  //
  CString csPublic(lppublicdispstring());
  if (csPublic.CompareNoCase ((const char *)lpRecord->objName) == 0) {
    // Unacceptable for this property page since managed differently in AllocateUserPageInfo() (mainvi2.cpp)
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataRole tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // starting from here, "Normal" case

  //
  // Get Detail Info
  //
  x_strcpy ((char *)roleParams.ObjectName, (const char *)lpRecord->objName);
  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_ROLE,
                               &roleParams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataRole tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();

  // update member variables, for display/load/save purpose
  if (roleParams.lpLimitSecLabels)
    m_Data.m_csLimSecureLabel = roleParams.lpLimitSecLabels;
  else
    m_Data.m_csLimSecureLabel = "";

  ASSERT (sizeof(m_Data.m_aPrivilege) == sizeof (roleParams.Privilege) );
  memcpy(m_Data.m_aPrivilege, roleParams.Privilege, sizeof (roleParams.Privilege));
  ASSERT (sizeof(m_Data.m_aSecAudit) == sizeof (roleParams.bSecAudit) );
  memcpy(m_Data.m_aSecAudit, roleParams.bSecAudit, sizeof (roleParams.bSecAudit));

  // liberate detail structure
  FreeAttachedPointers (&roleParams, OT_ROLE);

  //
  // Get list of grantees on role
  //
  m_Data.m_acsGranteesOnRole.RemoveAll();

  int     iret;
  LPUCHAR aparentsTemp[MAXPLEVEL];

  UCHAR   buf[MAXOBJECTNAME];
  UCHAR   bufOwner[MAXOBJECTNAME];
  UCHAR   bufComplim[MAXOBJECTNAME];

  memset (&bufComplim, '\0', sizeof(bufComplim));
  memset (&bufOwner, '\0', sizeof(bufOwner));
  aparentsTemp[0] = lpRecord->objName;
  aparentsTemp[1] = aparentsTemp[2] = NULL;

  iret =  DOMGetFirstObject(nNodeHandle,
                            OT_ROLEGRANT_USER,
                            1,                            // level,
                            aparentsTemp,                 // Temp mandatory!
                            pUps->pSFilter->bWithSystem,  // bwithsystem
                            NULL,                         // lpowner
                            buf,
                            bufOwner,
                            bufComplim);
  if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
    // Erroneous case!
    CString csUnavail = VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE);//"<Data Unavailable>"
    m_Data.m_acsGranteesOnRole.Add(csUnavail);
  }
  else {
    while (iret == RES_SUCCESS) {
      m_Data.m_acsGranteesOnRole.Add((LPCTSTR)buf);
      iret = DOMGetNextObject(buf, bufOwner, bufComplim);
    }
  }
  if (m_Data.m_acsGranteesOnRole.GetUpperBound() == -1) {
    CString csNoGrantee = VDBA_MfcResourceString (IDS_E_NO_GRANTEE);//"<No Grantee>";
    m_Data.m_acsGranteesOnRole.Add(csNoGrantee);
  }

  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #25
0
void GOrgueSetter::ButtonChanged(int id)
{
	switch(id)
	{
	case ID_SETTER_PREV:
		Prev();
		break;
	case ID_SETTER_NEXT:
		Next();
		break;
	case ID_SETTER_SET:
		wxTheApp->GetTopWindow()->UpdateWindowUI();
		break;
	case ID_SETTER_M1:
		SetPosition(m_pos - 1, false);
		break;
	case ID_SETTER_M10:
		SetPosition(m_pos - 10, false);
		break;
	case ID_SETTER_M100:
		SetPosition(m_pos - 100, false);
		break;
	case ID_SETTER_P1:
		SetPosition(m_pos + 1, false);
		break;
	case ID_SETTER_P10:
		SetPosition(m_pos + 10, false);
		break;
	case ID_SETTER_P100:
		SetPosition(m_pos + 100, false);
		break;
	case ID_SETTER_HOME:
		SetPosition(0, false);
		break;
	case ID_SETTER_GC:
		m_organfile->Reset();
		break;
	case ID_SETTER_CURRENT:
		SetPosition(m_pos);
		break;
	case ID_SETTER_DELETE:
		for(unsigned j = m_pos; j < m_framegeneral.size() - 1; j++)
			m_framegeneral[j]->Copy(m_framegeneral[j + 1]);
		ResetDisplay();
		break;
	case ID_SETTER_INSERT:
		for (unsigned j = m_framegeneral.size() - 1; j > m_pos; j--)
			m_framegeneral[j]->Copy(m_framegeneral[j - 1]);
		SetPosition(m_pos);
		break;
	case ID_SETTER_L0:
	case ID_SETTER_L1:
	case ID_SETTER_L2:
	case ID_SETTER_L3:
	case ID_SETTER_L4:
	case ID_SETTER_L5:
	case ID_SETTER_L6:
	case ID_SETTER_L7:
	case ID_SETTER_L8:
	case ID_SETTER_L9:
		SetPosition(m_pos - (m_pos % 10) + id - ID_SETTER_L0);
		break;
	case ID_SETTER_GENERAL00:
	case ID_SETTER_GENERAL01:
	case ID_SETTER_GENERAL02:
	case ID_SETTER_GENERAL03:
	case ID_SETTER_GENERAL04:
	case ID_SETTER_GENERAL05:
	case ID_SETTER_GENERAL06:
	case ID_SETTER_GENERAL07:
	case ID_SETTER_GENERAL08:
	case ID_SETTER_GENERAL09:
	case ID_SETTER_GENERAL10:
	case ID_SETTER_GENERAL11:
	case ID_SETTER_GENERAL12:
	case ID_SETTER_GENERAL13:
	case ID_SETTER_GENERAL14:
	case ID_SETTER_GENERAL15:
	case ID_SETTER_GENERAL16:
	case ID_SETTER_GENERAL17:
	case ID_SETTER_GENERAL18:
	case ID_SETTER_GENERAL19:
	case ID_SETTER_GENERAL20:
	case ID_SETTER_GENERAL21:
	case ID_SETTER_GENERAL22:
	case ID_SETTER_GENERAL23:
	case ID_SETTER_GENERAL24:
	case ID_SETTER_GENERAL25:
	case ID_SETTER_GENERAL26:
	case ID_SETTER_GENERAL27:
	case ID_SETTER_GENERAL28:
	case ID_SETTER_GENERAL29:
	case ID_SETTER_GENERAL30:
	case ID_SETTER_GENERAL31:
	case ID_SETTER_GENERAL32:
	case ID_SETTER_GENERAL33:
	case ID_SETTER_GENERAL34:
	case ID_SETTER_GENERAL35:
	case ID_SETTER_GENERAL36:
	case ID_SETTER_GENERAL37:
	case ID_SETTER_GENERAL38:
	case ID_SETTER_GENERAL39:
	case ID_SETTER_GENERAL40:
	case ID_SETTER_GENERAL41:
	case ID_SETTER_GENERAL42:
	case ID_SETTER_GENERAL43:
	case ID_SETTER_GENERAL44:
	case ID_SETTER_GENERAL45:
	case ID_SETTER_GENERAL46:
	case ID_SETTER_GENERAL47:
	case ID_SETTER_GENERAL48:
	case ID_SETTER_GENERAL49:
		m_general[id - ID_SETTER_GENERAL00 + m_bank * GENERALS ]->Push();
		ResetDisplay();
		m_button[id]->Display(true);
		break;
	case ID_SETTER_GENERAL_PREV:
	case ID_SETTER_GENERAL_NEXT:
		if (id == ID_SETTER_GENERAL_PREV && m_bank > 0)
			m_bank--;
		if (id == ID_SETTER_GENERAL_NEXT && m_bank < GENERAL_BANKS - 1)
			m_bank++;

		m_BankDisplay.SetContent(wxString::Format(wxT("%c"), m_bank + wxT('A')));
		break;

	case ID_SETTER_REGULAR:
		SetSetterType(SETTER_REGULAR);
		break;
	case ID_SETTER_SCOPE:
		SetSetterType(SETTER_SCOPE);
		break;
	case ID_SETTER_SCOPED:
		SetSetterType(SETTER_SCOPED);
		break;
	case ID_SETTER_CRESCENDO_A:
	case ID_SETTER_CRESCENDO_B:
	case ID_SETTER_CRESCENDO_C:
	case ID_SETTER_CRESCENDO_D:
		SetCrescendoType(id - ID_SETTER_CRESCENDO_A);
		break;

	case ID_SETTER_CRESCENDO_PREV:
		Crescendo(m_crescendopos - 1, true);
		break;
	case ID_SETTER_CRESCENDO_NEXT:
		Crescendo(m_crescendopos + 1, true);
		break;
	case ID_SETTER_CRESCENDO_CURRENT:
		m_crescendo[m_crescendopos + m_crescendobank * CRESCENDO_STEPS]->Push();
		break;

	case ID_SETTER_PITCH_M1:
		m_organfile->GetPipeConfig().ModifyTuning(-1);
		break;
	case ID_SETTER_PITCH_M10:
		m_organfile->GetPipeConfig().ModifyTuning(-10);
		break;
	case ID_SETTER_PITCH_M100:
		m_organfile->GetPipeConfig().ModifyTuning(-100);
		break;
	case ID_SETTER_PITCH_P1:
		m_organfile->GetPipeConfig().ModifyTuning(1);
		break;
	case ID_SETTER_PITCH_P10:
		m_organfile->GetPipeConfig().ModifyTuning(10);
		break;
	case ID_SETTER_PITCH_P100:
		m_organfile->GetPipeConfig().ModifyTuning(100);
		break;
	case ID_SETTER_SAVE:
		m_organfile->Save();
		break;

	case ID_SETTER_TEMPERAMENT_NEXT:
	case ID_SETTER_TEMPERAMENT_PREV:
		{
			unsigned index = m_organfile->GetSettings().GetTemperaments().GetTemperamentIndex(m_organfile->GetTemperament());
			index += m_organfile->GetSettings().GetTemperaments().GetTemperamentCount();
			if (id == ID_SETTER_TEMPERAMENT_NEXT)
				index++;
			else
				index--;
			index = index % m_organfile->GetSettings().GetTemperaments().GetTemperamentCount();
			m_organfile->SetTemperament(m_organfile->GetSettings().GetTemperaments().GetTemperamentName(index));
		}
		break;

	case ID_SETTER_TRANSPOSE_DOWN:
	case ID_SETTER_TRANSPOSE_UP:
		{
			int value = m_organfile->GetSettings().Transpose();
			if (id == ID_SETTER_TRANSPOSE_UP)
				value++;
			else
				value--;
			SetTranspose(value);
		}
		break;
	}
}
Example #26
0
void AndroidEGL::UnBind()
{
	ResetDisplay();
	DestroySurface();
}
Example #27
0
LONG CuDlgDomPropTableColumns::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
  // cast received parameters
  int nNodeHandle = (int)wParam;
  LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
  ASSERT (nNodeHandle != -1);
  ASSERT (pUps);

  // ignore selected actions on filters
  switch (pUps->nIpmHint)
  {
    case 0:
    //case FILTER_DOM_SYSTEMOBJECTS:
    //case FILTER_DOM_BASEOWNER:
    //case FILTER_DOM_OTHEROWNER:
      break;

    case FILTER_DOM_BKREFRESH_DETAIL:
      if (m_Data.m_refreshParams.MustRefresh(pUps->pSFilter->bOnLoad, pUps->pSFilter->refreshtime))
        break;    // need to update
      else
        return 0; // no need to update
      break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListColumns);
        return 0L;
    default:
      return 0L;    // nothing to change on the display
  }

  // Get info on the object
  TABLEPARAMS tableparams;
  memset (&tableparams, 0, sizeof (tableparams));

  LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
  ASSERT (lpRecord);
  ResetDisplay();
  x_strcpy ((char *)tableparams.DBName,     (const char *)lpRecord->extra);
  x_strcpy ((char *)tableparams.objectname, RemoveDisplayQuotesIfAny((LPCTSTR)StringWithoutOwner(lpRecord->objName)));
  x_strcpy ((char *)tableparams.szSchema,   (const char *)lpRecord->ownerName);
  tableparams.detailSubset = TABLE_SUBSET_COLUMNSONLY;  // minimize query duration

  int dummySesHndl;
  int iResult = GetDetailInfo ((LPUCHAR)GetVirtNodeName(nNodeHandle),
                               OT_TABLE,
                               &tableparams,
                               FALSE,
                               &dummySesHndl);
  if (iResult != RES_SUCCESS) {
    // Table may not exist if propagate too fast
    if (iResult != RES_ENDOFDATA)
      ASSERT (FALSE);

    // Reset m_Data
    CuDomPropDataTableColumns tempData;
    tempData.m_refreshParams = m_Data.m_refreshParams;
    m_Data = tempData;

    // Create error item and that's it!
    /* "<Data Unavailable>" */
    CuTblColumn tblColumn1(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));
    m_Data.m_uaColumns.Add(tblColumn1);

    // Refresh display
    RefreshDisplay();

    return 0L;
  }

  // Update refresh info
  m_Data.m_refreshParams.UpdateRefreshParams();
  TCHAR *lpObjComment = NULL;
  int iret = RES_SUCCESS;
  LPOBJECTLIST ls ,lpColTemp,lpObjCol = NULL;
  LPCOMMENTCOLUMN lpCommentCol;
  ls = tableparams.lpColumns;
  while (ls)
  {
    lpColTemp = AddListObjectTail(&lpObjCol, sizeof(COMMENTCOLUMN));
    if (!lpColTemp)
    {
      // Need to free previously allocated objects.
      FreeObjectList(lpObjCol);
      lpObjCol = NULL;
      break;
    }
    LPCOLUMNPARAMS lstbl=(LPCOLUMNPARAMS)ls->lpObject;
    lpCommentCol = (LPCOMMENTCOLUMN)lpColTemp->lpObject;
    lstrcpy((LPTSTR)lpCommentCol->szColumnName,(LPCTSTR)(LPUCHAR)lstbl->szColumn);
    lpCommentCol->lpszComment = NULL;
    ls=(LPOBJECTLIST)ls->lpNext;
  }

  if (lpObjCol)
    iret = VDBAGetCommentInfo ( (LPTSTR)(LPUCHAR)GetVirtNodeName(nNodeHandle),
                                (LPTSTR)tableparams.DBName, (LPTSTR)tableparams.objectname,
                                (LPTSTR)tableparams.szSchema, &lpObjComment, lpObjCol);
  else
    ASSERT (FALSE);

  // update member variables, for display/load/save purpose

  // list of columns
  m_Data.m_uaColumns.RemoveAll();
  ls = tableparams.lpColumns;
  ASSERT (ls);    // No columns is unacceptable
  while (ls) {
    LPCOLUMNPARAMS lpCol = (LPCOLUMNPARAMS)ls->lpObject;
    ASSERT (lpCol);

    // Column name
    CString csName = lpCol->szColumn;

    // Format "column type"
    CString csType = "";
    if (lstrcmpi(lpCol->tchszInternalDataType, lpCol->tchszDataType) != 0)  {
      ASSERT (lpCol->tchszInternalDataType[0]);
      csType = lpCol->tchszInternalDataType;  // UDTs
      if (lstrcmpi(lpCol->tchszInternalDataType,VDBA_MfcResourceString(IDS_OBJECT_KEY)) == 0 ||
          lstrcmpi(lpCol->tchszInternalDataType,VDBA_MfcResourceString(IDS_TABLE_KEY) ) == 0) {
          if (lpCol->bSystemMaintained)
              csType += VDBA_MfcResourceString(IDS_SYSTEM_MAINTAINED);
          else
              csType += VDBA_MfcResourceString(IDS_NO_SYSTEM_MAINTAINED);
      }
    }
    else {
      LPUCHAR lpType;
      lpType = GetColTypeStr(lpCol);
      if (lpType) {
        csType = lpType;
        ESL_FreeMem(lpType);
      }
      else {
        // Unknown type: put type name "as is" - length will not be displayed
        csType = lpCol->tchszDataType;
	  }
    }

    // Format "default specification"
    CString csDefSpec = "";
    if (lpCol->lpszDefSpec)
      csDefSpec = lpCol->lpszDefSpec;

    // Format "Comment"
    CString csTblComment = "";
    LPOBJECTLIST LsObj = lpObjCol;
    LPCOMMENTCOLUMN lpCommentCol;

    while (LsObj)
    {
      lpCommentCol = (LPCOMMENTCOLUMN)LsObj->lpObject;
      if (strcmp((LPTSTR)lpCommentCol->szColumnName,(LPTSTR)lpCol->szColumn) == 0)
      {
        if (iret!=RES_SUCCESS && !lpCommentCol->lpszComment)
          csTblComment.LoadString(IDS_NOT_AVAILABLE);
        else
        {
            if (lpCommentCol->lpszComment)
              csTblComment = lpCommentCol->lpszComment;
        }
      }
      LsObj = (LPOBJECTLIST)LsObj->lpNext;
    }

    // item on the stack
    CuTblColumn tblColumn(csName,             // LPCTSTR name,
                          csType,             // LPCTSTR type, ??? Code complexe
                          lpCol->nKeySequence,// int primKeyRank,
                          lpCol->bNullable,   // BOOL bNullable,
                          lpCol->bDefault,    // BOOL bWithDefault,
                          csDefSpec,          // LPCTSTR defSpec
                          csTblComment );     // LPCTSTR comment on column
    CuMultFlag *pRefCol = m_Data.m_uaColumns.Find(&tblColumn);
    ASSERT (!pRefCol);
    m_Data.m_uaColumns.Add(tblColumn);

    // Loop on next column
    ls = (LPOBJECTLIST)ls->lpNext;
  }

  // liberate detail structure
  FreeAttachedPointers (&tableparams,  OT_TABLE);
  // liberate column comment
  ls = lpObjCol;
  while (ls)
  {
    lpCommentCol = (LPCOMMENTCOLUMN)ls->lpObject;
    if (lpCommentCol->lpszComment)
      ESL_FreeMem (lpCommentCol->lpszComment);
    ls = (LPOBJECTLIST)ls->lpNext;
  }
  FreeObjectList(lpObjCol);
  if (lpObjComment)
    ESL_FreeMem (lpObjComment);
  // Refresh display
  RefreshDisplay();

  return 0L;
}
Example #28
0
LONG CuDlgDomPropDbSeq::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
    // cast received parameters
    int nNodeHandle = (int)wParam;
    LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
    ASSERT (nNodeHandle != -1);
    ASSERT (pUps);

    // ignore selected actions on filters
    switch (pUps->nIpmHint)
    {
    case 0:
    case FILTER_DOM_SYSTEMOBJECTS:    // eligible
    //case FILTER_DOM_BASEOWNER:
    case FILTER_DOM_OTHEROWNER:
        break;

    case FILTER_DOM_BKREFRESH:
        // eligible if UpdateType is compatible with DomGetFirst/Next object type,
        // or is ot_virtnode, which means refresh for all whatever the type is
        if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
                pUps->pSFilter->UpdateType != OT_PROCEDURE)
            return 0L;
        break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
        return 0L;    // nothing to change on the display
    }

    ResetDisplay();
    // Get info on the current item
    LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
    ASSERT (lpRecord);

    //
    // Get list of Proc for the replication
    //
    m_Data.m_uaDbSeq.RemoveAll();

    int     iret;
    LPUCHAR aparentsTemp[MAXPLEVEL];

    UCHAR   buf[MAXOBJECTNAME];
    UCHAR   bufOwner[MAXOBJECTNAME];
    UCHAR   bufComplim[MAXOBJECTNAME];

    // parent preparation - added static type.
    int basicType = GetBasicType(lpRecord->recType);
    switch (basicType) {
    case OT_DATABASE:
        aparentsTemp[0] = lpRecord->objName;
        break;
    case OT_STATIC_SEQUENCE:
        aparentsTemp[0] = lpRecord->extra;
        break;
    default:
        ASSERT(FALSE);
        return 0L;
    }
    aparentsTemp[1] = aparentsTemp[2] = NULL;
    m_Data.m_objType = basicType;

    memset (&bufComplim, '\0', sizeof(bufComplim));
    memset (&bufOwner, '\0', sizeof(bufOwner));
    iret =  DOMGetFirstObject(nNodeHandle,
                              OT_SEQUENCE,
                              1,                            // level,
                              aparentsTemp,                 // Temp mandatory!
                              pUps->pSFilter->bWithSystem,  // bwithsystem
                              (LPUCHAR)pUps->pSFilter->lpOtherOwner, // lpowner
                              buf,
                              bufOwner,
                              bufComplim);
    if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
        // Erroneous case!
        CuNameWithOwner errItem(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));//"<Data Unavailable>"
        m_Data.m_uaDbSeq.Add(errItem);
    }
    else {
        while (iret == RES_SUCCESS) {
            CuNameWithOwner item((const char*)buf, (const char*)bufOwner);
            m_Data.m_uaDbSeq.Add(item);

            iret = DOMGetNextObject(buf, bufOwner, bufComplim);
        }
    }
    if (m_Data.m_uaDbSeq.GetCount() == 0) {
        CuNameWithOwner noItem(VDBA_MfcResourceString (IDS_E_NO_SEQUENCE));//"<No Sequence>"
        m_Data.m_uaDbSeq.Add(noItem);
    }

    // Refresh display
    RefreshDisplay();

    return 0L;
}
Example #29
0
LONG CuDlgDomPropTableGrantees::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
    // cast received parameters
    int nNodeHandle = (int)wParam;
    LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
    ASSERT (nNodeHandle != -1);
    ASSERT (pUps);

    // ignore selected actions on filters
    switch (pUps->nIpmHint)
    {
    case 0:
    case FILTER_DOM_SYSTEMOBJECTS:  // can be $ingres
        //case FILTER_DOM_BASEOWNER:
        //case FILTER_DOM_OTHEROWNER:
        break;

    case FILTER_DOM_BKREFRESH:
        // eligible if UpdateType is compatible with DomGetFirst/Next object type,
        // or is ot_virtnode, which means refresh for all whatever the type is
        if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
                pUps->pSFilter->UpdateType != OTLL_GRANTEE)
            return 0L;
        break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
        return 0L;    // nothing to change on the display
    }

    // Get info on the current item
    LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
    ASSERT (lpRecord);
    ResetDisplay();
    //
    // Get list of Grantees
    //
    m_Data.m_uaTableGrantees.RemoveAll();

    int     iret;
    LPUCHAR aparentsTemp[MAXPLEVEL];

    UCHAR   buf[MAXOBJECTNAME];
    UCHAR   bufOwner[MAXOBJECTNAME];
    UCHAR   bufComplim[MAXOBJECTNAME];

    memset (&bufComplim, '\0', sizeof(bufComplim));
    memset (&bufOwner, '\0', sizeof(bufOwner));

    // prepare parenthood with schema where relevant
    aparentsTemp[0] = lpRecord->extra;  // parent DB Name

    UCHAR bufParent1[MAXOBJECTNAME];
    aparentsTemp[1] = bufParent1;
    switch (lpRecord->recType) {
    case OT_TABLE:
    case OTR_GRANTEE_SEL_TABLE:
    case OTR_GRANTEE_INS_TABLE:
    case OTR_GRANTEE_UPD_TABLE:
    case OTR_GRANTEE_DEL_TABLE:
    case OTR_GRANTEE_REF_TABLE:
    case OTR_GRANTEE_CPI_TABLE:
    case OTR_GRANTEE_CPF_TABLE:
    case OTR_GRANTEE_ALL_TABLE:
    case OTR_LOCATIONTABLE:
    case OT_REPLIC_REGTABLE:
    case OT_SCHEMAUSER_TABLE:
    case OTR_REPLIC_CDDS_TABLE:
        x_strcpy((char *)buf, (const char *)lpRecord->objName);
        break;
    case OT_STATIC_TABLEGRANTEES:
        x_strcpy((char *)buf, (const char *)lpRecord->extra2);
        break;
    default:
        ASSERT (FALSE);
        buf[0] = '\0';
    }
    ASSERT (lpRecord->ownerName);
    StringWithOwner(buf, lpRecord->ownerName, aparentsTemp[1]); // schema.name

    aparentsTemp[2] = NULL;

    // loop on grants
    BOOL bError = FALSE;
    for (int index = 0; index < NBTBLGRANTEES; index++) {
        iret =  DOMGetFirstObject(nNodeHandle,
                                  aGrantType[index],
                                  2,                            // level,
                                  aparentsTemp,                 // Temp mandatory!
                                  pUps->pSFilter->bWithSystem,  // bwithsystem
                                  NULL,                         // lpowner
                                  buf,
                                  bufOwner,
                                  bufComplim);
        if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
            bError = TRUE;
            continue;
        }
        else {
            while (iret == RES_SUCCESS) {
                // received data:
                // - Grantee name in buf
                CuTableGrantee grantee((const char *)buf,     // Grantee name (user/group/role)
                                       FALSE,                 // not special item
                                       aGrantType[index]    // grant type
                                      );

                // Solve type on the fly and SetGranteeType
                int granteeType;
                UCHAR resBuf[MAXOBJECTNAME];
                UCHAR resBuf2[MAXOBJECTNAME];
                UCHAR resBuf3[MAXOBJECTNAME];
                int res = DOMGetObjectLimitedInfo(nNodeHandle,
                                                  buf,
                                                  bufOwner,
                                                  OT_GRANTEE,
                                                  0,     // level
                                                  NULL,  // parentstrings,
                                                  TRUE,
                                                  &granteeType,
                                                  resBuf,
                                                  resBuf2,
                                                  resBuf3);
                if (res != RES_SUCCESS)
                    grantee.SetGranteeType(OT_ERROR);
                else
                    grantee.SetGranteeType(granteeType);

                CuMultFlag *pRefGrantee = m_Data.m_uaTableGrantees.Find(&grantee);
                if (pRefGrantee)
                    m_Data.m_uaTableGrantees.Merge(pRefGrantee, &grantee);
                else
                    m_Data.m_uaTableGrantees.Add(grantee);

                iret = DOMGetNextObject(buf, bufOwner, bufComplim);
            }
        }
    }

    // Manage error case
    if (bError)
    {
        /* "<Data Unavailable>" */
        CuTableGrantee grantee1(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE),
                                TRUE);
        m_Data.m_uaTableGrantees.Add(grantee1);
    }

    // Manage no grantee
    if (m_Data.m_uaTableGrantees.GetCount() == 0)
    {
        /* "<No Grantee>" */
        CuTableGrantee grantee2(VDBA_MfcResourceString (IDS_E_NO_GRANTEE), TRUE);
        m_Data.m_uaTableGrantees.Add(grantee2);
    }

    ASSERT (m_Data.m_uaTableGrantees.GetCount() > 0 );

    // Refresh display
    RefreshDisplay();

    return 0L;
}
Example #30
0
LONG CuDlgDomPropIceFacetNPageRoles::OnUpdateData (WPARAM wParam, LPARAM lParam)
{
    // cast received parameters
    int nNodeHandle = (int)wParam;
    LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam;
    ASSERT (nNodeHandle != -1);
    ASSERT (pUps);

    // ignore selected actions on filters
    switch (pUps->nIpmHint)
    {
    case 0:
    case FILTER_DOM_SYSTEMOBJECTS:    // eligible
        //case FILTER_DOM_BASEOWNER:
        //case FILTER_DOM_OTHEROWNER:
        break;

    case FILTER_DOM_BKREFRESH:
        // eligible if UpdateType is compatible with DomGetFirst/Next object type,
        // or is ot_virtnode, which means refresh for all whatever the type is
        if (pUps->pSFilter->UpdateType != OT_VIRTNODE &&
                pUps->pSFilter->UpdateType != OT_ICE_GENERIC)
            return 0L;
        break;
    case FILTER_SETTING_CHANGE:
        VDBA_OnGeneralSettingChange(&m_cListCtrl);
        return 0L;
    default:
        return 0L;    // nothing to change on the display
    }

    ResetDisplay();
    // Get info on the current item
    LPTREERECORD  lpRecord = (LPTREERECORD)pUps->pStruct;
    ASSERT (lpRecord);

    //
    // Get list of FacetNPageRoles
    //
    m_Data.m_uaIceFacetNPageAccessdef.RemoveAll();

    int     iret;
    LPUCHAR aparentsTemp[MAXPLEVEL];

    UCHAR   buf[MAXOBJECTNAME];
    UCHAR   bufOwner[MAXOBJECTNAME];
    UCHAR   bufComplim[MAXOBJECTNAME];

    // no parent preparation - check type
    ASSERT (lpRecord->recType == OT_STATIC_ICE_BUNIT_FACET_ROLE ||
            lpRecord->recType == OT_ICE_BUNIT_FACET             ||
            lpRecord->recType == OT_STATIC_ICE_BUNIT_PAGE_ROLE ||
            lpRecord->recType == OT_ICE_BUNIT_PAGE
           );
    m_Data.m_objType = lpRecord->recType;   // MANDATORY!

    // parent bunit name in aparentsTemp[0]
    // parent facet or page name in aparentsTemp[1]
    aparentsTemp[0] = lpRecord->extra;
    switch (lpRecord->recType) {
    case OT_ICE_BUNIT_FACET:
    case OT_ICE_BUNIT_PAGE:
        aparentsTemp[1] = lpRecord->objName;
        break;
    case OT_STATIC_ICE_BUNIT_FACET_ROLE:
    case OT_STATIC_ICE_BUNIT_PAGE_ROLE:
        aparentsTemp[1] = lpRecord->extra2;
        break;
    default:
        ASSERT(FALSE);
        return 0L;
    }
    aparentsTemp[2] = NULL;

    // request type:
    int reqType = -1;
    switch (lpRecord->recType) {
    case OT_ICE_BUNIT_FACET:
    case OT_STATIC_ICE_BUNIT_FACET_ROLE:
        reqType = OT_ICE_BUNIT_FACET_ROLE;
        break;
    case OT_ICE_BUNIT_PAGE:
    case OT_STATIC_ICE_BUNIT_PAGE_ROLE:
        reqType = OT_ICE_BUNIT_PAGE_ROLE;
        break;
    default:
        ASSERT(FALSE);
        return 0L;
    }

    memset (&bufComplim, '\0', sizeof(bufComplim));
    memset (&bufOwner, '\0', sizeof(bufOwner));
    iret =  DOMGetFirstObject(nNodeHandle,
                              reqType,
                              2,                            // level,
                              aparentsTemp,                 // Temp mandatory!
                              pUps->pSFilter->bWithSystem,  // bwithsystem
                              NULL,                         // lpowner
                              buf,
                              bufOwner,
                              bufComplim);
    if (iret != RES_SUCCESS && iret != RES_ENDOFDATA) {
        // Erroneous case!
        CuIceFacetNPageAccessdef errItem(VDBA_MfcResourceString (IDS_DATA_UNAVAILABLE));   // Special item"<Data Unavailable>"
        m_Data.m_uaIceFacetNPageAccessdef.Add(errItem);
    }
    else {
        while (iret == RES_SUCCESS) {
            BOOL bExecute = getint(bufComplim);
            BOOL bRead    = getint(bufComplim + STEPSMALLOBJ);
            BOOL bUpdate  = getint(bufComplim + (2*STEPSMALLOBJ));
            BOOL bDelete  = getint(bufComplim + (3*STEPSMALLOBJ));
            CuIceFacetNPageAccessdef item((const char*)buf, bExecute, bRead, bUpdate, bDelete);   // Regular item
            m_Data.m_uaIceFacetNPageAccessdef.Add(item);

            iret = DOMGetNextObject(buf, bufOwner, bufComplim);
        }
    }
    if (m_Data.m_uaIceFacetNPageAccessdef.GetCount() == 0) {
        CuIceFacetNPageAccessdef noItem(VDBA_MfcResourceString(IDS_NO_ROLE));//"< No Role >"      // Special item
        m_Data.m_uaIceFacetNPageAccessdef.Add(noItem);
    }

    // Refresh display
    RefreshDisplay();

    return 0L;
}