Beispiel #1
0
zOPER_EXPORT zSHORT OPERATION
zwTZVSDBAD_FindStatement( zVIEW    XPG2,
                          zVIEW    XPG )
{
   zSHORT   StatementFound;
   zSHORT   RESULT;
   zLONG    lTempInteger_0;
   zSHORT   nZRetCode;

   RESULT = SetCursorFirstEntity( XPG2, "Statement", "" );
   StatementFound = 0;
   while ( StatementFound == 0 && RESULT == zCURSOR_SET )
   {
      lTempInteger_0 = CheckExistenceOfEntity( XPG2, "Substatement" );
      if ( lTempInteger_0 == 0 )
      {
         nZRetCode = SetViewToSubobject( XPG2, "Substatement" );
         StatementFound = zwTZVSDBAD_FindStatement( XPG2, XPG );
         nZRetCode = ResetViewFromSubobject( XPG2 );
      }
      if ( StatementFound == 0 )
      {
         if ( CompareAttributeToAttribute( XPG2, "Statement", "RelativeLineNumber", XPG, "OperationText", "RelativeLineNumber" ) == 0 )
         {
            StatementFound = 1;
            if ( CompareAttributeToString ( XPG, "OperationText", "BreakPointFlag", ">" ) == 0 )
            {
               nZRetCode = SetAttributeFromString( XPG2, "Statement", "BreakPointFlag", "" );
               nZRetCode = SetAttributeFromString( XPG, "OperationText", "BreakPointFlag", "" );
            }
            else
            {
               nZRetCode = SetAttributeFromString( XPG2, "Statement", "BreakPointFlag", "Y" );
               nZRetCode = SetAttributeFromString( XPG, "OperationText", "BreakPointFlag", ">" );
            }
         }
         else
         {
            RESULT = SetCursorNextEntity( XPG2, "Statement", "" );
         }
      }

      lTempInteger_0 = CheckExistenceOfEntity( XPG2, "Statement" );
   }

   return( StatementFound );
}
Beispiel #2
0
zOPER_EXPORT zSHORT OPERATION
UpgradeControl( zVIEW    vSubtask,
                zVIEW    OrigW,
                zVIEW    OrigWC,
                zVIEW    vType,
                zVIEW    vPE )
{
#if 0
   zLONG    lType;
   zCHAR    szTag[ 35 ];
   zSHORT   RESULT;
   zSHORT   nZRetCode;

   RESULT = SetCursorFirstEntity( OrigWC, "CtrlCtrl", "" );
   while ( RESULT >= 0 )
   {
      nZRetCode = SetViewToSubobject( OrigWC, "CtrlCtrl" );
      nZRetCode = UpgradeControl( vSubtask, OrigW, OrigWC, vType, vPE );
      nZRetCode = ResetViewFromSubobject( OrigWC );
      RESULT = SetCursorNextEntity( OrigWC, "CtrlCtrl", "" );
   }
   RESULT = SetCursorFirstEntity( OrigWC, "CtrlMap", "" );
   while ( RESULT >= 0 )
   {
      nZRetCode = UpgradeCtrlMap( vSubtask, OrigW, OrigWC );
      RESULT = SetCursorNextEntity( OrigWC, "CtrlMap", "" );
   }
   // Upgrade Control to relate to ControlDef
   if ( CheckExistenceOfEntity ( OrigWC, "ControlDef" ) < 0 )
   {
      GetIntegerFromAttribute( &lType, OrigWC, "Control", "Type" );
      SetCursorFirstEntityByInteger( vType, "Control", "Type", lType, "" );
      GetStringFromAttribute( szTag, vType, "Control", "Tag" );
      SetCursorFirstEntityByString( vPE, "ControlDef", "Tag", szTag, "" );
      IncludeSubobjectFromSubobject( OrigWC, "ControlDef", vPE, "ControlDef", zPOS_AFTER );
      SetAttributeFromString ( OrigWC, "Control", "Type", "");
   }
#endif
   return( 0 );
}
Beispiel #3
0
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: zofnTZSIXSKO_BldXSKChildEnt
//
// PURPOSE:
//
// TRIGGLODED BY:
//    WINDOW: TZZOLODD
//    ACTION: OPTION
//    NAME: File_Save
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
zofnTZSIXSKO_BldXSKChildEnt ( zVIEW vKZSIXSKO_Root,
                              zVIEW vKZSIXSKO, zVIEW vTZZOXOD1,
                              zVIEW vTZTENVRO_REF,
                              zSHORT nEntityFlag )
{
   zVIEW  vTZTENVRO_Parent;
   zSHORT nRC;
   zSHORT nRC2;
   zPCHAR szDBMS;
   zSHORT nEntImpls;
   zLONG  lEntityZKey;
   zSHORT nEntitySet    = nEntityFlag;
   zSHORT nSetViewToSubXsk = 0;

   nRC = CreateViewFromViewForTask( &vTZTENVRO_Parent, vTZTENVRO_REF, 0 );

   nRC = zCURSOR_SET;
   while ( nRC >= zCURSOR_SET )
   {
      nRC = SetViewToSubobject( vTZZOXOD1, "CHILDENTITY" );

      /* Check physik, if no, then do not process this entity */
      if ( (nRC = CheckExistenceOfEntity ( vTZZOXOD1, "DATARECORD" )) >= zCURSOR_SET )
      {

         nRC = GetIntegerFromAttribute( &lEntityZKey, vTZZOXOD1,
                                        "ENTITY", "ERENT_TOK" );
         nRC = SetCursorFirstEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                              "ZKey", lEntityZKey,
                                              "TE_DBMS_Source" );
         if ( nRC < zCURSOR_SET )
         {
            GetAddrForAttribute( &szDBMS,
                                 vTZTENVRO_Parent, "TE_DBMS_Source", "DBMS" );
            nEntImpls = 0;
            for ( nRC = SetCursorFirstEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                "ZKey", lEntityZKey,
                                                "TE_DB_Environ" );
                  nRC > zCURSOR_UNCHANGED;
                  nRC = SetCursorNextEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                "ZKey", lEntityZKey,
                                                "TE_DB_Environ" ) )
            {
               if ( CompareAttributeToString( vTZTENVRO_Parent, "TE_DBMS_Source", "DBMS",
                               szDBMS ) == 0 )
               {
                  nEntImpls++;
               }
            }
            if ( nEntImpls == 1 )
            {
               nRC = zCURSOR_SET;
            }
            else
            if ( nEntImpls > 1 )
            {
              for ( nRC = SetCursorFirstEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                  "ZKey", lEntityZKey,
                                                  "TE_DB_Environ" );
                    nRC > zCURSOR_UNCHANGED;
                    nRC = SetCursorNextEntityByInteger( vTZTENVRO_Parent, "ER_Entity",
                                                  "ZKey", lEntityZKey,
                                                  "TE_DB_Environ" ) )
              {
                 if ( CompareAttributeToString( vTZTENVRO_Parent, "TE_DBMS_Source", "DBMS",
                                szDBMS ) == 0 )
                 {
                    zstrcpy( szMsg, "Do you want to use Data Source '" );
                    GetAddrForAttribute( &szMsgName,
                                         vTZTENVRO_Parent, "TE_DBMS_Source", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "' to implement ER Entity '" );
                    GetAddrForAttribute( &szMsgName,
                                         vTZTENVRO_Parent, "ER_Entity", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "'?" );
                    nRC = MessagePrompt ( vTZTENVRO_Parent, "XOD_06", "TE Choice",
                                          szMsg, 0, zBUTTONS_YESNO, 0, 0 );
                    if ( nRC == zRESPONSE_YES )
                        break;   // found Entity implemented in same DBMS
                 }
              }
            }

            if ( nRC < zCURSOR_SET )
            {
               zstrcpy( szMsg, "Unable to Find Entity in TE Data Source with same DBMS.\n\nEntity Name = " );
               GetAddrForAttribute( &szMsgName, vTZZOXOD1, "ER_EntityRec", "Name" );
               zstrcat( szMsg, szMsgName );
               nRC = MessagePrompt( vTZZOXOD1, "XOD_06", "Internal LOD Error", szMsg, 0,
                                    zBUTTONS_OK, 0, 0 );
               nRC = DropView( vTZTENVRO_Parent );
               return( 0 );
            }
         }

         //  new Entity found
         //  if SironGroup exists
         //     if SironKatalog exists
         //        create new Katalog
         //     create next ENTITY and ENTITYCOM entities
         //     create dependent ATTRIB and ATTRICOM entities
         nRC = CheckExistenceOfEntity ( vTZTENVRO_Parent, "SironGroup" );
         if ( nRC >= zCURSOR_SET )
         {
          nRC = CheckExistenceOfEntity ( vTZTENVRO_Parent, "SironKatalog" );
          if ( nRC >= zCURSOR_SET )
          {
            // Go back to KATALOG entity
            if ( nEntitySet )
            {
              while ( ResetViewFromSubobject( vKZSIXSKO_Root ) == 0 );
            }

            // Create new  KATALOG entity
            nRC = SetCursorLastEntity ( vKZSIXSKO_Root, "KATALOG", "" );
            nRC = CreateEntity ( vKZSIXSKO_Root, "KATALOG", zPOS_AFTER );
            SetMatchingAttributesByName(vKZSIXSKO_Root, "KATALOG",
                                        vTZTENVRO_Parent, "SironKatalog", zSET_ALL );

            for ( nRC = SetCursorFirstEntity( vTZTENVRO_Parent,
                                            "KatalogComment", "SironKatalog");
                  nRC > zCURSOR_UNCHANGED;
                  nRC = SetCursorNextEntity( vTZTENVRO_Parent,
                                             "KatalogComment", "SironKatalog") )
            {
              CreateEntity ( vKZSIXSKO_Root, "KATCOM", zPOS_AFTER );
              SetMatchingAttributesByName( vKZSIXSKO_Root, "KATCOM",
                                           vTZTENVRO_Parent, "KatalogComment", zSET_ALL );
            }
          }

          // ViewToSubobject only, if caller created an ENTITY entity
          if ( nEntitySet )
          {
            if ( CheckExistenceOfEntity( vKZSIXSKO_Root, "ENTITY" )
                                                             >= zCURSOR_SET )
            {
               SetViewToSubobject( vKZSIXSKO_Root, "ENTITYCHILD" );
               nSetViewToSubXsk = 1;
            }
          }

          // Create next ENTITY entity
          nRC = SetCursorLastEntity ( vKZSIXSKO_Root, "ENTITY", "" );
          nRC = CreateEntity ( vKZSIXSKO_Root, "ENTITY", zPOS_AFTER );
          nEntitySet = 1;
          SetMatchingAttributesByName(vKZSIXSKO_Root, "ENTITY",
                                      vTZTENVRO_Parent, "SironGroup", zSET_ALL );
          SetAttributeFromInteger( vKZSIXSKO_Root, "ENTITY", "ERENT_TOK",
                                   lEntityZKey );

          for ( nRC = SetCursorFirstEntity( vTZTENVRO_Parent, "GroupComment", "SironGroup");
                nRC > zCURSOR_UNCHANGED;
                nRC = SetCursorNextEntity( vTZTENVRO_Parent, "GroupComment", "SironGroup") )
          {
            CreateEntity ( vKZSIXSKO_Root, "ENTITYCOM", zPOS_AFTER );
            SetMatchingAttributesByName( vKZSIXSKO_Root, "ENTITYCOM",
                                         vTZTENVRO_Parent, "GroupComment", zSET_ALL );
          }

          // Create all dependent ATTRIB entities according to XOD ATTRIB
          // entities
          for ( nRC  = SetCursorFirstEntity( vTZZOXOD1, "ATTRIB", "ENTITY");
                nRC  > zCURSOR_UNCHANGED;
                nRC  = SetCursorNextEntity( vTZZOXOD1, "ATTRIB", "ENTITY") )
          {
             nRC = SetCursorFirstEntityByAttr( vTZTENVRO_Parent,
                                               "TE_FieldDataRel","Name",
                                               vTZZOXOD1, "ATTRIB", "NAME",
                                               "TE_TablRec");

             nRC = CheckExistenceOfEntity( vTZTENVRO_Parent, "SironField" );
             if ( nRC < zCURSOR_SET )
             {
               zstrcpy( szMsg,
       "Unable to Find SironField in TE Data Source .\n\nAttribute Name = " );
               GetAddrForAttribute( &szMsgName, vTZZOXOD1, "ATTRIB", "NAME" );
               zstrcat( szMsg, szMsgName );
               nRC = MessagePrompt ( vTZZOXOD1, "XOD_06",
                                     "Internal XOD Error", szMsg,
                                     0, zBUTTONS_OK, 0, 0 );
               nRC = DropView( vTZTENVRO_Parent );
               return( 0 );
             }

             CreateEntity( vKZSIXSKO_Root, "ATTRIB", zPOS_AFTER );
             SetMatchingAttributesByName( vKZSIXSKO_Root, "ATTRIB",
                                          vTZTENVRO_Parent, "SironField", zSET_ALL );
             SetAttributeFromAttribute( vKZSIXSKO_Root, "ATTRIB", "XVAATT_TOK",
                                        vTZZOXOD1,      "ATTRIB", "XVAATT_TOK" );

             // Create all dependent ATTRIBCOM entities
             for ( nRC = SetCursorFirstEntity( vTZTENVRO_Parent,
                                               "SironFieldComment","SironField");
                   nRC > zCURSOR_UNCHANGED;
                   nRC = SetCursorNextEntity( vTZTENVRO_Parent,
                                              "SironFieldComment","SironField"))
             {
               CreateEntity ( vKZSIXSKO_Root, "ATTRIBCOM", zPOS_AFTER );
               SetMatchingAttributesByName( vKZSIXSKO_Root, "ATTRIBCOM",
                                            vTZTENVRO_Parent, "SironFieldComment",
                                            zSET_ALL );
             }
          }
        }
      }

      // Abstieg des Pfades
      nRC = CheckExistenceOfEntity( vTZZOXOD1, "CHILDENTITY" );
      if ( nRC >= zCURSOR_SET )
              zofnTZSIXSKO_BldXSKChildEnt( vKZSIXSKO_Root, vKZSIXSKO,
                   vTZZOXOD1, vTZTENVRO_Parent, nEntitySet );

      nRC2 = ResetViewFromSubobject( vTZZOXOD1 );
      if ( nSetViewToSubXsk )
      {
        nRC2 = ResetViewFromSubobject( vKZSIXSKO_Root );
        nSetViewToSubXsk = 0;
      }

      nRC  = SetCursorNextEntity( vTZZOXOD1, "CHILDENTITY", "" );
   }

   if ( vTZTENVRO_Parent )
      nRC = DropView( vTZTENVRO_Parent );

   return( 0 );
}
Beispiel #4
0
//:   VIEW vMappingOI
static zSHORT
oTZRPSRCO_GenerateXML_CtlRecurs( zVIEW     vReportDef,
                                 zVIEW     vSourceOI,
                                 zPCHAR    szDrivingObjectViewName,
                                 zPCHAR    szOutputLine,
                                 zLONG     lFileHandle,
                                 zPCHAR    szIndentationValue )
{
   zVIEW     vMappingOI = 0; 
   //:STRING ( 32 )   szEntityName
   zCHAR     szEntityName[ 33 ] = { 0 }; 
   //:STRING ( 32 )   szAttributeName
   zCHAR     szAttributeName[ 33 ] = { 0 }; 
   //:STRING ( 32 )   szMappingName
   zCHAR     szMappingName[ 33 ] = { 0 }; 
   //:STRING ( 32 )   szContextName
   zCHAR     szContextName[ 33 ] = { 0 }; 
   //:STRING ( 5000 ) szReturnedAttributeValue
   zCHAR     szReturnedAttributeValue[ 5001 ] = { 0 }; 
   //:STRING ( 5000 ) szConvertedAttributeValue
   zCHAR     szConvertedAttributeValue[ 5001 ] = { 0 }; 
   //:STRING ( 200 )  szMsg
   zCHAR     szMsg[ 201 ] = { 0 }; 
   zSHORT    RESULT; 
   zSHORT    lTempInteger_0; 
   zSHORT    lTempInteger_1; 
   zSHORT    lTempInteger_2; 


   //:// Generate an attribute entry for each attribute with mapping in the GroupSet. Note that these are all at the same
   //:// hierarchical level since we're assuming no tables within a GroupSet. However, the controls in the GroupSet may well be
   //:// organized hierarchically and must thus be processed recursively.

   //:// Sort the Controls in position order so they will be in the same order as in the XSLT. (This probably isn't
   //:// necessary, but it will simply debugging.)
   //:OrderEntityForView( vReportDef, "Control", "PSDLG_Y A PSDLG_X A" )
   OrderEntityForView( vReportDef, "Control", "PSDLG_Y A PSDLG_X A" );

   //:// Process each Control. The processing rule is simple:
   //:// If the control has mapping, build an XML node.
   //:// If the control doesn't have mapping, ignore it.
   //:// The only issue is that we must step down a level if the Control has a subcontrol.

   //:FOR EACH vReportDef.Control
   RESULT = SetCursorFirstEntity( vReportDef, "Control", "" );
   while ( RESULT > zCURSOR_UNCHANGED )
   { 
      //:IF vReportDef.CtrlCtrl EXISTS
      lTempInteger_0 = CheckExistenceOfEntity( vReportDef, "CtrlCtrl" );
      if ( lTempInteger_0 == 0 )
      { 
         //:SetViewToSubobject( vReportDef, "CtrlCtrl" )
         SetViewToSubobject( vReportDef, "CtrlCtrl" );
         //:GenerateXML_CtlRecurs( vReportDef, vSourceOI, szDrivingObjectViewName, szOutputLine, lFileHandle, szIndentationValue )
         oTZRPSRCO_GenerateXML_CtlRecurs( vReportDef, vSourceOI, szDrivingObjectViewName, szOutputLine, lFileHandle, szIndentationValue );
         //:ResetViewFromSubobject( vReportDef )
         ResetViewFromSubobject( vReportDef );
         //:ELSE
      } 
      else
      { 

         //:IF vReportDef.CtrlMapER_Attribute EXISTS
         lTempInteger_1 = CheckExistenceOfEntity( vReportDef, "CtrlMapER_Attribute" );
         if ( lTempInteger_1 == 0 )
         { 
            //:// Format XML Line for Attribute.
            //:szReturnedAttributeValue = ""
            ZeidonStringCopy( szReturnedAttributeValue, 1, 0, "", 1, 0, 5001 );
            //:szConvertedAttributeValue = ""
            ZeidonStringCopy( szConvertedAttributeValue, 1, 0, "", 1, 0, 5001 );
            //:szAttributeName = vReportDef.CtrlMapER_Attribute.Name
            GetVariableFromAttribute( szAttributeName, 0, 'S', 33, vReportDef, "CtrlMapER_Attribute", "Name", "", 0 );
            //:szEntityName    = vReportDef.CtrlMapRelatedEntity.Name
            GetVariableFromAttribute( szEntityName, 0, 'S', 33, vReportDef, "CtrlMapRelatedEntity", "Name", "", 0 );
            //:szContextName = ""
            ZeidonStringCopy( szContextName, 1, 0, "", 1, 0, 33 );
            //:IF vReportDef.CtrlMapContext EXISTS
            lTempInteger_2 = CheckExistenceOfEntity( vReportDef, "CtrlMapContext" );
            if ( lTempInteger_2 == 0 )
            { 
               //:szContextName = vReportDef.CtrlMapContext.Name  
               GetVariableFromAttribute( szContextName, 0, 'S', 33, vReportDef, "CtrlMapContext", "Name", "", 0 );
            } 

            //:END
            //:IF vReportDef.CtrlMapView.Name = szDrivingObjectViewName   // Check if mapping if from Driving Object View.
            if ( CompareAttributeToString( vReportDef, "CtrlMapView", "Name", szDrivingObjectViewName ) == 0 )
            { 
               //:GetStringFromAttributeByContext( szReturnedAttributeValue, vSourceOI, szEntityName, szAttributeName, szContextName, 5000 )
               GetStringFromAttributeByContext( szReturnedAttributeValue, vSourceOI, szEntityName, szAttributeName, szContextName, 5000 );
               //:ELSE
            } 
            else
            { 
               //:// Mapping is from separate view.
               //:szMappingName = vReportDef.CtrlMapView.Name
               GetVariableFromAttribute( szMappingName, 0, 'S', 33, vReportDef, "CtrlMapView", "Name", "", 0 );
               //:GET VIEW vMappingOI NAMED szMappingName
               RESULT = GetViewByName( &vMappingOI, szMappingName, vReportDef, zLEVEL_TASK );
               //:GetStringFromAttributeByContext( szReturnedAttributeValue, vMappingOI, szEntityName, szAttributeName, szContextName, 5000 )
               GetStringFromAttributeByContext( szReturnedAttributeValue, vMappingOI, szEntityName, szAttributeName, szContextName, 5000 );
            } 

            //:END

            //:ConvertXML_SpecialCharacters( vReportDef, szConvertedAttributeValue, szReturnedAttributeValue, 5000 )
            ConvertXML_SpecialCharacters( vReportDef, szConvertedAttributeValue, szReturnedAttributeValue, 5000 );

            //:szOutputLine = szIndentationValue + "  " + "<" + szEntityName + "." + szAttributeName + ">" + szConvertedAttributeValue
            ZeidonStringCopy( szOutputLine, 1, 0, szIndentationValue, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "  ", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "<", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, ".", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szAttributeName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, ">", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szConvertedAttributeValue, 1, 0, 5001 );
            //:szOutputLine = szOutputLine + "</" + szEntityName + "." + szAttributeName + ">"
            ZeidonStringConcat( szOutputLine, 1, 0, "</", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, ".", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szAttributeName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, ">", 1, 0, 5001 );
            //:GenerateXMLLine( vReportDef, lFileHandle, szOutputLine )
            oTZRPSRCO_GenerateXMLLine( vReportDef, lFileHandle, szOutputLine );
         } 


         //:END
      } 

      RESULT = SetCursorNextEntity( vReportDef, "Control", "" );
      //:END
   } 

   //:END
   return( 0 );
// END
} 
Beispiel #5
0
//:   STRING ( 32 ) szEntityName
zOPER_EXPORT zSHORT OPERATION
oTZRPSRCO_GenerateXML_LODRecurs( zVIEW     vReportDef,
                                 zVIEW     vReportDefRecurs,
                                 zVIEW     vSourceOI,
                                 zPCHAR    szOutputLine,
                                 zLONG     lFileHandle,
                                 zPCHAR    szIndentationValue )
{
   zCHAR     szEntityName[ 33 ] = { 0 }; 
   //:STRING ( 32 ) szDrivingViewName
   zCHAR     szDrivingViewName[ 33 ] = { 0 }; 
   //:STRING ( 50 ) szIndentationSubValue
   zCHAR     szIndentationSubValue[ 51 ] = { 0 }; 
   //:STRING ( 10 ) szCnt
   zCHAR     szCnt[ 11 ] = { 0 }; 
   //:SHORT nRC
   zSHORT    nRC = 0; 
   zSHORT    RESULT; 
   zSHORT    lTempInteger_0; 
   zSHORT    lTempInteger_1; 


   //:szDrivingViewName = vReportDef.DrivingViewObjRef.Name
   GetVariableFromAttribute( szDrivingViewName, 0, 'S', 33, vReportDef, "DrivingViewObjRef", "Name", "", 0 );

   //:// Build one level of the PartialReportEntity subobject, matching the structure of the Driving LOD and
   //:// setting the ReportDisplayFlag entity for any entity with a corresponding GroupSet entity in the report, or having
   //:// a PartialReportEntityChild entity with a corresponding GroupSet entity. The flag is set to "D" if the entity has
   //:// a corresponding GroupSet entity and to a "C" if it has a child with a corresponding GroupSet entity.

   //:FOR EACH vReportDefRecurs.PartialReportEntity 
   RESULT = SetCursorFirstEntity( vReportDefRecurs, "PartialReportEntity", "" );
   while ( RESULT > zCURSOR_UNCHANGED )
   { 

      //:szEntityName = vReportDefRecurs.PartialReportEntity.Name 
      GetVariableFromAttribute( szEntityName, 0, 'S', 33, vReportDefRecurs, "PartialReportEntity", "Name", "", 0 );
      //: 
      //:// If ReportDisplayFlag = "D" then this is an entity that is displayed on the report (there is a GroupSet).  
      //:// Otherwise, it's a parent entity where one of it's children is displayed on the report.                    
      //:IF vReportDefRecurs.PartialReportEntity.ReportDisplayFlag = "D"
      if ( CompareAttributeToString( vReportDefRecurs, "PartialReportEntity", "ReportDisplayFlag", "D" ) == 0 )
      { 

         //:SET CURSOR FIRST vReportDef.GroupSet WHERE vReportDef.GroupSet.Tag = szEntityName 
         RESULT = SetCursorFirstEntityByString( vReportDef, "GroupSet", "Tag", szEntityName, "" );
         //:IF RESULT < zCURSOR_SET
         if ( RESULT < zCURSOR_SET )
         { 
         } 

         //:   // There is an error because the report should have a GroupSet for this.          
         //:END

         //:nRC = SetCursorFirstEntity( vSourceOI, szEntityName, "" )
         nRC = SetCursorFirstEntity( vSourceOI, szEntityName, "" );

         //:// Process group header
         //:SET CURSOR FIRST vReportDef.Group WHERE vReportDef.Group.Type = "gh"
         RESULT = SetCursorFirstEntityByString( vReportDef, "Group", "Type", "gh", "" );
         //:IF RESULT >= zCURSOR_SET
         if ( RESULT >= zCURSOR_SET )
         { 
            //:szOutputLine = szIndentationValue + "   <" + szEntityName + "Header>"
            ZeidonStringCopy( szOutputLine, 1, 0, szIndentationValue, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "   <", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "Header>", 1, 0, 5001 );
            //:GenerateXMLLine( vReportDef, lFileHandle, szOutputLine )
            oTZRPSRCO_GenerateXMLLine( vReportDef, lFileHandle, szOutputLine );

            //:szIndentationSubValue = szIndentationValue + "      "
            ZeidonStringCopy( szIndentationSubValue, 1, 0, szIndentationValue, 1, 0, 51 );
            ZeidonStringConcat( szIndentationSubValue, 1, 0, "      ", 1, 0, 51 );
            //:GenerateXML_CtlRecurs( vReportDef, vSourceOI, szDrivingViewName, szOutputLine, lFileHandle, szIndentationSubValue )
            oTZRPSRCO_GenerateXML_CtlRecurs( vReportDef, vSourceOI, szDrivingViewName, szOutputLine, lFileHandle, szIndentationSubValue );

            //:szOutputLine = szIndentationValue + "   </" + szEntityName + "Header>"
            ZeidonStringCopy( szOutputLine, 1, 0, szIndentationValue, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "   </", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "Header>", 1, 0, 5001 );
            //:GenerateXMLLine( vReportDef, lFileHandle, szOutputLine )
            oTZRPSRCO_GenerateXMLLine( vReportDef, lFileHandle, szOutputLine );
         } 

         //:END

         //:// Go to generate an attribute entry for each attribute with mapping in the Detail Group of the GroupSet.
         //:SET CURSOR FIRST vReportDef.Group WHERE vReportDef.Group.Type = "ga"
         RESULT = SetCursorFirstEntityByString( vReportDef, "Group", "Type", "ga", "" );
         //:IF RESULT >= zCURSOR_SET
         if ( RESULT >= zCURSOR_SET )
         { 
            //:         
            //:// Loop through vSourceOI for each entity
            //:LOOP WHILE nRC >= zCURSOR_SET                     
            while ( nRC >= zCURSOR_SET )
            { 

               //:szOutputLine = szIndentationValue + "   <" + szEntityName + ">"
               ZeidonStringCopy( szOutputLine, 1, 0, szIndentationValue, 1, 0, 5001 );
               ZeidonStringConcat( szOutputLine, 1, 0, "   <", 1, 0, 5001 );
               ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
               ZeidonStringConcat( szOutputLine, 1, 0, ">", 1, 0, 5001 );
               //:GenerateXMLLine( vReportDef, lFileHandle, szOutputLine )
               oTZRPSRCO_GenerateXMLLine( vReportDef, lFileHandle, szOutputLine );
               //:szIndentationSubValue = szIndentationValue + "   "
               ZeidonStringCopy( szIndentationSubValue, 1, 0, szIndentationValue, 1, 0, 51 );
               ZeidonStringConcat( szIndentationSubValue, 1, 0, "   ", 1, 0, 51 );

               //:GenerateXML_CtlRecurs( vReportDef, vSourceOI, szDrivingViewName, szOutputLine, lFileHandle, szIndentationSubValue )
               oTZRPSRCO_GenerateXML_CtlRecurs( vReportDef, vSourceOI, szDrivingViewName, szOutputLine, lFileHandle, szIndentationSubValue );

               //:// Check to see if there are child entities.
               //:IF vReportDefRecurs.PartialReportEntityChild EXISTS
               lTempInteger_0 = CheckExistenceOfEntity( vReportDefRecurs, "PartialReportEntityChild" );
               if ( lTempInteger_0 == 0 )
               { 

                  //:SetViewToSubobject( vReportDefRecurs, "PartialReportEntityChild" )
                  SetViewToSubobject( vReportDefRecurs, "PartialReportEntityChild" );
                  //:szIndentationSubValue = szIndentationValue + "      "
                  ZeidonStringCopy( szIndentationSubValue, 1, 0, szIndentationValue, 1, 0, 51 );
                  ZeidonStringConcat( szIndentationSubValue, 1, 0, "      ", 1, 0, 51 );
                  //:nRC = GenerateXML_LODRecurs( vReportDef,
                  //:                             vReportDefRecurs, vSourceOI, szOutputLine, lFileHandle, szIndentationSubValue )
                  nRC = oTZRPSRCO_GenerateXML_LODRecurs( vReportDef, vReportDefRecurs, vSourceOI, szOutputLine, lFileHandle, szIndentationSubValue );
                  //:ResetViewFromSubobject( vReportDefRecurs )
                  ResetViewFromSubobject( vReportDefRecurs );

                  //:// We need to reset on the report GroupSet/Group because it has been changed when we go down levels.
                  //:SET CURSOR FIRST vReportDef.GroupSet WHERE vReportDef.GroupSet.Tag = szEntityName
                  RESULT = SetCursorFirstEntityByString( vReportDef, "GroupSet", "Tag", szEntityName, "" );
                  //:SET CURSOR FIRST vReportDef.Group WHERE vReportDef.Group.Type = "ga"
                  RESULT = SetCursorFirstEntityByString( vReportDef, "Group", "Type", "ga", "" );
               } 

               //:END

               //:// End of checking for child entities...               
               //:szOutputLine = szIndentationValue + "   </" + szEntityName + ">"
               ZeidonStringCopy( szOutputLine, 1, 0, szIndentationValue, 1, 0, 5001 );
               ZeidonStringConcat( szOutputLine, 1, 0, "   </", 1, 0, 5001 );
               ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
               ZeidonStringConcat( szOutputLine, 1, 0, ">", 1, 0, 5001 );
               //:GenerateXMLLine( vReportDef, lFileHandle, szOutputLine )
               oTZRPSRCO_GenerateXMLLine( vReportDef, lFileHandle, szOutputLine );

               //:nRC = SetCursorNextEntity( vSourceOI, szEntityName, "" )
               nRC = SetCursorNextEntity( vSourceOI, szEntityName, "" );
            } 

            //:END
         } 

         //:END

         //:// Process group footer.
         //:SET CURSOR FIRST vReportDef.Group WHERE vReportDef.Group.Type = "gf"
         RESULT = SetCursorFirstEntityByString( vReportDef, "Group", "Type", "gf", "" );
         //:IF RESULT >= zCURSOR_SET
         if ( RESULT >= zCURSOR_SET )
         { 
            //:szOutputLine = szIndentationValue + "   <" + szEntityName + "Footer>"
            ZeidonStringCopy( szOutputLine, 1, 0, szIndentationValue, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "   <", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "Footer>", 1, 0, 5001 );
            //:GenerateXMLLine( vReportDef, lFileHandle, szOutputLine )
            oTZRPSRCO_GenerateXMLLine( vReportDef, lFileHandle, szOutputLine );

            //:szIndentationSubValue = szIndentationValue + "      "
            ZeidonStringCopy( szIndentationSubValue, 1, 0, szIndentationValue, 1, 0, 51 );
            ZeidonStringConcat( szIndentationSubValue, 1, 0, "      ", 1, 0, 51 );
            //:GenerateXML_CtlRecurs( vReportDef, vSourceOI, szEntityName, szOutputLine, lFileHandle, szIndentationSubValue )
            oTZRPSRCO_GenerateXML_CtlRecurs( vReportDef, vSourceOI, szEntityName, szOutputLine, lFileHandle, szIndentationSubValue );
            //:szOutputLine = szIndentationValue + "   </" + szEntityName + "Footer>"
            ZeidonStringCopy( szOutputLine, 1, 0, szIndentationValue, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "   </", 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, szEntityName, 1, 0, 5001 );
            ZeidonStringConcat( szOutputLine, 1, 0, "Footer>", 1, 0, 5001 );
            //:GenerateXMLLine( vReportDef, lFileHandle, szOutputLine )
            oTZRPSRCO_GenerateXMLLine( vReportDef, lFileHandle, szOutputLine );
         } 

         //:END

         //:ELSE
      } 
      else
      { 
         //:// Maybe the parent isn't being displayed but a child might be, so we need to check...
         //:      
         //:// Loop through vSourceOI for each entity
         //:nRC = SetCursorFirstEntity( vSourceOI, szEntityName, "" )
         nRC = SetCursorFirstEntity( vSourceOI, szEntityName, "" );
         //:LOOP WHILE nRC >= zCURSOR_SET                     
         while ( nRC >= zCURSOR_SET )
         { 
            //:IF vReportDefRecurs.PartialReportEntityChild EXISTS
            lTempInteger_1 = CheckExistenceOfEntity( vReportDefRecurs, "PartialReportEntityChild" );
            if ( lTempInteger_1 == 0 )
            { 

               //:SetViewToSubobject( vReportDefRecurs, "PartialReportEntityChild" )
               SetViewToSubobject( vReportDefRecurs, "PartialReportEntityChild" );
               //:szIndentationSubValue = szIndentationValue + "      "
               ZeidonStringCopy( szIndentationSubValue, 1, 0, szIndentationValue, 1, 0, 51 );
               ZeidonStringConcat( szIndentationSubValue, 1, 0, "      ", 1, 0, 51 );
               //:nRC = GenerateXML_LODRecurs( vReportDef,
               //:                             vReportDefRecurs, vSourceOI, szOutputLine, lFileHandle, szIndentationSubValue )
               nRC = oTZRPSRCO_GenerateXML_LODRecurs( vReportDef, vReportDefRecurs, vSourceOI, szOutputLine, lFileHandle, szIndentationSubValue );
               //:ResetViewFromSubobject( vReportDefRecurs )
               ResetViewFromSubobject( vReportDefRecurs );
            } 

            //:   
            //:END
            //:nRC = SetCursorNextEntity( vSourceOI, szEntityName, "" )
            nRC = SetCursorNextEntity( vSourceOI, szEntityName, "" );
         } 

         //:END
      } 

      RESULT = SetCursorNextEntity( vReportDefRecurs, "PartialReportEntity", "" );
      //:END
   } 

   //:   
   //:END  // FOR EACH vReportDefRecurs.PartialReportEntity 
   return( 0 );
// END
} 
Beispiel #6
0
//:   VIEW OldOperGrp  BASED ON LOD TZOGSRCO
zOPER_EXPORT zSHORT OPERATION
oTZOGSRCO_GlobalOperGrpMigrate( zVIEW     NewOperGrp,
                                zPCHAR    OperGroupMetaName,
                                zVIEW     SourceLPLR,
                                zVIEW     vSubtask )
{
   zVIEW     OldOperGrp = 0; 
   //:VIEW CurrentLPLR BASED ON LOD TZCMLPLO
   zVIEW     CurrentLPLR = 0; 

   //:STRING ( 513 ) SourceFileName                    // size according to zMAX_FILESPEC+1
   zCHAR     SourceFileName[ 514 ] = { 0 }; 
   //:STRING ( 513 ) SourceFileName2                   // size according to zMAX_FILESPEC+1
   zCHAR     SourceFileName2[ 514 ] = { 0 }; 
   //:STRING ( 36 ) SourceName
   zCHAR     SourceName[ 37 ] = { 0 }; 
   zSHORT    lTempInteger_0; 
   zSHORT    RESULT; 
   zCHAR     szTempString_0[ 33 ]; 


   //:// Activate existing source meta OldOperGroup
   //:SourceFileName = SourceLPLR.LPLR.MetaSrcDir + "\" + OperGroupMetaName + ".POG"
   GetStringFromAttribute( SourceFileName, SourceLPLR, "LPLR", "MetaSrcDir" );
   ZeidonStringConcat( SourceFileName, 1, 0, "\\", 1, 0, 514 );
   ZeidonStringConcat( SourceFileName, 1, 0, OperGroupMetaName, 1, 0, 514 );
   ZeidonStringConcat( SourceFileName, 1, 0, ".POG", 1, 0, 514 );
   //:// zIGNORE_ATTRIB_ERRORS=8192
   //:ActivateOI_FromFile( OldOperGrp, "TZOGSRCO", SourceLPLR,
   //:                     SourceFileName, zSINGLE + 8192 )
   ActivateOI_FromFile( &OldOperGrp, "TZOGSRCO", SourceLPLR, SourceFileName, zSINGLE + 8192 );
   //:NAME VIEW OldOperGrp "OldOperGrp"
   SetNameForView( OldOperGrp, "OldOperGrp", 0, zLEVEL_TASK );
   //://ActivateEmptyMetaOI( vSubtask, NewOperGrp, 14, zSINGLE ) // 14 is zSOURCE_GOPGRP_META
   //://NAME VIEW NewOperGrp "NewOperGrp"

   //:IF NewOperGrp.GlobalOperationGroup DOES NOT EXIST
   lTempInteger_0 = CheckExistenceOfEntity( NewOperGrp, "GlobalOperationGroup" );
   if ( lTempInteger_0 != 0 )
   { 

      //:// The Global Operation Group does not exist in the target, so simply copy everything over.

      //:CreateMetaEntity( vSubtask, NewOperGrp, "GlobalOperationGroup", zPOS_AFTER )
      CreateMetaEntity( vSubtask, NewOperGrp, "GlobalOperationGroup", zPOS_AFTER );
      //:SetMatchingAttributesByName( NewOperGrp, "GlobalOperationGroup", OldOperGrp, "GlobalOperationGroup", zSET_NULL )
      SetMatchingAttributesByName( NewOperGrp, "GlobalOperationGroup", OldOperGrp, "GlobalOperationGroup", zSET_NULL );

      //:// Copy over the source file to the new LPLR directory, if there is a source file.
      //:// We will assume a source file exists if the SourceFile.Extension is not null.  If there
      //:// is actually no source file, the CopyFile does no harm.
      //:IF OldOperGrp.GlobalOperationGroup.Extension != ""
      if ( CompareAttributeToString( OldOperGrp, "GlobalOperationGroup", "Extension", "" ) != 0 )
      { 
         //:RetrieveViewForMetaList( vSubtask, CurrentLPLR, zSOURCE_ERD_META ) // Get view for directory info.
         RetrieveViewForMetaList( vSubtask, &CurrentLPLR, zSOURCE_ERD_META );
         //:ResetViewFromSubobject( CurrentLPLR )
         ResetViewFromSubobject( CurrentLPLR );
         //:IF OldOperGrp.GlobalOperationGroup.Extension = "C"
         if ( CompareAttributeToString( OldOperGrp, "GlobalOperationGroup", "Extension", "C" ) == 0 )
         { 
            //:SourceName = OperGroupMetaName + ".C"
            ZeidonStringCopy( SourceName, 1, 0, OperGroupMetaName, 1, 0, 37 );
            ZeidonStringConcat( SourceName, 1, 0, ".C", 1, 0, 37 );
            //:ELSE
         } 
         else
         { 
            //:SourceName = OperGroupMetaName + ".VML"
            ZeidonStringCopy( SourceName, 1, 0, OperGroupMetaName, 1, 0, 37 );
            ZeidonStringConcat( SourceName, 1, 0, ".VML", 1, 0, 37 );
         } 

         //:END
         //:SourceFileName = SourceLPLR.LPLR.PgmSrcDir + "\" + SourceName
         GetStringFromAttribute( SourceFileName, SourceLPLR, "LPLR", "PgmSrcDir" );
         ZeidonStringConcat( SourceFileName, 1, 0, "\\", 1, 0, 514 );
         ZeidonStringConcat( SourceFileName, 1, 0, SourceName, 1, 0, 514 );
         //:SourceFileName2 = CurrentLPLR.LPLR.PgmSrcDir + "\" + SourceName
         GetStringFromAttribute( SourceFileName2, CurrentLPLR, "LPLR", "PgmSrcDir" );
         ZeidonStringConcat( SourceFileName2, 1, 0, "\\", 1, 0, 514 );
         ZeidonStringConcat( SourceFileName2, 1, 0, SourceName, 1, 0, 514 );
         //:SysCopyFile( vSubtask, SourceFileName, SourceFileName2, TRUE )
         SysCopyFile( vSubtask, SourceFileName, SourceFileName2, TRUE );
         //:DropMetaOI( vSubtask, CurrentLPLR )
         DropMetaOI( vSubtask, CurrentLPLR );
      } 

      //:END

      //:FOR EACH OldOperGrp.Operation
      RESULT = SetCursorFirstEntity( OldOperGrp, "Operation", "" );
      while ( RESULT > zCURSOR_UNCHANGED )
      { 

         //:CreateMetaEntity( vSubtask, NewOperGrp, "Operation", zPOS_AFTER )
         CreateMetaEntity( vSubtask, NewOperGrp, "Operation", zPOS_AFTER );
         //:SetMatchingAttributesByName ( NewOperGrp, "Operation", OldOperGrp,
         //:                              "Operation", zSET_NULL )
         SetMatchingAttributesByName( NewOperGrp, "Operation", OldOperGrp, "Operation", zSET_NULL );

         //:FOR EACH OldOperGrp.Parameter
         RESULT = SetCursorFirstEntity( OldOperGrp, "Parameter", "" );
         while ( RESULT > zCURSOR_UNCHANGED )
         { 
            //:// Make sure the ShortDesc in the Parameter is not null.
            //:IF OldOperGrp.Parameter.ShortDesc = ""
            if ( CompareAttributeToString( OldOperGrp, "Parameter", "ShortDesc", "" ) == 0 )
            { 
               //:OldOperGrp.Parameter.ShortDesc = "Parm"
               SetAttributeFromString( OldOperGrp, "Parameter", "ShortDesc", "Parm" );
            } 

            //:END
            //:CreateMetaEntity( vSubtask, NewOperGrp, "Parameter", zPOS_AFTER )
            CreateMetaEntity( vSubtask, NewOperGrp, "Parameter", zPOS_AFTER );
            //:SetMatchingAttributesByName( NewOperGrp, "Parameter", OldOperGrp,
            //:                             "Parameter", zSET_NULL )
            SetMatchingAttributesByName( NewOperGrp, "Parameter", OldOperGrp, "Parameter", zSET_NULL );
            RESULT = SetCursorNextEntity( OldOperGrp, "Parameter", "" );
         } 

         RESULT = SetCursorNextEntity( OldOperGrp, "Operation", "" );
         //:END
      } 


      //:END

      //:ELSE
   } 
   else
   { 

      //:// The Global Operation Group exists in the target, so merge in any new Operations.
      //:// We will force over any Operations (both prototype and code) for any Operations not flagged as modified in target LPLR.

      //:FOR EACH OldOperGrp.Operation
      RESULT = SetCursorFirstEntity( OldOperGrp, "Operation", "" );
      while ( RESULT > zCURSOR_UNCHANGED )
      { 

         //:SET CURSOR FIRST NewOperGrp.Operation WHERE NewOperGrp.Operation.Name = OldOperGrp.Operation.Name
         GetStringFromAttribute( szTempString_0, OldOperGrp, "Operation", "Name" );
         RESULT = SetCursorFirstEntityByString( NewOperGrp, "Operation", "Name", szTempString_0, "" );
         //:IF RESULT < zCURSOR_SET
         if ( RESULT < zCURSOR_SET )
         { 
            //:CreateMetaEntity( vSubtask, NewOperGrp, "Operation", zPOS_AFTER )
            CreateMetaEntity( vSubtask, NewOperGrp, "Operation", zPOS_AFTER );
            //:SetMatchingAttributesByName ( NewOperGrp, "Operation", OldOperGrp, "Operation", zSET_NULL )
            SetMatchingAttributesByName( NewOperGrp, "Operation", OldOperGrp, "Operation", zSET_NULL );
         } 

         //:END

         //:// If the operation is new or modifiable, set new parameters and operation code.
         //:IF NewOperGrp.Operation.DoNotMergeFlag = ""
         if ( CompareAttributeToString( NewOperGrp, "Operation", "DoNotMergeFlag", "" ) == 0 )
         { 
            //:FOR EACH NewOperGrp.Parameter
            RESULT = SetCursorFirstEntity( NewOperGrp, "Parameter", "" );
            while ( RESULT > zCURSOR_UNCHANGED )
            { 
               //:DELETE ENTITY NewOperGrp.Parameter NONE
               RESULT = DeleteEntity( NewOperGrp, "Parameter", zREPOS_NONE );
               RESULT = SetCursorNextEntity( NewOperGrp, "Parameter", "" );
            } 

            //:END
            //:FOR EACH OldOperGrp.Parameter
            RESULT = SetCursorFirstEntity( OldOperGrp, "Parameter", "" );
            while ( RESULT > zCURSOR_UNCHANGED )
            { 
               //:// Make sure the ShortDesc in the Parameter is not null.
               //:IF OldOperGrp.Parameter.ShortDesc = ""
               if ( CompareAttributeToString( OldOperGrp, "Parameter", "ShortDesc", "" ) == 0 )
               { 
                  //:OldOperGrp.Parameter.ShortDesc = "Parm"
                  SetAttributeFromString( OldOperGrp, "Parameter", "ShortDesc", "Parm" );
               } 

               //:END
               //:CreateMetaEntity( vSubtask, NewOperGrp, "Parameter", zPOS_AFTER )
               CreateMetaEntity( vSubtask, NewOperGrp, "Parameter", zPOS_AFTER );
               //:SetMatchingAttributesByName( NewOperGrp, "Parameter", OldOperGrp, "Parameter", zSET_NULL )
               SetMatchingAttributesByName( NewOperGrp, "Parameter", OldOperGrp, "Parameter", zSET_NULL );
               RESULT = SetCursorNextEntity( OldOperGrp, "Parameter", "" );
            } 

            //:END
         } 

         RESULT = SetCursorNextEntity( OldOperGrp, "Operation", "" );

         //:   // Add new Operation Code.
         //:   // CopyOperationCode

         //:END
      } 


      //:END
   } 


   //:END



   //:DropObjectInstance( OldOperGrp )
   DropObjectInstance( OldOperGrp );
   //:CommitMetaOI( vSubtask, NewOperGrp, 14 )   // 14 is zSOURCE_GOPGRP_META
   CommitMetaOI( vSubtask, NewOperGrp, 14 );

   //:// Build the prototypes in zeidon.h file.
   //:RetrieveViewForMetaList( vSubtask, CurrentLPLR, zSOURCE_GOPGRP_META ) // Get view for Merge oper.
   RetrieveViewForMetaList( vSubtask, &CurrentLPLR, zSOURCE_GOPGRP_META );
   //:ResetViewFromSubobject( CurrentLPLR )
   ResetViewFromSubobject( CurrentLPLR );
   //:MergeGlobalPrototypes( NewOperGrp,
   //:                       NewOperGrp.GlobalOperationGroup.Name,
   //:                       "GlobalOperationGroup",
   //:                       CurrentLPLR )
   GetStringFromAttribute( szTempString_0, NewOperGrp, "GlobalOperationGroup", "Name" );
   MergeGlobalPrototypes( NewOperGrp, szTempString_0, "GlobalOperationGroup", CurrentLPLR );
   //:DropMetaOI( vSubtask, CurrentLPLR )
   DropMetaOI( vSubtask, CurrentLPLR );
   return( 0 );
// END
} 
Beispiel #7
0
/////////////////////////////////////////////////////////////////////////////
//
//  CONSTRUCTOR: Tab sub-control (to group controls at the tab level)
//
/////////////////////////////////////////////////////////////////////////////
// ctor
TZNotePage::TZNotePage( TZPainterWindow *pPainterWindow,
                        TZPainterCtrl   *pCtrlParent,
                        CWnd    *pWndParent,
                        CRect&  rect,
                        zVIEW   vCtrl,
                        zLONG   lType,
                        zBOOL   bPlaceHolder,
                        zLONG   lZKey,
                        zLONG   lTabStopNbr,
                        zLONG   lCtrlID,
                        zPCHAR  pchTag,
                        zPCHAR  pchText ) :
            CWnd( ),
            TZPainterCtrl( pPainterWindow, pCtrlParent, pWndParent,
                           rect, vCtrl, this, pchTag, pchText,
                           lType, bPlaceHolder, lZKey, lTabStopNbr, lCtrlID )
{
#ifdef DEBUG_ALL
   TraceLineS( "TZNotePage::ctor ", m_csTag );
#endif
   m_pNext = 0;
   m_uVisible = 0x0100;

   m_lSubtype = 0;

   m_pZNoteBook = DYNAMIC_DOWNCAST( TZNoteBook, pWndParent );
   if ( m_pZNoteBook == 0 )
      return;

   zPCHAR pch;
   zLONG  lTabNbr;
   zLONG  lLth;

   if ( vCtrl )
   {
      GetAddrForAttribute( &pch, vCtrl, szlControl, szlText );
      lLth = zstrlen( pch ) + 1;
      m_pchCaption = new char[ lLth ];
      strcpy_s( m_pchCaption, lLth, pch );
      GetIntegerFromAttribute( &lTabNbr, vCtrl, szlControl, szlType );
      if ( lTabNbr == 0 )
      {
         zVIEW vTemp;

         m_pZNoteBook->m_nTabNbrMax++;
         CreateViewFromViewForTask( &vTemp, vCtrl, pPainterWindow->m_vDialog );
         ResetViewFromSubobject( vTemp );
         while ( SetCursorFirstEntityByInteger( vTemp, szlCtrlCtrl, szlType,
                                                m_pZNoteBook->m_nTabNbrMax, 0 ) == zCURSOR_SET )
         {
            m_pZNoteBook->m_nTabNbrMax++;
         }

         SetAttributeFromInteger( vCtrl, szlControl, szlType, m_pZNoteBook->m_nTabNbrMax );
         m_lSubtype = m_pZNoteBook->m_nTabNbrMax;
         DropView( vTemp );
      }
      else
      {
         if ( lTabNbr > m_pZNoteBook->m_nTabNbrMax )
            m_pZNoteBook->m_nTabNbrMax = (zSHORT) lTabNbr;

         m_lSubtype = m_pZNoteBook->m_nTabNbrMax;
      }

      if ( MiGetUpdateForView( vCtrl ) > 0 )
      {
         SetAttributeFromAttribute( vCtrl, szlControl, szlSyncKey, vCtrl, szlControl, szlType );
      }
   }
   else
   {
      m_pZNoteBook->m_nTabNbrMax++;
      m_lSubtype = m_pZNoteBook->m_nTabNbrMax;
      lTabNbr = m_pZNoteBook->m_nTabNbrMax;
      lLth = zstrlen( pchText ) + 1;
      m_pchCaption = new char[ lLth ];
      strcpy_s( m_pchCaption, lLth, pchText );
   }

// TraceRect( "TabCtl rect ", rect );
// TraceLineI( "    Attr.X ", Attr.X );
// TraceLineI( "    Attr.Y ", Attr.Y );
// TraceLineI( "    Attr.W ", Attr.W );
// TraceLineI( "    Attr.H ", Attr.H );

   // Build sub-controls on demand (only when visible or selectable).
   m_bBuildOnDemand = TRUE;

   if ( m_pZNoteBook->m_pZNotePage )
   {
      m_nTabIdx = 1;
      TZNotePage *pCurrNotePage = m_pZNoteBook->m_pZNotePage;
      while ( pCurrNotePage->m_pNext )
      {
         m_nTabIdx++;
         pCurrNotePage = pCurrNotePage->m_pNext;
      }

      pCurrNotePage->m_pNext = this;
   }
   else
   {
      m_nTabIdx = 0;
      m_pZNoteBook->m_pZNotePage = this;
   }

// m_nTabNbr = (zSHORT) lTabNbr;
   m_nTabNbr = m_nTabIdx + 1;
   m_pZNoteBook->m_nPageCnt++;

   TC_ITEM TabCtrlItem;
   TabCtrlItem.mask = TCIF_TEXT;
   TabCtrlItem.pszText = m_pchCaption;
#ifdef DEBUG_ALL
   TraceLineS( "Adding TabCtrlItem: ", m_pchCaption );
#endif
   m_pZNoteBook->InsertItem( m_nTabIdx, &TabCtrlItem );

//?Attr.StyleEx = WS_EX_TRANSPARENT;
//?Attr.Style &= ~(WS_CLIPSIBLINGS | WS_CLIPCHILDREN);

   CreateZ( );
}