コード例 #1
0
ファイル: tzbrau2o.c プロジェクト: DeegC/10d
//:   STRING(60)  szText
zOPER_EXPORT zSHORT OPERATION
oTZBRAU2O_DeletedText( zVIEW     ViewtoInstance,
                       LPVIEWENTITY InternalEntityStructure,
                       LPVIEWATTRIB InternalAttribStructure,
                       zSHORT    GetOrSetFlag )
{
   zCHAR     szText[ 61 ] = { 0 }; 


   //:CASE GetOrSetFlag
   switch( GetOrSetFlag )
   { 
      //:OF   zDERIVED_GET:
      case zDERIVED_GET :
         //:IF ViewtoInstance.AuditTrailMeta.bDeleted = "Y"
         if ( CompareAttributeToString( ViewtoInstance, "AuditTrailMeta", "bDeleted", "Y" ) == 0 )
         { 
            //: szText = "Deleted"
            ZeidonStringCopy( szText, 1, 0, "Deleted", 1, 0, 61 );
            //:ELSE
         } 
         else
         { 
            //: IF ViewtoInstance.AuditTrailMeta.bDeleted = "N"
            if ( CompareAttributeToString( ViewtoInstance, "AuditTrailMeta", "bDeleted", "N" ) == 0 )
            { 
               //: szText = "Updated"
               ZeidonStringCopy( szText, 1, 0, "Updated", 1, 0, 61 );
               //:ELSE
            } 
            else
            { 
               //: szText = ""
               ZeidonStringCopy( szText, 1, 0, "", 1, 0, 61 );
            } 

            //: END
         } 

         //: END
         //:StoreValueInRecord( ViewtoInstance,
         //:                   InternalEntityStructure,
         //:                   InternalAttribStructure,
         //:                    szText, 0 )
         StoreValueInRecord( ViewtoInstance, InternalEntityStructure, InternalAttribStructure, szText, 0 );
         break ;

      //:  /* end zDERIVED_GET */
      //:OF   zDERIVED_SET:
      case zDERIVED_SET :
         break ;
   } 


   //:     /* end zDERIVED_SET */
   //:END  /* case */
   return( 0 );
// END
} 
コード例 #2
0
ファイル: tzpnupgd.c プロジェクト: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
UpgradeAction( zVIEW    vSubtask,
               zVIEW    OrigW )
{
#if 0
   zSHORT   RESULT;
   zCHAR    szTempString_0[ 33 ];
   zSHORT   nZRetCode;

   if ( CompareAttributeToString( OrigW, "Action", "OperName", "" ) != 0 )
   {
      nZRetCode = GetStringFromAttribute( szTempString_0, OrigW, "Action", "OperName" );
      RESULT = SetCursorFirstEntityByString( OrigW, "Operation", "Name", szTempString_0, "" );
      if ( RESULT < 0 )
      {
         nZRetCode = CreateMetaEntity( vSubtask, OrigW, "Operation", zPOS_AFTER );
         SetAttributeFromAttribute( OrigW, "Operation", "Name", OrigW, "Action", "OperName" );
         nZRetCode = IncludeSubobjectFromSubobject( OrigW, "SourceFileOfOperation", OrigW, "SourceFile", zPOS_AFTER );
         SetAttributeFromString( OrigW, "Action", "OperName", "");
      }
      nZRetCode = IncludeSubobjectFromSubobject( OrigW, "ActOper", OrigW, "Operation", zPOS_AFTER );
      SetAttributeFromString( OrigW, "Action", "OperName", "");
   }
#endif
   return( 0 );
}
コード例 #3
0
ファイル: tzpnupgd.c プロジェクト: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
UpgradeCtrlMap( zVIEW    vSubtask,
                zVIEW    OrigW,
                zVIEW    OrigWC )
{
#if 0
   zLONG    lTempInteger_0;
   zSHORT   RESULT;
   zCHAR    szTempString_0[ 33 ];
   zSHORT   nZRetCode;
   zLONG    lTempInteger_1;
   zLONG    lTempInteger_2;

   lTempInteger_0 = CheckExistenceOfEntity( OrigWC, "CtrlMapView" );
   if ( lTempInteger_0 >= 0 )
   {
      nZRetCode = GetStringFromAttribute( szTempString_0, OrigWC, "CtrlMapView", "Name" );
      RESULT = SetCursorFirstEntityByString( OrigW, "ViewObjRef", "Name", szTempString_0, "" );
   }
   else
   {
      if ( CompareAttributeToString ( OrigWC, "CtrlMap", "X_ViewName", "" ) != 0 )
      {
         nZRetCode = GetStringFromAttribute( szTempString_0, OrigWC, "CtrlMap", "X_ViewName" );
         RESULT = SetCursorFirstEntityByString( OrigW, "ViewObjRef", "Name", szTempString_0, "" );
      }
   }
   lTempInteger_1 = CheckExistenceOfEntity( OrigWC, "CtrlMapView" );
   if ( lTempInteger_1 < 0 && CompareAttributeToString ( OrigWC, "CtrlMap", "X_ViewName", "" ) != 0 )
   {
      nZRetCode = IncludeSubobjectFromSubobject( OrigWC, "CtrlMapView", OrigW, "ViewObjRef", zPOS_AFTER );
   }
   lTempInteger_2 = CheckExistenceOfEntity( OrigWC, "CtrlMapLOD_Attribute" );
   if ( lTempInteger_2 < 0 && CompareAttributeToString ( OrigWC, "CtrlMap", "X_AttributeName", "" ) != 0 )
   {
      nZRetCode = IncludeAttributeMapping( vSubtask, OrigW, OrigWC );
   }
   nZRetCode = SetAttributeFromString( OrigWC, "CtrlMap", "X_ViewName", "" );
   nZRetCode = SetAttributeFromString( OrigWC, "CtrlMap", "X_EntityName", "" );
   nZRetCode = SetAttributeFromString( OrigWC, "CtrlMap", "X_AttributeName", "" );
   nZRetCode = SetAttributeFromString( OrigWC, "CtrlMap", "X_Context", "" );
#endif
   return( 0 );
}
コード例 #4
0
ファイル: tzedcwzd.c プロジェクト: DeegC/ZeidonTools
zOPER_EXPORT zSHORT OPERATION
VML_Postbuild( zVIEW vSubtask )
{
   zVIEW  vProfileXFER;

   // Call postbuild routine in ZEDITOR to reposition the window.
   fnCallEditorOperation( vSubtask, "VML_Postbuild" );

   GetProfileView( &vProfileXFER );

   // Set the default values of the Show... attributes.
   if ( CompareAttributeToString( vProfileXFER,
                                  "ED", "VML_ShowDeclarations", "" ) == 0 )
   {
      SetAttributeFromString( vProfileXFER, "ED", "VML_ShowDeclarations", "Y" );
   }

   if ( CompareAttributeToString( vProfileXFER,
                                  "ED", "VML_ShowControlStatements", "" ) == 0 )
   {
      SetAttributeFromString( vProfileXFER, "ED", "VML_ShowControlStatements", "Y" );
   }

   if ( CompareAttributeToString( vProfileXFER,
                                  "ED", "VML_ShowViewStatements", "" ) == 0 )
   {
      SetAttributeFromString( vProfileXFER, "ED", "VML_ShowViewStatements", "Y" );
   }

   if ( CompareAttributeToString( vProfileXFER,
                                  "ED", "VML_ShowEntityStatements", "" ) == 0 )
   {
      SetAttributeFromString( vProfileXFER, "ED", "VML_ShowEntityStatements", "Y" );
   }

   if ( CompareAttributeToString( vProfileXFER,
                                  "ED", "VML_ShowOperators", "" ) == 0 )
   {
      SetAttributeFromString( vProfileXFER, "ED", "VML_ShowOperators", "Y" );
   }

   if ( CompareAttributeToString( vProfileXFER,
                                  "ED", "VML_ShowOther", "" ) == 0 )
   {
      SetAttributeFromString( vProfileXFER, "ED", "VML_ShowOther", "Y" );
   }

   if ( CompareAttributeToString( vProfileXFER,
                                  "ED", "VML_InsertFull", "" ) == 0 )
   {
      SetAttributeFromString( vProfileXFER, "ED", "VML_InsertFull", "Y" );
   }

   VML_DisplayList( vSubtask );

   return( 0 );

} // VML_BuildTextList
コード例 #5
0
ファイル: tzpnupgd.c プロジェクト: arksoftgit/10c
zOPER_EXPORT zSHORT OPERATION
IncludeAttributeMapping( zVIEW    vSubtask,
                         zVIEW    OrigW,
                         zVIEW    OrigWC )
{
#if 0
   zVIEW    vLOD;
   zVIEW    LOD_List;
   zVIEW    vDomain;
   zVIEW    DomainList;
   zSHORT   nZRetCode;
   zSHORT   RESULT;
   zCHAR    szTempString_0[ 33 ];

   RetrieveViewForMetaList( vSubtask, &LOD_List, zREFER_LOD_META );
   GetStringFromAttribute( szTempString_0, OrigW, "LOD", "Name" );
   SetCursorFirstEntityByString( LOD_List, "W_MetaDef", "Name", szTempString_0, "" );
   ActivateMetaOI( vSubtask, &vLOD, LOD_List, zREFER_LOD_META, zSINGLE );
   GetStringFromAttribute( szTempString_0, OrigWC, "CtrlMap", "X_EntityName" );
   RESULT = SetCursorFirstEntityByString( vLOD, "LOD_Entity", "Name", szTempString_0, "" );
   if ( RESULT >= 0 )
   {
      nZRetCode = GetStringFromAttribute( szTempString_0, OrigWC, "CtrlMap", "X_AttributeName" );
      RESULT = SetCursorFirstEntityByString( vLOD, "ER_Attribute", "Name", szTempString_0, "LOD_Entity" );
      if ( RESULT >= 0 )
      {
         nZRetCode = IncludeSubobjectFromSubobject( OrigWC, "CtrlMapLOD_Attribute", vLOD, "LOD_Attribute", zPOS_AFTER );
         if ( CompareAttributeToString ( OrigWC, "CtrlMap", "X_Context", "" ) != 0 )
         {
            nZRetCode = RetrieveViewForMetaList( vSubtask, &DomainList, zREFER_DOMAIN_META );
            nZRetCode = GetStringFromAttribute( szTempString_0, vLOD, "Domain", "Name" );
            RESULT = SetCursorFirstEntityByString( DomainList, "W_MetaDef", "Name", szTempString_0, "" );
            nZRetCode = ActivateMetaOI( vSubtask, &vDomain, DomainList, zREFER_DOMAIN_META, zSINGLE );
            nZRetCode = GetStringFromAttribute( szTempString_0, OrigWC, "CtrlMap", "X_Context" );
            RESULT = SetCursorFirstEntityByString( vDomain, "Context", "Name", szTempString_0, "" );
            if ( RESULT >= 0 )
            {
               nZRetCode = IncludeSubobjectFromSubobject( OrigWC, "CtrlMapContext", vDomain, "Context", zPOS_AFTER );
            }
            nZRetCode = DropMetaOI( vSubtask, vDomain );
            nZRetCode = DropView( DomainList );
         }
      }
   }

   nZRetCode = DropMetaOI( vSubtask, vLOD );
   nZRetCode = DropView( LOD_List );
#endif
   return( 0 );
}
コード例 #6
0
ファイル: tzvsdbad.c プロジェクト: DeegC/ZeidonTools
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 );
}
コード例 #7
0
ファイル: tzadw4aw.c プロジェクト: arksoftgit/10c
/////////////////////////////////////////////////////////////////////
//
// PURPOSE:  This routine paints selected fields in a list box
// or partition (all the fields are on one line) and paints the
// field literals above the listbox or partition.
//
/////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
ofnTZWDLGSO_AutoPaintListBox( zVIEW  vSubtask,
                              zVIEW  vUserSpec,
                              zVIEW  vNewDialog,
                              zPCHAR szListType )
{
   zLONG    lCC;
   zLONG    lCL;
   zSHORT   nRC;
   zLONG    lFieldRow;
   zLONG    lFieldCol;
   zLONG    lPartitionStartDLG_Y;
   zLONG    lPartitionStartDLG_X;
   zLONG    lPartitionSizeDLG_X;
   zLONG    lSubtype;
   zCHAR    szParentName[ 33 ];
   zLONG    lTempInteger_0;
   zSHORT   RESULT;
//BL   zLONG    lTempInteger_1;
   zCHAR    X_LOD_Attribute[ 16 ];

// TraceLineS("IN", "AutoPaintListBox W4" );

   // Set up variables to either I_LOD listbox or L_LOD listbox.
   if ( szListType[ 0 ] == 'I' )
      zstrcpy( X_LOD_Attribute, "I_LOD_Attribute" );
   else
      zstrcpy( X_LOD_Attribute, "L_LOD_Attribute" );

   lCL = 12;
   lCC = 5;
   zstrcpy( szParentName, "Window" );
   lTempInteger_0  = zstrcmp( szParentName, "SECTION" );
   /* If we are Autodesigning a ROD, set the lCL to 8 so line skips do
      not tak place. */
   if ( lTempInteger_0 == 0 )
   {
      lCL = 8;
   }
   else
   {
      lCL = 12;
   }

   // Set the Tag
   ofnTZWDLGSO_AssignTag( vSubtask, vNewDialog, vNewDialog, "ListBox" );
// SetAttributeFromAttribute( vNewDialog, "Control", "Tag",
//                            vUserSpec, "LOD_Entity", "Name" );

   /* Get the group's dimensions. */
   GetIntegerFromAttribute( &lPartitionStartDLG_Y, vNewDialog,
                            "Control", "PSDLG_Y" );
   GetIntegerFromAttribute( &lPartitionStartDLG_X, vNewDialog,
                            "Control", "PSDLG_X" );
   GetIntegerFromAttribute( &lPartitionSizeDLG_X, vNewDialog,
                            "Control", "SZDLG_X" );

   /* If the control is a group box not a listbox, then the output
      fields should be placed lower down then the listbox's output fields. */
   if ( CompareAttributeToString( vNewDialog, "ControlDef", "Tag",
                                  "ListBox" ) == 0 )
      lFieldRow = 2;
   else
      lFieldRow = 5;
   lFieldCol = 1;

   RESULT = SetCursorFirstEntity( vUserSpec, X_LOD_Attribute, "" );

   /* Paint the output fields into the listbox or partition. */
   nRC = ofnTZWDLGSO_AutoPaintListPart( vSubtask, vUserSpec, vNewDialog,
                                        lFieldRow, lFieldCol,
                                        lPartitionSizeDLG_X, szListType );

#if 0
   //* Eliminated 1999/04/23 for support of new listbox style.
   /* If the fields fit and there was no other problem, paint the lits. */
   if ( nRC > -1 )
   {
      /* The literals are going to be placed above the listbox
         or partition. */
      lFieldRow = lPartitionStartDLG_Y - nCL;
      lFieldCol = lPartitionStartDLG_X + nCC;

      RESULT = SetCursorFirstEntity( vUserSpec, X_LOD_Attribute, "" );

      /* Paint the literals above the listbox or partition. */
      lTempInteger_1 = zstrcmp( szParentName, "Window" );
      if ( lTempInteger_1 == 0 )
      {
         nRC = ofnTZWDLGSO_AutoPaintLstLitPart( vUserSpec, vNewDialog,
                                                lFieldRow, lFieldCol,
                                                lPartitionSizeDLG_X,
                                                szListType );
         if ( nRC == -1 )
            return( -1 );
      }
   }
   else
   {
      return( -1 );
   }
#endif

   // Set listbox to sort and disable first subcontrol.
   GetIntegerFromAttribute( &lSubtype, vNewDialog, "Control", "Subtype" );
   lSubtype |= zLISTBOX_SORTEDHEADERS;
   SetAttributeFromInteger( vNewDialog, "Control", "Subtype", lSubtype );
   SetCursorFirstEntity( vNewDialog, "CtrlCtrl", 0 );
   GetIntegerFromAttribute( &lSubtype, vNewDialog, "CtrlCtrl", "Subtype" );
   lSubtype |= zCONTROL_DISABLED;
   SetAttributeFromInteger( vNewDialog, "CtrlCtrl", "Subtype", lSubtype );

// TraceLineS("END", "AutoPaintListBox W4" );
   return( nRC );
}
コード例 #8
0
ファイル: tzsixsko.c プロジェクト: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
// 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 );
}
コード例 #9
0
ファイル: tzsixsko.c プロジェクト: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
// OPERATION: zofnTZSIXSKO_BldXSK
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT OPERATION
zofnTZSIXSKO_BldXSK ( zVIEW vKZSIXSKO_Root,
                      zVIEW vKZSIXSKO, zVIEW vTZZOXODO,
                      zVIEW vTZTENVRO_REF )
{
   zVIEW  vTZZOXOD1;
   zVIEW  vTZZOXOD_TestWorkAttrib;
   zVIEW  vTZTENVR1;
   zPCHAR szDBMS;
   zSHORT nEntImpls;
   zSHORT nRC;
   zLONG  lEntityZKey;
   zSHORT nAttrCount = 0;
   zSHORT nEntitySet = 0;

   nRC = CreateViewFromViewForTask( &vTZTENVR1, vTZTENVRO_REF, 0 );
   nRC = CreateViewFromViewForTask( &vTZZOXOD1, vTZZOXODO, 0 );

   nRC = SetCursorFirstEntity( vTZZOXOD1, "ENTITY", "" );

   /*=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?
   ?? Was ist hier mit Work Entities ?
   ?? Wie koennen diese umgangen werden
   ?? natuerlich auch fuer Kinder beruecksichtigen
   **=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?*/

   /* Check physik, if no, then do not process this entity */
   if ( (nRC = CheckExistenceOfEntity( vTZZOXOD1,
                                       "DATARECORD" )) >= zCURSOR_SET )
   {
     // Suche SironKatalog in TE
     nRC = GetIntegerFromAttribute( &lEntityZKey, vTZZOXOD1, "ENTITY",
                                    "ERENT_TOK" );
     nRC = SetCursorFirstEntityByInteger( vTZTENVR1, "ER_Entity",
                                          "ZKey", lEntityZKey,
                                          "TE_DBMS_Source" );
     if ( nRC < zCURSOR_SET )
     {
         GetAddrForAttribute( &szDBMS,
                              vTZTENVR1, "TE_DBMS_Source", "DBMS" );
           nEntImpls = 0;
           for ( nRC = SetCursorFirstEntityByInteger( vTZTENVR1, "ER_Entity",
                                                      "ZKey", lEntityZKey,
                                                      "TE_DB_Environ" );
               nRC > zCURSOR_UNCHANGED;
               nRC = SetCursorNextEntityByInteger( vTZTENVR1, "ER_Entity",
                                             "ZKey", lEntityZKey,
                                             "TE_DB_Environ" ) )
           {
              if ( CompareAttributeToString( vTZTENVR1, "TE_DBMS_Source",
                                             "DBMS", szDBMS ) == 0 )
              {
                 nEntImpls++;
              }
           }

           if ( nEntImpls == 1 )
           {
              nRC = zCURSOR_SET;
           }
           else
           if ( nEntImpls > 1 )
           {
              for ( nRC = SetCursorFirstEntityByInteger( vTZTENVR1, "ER_Entity",
                                                         "ZKey", lEntityZKey,
                                                         "TE_DB_Environ" );
                    nRC > zCURSOR_UNCHANGED;
                    nRC = SetCursorNextEntityByInteger( vTZTENVR1, "ER_Entity",
                                                        "ZKey", lEntityZKey,
                                                        "TE_DB_Environ" ) )
              {
                 if ( CompareAttributeToString( vTZTENVR1, "TE_DBMS_Source",
                                                "DBMS", szDBMS ) == 0 )
                 {
                    zstrcpy( szMsg, "Do you want to use Data Source '" );
                    GetAddrForAttribute( &szMsgName,
                                    vTZTENVR1, "TE_DBMS_Source", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "' to implement ER Entity '" );
                    GetAddrForAttribute( &szMsgName,
                                         vTZTENVR1, "ER_Entity", "Name" );
                    zstrcat( szMsg, szMsgName );
                    zstrcat( szMsg, "'?" );
                    nRC = MessagePrompt ( vTZTENVR1, "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, "ENTITY", "NAME" );
              zstrcat( szMsg, szMsgName );
              nRC = MessagePrompt( vTZZOXOD1, "XOD_03",
                                   "Internal LOD Error", szMsg,
                                   0, zBUTTONS_OK, 0, 0 );
              return( 0 );
           }
     }

     // Now: First Entity found
     //      if SironKatalog Exits
     //         create KATALOG and KATCOM entities
     //         create first ENTITY and ENTITYCOM entities
     //         create dependent ATTRIB and ATTRICOM entities
     nRC = CheckExistenceOfEntity ( vTZTENVR1, "SironKatalog" );
     if (  nRC >= zCURSOR_SET )
     {
        // Create KATALOG entity
        nRC = CreateEntity ( vKZSIXSKO_Root, "KATALOG", zPOS_AFTER );
        SetMatchingAttributesByName(vKZSIXSKO_Root, "KATALOG",
                               vTZTENVR1, "SironKatalog", zSET_ALL );

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

        // Create first ENTITY entity
        nRC = CreateEntity ( vKZSIXSKO_Root, "ENTITY", zPOS_AFTER );
        nEntitySet = 1;
        SetMatchingAttributesByName(vKZSIXSKO_Root, "ENTITY",
                                    vTZTENVR1, "OrigSironField", zSET_ALL );
        SetAttributeFromAttribute( vKZSIXSKO_Root, "ENTITY", "ERENT_TOK",
                                   vTZZOXOD1,      "ENTITY", "ERENT_TOK" );

        for ( nRC = SetCursorFirstEntity( vTZTENVR1,
                                          "FieldComment", "OrigSironField");
              nRC > zCURSOR_UNCHANGED;
              nRC = SetCursorNextEntity( vTZTENVR1,
                                        "FieldComment", "OrigSironField") )
        {
          CreateEntity ( vKZSIXSKO_Root, "ENTITYCOM", zPOS_AFTER );
          SetMatchingAttributesByName( vKZSIXSKO_Root, "ENTITYCOM",
                                       vTZTENVR1, "FieldComment",
                                       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") )
        {
          // If the Attribute is a Workattribute there is no Datafield.
          // Do not save the Workattributes in the XSK-file.
          nRC = CreateViewFromViewForTask( &vTZZOXOD_TestWorkAttrib, vTZZOXOD1, 0 );
          nRC = SetCursorFirstEntityByAttr (vTZZOXOD_TestWorkAttrib, "DATAFIELD",
                                            "FLDNAME",
                                            vTZZOXOD1, "ATTRIB", "NAME", "");

          if (nRC == zCURSOR_SET)
          {
             nRC = SetCursorFirstEntityByAttr
                        ( vTZTENVR1, "TE_FieldDataRel", "Name",
                          vTZZOXOD1, "ATTRIB", "NAME", "TE_TablRec");


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

          DropView( vTZZOXOD_TestWorkAttrib );
        }
     }
   }

   nRC = CheckExistenceOfEntity( vTZZOXOD1, "CHILDENTITY" );
   if ( nRC >= zCURSOR_SET )
        zofnTZSIXSKO_BldXSKChildEnt( vKZSIXSKO_Root, vKZSIXSKO, vTZZOXOD1,
                                     vTZTENVRO_REF, nEntitySet );

   nRC = DropView( vTZZOXOD1 );
   nRC = DropView( vTZTENVR1 );
   return( 0 );
}
コード例 #10
0
ファイル: tzzoloq2.c プロジェクト: DeegC/ZeidonTools
//:   VIEW TZZOLODO  REGISTERED AS TZZOLODO
zOPER_EXPORT zSHORT OPERATION
EntityChanged( zVIEW     vSubtask )
{
   zVIEW     TZZOLODO = 0; 
   zSHORT    RESULT; 
   //:VIEW TZTENVRO  REGISTERED AS TZTENVRO
   zVIEW     TZTENVRO = 0; 
   //:SHORT nIsCheckedOut
   zSHORT    nIsCheckedOut = 0; 
   zSHORT    lTempInteger_0; 
   zSHORT    lTempInteger_1; 
   zCHAR     szTempString_0[ 201 ]; 
   zCHAR     szTempString_1[ 2 ]; 
   zCHAR     szTempString_2[ 201 ]; 

   RESULT = GetViewByName( &TZZOLODO, "TZZOLODO", vSubtask, zLEVEL_TASK );
   RESULT = GetViewByName( &TZTENVRO, "TZTENVRO", vSubtask, zLEVEL_TASK );

   //:nIsCheckedOut = ComponentIsCheckedOut( vSubtask, TZZOLODO, zSOURCE_LOD_META )
   nIsCheckedOut = ComponentIsCheckedOut( vSubtask, TZZOLODO, zSOURCE_LOD_META );

   //:IF nIsCheckedOut = 1
   if ( nIsCheckedOut == 1 )
   { 
      //:// do not allow any input to the Join checkbox, if we are on the root
      //://  or if the currrent LOD entity is work or if the currrent LOD entity is derived
      //:IF TZZOLODO.ER_RelLinkRec EXISTS AND TZZOLODO.LOD_EntityParent.Work != "Y"
      lTempInteger_0 = CheckExistenceOfEntity( TZZOLODO, "ER_RelLinkRec" );
      //:   AND TZZOLODO.LOD_EntityParent.Derived != "Y"
      if ( lTempInteger_0 == 0 && CompareAttributeToString( TZZOLODO, "LOD_EntityParent", "Work", "Y" ) != 0 && CompareAttributeToString( TZZOLODO, "LOD_EntityParent", "Derived", "Y" ) != 0 )
      { 

         //:// Set the cursor to the POD_Entity for the current TE Source.
         //:SET CURSOR FIRST TZZOLODO.POD_Entity
         //:           WHERE  TZZOLODO.TE_DBMS_SourceForEntity.ZKey = TZTENVRO.TE_DBMS_Source.ZKey
         RESULT = SetCursorFirstEntity( TZZOLODO, "POD_Entity", "" );
         if ( RESULT > zCURSOR_UNCHANGED )
         { 
            while ( RESULT > zCURSOR_UNCHANGED && ( CompareAttributeToAttribute( TZZOLODO, "TE_DBMS_SourceForEntity", "ZKey", TZTENVRO, "TE_DBMS_Source", "ZKey" ) != 0 ) )
            { 
               RESULT = SetCursorNextEntity( TZZOLODO, "POD_Entity", "" );
            } 

         } 


         //:IF RESULT < zCURSOR_SET
         if ( RESULT < zCURSOR_SET )
         { 
            //:// POD_Entity doesn't exist so create one.
            //:CREATE ENTITY TZZOLODO.POD_Entity
            RESULT = CreateEntity( TZZOLODO, "POD_Entity", zPOS_AFTER );

            //:TZZOLODO.POD_Entity.SQL_JoinWithParent = "N"
            SetAttributeFromString( TZZOLODO, "POD_Entity", "SQL_JoinWithParent", "N" );
            //:INCLUDE TZZOLODO.TE_DBMS_SourceForEntity FROM TZTENVRO.TE_DBMS_Source
            RESULT = IncludeSubobjectFromSubobject( TZZOLODO, "TE_DBMS_SourceForEntity", TZTENVRO, "TE_DBMS_Source", zPOS_AFTER );
         } 

         //:END

         //:// not the root and not work and not derived
         //:SetCtrlState( vSubtask,      "JoinCheck", zCONTROL_STATUS_ENABLED, TRUE )
         SetCtrlState( vSubtask, "JoinCheck", zCONTROL_STATUS_ENABLED, TRUE );
         //:ELSE
      } 
      else
      { 
         //:SetCtrlState( vSubtask,      "JoinCheck", zCONTROL_STATUS_ENABLED, FALSE )
         SetCtrlState( vSubtask, "JoinCheck", zCONTROL_STATUS_ENABLED, FALSE );
      } 

      //:END

      //:// Refresh checkbox and set the string being displayed.
      //:IF  TZZOLODO.POD_Entity EXISTS
      lTempInteger_1 = CheckExistenceOfEntity( TZZOLODO, "POD_Entity" );
      if ( lTempInteger_1 == 0 )
      { 
         //: TZZOLODO.LOD_EntityParent.WorkString = TZZOLODO.LOD_EntityParent.Name +
         //:                                        " JOIN = " + TZZOLODO.POD_Entity.SQL_JoinWithParent
         GetStringFromAttribute( szTempString_0, TZZOLODO, "LOD_EntityParent", "Name" );
         ZeidonStringConcat( szTempString_0, 1, 0, " JOIN = ", 1, 0, 201 );
         GetVariableFromAttribute( szTempString_1, 0, 'S', 2, TZZOLODO, "POD_Entity", "SQL_JoinWithParent", "", 0 );
         ZeidonStringConcat( szTempString_0, 1, 0, szTempString_1, 1, 0, 201 );
         SetAttributeFromString( TZZOLODO, "LOD_EntityParent", "WorkString", szTempString_0 );
         //:ELSE
      } 
      else
      { 
         //: TZZOLODO.LOD_EntityParent.WorkString = TZZOLODO.LOD_EntityParent.Name + " JOIN = N"
         GetStringFromAttribute( szTempString_2, TZZOLODO, "LOD_EntityParent", "Name" );
         ZeidonStringConcat( szTempString_2, 1, 0, " JOIN = N", 1, 0, 201 );
         SetAttributeFromString( TZZOLODO, "LOD_EntityParent", "WorkString", szTempString_2 );
      } 

      //:END
   } 

   //:END

   //:RefreshCtrl( vSubtask, "JoinCheck" )
   RefreshCtrl( vSubtask, "JoinCheck" );
   //:RefreshCtrl( vSubtask, "edDescription" )
   RefreshCtrl( vSubtask, "edDescription" );
   //:RefreshCtrl( vSubtask, "cbDerived" )
   RefreshCtrl( vSubtask, "cbDerived" );
   //:RefreshCtrl( vSubtask, "cbWork" )
   RefreshCtrl( vSubtask, "cbWork" );
   return( 0 );
// END
} 
コード例 #11
0
ファイル: kzxmlpgo.c プロジェクト: arksoftgit/10c
//:   VIEW            SourceView
zOPER_EXPORT zSHORT OPERATION
oKZXMLPGO_AddWebControlSubobject( zVIEW     vKZXMLPGO,
                                  zPCHAR    ControlName,
                                  zPCHAR    ControlType,
                                  zPCHAR    ControlContext,
                                  zPCHAR    SourceViewName,
                                  zPCHAR    SourceEntity,
                                  zPCHAR    SourceAttribute,
                                  zPCHAR    AutoComboBoxExternalValue )
{
   zVIEW     SourceView = 0; 
   //:VIEW            SourceView2
   zVIEW     SourceView2 = 0; 
   //:SHORT           nRC
   zSHORT    nRC = 0; 
   //:INTEGER         CursorPos
   zLONG     CursorPos = 0; 
   //:STRING ( 2000 ) ExternalValue
   zCHAR     ExternalValue[ 2001 ] = { 0 }; 
   //:STRING ( 200 )  CurrentValue
   zCHAR     CurrentValue[ 201 ] = { 0 }; 
   zSHORT    RESULT; 
   zCHAR     szTempString_0[ 255 ]; 
   zCHAR     szTempString_1[ 32001 ]; 


   //:// Create a Control entity for the data passed.
   //:// If the Control is a ListBox or ComboBox, also create the SubControl entries for each list value.

   //:CREATE ENTITY vKZXMLPGO.Control
   RESULT = CreateEntity( vKZXMLPGO, "Control", zPOS_AFTER );
   //:vKZXMLPGO.Control.Name = ControlName
   SetAttributeFromString( vKZXMLPGO, "Control", "Name", ControlName );
   //:vKZXMLPGO.Control.Type = ControlType
   SetAttributeFromString( vKZXMLPGO, "Control", "Type", ControlType );

   //:// If the Named View does not exist or the EntityName doesn't exist, simply return.
   //:GET VIEW SourceView NAMED SourceViewName
   RESULT = GetViewByName( &SourceView, SourceViewName, vKZXMLPGO, zLEVEL_TASK );
   //:IF RESULT < 0
   if ( RESULT < 0 )
   { 
      //:// There is no mapping, so return having just created the entity, with Name and Type,
      //:// unless the Control is Text, in which case we'll add the Text value, which is passed as
      //:// AutoComboBoxExternalValue.
      //:IF vKZXMLPGO.Control.Type = "Text" OR
      //:   vKZXMLPGO.Control.Type = "PushBtn"
      if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "Text" ) == 0 || CompareAttributeToString( vKZXMLPGO, "Control", "Type", "PushBtn" ) == 0 )
      { 

         //:vKZXMLPGO.Control.CurrentValue = AutoComboBoxExternalValue
         SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", AutoComboBoxExternalValue );
      } 

      //:END
      //:RETURN
      return( 0 );
   } 

   //:END
   //:IF SourceEntity != ""
   if ( ZeidonStringCompare( SourceEntity, 1, 0, "", 1, 0, 33 ) != 0 )
   { 
      //:nRC = CheckExistenceOfEntity( SourceView, SourceEntity )
      nRC = CheckExistenceOfEntity( SourceView, SourceEntity );
      //:IF nRC < 0
      if ( nRC < 0 )
      { 
         //:RETURN
         return( 0 );
      } 

      //:END
   } 

   //:END

   //:// If there is mapping, process according to Control Type
   //:IF vKZXMLPGO.Control.Type = "EditBox" OR
   //:   vKZXMLPGO.Control.Type = "Text" OR
   //:   vKZXMLPGO.Control.Type = "CheckBox"
   if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "EditBox" ) == 0 || CompareAttributeToString( vKZXMLPGO, "Control", "Type", "Text" ) == 0 || CompareAttributeToString( vKZXMLPGO, "Control", "Type", "CheckBox" ) == 0 )
   { 

      //:GetStringFromAttributeByContext( ExternalValue,
      //:                                 SourceView, SourceEntity, SourceAttribute, ControlContext, 2000 )
      GetStringFromAttributeByContext( ExternalValue, SourceView, SourceEntity, SourceAttribute, ControlContext, 2000 );
      //:vKZXMLPGO.Control.CurrentValue = ExternalValue
      SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", ExternalValue );
      //:ELSE
   } 
   else
   { 

      //:IF vKZXMLPGO.Control.Type = "MLEdit"
      if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "MLEdit" ) == 0 )
      { 
         //:SetAttributeFromAttribute( vKZXMLPGO, "Control", "CurrentValue",
         //:                        SourceView, SourceEntity, SourceAttribute )
         SetAttributeFromAttribute( vKZXMLPGO, "Control", "CurrentValue", SourceView, SourceEntity, SourceAttribute );
         //:ELSE
      } 
      else
      { 

         //:IF vKZXMLPGO.Control.Type = "ComboBox"
         if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "ComboBox" ) == 0 )
         { 
            //:// Build the list of selection values from the Domain table entries.
            //:GetStringFromAttributeByContext( CurrentValue,
            //:                           SourceView, SourceEntity, SourceAttribute, ControlContext, 200 )
            GetStringFromAttributeByContext( CurrentValue, SourceView, SourceEntity, SourceAttribute, ControlContext, 200 );
            //:vKZXMLPGO.Control.CurrentValue = CurrentValue
            SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", CurrentValue );
            //:nRC = GetFirstTableEntryForAttribute( ExternalValue,
            //:                                SourceView, SourceEntity, SourceAttribute,
            //:                                ControlContext, CursorPos )
            nRC = GetFirstTableEntryForAttribute( ExternalValue, SourceView, SourceEntity, SourceAttribute, ControlContext, &CursorPos );
            //:LOOP WHILE nRC >= 0
            while ( nRC >= 0 )
            { 
               //:CREATE ENTITY vKZXMLPGO.ComboValue
               RESULT = CreateEntity( vKZXMLPGO, "ComboValue", zPOS_AFTER );
               //:vKZXMLPGO.ComboValue.ExternalValue = ExternalValue
               SetAttributeFromString( vKZXMLPGO, "ComboValue", "ExternalValue", ExternalValue );
               //:IF ExternalValue = CurrentValue
               if ( ZeidonStringCompare( ExternalValue, 1, 0, CurrentValue, 1, 0, 2001 ) == 0 )
               { 
                  //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 )
                  SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 );
                  //:ELSE
               } 
               else
               { 
                  //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 )
                  SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 );
               } 

               //:END
               //:nRC = GetNextTableEntryForAttribute( ExternalValue,
               //:                               SourceView, SourceEntity, SourceAttribute,
               //:                               ControlContext, CursorPos )
               nRC = GetNextTableEntryForAttribute( ExternalValue, SourceView, SourceEntity, SourceAttribute, ControlContext, &CursorPos );
            } 

            //:END
            //:ELSE
         } 
         else
         { 

            //:IF vKZXMLPGO.Control.Type = "ComboBoxAuto"
            if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "ComboBoxAuto" ) == 0 )
            { 
               //:// Build the list of selection values from the list of entities.
               //:// Note that the entry selected is defined by the AutoComboBoxExternalValue passed, which
               //:// was set from the value of the Edit Mapping.
               //:vKZXMLPGO.Control.CurrentValue = AutoComboBoxExternalValue
               SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", AutoComboBoxExternalValue );
               //:nRC = SetCursorFirstEntity( SourceView, SourceEntity, "" )
               nRC = SetCursorFirstEntity( SourceView, SourceEntity, "" );
               //:LOOP WHILE nRC >= 0
               while ( nRC >= 0 )
               { 
                  //:CREATE ENTITY vKZXMLPGO.ComboValue
                  RESULT = CreateEntity( vKZXMLPGO, "ComboValue", zPOS_AFTER );
                  //:GetStringFromAttributeByContext( ExternalValue,
                  //:                        SourceView, SourceEntity, SourceAttribute, "", 2000 )
                  GetStringFromAttributeByContext( ExternalValue, SourceView, SourceEntity, SourceAttribute, "", 2000 );
                  //:vKZXMLPGO.ComboValue.ExternalValue = ExternalValue
                  SetAttributeFromString( vKZXMLPGO, "ComboValue", "ExternalValue", ExternalValue );
                  //:IF ExternalValue = AutoComboBoxExternalValue
                  if ( ZeidonStringCompare( ExternalValue, 1, 0, AutoComboBoxExternalValue, 1, 0, 2001 ) == 0 )
                  { 
                     //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 )
                     SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 );
                     //:ELSE
                  } 
                  else
                  { 
                     //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 )
                     SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 );
                  } 

                  //:END
                  //:nRC = SetCursorNextEntity( SourceView, SourceEntity, "" )
                  nRC = SetCursorNextEntity( SourceView, SourceEntity, "" );
               } 

               //:END
               //:ELSE
            } 
            else
            { 

               //:IF vKZXMLPGO.Control.Type = "ComboBoxList"
               if ( CompareAttributeToString( vKZXMLPGO, "Control", "Type", "ComboBoxList" ) == 0 )
               { 
                  //:// Build the list of selection values from the list of entities.
                  //:// Note that the entry selected is defined by the cursor position.
                  //:CreateViewFromViewForTask( SourceView2, SourceView, vKZXMLPGO )
                  CreateViewFromViewForTask( &SourceView2, SourceView, vKZXMLPGO );
                  //:GetStringFromAttributeByContext( CurrentValue,
                  //:                     SourceView, SourceEntity, SourceAttribute, "", 2000 )
                  GetStringFromAttributeByContext( CurrentValue, SourceView, SourceEntity, SourceAttribute, "", 2000 );
                  //:vKZXMLPGO.Control.CurrentValue = CurrentValue
                  SetAttributeFromString( vKZXMLPGO, "Control", "CurrentValue", CurrentValue );
                  //:nRC = SetCursorFirstEntity( SourceView2, SourceEntity, "" )
                  nRC = SetCursorFirstEntity( SourceView2, SourceEntity, "" );
                  //:LOOP WHILE nRC >= 0
                  while ( nRC >= 0 )
                  { 
                     //:CREATE ENTITY vKZXMLPGO.ComboValue
                     RESULT = CreateEntity( vKZXMLPGO, "ComboValue", zPOS_AFTER );
                     //:GetStringFromAttributeByContext( ExternalValue,
                     //:                     SourceView2, SourceEntity, SourceAttribute, "", 2000 )
                     GetStringFromAttributeByContext( ExternalValue, SourceView2, SourceEntity, SourceAttribute, "", 2000 );
                     //:vKZXMLPGO.ComboValue.ExternalValue = ExternalValue
                     SetAttributeFromString( vKZXMLPGO, "ComboValue", "ExternalValue", ExternalValue );
                     //:IF ExternalValue = CurrentValue
                     if ( ZeidonStringCompare( ExternalValue, 1, 0, CurrentValue, 1, 0, 2001 ) == 0 )
                     { 
                        //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 )
                        SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 1 );
                        //:ELSE
                     } 
                     else
                     { 
                        //:SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 )
                        SetSelectStateOfEntity( vKZXMLPGO, "ComboValue", 0 );
                     } 

                     //:END
                     //:nRC = SetCursorNextEntity( SourceView2, SourceEntity, "" )
                     nRC = SetCursorNextEntity( SourceView2, SourceEntity, "" );
                  } 

                  //:END
                  //:DropView( SourceView2 )
                  DropView( SourceView2 );
               } 


               //:END
            } 

            //:END
         } 

         //:END
      } 

      //:END
   } 

   //:END

   //:TraceLineS( "AddWebControlSubobject Type: ", vKZXMLPGO.Control.Type )
   GetStringFromAttribute( szTempString_0, vKZXMLPGO, "Control", "Type" );
   TraceLineS( "AddWebControlSubobject Type: ", szTempString_0 );
   //:TraceLineS( "      =============== Value: ", vKZXMLPGO.Control.CurrentValue )
   GetStringFromAttribute( szTempString_1, vKZXMLPGO, "Control", "CurrentValue" );
   TraceLineS( "      =============== Value: ", szTempString_1 );
   return( 0 );
//    /* vKZXMLPGO.Control.Type = "EditBox" OR
//       vKZXMLPGO.Control.Type = "ListBox" OR
//       vKZXMLPGO.Control.Type = "Text" OR
//       vKZXMLPGO.Control.Type = "CheckBox" OR
//       vKZXMLPGO.Control.Type = "ListBox" OR
//       vKZXMLPGO.Control.Type = "MLE" OR
//       vKZXMLPGO.Control.Type = "Outliner" OR
//       vKZXMLPGO.Control.Type = "RadioBtnGroup" */
// END
} 
コード例 #12
0
ファイル: tzrpsxml.c プロジェクト: DeegC/ZeidonTools
//:   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
} 
コード例 #13
0
ファイル: tzrpsxml.c プロジェクト: DeegC/ZeidonTools
//:   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
} 
コード例 #14
0
ファイル: tzedcwzd.c プロジェクト: DeegC/ZeidonTools
zOPER_EXPORT zSHORT OPERATION
VML_DisplayList( zVIEW vSubtask )
{
   zVIEW  vProfileXFER;
   zCHAR  szShowStr[ 10 ];
   zSHORT nRC;

   GetProfileView( &vProfileXFER );
   *szShowStr = 0;

   // Build a string that contains each of the VML types that the user
   // wants shown.

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowDeclarations", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "D" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowControlStatements", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "C" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowViewStatements", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "V" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowEntityStatements", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "E" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowOperators", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "O" );
   }

   if ( CompareAttributeToString( vProfileXFER, "ED",
                                  "VML_ShowOther", "Y" ) == 0 )
   {
      zstrcat( szShowStr, "?" );
   }

   // szShowStr lists all the types that the user wants shown. eg "CV?" means
   // that the user wants all control, view, and 'other' vml statements
   // shown.
   for ( nRC = SetCursorFirstEntity( vProfileXFER, "VML_Text", 0 );
         nRC == zCURSOR_SET;
         nRC = SetCursorNextEntity( vProfileXFER, "VML_Text", 0 ) )
   {
      zCHAR szType[ 5 ];

      GetStringFromAttribute( szType, vProfileXFER, "VML_Text", "Type" );
      if ( zstrchr( szShowStr, *szType ) )
         SetSelectStateOfEntity( vProfileXFER, "VML_Text", TRUE );
      else
         SetSelectStateOfEntity( vProfileXFER, "VML_Text", FALSE );
   }

   SetCursorFirstSelectedEntity( vProfileXFER, "VML_Text", 0 );
   LB_SetDisplaySelectSet( vSubtask, "TextList", DISP_SELECT_SET );
   LB_SetSelectSelectSet( vSubtask, "TextList", SEL_SELECT_SET );

   return( 0 );

} // VML_DisplayList
コード例 #15
0
ファイル: tzedcwzd.c プロジェクト: DeegC/ZeidonTools
/*

   This operation builds the operation list for the OperationList window.
   Depending on what the value is for vProfileXFER.ED.OpIns_CurrentType
   we build different operations lists.

*/
zOPER_EXPORT zSHORT OPERATION
OpIns_BuildOperList( zVIEW vSubtask )
{
#define DISP_SELECT_SET    1
#define SEL_SELECT_SET     2

   zCHAR  szCurrentType[ 5 ];
   zVIEW  vProfileXFER;
   zVIEW  vEdWrk;
   zSHORT nRC;
   zCHAR  szKeyword[ 255 ];
   zLONG  lSelectCount = 0;

   GetWorkView( &vEdWrk );
   GetProfileView( &vProfileXFER );
   GetStringFromAttribute( szCurrentType, vProfileXFER, "ED",
                           "OpIns_CurrentType" );

   // Default of CurrentType is 'Z'...
   if ( *szCurrentType == 0 )
   {
      zstrcpy( szCurrentType, "Z" );
      SetAttributeFromString( vProfileXFER, "ED", "OpIns_CurrentType",
                              szCurrentType );
   }

   // Check to see if the operations for the current type are already
   // loaded. If they are, then we obviously don't need to load them again.
   if ( SetCursorFirstEntityByString( vEdWrk, "OperListType", "Type",
                                      szCurrentType, 0 ) != zCURSOR_SET )
   {
      // Operations haven't been loaded yet, so load 'em up.

      CreateEntity( vEdWrk, "OperListType", zPOS_LAST );
      SetAttributeFromString( vEdWrk, "OperListType", "Type", szCurrentType );

      switch ( *szCurrentType )
      {
         case 'Z':
         {
            zVIEW vTZOPSIGK;

            // Get list of Zeidon operations.

            // Check to see if we've already activated the Zeidon opers list.
            // If not, activate it and save the view.
            GetViewByName( &vTZOPSIGK, "TZOPSIGK", vSubtask, zLEVEL_TASK );
            if ( !vTZOPSIGK )
            {
               oTZOPGRPO_GetViewForXGO( vSubtask, &vTZOPSIGK, zSYS_CURRENT_OI );
               SetNameForView( vTZOPSIGK, "TZOPSIGK", vSubtask, zLEVEL_TASK );
            }

            // Now copy each of the operations to the editor work object.
            for ( nRC = SetCursorFirstEntity( vTZOPSIGK, "Operation", 0 );
                  nRC == zCURSOR_SET;
                  nRC = SetCursorNextEntity( vTZOPSIGK, "Operation", 0 ) )
            {
               CreateEntity( vEdWrk, "Oper", zPOS_LAST );
               SetMatchingAttributesByName( vEdWrk, "Oper",
                                            vTZOPSIGK, "Operation", zSET_ALL );
            }

            break;
         } // Case 'Z'...

         case 'G':
         {
            zVIEW vOp;

            // Get list of Global operations.

            RetrieveViewForMetaList( vSubtask, &vOp, zREFER_GO_META );

            // Now copy each of the operations to the editor work object.
            for ( nRC = SetCursorFirstEntity( vOp, "W_MetaDef", 0 );
                  nRC == zCURSOR_SET;
                  nRC = SetCursorNextEntity( vOp, "W_MetaDef", 0 ) )
            {
               CreateEntity( vEdWrk, "Oper", zPOS_LAST );
               SetMatchingAttributesByName( vEdWrk, "Oper",
                                            vOp, "W_MetaDef", zSET_ALL );
            }

            DropView( vOp );

            break;
         } // Case 'G'...

         case 'L':
         {
            zVIEW vMeta;
            zLONG lMetaType;

            // Get list of "Local" operations.  "Local" operations in this
            // case mean all operations that are for the current meta.
            // For example, if the current meta is a Dialog, then the "Local"
            // operations include local and Dialog operations.

            // Get the source view and the meta type.
            GetIntegerFromAttribute( (zPLONG) &vMeta, vEdWrk, "Buffer",
                                     "SourceViewID" );
            GetIntegerFromAttribute( &lMetaType, vEdWrk, "Buffer",
                                     "MetaType" );

            // Create a new, temp view of the meta so that we can muck around
            // with the cursors.
            CreateViewFromViewForTask( &vMeta, vMeta, 0 );

            //
            // Now copy the "Local" meta operations to vEdWrk.
            //

            if ( lMetaType == zREFER_DIALOG_META ||
                 lMetaType == zREFER_LOD_META )
            {
               // Make sure we are reading the "Local" operations for
               // the current source file.
               SetCursorFirstEntityByAttr( vMeta, "SourceFile", "Name",
                                           vEdWrk, "Buffer",
                                           "SourceFileName", 0 );
            }

            // Copy all the operations to vEdWrk
            for ( nRC = SetCursorFirstEntity( vMeta, "Operation", 0 );
                  nRC == zCURSOR_SET;
                  nRC = SetCursorNextEntity( vMeta, "Operation", 0 ) )
            {
               CreateEntity( vEdWrk, "Oper", zPOS_LAST );
               SetMatchingAttributesByName( vEdWrk, "Oper",
                                            vMeta, "Operation",
                                            zSET_ALL );
            }

            DropView( vMeta );

            break;

         } // Case 'L'...

         case 'O':
         {
            // Since we load the object operations by object, we don't have
            // to do anything here.
            break;

         } // Case 'O'...

         default:
            SysMessageBox( "Zeidon Internal",
                           "This operation type not yet supported", 0 );
            break;

      } // switch ( *szCurrentType )...

      // Now that we've loaded the operations, sort them.
      OrderEntityForView( vEdWrk, "Oper", "Name A" );

   } // if ( SetCursor...)...

   // Disable the "Objects" button unless we are showing object operations.
   if ( *szCurrentType == 'O' )
      SetCtrlState( vSubtask, "ListObjects", zCONTROL_STATUS_ENABLED, TRUE );
   else
      SetCtrlState( vSubtask, "ListObjects", zCONTROL_STATUS_ENABLED, FALSE );

   // Now set the select states depending on the keyword values.
   GetStringFromAttribute( szKeyword, vProfileXFER, "ED", "OpIns_Keyword" );
   if ( *szKeyword &&
        CompareAttributeToString( vProfileXFER,
                                  "ED", "OpIns_UseKeyword", "Y" ) == 0 )
   {
      zCHAR  szIgnoreCase[ 5 ];
      zPCHAR pszKeyword;
      zBOOL  bStartColOne;
      zSHORT nKeywordLth;

      // De-select all operations.
      SetAllSelectStatesForEntity( vEdWrk, "Oper", FALSE, 0 );

      GetStringFromAttribute( szIgnoreCase, vProfileXFER, "ED",
                              "OpIns_KeywordIgnoreCase" );
      if ( *szIgnoreCase == 'Y' )
      {
         for ( pszKeyword = szKeyWord; *pszKeyword; pszKeyword++ )
            *pszKeyword = ztoupper( *pszKeyword );
      }

      // If the keyword starts with a "/", then the keyword search starts
      // with the first zCHAR (e.g. column) ONLY.
      pszKeyword = szKeyword;
      if ( *pszKeyword == '/' )
      {
         pszKeyword++;
         bStartColOne = TRUE;
         nKeywordLth = zstrlen( pszKeyword );
      }
      else
         bStartColOne = FALSE;

      for ( nRC = SetCursorFirstEntity( vEdWrk, "Oper", 0 );
            nRC == zCURSOR_SET;
            nRC = SetCursorNextEntity( vEdWrk, "Oper", 0 ) )
      {
         zCHAR  szOperName[ 255 ];

         GetStringFromAttribute( szOperName, vEdWrk, "Oper", "Name" );
         if ( *szIgnoreCase == 'Y' )
            strupr( szOperName );

         if ( bStartColOne )
         {
            if ( zstrncmp( szOperName, pszKeyword, nKeywordLth ) == 0 )
            {
               SetSelectStateOfEntity( vEdWrk, "Oper", TRUE );
               lSelectCount++;
            }
         }
         else
         {
            if ( strstr( szOperName, pszKeyword ) )
            {
               SetSelectStateOfEntity( vEdWrk, "Oper", TRUE );
               lSelectCount++;
            }
         }
      } // for...
   }
   else
   {
      // Select all operations.
      SetAllSelectStatesForEntity( vEdWrk, "Oper", TRUE, 0 );
      lSelectCount = CountEntitiesForView( vEdWrk, "Oper" );
   }

   //SetSelectSetForView( vEdWrk, nOldSelectSet );
   SetCursorFirstSelectedEntity( vEdWrk, "Oper", 0 );
   LB_SetDisplaySelectSet( vSubtask, "OperationList", DISP_SELECT_SET );
   LB_SetSelectSelectSet( vSubtask, "OperationList", SEL_SELECT_SET );

   // Re-use szKeyword to set the message...
   sprintf( szKeyword, "%d Operations listed", lSelectCount );
   MB_SetMessage( vSubtask, 0, szKeyword );

   RefreshWindow( vSubtask );

   return( 0 );

} // OpIns_BuildOperList
コード例 #16
0
ファイル: tzogsrco.c プロジェクト: arksoftgit/10c
//:   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
}