Main Page | Modules | Files | Functions | Code Elements | Data Structures | Deprecated

ai/appinterface.h

Go to the documentation of this file.
00001 /*==============================================================================
00002                 Copyright (c) 2003-2005 UGS Corporation
00003                    Unpublished - All Rights Reserved
00004  ==============================================================================*/
00005 
00014 /*  */
00015 
00016 #ifndef APPINTERFACE_H
00017 #define APPINTERFACE_H
00018 
00019 #include <unidefs.h>
00020 #include <pie/pie.h>
00021 
00022 #include <ai/libai_exports.h>
00023 
00034 #define AppInterface_class_name_c                   "AppInterface"
00035 #define MasterRecord_class_name_c                   "MasterRecord"
00036 #define RequestObject_class_name_c                  "RequestObject"
00037 #define RecordObject_class_name_c                   "RecordObject"
00038 
00044 #define AppInterfaceType_class_name_c "AppInterfaceType"
00045 #define AppInterface_private_structure_type_name_c  "PrivateContext"
00046 #define AppInterface_private_appgrp_type_name_c     "PrivateAppGrp"
00047 #define AppInterface_vis_structure_type_name_c  "VisStructureContext"
00048 
00050 #define TC_link_ic_relation_name                  "IMAN_eco_link"
00051 
00052 #define AI_id_size_c                                WSO_desc_size_c
00053 #define AI_msg_size_c                               WSO_desc_size_c
00054 
00056 #define AI_request_no_dependancy                    "AI_request_no_dependancy"
00057 
00059 #define AI_max_app_ref_string                       240
00060 
00062 #define AppInterfaceType_idc_type_name_c  "IntermediateDataCapture"
00063 typedef enum Request_type_e
00064 {
00065     Request_type_publish =0,
00066     Request_type_sync    =1,
00067     Request_type_any     =2
00068 } Request_type_t;
00069 
00071 typedef enum Request_status_e
00072 {
00073     Request_status_normal  =0,
00074     Request_status_warning =1,
00075     Request_status_severe  =2,
00076     Request_status_abort   =3,
00077     Request_status_any     =4
00078 } Request_status_t;
00079 
00081 typedef enum Request_state_e
00082 {
00083     Request_state_new           =0,
00084     Request_state_processing    =1,
00085     Request_state_pending       =2,
00086     Request_state_communicating =3,
00087     Request_state_completed     =4,
00088     Request_state_rejected      =5,
00089     Request_state_any           =6
00090 } Request_state_t;
00091 
00093 typedef enum Request_scope_e
00094 {
00095     Request_scope_whole     =0,
00096     Request_scope_partial   =1,
00097     Request_scope_any       =2
00098 } Request_scope_t;
00099 
00101 typedef enum Request_update_e
00102 {
00103     Request_update_full     =0,
00104     Request_update_delta    =1,
00105     Request_update_any      =2
00106 } Request_update_t;
00107 
00108 typedef struct AI_search_criteria_s
00109 {
00110     char       name[WSO_name_size_c+1];
00111     char       desc[WSO_desc_size_c+1];
00112     char       type[WSO_name_size_c+1];
00113     tag_t      owner;
00114     tag_t      group;
00115 
00116     date_t     createdBefore;
00117     date_t     modifiedBefore;
00118     date_t     releasedBefore;
00119 
00120     date_t     createdAfter;
00121     date_t     modifiedAfter;
00122     date_t     releasedAfter;
00123 
00124     char       context[AI_id_size_c+1];
00125     char       site_id[AI_id_size_c+1];
00126     char       project_id[AI_id_size_c+1];
00127 
00128 } AI_search_criteria_t, *AI_search_criteria_p_t;
00129 
00130 #ifdef __cplusplus
00131     extern "C"{
00132 #endif
00133 
00134 extern AI_API int AI_init_module();
00135 
00144 extern AI_API int AI_create_instance(
00145     const char*    type,    
00146     const char*    name,    
00147     const char*    desc,    
00148     tag_t*         ai       
00149     );
00150 
00159 extern AI_API int AI_export_objects(
00160     tag_t          ai,      
00161     int            num,     
00162     tag_t*         objects, 
00163     logical        partial  
00164     );
00173 extern AI_API int AI_export_objects_incremental(
00174     tag_t          ai,      
00175     int            num,     
00176     tag_t*         objects, 
00177     logical        partial  
00178 );
00186 extern AI_API int AI_can_add_request(
00187     tag_t          ai,      
00188     Request_type_t type,    
00189     logical*       ok       
00190     );
00191 
00199 extern AI_API int AI_create_request(
00200     tag_t          ai,      
00201     const char*    name,    
00202     const char*    desc,    
00203     Request_type_t reqType, 
00204     tag_t*         req      
00205     );
00206 
00210 extern AI_API int AI_ask_request_objects(
00211     tag_t           ai,     
00212     Request_type_t  type,   
00213     Request_state_t state,  
00214     int*            num,    
00215     tag_t**         req     
00216     );
00217 
00221 extern AI_API int AI_ask_next_request(
00222     tag_t           ai,         
00223     tag_t           cur_req,    
00224     Request_type_t  type,       
00225     Request_state_t state,      
00226     tag_t*          req         
00227     );
00228 
00229 extern AI_API int AI_remove_request_object(
00230     tag_t          ai,      
00231     tag_t          req      
00232     );
00233 
00237 extern AI_API int AI_find(
00238     AI_search_criteria_t* seach,    
00239     int*                  num,      
00240     tag_t**               ais       
00241     );
00242 
00243 extern AI_API int AI_init_search(
00244     AI_search_criteria_t* seach     
00245     );
00246 
00247 extern AI_API int AI_ask_transfermode(
00248     tag_t           ai,     
00249     PIE_direction_t type,   
00250     tag_t*          tm      
00251     );
00252 
00253 extern AI_API int AI_set_transfermode(
00254     tag_t           ai,     
00255     PIE_direction_t type,   
00256     tag_t           tm      
00257     );
00258 
00259 extern AI_API int AI_ask_master_record(
00260     tag_t          ai,  
00261     tag_t*         ma   
00262     );
00263 
00264 extern AI_API int AI_set_master_record(
00265     tag_t          ai,  
00266     tag_t          ma   
00267     );
00268 
00269 extern AI_API int AI_ask_base_refs(
00270     tag_t          ai,      
00271     int*           num,     
00272     tag_t**        refs     
00273     );
00274 
00275 /*****************************************************************************
00276     * Description
00277     *   Set the input tags to base references ( the root objects used by this interface)
00278     *   If the tags are run time configured objects such as BOMLine, we need to
00279     *   persistant it.
00280     *
00281     *   If multiple BOMLines are input, we will just create one single private StructureContext
00282     *
00283     *   Note: it will reset the previous baserefs.
00284     *
00285     * Input:
00286     *   ref - tag of reference
00287     * Output:
00288     *
00289     *
00290     * Returns:
00291     *   status_t
00292     *
00293     * Side Effects:
00294     *   see Description
00295     *
00296     *****************************************************************************/
00297 extern AI_API int AI_set_base_refs(
00298     tag_t          ai,      
00299     int            num,     
00300     tag_t*         refs     
00301     );
00302 
00303 extern AI_API int AI_add_base_ref(
00304     tag_t          ai,      
00305     tag_t          ref      
00306     );
00307 
00308 /*****************************************************************************
00309     * Description
00310     *   Add the input tags to base references ( the root objects used by this interface)
00311     *   If the tags are run time configured objects such as BOMLine, we need to
00312     *   persistant it.
00313     *
00314     *   If multiple BOMLines are input, we will just create one single private StructureContext
00315     *
00316     * Input:
00317     *   ref - tag of reference
00318     * Output:
00319     *
00320     *
00321     * Returns:
00322     *   status_t
00323     *
00324     * Side Effects:
00325     *   see Description
00326     *
00327     *****************************************************************************/
00328 extern AI_API int AI_add_base_refs(
00329     tag_t          ai,      
00330     int            num,     
00331     tag_t*         refs,     
00332     int*            persistNum,  
00333     tag_t**        persistObj   
00334     );
00335 
00342 extern AI_API int AI_ask_site_id(
00343     tag_t          ai,                  
00344     char           id[AI_id_size_c+1]   
00345     );
00346 
00347 
00349 extern AI_API int AI_ask_site_id2(
00350     tag_t          ai,                  
00351     char           **id                 
00352     );
00353 
00354 extern AI_API int AI_set_site(
00355     tag_t          ai,      
00356     tag_t          site     
00357     );
00358 
00365 extern AI_API int AI_ask_app_id(
00366     tag_t          ai,                  
00367     char           id[AI_id_size_c+1]   
00368     );
00369 
00371 extern AI_API int AI_ask_app_id2(
00372     tag_t          ai,                  
00373     char           **id                 
00374     );
00375 
00381 extern AI_API int AI_ask_project_id(
00382     tag_t          ai,                  
00383     char           id[AI_id_size_c+1]   
00384     );
00385 
00387 extern AI_API int AI_ask_project_id2(
00388     tag_t          ai,                  
00389     char           **id                 
00390     );
00391 
00392 extern AI_API int AI_set_project_id(
00393     tag_t          ai,  
00394     const char*    id   
00395     );
00396 
00398 extern AI_API int AI_ask_master_file(
00399     tag_t          ai,  
00400     tag_t*         mf   
00401     );
00402 
00403 extern AI_API int AI_set_master_file(
00404     tag_t          ai,  
00405     tag_t          mf   
00406     );
00407 
00422 extern AI_API int AI_request_process(
00423     tag_t          req,     
00424     tag_t          eco      
00425     );
00426 
00430 extern AI_API int AI_request_can_process(
00431     tag_t          req,     
00432     logical*       ok       
00433     );
00434 
00436 extern AI_API int AI_request_process_partial(
00437     tag_t          req,         
00438     int            num_obj,     
00439     tag_t*         objs         
00440     );
00441 
00442 extern AI_API int AI_request_ask_type(
00443     tag_t          req,     
00444     int*           type     
00445     );
00446 
00448 extern AI_API int AI_request_ask_scope(
00449     tag_t          req,     
00450     int*           scope    
00451     );
00452 
00453 extern AI_API int AI_request_set_scope(
00454     tag_t           req,    
00455     Request_scope_t scope   
00456     );
00457 
00459 extern AI_API int AI_request_ask_update_type(
00460     tag_t          req,     
00461     int*           update   
00462     );
00463 
00464 /*Set for update type, which is Full/Delta*/
00465 extern AI_API int AI_request_set_update_type
00466 (
00467     tag_t             req,    
00468     Request_update_t  update  
00469 );
00470 
00471 extern AI_API int AI_request_ask_state(
00472     tag_t          req,     
00473     int*           stat     
00474     );
00475 
00476 extern AI_API int AI_request_set_state(
00477     tag_t           req,    
00478     Request_state_t stat    
00479     );
00480 
00481 
00486 extern AI_API int AI_request_ask_state_msg(
00487     tag_t          req,                         
00488     char           stat_msg[AI_msg_size_c+1]    
00489     );
00490 
00491 
00492 extern AI_API int AI_request_ask_state_msg2(
00493     tag_t          req,                         
00494     char           **stat_msg                   
00495     );
00496 
00497 extern AI_API int AI_request_set_state_msg(
00498     tag_t          req,         
00499     const char*    stat_msg     
00500     );
00501 
00502 extern AI_API int AI_request_ask_status(
00503     tag_t          req,     
00504     int*           stat     
00505     );
00506 
00507 extern AI_API int AI_request_set_status(
00508     tag_t            req,   
00509     Request_status_t stat   
00510     );
00511 
00512 
00517 extern AI_API int AI_request_ask_status_msg(
00518     tag_t          req,                         
00519     char           stat_msg[AI_msg_size_c+1]    
00520     );
00521 
00522 
00523 extern AI_API int AI_request_ask_status_msg2(
00524     tag_t          req,                         
00525     char           **stat_msg                   
00526     );
00527 
00528 extern AI_API int AI_request_set_status_msg(
00529     tag_t          req,         
00530     const char*    stat_msg     
00531     );
00532 
00533 extern AI_API int AI_request_ask_structure_file(
00534     tag_t            req,       
00535     Request_update_t type,      
00536     tag_t*           file       
00537     );
00538 
00539 extern AI_API int AI_request_set_structure_file(
00540     tag_t            req,       
00541     Request_update_t type,      
00542     tag_t            file       
00543     );
00544 
00545 extern AI_API int AI_request_ask_process_by(
00546     tag_t          req,     
00547     tag_t*         user     
00548     );
00549 
00550 extern AI_API int AI_request_ask_process_on(
00551     tag_t          req,     
00552     date_t*        date     
00553     );
00554 
00555 extern AI_API int AI_request_ask_owning_ai(
00556     tag_t          req,     
00557     tag_t*         owner    
00558     );
00559 
00560 extern AI_API int AI_request_add_file_map(
00561     tag_t          req,         
00562     const char*    fileRef,     
00563     const char*    fileId       
00564     );
00565 
00570 extern AI_API int AI_request_import_file(
00571     tag_t          req,         
00572     const char*    fName,       
00573     const char*    fRefId,      
00574     int            fileType,    
00575     const char*    appName,     
00576     const char*    siteId,      
00577     const char*    version,     
00578     tag_t*         fileTag      
00579     );
00580 
00591 extern AI_API int AI_save_records(
00592     tag_t          ai   
00593     );
00594 
00598 extern AI_API int AI_add_record(
00599     tag_t          ai,          
00600     const char*    objId,       
00601     const char*    masterId,    
00602     date_t         date,        
00603     tag_t*         record       
00604     );
00605 
00606 extern AI_API int AI_ask_record(
00607     tag_t          ai,      
00608     const char*    objId,   
00609     tag_t*         record   
00610     );
00611 
00612 extern AI_API int AI_remove_record(
00613     tag_t          ai,      
00614     const char*    objId    
00615     );
00616 
00621 extern AI_API int AI_is_object_modified(
00622     tag_t          ai,          
00623     const char*    objId,       
00624     date_t         modDate,     
00625     logical*       modified     
00626     );
00627 
00632 #ifdef __cplusplus
00633     }
00634 #endif
00635 
00636 /* ----------------------------------------------------------------------------------
00637                 AppInterface Type related
00638 -------------------------------------------------------------------------------------*/
00639 
00640 /*****************************************************************************
00641 * Description
00642 *   Finds an AppInterface Type with specified name
00643 *
00644 * Input:
00645 *   name - Name of new AIType
00646 *
00647 * Output:
00648 *   typeTag - Tag of AIType
00649 *
00650 * Returns:
00651 *
00652 * Side Effects:
00653 *   see Description
00654 *
00655 *****************************************************************************/
00656 extern AI_API int AIType_find
00657 (
00658     const char   *name,          /* (I) */
00659     tag_t        *type           /* (O) */
00660 );
00661 
00662 /*****************************************************************************
00663 * Description
00664 *   Returns isUsedForIDC logical flag on AppInterface type.
00665 *
00666 * Input:
00667 *   aitype - AppInterface Type object tag
00668 *
00669 * Output:
00670 *   status - TRUE/FALSE
00671 *
00672 * Returns:
00673 *
00674 * Side Effects:
00675 *   see Description
00676 *
00677 *****************************************************************************/
00678 extern AI_API int AIType_ask_is_used_for_idc
00679 (
00680     tag_t        aitype,          /* (I) */
00681     logical*     status           /* (O) */
00682 );
00683 
00684 /*********************************************************************************
00685     Utility Funtion
00686 **********************************************************************************/
00687 /*****************************************************************************
00688 * Description
00689 *   Utility funtion to validate the PLMXML file, given a checking data file.
00690 *   It will be able to check:
00691 *       1) Total number of element:                Element ; Occurrence; 100
00692 *       2) Total Number of attribute:              Attribute ; Occurrence ; linkedOccurrenceRef; 23
00693 *       3) Check whether has require attribute:    Required ; Occurrence ; instancedRef
00694 *
00695 *   If any checking failes, will return failure. Checking result will be print to the log file
00696 *
00697 * Input:
00698 *    char* plmxml_file,        PLMXML file full name
00699 *    char *custom_fptr,        Customization file which contains the checking info
00700 *    char *log_fptr,           Log file
00701 *
00702 *
00703 * Output:
00704 *    write the result to the log file
00705 *    logical* failed     check failed or not
00706 * Returns:
00707 *
00708 * Side Effects:
00709 *   see Description
00710 *
00711 *****************************************************************************/
00712 
00713 extern AI_API int AI_validate_plmxml
00714 (
00715     char* plmxml_file,   /* (I) */
00716     char *custom_fptr,      /* (I) */
00717     char *log_fptr,      /* (I) */
00718     logical* failed       /* (O) */
00719 );
00720 extern AI_API int AI_request_find_by_ai_type(
00721     Request_type_t req_type, /* (I) */
00722     Request_state_t  state,  /* (I) */
00723     const char* ai_type,     /* (I) */
00724     int*  num,            /* (O) */
00725     tag_t **reqs             /* (OF) */
00726 );
00727 
00728 #include <ai/libai_undef.h>
00729 
00730 #endif