©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwarePDM开发培训教材张永UDSyzhang@udschina.comPage2©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware目录一、基础知识二、ITK三、JAVAPage3©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware日程安排第一天上午基础知识ExternalITK下午InternalITK讨论第二天上午基础知识属性表下午菜单、报表讨论Page4©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware前提所需知识TeamcenterEngineeringApplicationAdministrationTeamcenterEngineeringProductDataManagementProficiencyinC/C++programmingJavaprogramminglanguageexperience所需软件:Oracle10gTeamcenterEngineering2007(two-tierrichclient,samplefiles)MicrosoftVisualStudio.NET2005J2SESDKV1.5.0TextEditor(Notepad,EditPlus,UltraEdit,etc.)Eclipse3.2Page5©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwareRichClient架构C/S结构:Client:JavaServer:C(ITK)Page6©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwareRichClient架构OracleTC_ROOTTC_DATAVolumeFSC/FCCTCFS2-TRichClient√4-TRichClient4-TThinClientPage7©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware基础知识-目录结构%TC_ROOT%bin\TeamcenterEngineeringexecutablesdata\templatedatausedforcreatingimandatainclude\headfilesusedforITKprogrammingInstall\installationutilitylang\localizationfilesfordifferentlanguageslib\archiveandsharedlibrariessample\samplessourcecodeandscriptsforcustomizationweb\filesforTeamcenterEngineeringWebPage8©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware基础知识-目录结构%TC_DATA%\localbin\sharedexecutedITKprogramsdata\shareddatalang\localizationfilesfordifferentlanguageslib\sharedlibraryfilestools\sharedencapsulationprogramsPage9©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware基础知识-环境变量环境变量定义在%TC_DATA%內tc_profilevars.batTC_ROOTC:\tceng2007TC_DATAC:\tcdataTC_BINC:\tceng2005\binTC_INCLUDEC:\tceng2007\includeTC_LIBRARYC:\tceng2007\libTC_LOCALIZATION_DIRen……客户化相关变量setIMAN_USER_LIB=%IMAN_DATA%\local\libsetIMAN_KEEP_SYSTEM_LOG=ONPage10©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware基础知识-关键概念Page11©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware基础知识-关键概念DBTablePOMClassAttribute2Attribute3SubType1Property1Property2Property3RuntimePropertyPrimaryTypeProperty1Property2Property3RuntimePropertyRuntimePropertySubType2Object1Object2Object3Object4MessageMethodRuntimeMethodAttribute1Page12©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftware基础知识-POMClassPOM:PersistentObjectManagerAOM:ApplicationObjectModuleIMF:IMANFileVM:TcEngVolumesCR:CascadeReleaseEPM:EnterpriseProcessModuleWSOM:WorkspaceObjectAE:ApplicationEncapsulationFORM:FormsFL:FolderManagementMAIL:TcEngMailPS:ProductStructureSA:SystemAdministrationUOM:UnitofMeasurePage13©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwareITK-知识点ITKFunctionFormatintFunctionName(typevari-name[dim]/*(I/O/OF)*/);OF使用voidMEM_free(void*pointer)释放内存IncludeFiles#includetc/tc.h必须tag_tdatatype所有在PDM的对象都有唯一的识别码,当对象加载到内存中时,就是以dynamictag来识别,tag_t是integerErrorMessageHandler(EMH)当有错误发生时,大部分ITKfunctions都会传会一个整数值,此整数值一个错误信息对应。Page14©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwareITK-ITKMemoryManagementOF类型的变量一定要通过MEM_free()进行释放voidMEM_free(void*pointer)MEM_alloc()MEM_crealloc()MEM_free()MEM_realloc()使用以上内存管理函数,也可以使用C内存管理函数Includefile:mem.hPage15©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwareITK-ITKErrorMessageHandler(EMH)函数返回值不为ITK_ok,则有错误发生,必须进行处理EMH_ask_error_text()和EMH_ask_errors()通常用来获得错误信息(参考%IMAN_ROOT%\include\emh.h)可以自定义错误信息编号,可用的自定义错误代号范围919000~919999。status=AOM_save();if(status!=ITK_ok){EMH_ask_error_text(status,&message);printf(ErrorwithAOM_save:%s\n,message);MEM_free(message);returnstatus;}status=AOM_save(fl_tag);if(status!=ITK_ok){EMH_ask_errors(&n_errors,&severities,&statuses,&messages);for(i=0;in_errors;i++){printf(%6d:%s\n,statuses[i],messages[i]);}returnstatus;}Page16©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwareITK-分类ExternalITK可单独执行的程序,即batchprogramInternalITK必须于系统内使用,经过Portal或Web介面UserExits替换系统固有功能(仅能修改系统给定的)CR&EPMHandlers工作流程中加入自己的处理MethodsTypeOrProperty前后处理CannedMethods业务建模器扩展BusinessModelerExtensions新的方法实现CannedMethodsUserService供Protal调用Page17©2007.SiemensProductLifecycleManagementSoftwareInc.AllrightsreservedSiemensPLMSoftwareITK-常用函数-Item/ItemRevisionITEM:ItemrelatedfunctionsITEM_create_itemITEM_find_itemITEM_attach_objectITEM_ask_latest_revITEM_list_all_revsITEM_list_attachs_of_typeITEM_list_all_attachmentsITEM_ask_idItemRevision:ItemRevisionrelatedfunctionsITEM_create_revITEM_ask_rev_idITEM_ask_item_of_revITEM_attach_rev_objectITEM_list_rev_