示例#1
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;
}
示例#2
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;
}
示例#3
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;
}
示例#4
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;
}