zOPER_EXPORT zSHORT OPERATION zwTZCMRPTD_RefreshSelComponents( zVIEW vSubtask ) { zVIEW vTZCMLPLO; zVIEW vTZCMRPTO; zVIEW vCompList; zVIEW vTZCMRPTO_New; zCHAR szName[ 33 ]; zCHAR szERR_Msg[ 254 ]; SetNameForView( vSubtask,"TZCM_ChkInWindow", vSubtask, zLEVEL_TASK ); GetViewByName( &vTZCMRPTO, "TZCMRPTO", vSubtask, zLEVEL_TASK ); if ( SetCursorFirstSelectedEntity( vTZCMRPTO, "ReportLine", "" ) < zCURSOR_SET ) { zstrcpy( szERR_Msg, "No Component selected to Refresh." ); MessageSend( vSubtask, "CM00241", "Configuration Management", szERR_Msg, zMSGQ_OBJECT_CONSTRAINT_WARNING, zBEEP ); return( 0 ); } if ( zwTZCMLPLD_OptionRefreshFromRepo( vSubtask, &vTZCMLPLO, szName, zRefreshUserDefined ) < 0 ) { return( -1 ); } GetViewByName( &vTZCMRPTO_New, "TZCMRPTO_New", vSubtask, zLEVEL_TASK ); // if component refreshed? if ( CompareAttributeToInteger( vTZCMRPTO_New, "CPLR", "ComponentRefreshed", 1 ) == 0 ) { zstrcpy( szERR_Msg, "Project '" ); GetStringFromAttribute( &szERR_Msg[ zstrlen( szERR_Msg ) ], vTZCMLPLO, "LPLR", "Name" ); zstrcat( szERR_Msg, "' has been successfully refreshed \nfrom CPLR '" ); zstrcat( szERR_Msg, szName ); zstrcat( szERR_Msg, "'." ); MessageSend( vSubtask, "CM00279", "Configuration Management", szERR_Msg, zMSGQ_OBJECT_CONSTRAINT_INFORMATION, zBEEP ); } if ( GetViewByName( &vTZCMRPTO, "TZCMRPTO", vSubtask, zLEVEL_TASK ) > 0 ) DropObjectInstance( vTZCMRPTO ); // Build new Refresh List if ( zwTZCMLPLD_RefreshUserDefined( vSubtask ) < 1 ) return( -1 ); RefreshWindow( vSubtask ); if ( GetViewByName( &vCompList, "CompList", vSubtask, zLEVEL_TASK ) >= 0 ) RefreshWindow( vCompList ); return( 0 ); } // zwTZCMRPTD_RefreshSelComponents
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
zOPER_EXPORT zSHORT OPERATION BuildXODsOnLPLR( zVIEW vSubtask ) { // This routine does not actually save LODs, but only builds the XODs // on the LPLR. zVIEW vDTE; zVIEW vLPLR; zVIEW vLOD_List; zVIEW vLOD; zVIEW vXOD; zSHORT nRC; zCHAR szMsg[ zSHORT_MESSAGE_LTH + 1 ]; zCHAR szLOD_Name[ 33 ]; zCHAR szFileName[ zMAX_FILESPEC_LTH + 1 ]; GetViewByName( &vDTE, "TE_DB_Environ", vSubtask, zLEVEL_TASK ); GetViewByName( &vLOD_List, "TZZOLFLO", vSubtask, zLEVEL_TASK ); GetViewByName( &vLPLR, "TaskLPLR", vSubtask, zLEVEL_TASK ); // Save Subtask for use by XOD build routine. SetNameForView( vSubtask, "TE_Window", vSubtask, zLEVEL_TASK ); // For each selected LOD, build the XOD using the current DBMS and // commit as file to LPLR, unless the LOD does not have a POD. // Note that we are not looking to see if the DBMS identified // in the POD.TE_SourceZKey matches the current DBMS. We will save // selected LODs with the current DBMS no matter how they were saved // last time. for ( nRC = SetCursorFirstSelectedEntity( vLOD_List, "W_MetaDef", "" ); nRC >= zCURSOR_SET; nRC = SetCursorNextSelectedEntity( vLOD_List, "W_MetaDef", "" ) ) { GetStringFromAttribute( szLOD_Name, vLOD_List, "W_MetaDef", "Name" ); nRC = ActivateMetaOI( vSubtask, &vLOD, vLOD_List, zREFER_LOD_META, zCURRENT_OI ); if ( nRC < 0 ) { zstrcpy( szMsg, "Could not Activate LOD: " ); zstrcat( szMsg, szLOD_Name ); zstrcat( szMsg, ".\nAborting Build" ); MessageSend( vSubtask, "TE00426", "Physical Data Model", szMsg, zMSGQ_OBJECT_CONSTRAINT_ERROR, zBEEP ); return( 0 ); } else { // Send message that we are building the LOD. zstrcpy( szMsg, "Building executable for LOD: " ); zstrcat( szMsg, szLOD_Name ); zstrcat( szMsg, "." ); MB_SetMessage( vSubtask, 1, szMsg ); // Make sure the TE_SourceZKey attribute is set because it determines // what DBMS_Source is used in building the XOD. if ( CheckExistenceOfEntity( vLOD, "POD" ) >= zCURSOR_SET ) SetAttributeFromAttribute( vLOD, "POD", "TE_SourceZKey", vDTE, "TE_DBMS_Source", "ZKey" ); // Build the XOD in memory. oTZZOXODO_SaveXOD( vSubtask, vLOD ); SetNameForView( vLOD, "TZZOLODO", vSubtask, zLEVEL_TASK ); GetViewByName( &vXOD, "TZZOXODO", vSubtask, zLEVEL_TASK ); DropMetaOI( vSubtask, vLOD ); // Commit the XOD to LPLR file. GetStringFromAttribute( szFileName, vLPLR, "LPLR", "ExecDir" ); ofnTZCMWKSO_AppendSlash( szFileName ); zstrcat( szFileName, szLOD_Name ); zstrcat( szFileName, ".XOD" ); TraceLineS( "*** Committing workstation file: ", szFileName ); CommitOI_ToFile( vXOD, szFileName, zSINGLE ); } } MB_SetMessage( vSubtask, 1, "Build of XODs complete." ); return( 0 ); }
/* 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