




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
TeamcenterRichclientCustomizationTrainingfor10.1ØPrerequisites TeamcenterApplicationAdministration ProficiencyinJavaprogramming ØRequired Oracle Teamcenter (includingadministratorrichclient,onlinehelp,sample VisualStudio.NET JDK Eclipse TeamcenterRichClient-Server Teamcenterclientserver均可客户 Serverlayer:服务器层,采IntegrationToolkit(ITKCBusinessBusinessModelerExercise 找出你的Teamcenter环境变 设置Teamcenter客户化需要的环境变量与对应的文件 使用BMIDE查看常见对象对应 MSG%TCLOCALIZATIONUSERXMLDATAUSERLIB%;%TCTMPKEEPSYSTEMTeamcenterClass attributes方method)是继承到子 RichClientProgrammingEclipseEnvironment有有RichClientProgrammingEclipseEnvironment RichClientProgrammingEclipseEnvironment RichClient 输入ProjectName(譬如 选择产生 选择此plug-in将传递到 选择不要建立一个richclientRichClientProgrammingEclipseEnvironment RichClientRichClientProgrammingEclipseEnvironmentØRichClientüü ülülüaüsü..tRichClientProgrammingEclipseEnvironment RichClientRichClient RuntherichclientfromInEclipse,chooseRun→DebugRichClient 选择Plug-inDevelopment内Deployableplug-insand可直接指定Teamcenterrichclient文件夹,Eclipse会自动把jar放到plugins子文件 如果有修改properties文档,必须执行 two-tierrich four-tierrich利用WebApplicationManager打包richclientRichClientExercise TeamcenterUI boBox, ponent, ØeterHow-To获得Teamcenter如果需要建立objects或是searchobjects,必须先获取目前clientsession,我们可以通过以下的方式来获TCSessionsession=一般在Handler通过如下方法获取AIFDesktopaifdesktop=application=aifdesktop.getCurrentApplication();session=(TCSession)eterHow-Togetselecteditemsfrom从TeamcenterUI中,用户点选Itemorformorfolder,我们可以通过以的方式得到选取的StructuredSelectioniselectionIteratorit=iselection.iterator();ponentContextcompContext= p= 也可以AIFDesktopaifdesktop=application=ponentContextaif[]=eterHow-To建立Item、Form、or ponentItemType=( ponentitem ID,REVID,ITEMTYPE,OBJECTNAME,DESC,通过以下的方式,可以获取目前的sessionuser所属的newstufffolder将objects粘贴在这个folderponentFoldertcfolder= 请建立一个CrtetmrtHaja求 bar加入一个选单,增列一个CreateItemCommand的功创建一个Item,请自行定义id、revid、object将新建立的item粘贴在newstuffeterHow-Toset/getobject’s在设定object’sproperties时,必须注当有大批量的properties要设定值时,最好采取以下的TCFormProperty[]ps=f.getAllFormProperties();//Getthepropertytosetps[0].setStringValueData(“abc”);//Setsthevaluebutisnotsaved.ps[1].setStringValueData(“def”);//Setsthevaluebutisnotsaved.f.setTCProperties(ps);//Nowissavedtothedb当properties数量不大时,则可以采用以下的TCFormPropertyp=f.getFormTCProperty(“my_prop_name”);//Getpropertytosetp.setStringValue(“abc”);//Setit.Atthispointitissavedtothedb.eterHow-Toset/get针对不同型态的property,使用的method也会不一样,例如string可以通过以下的方式来获取或是设定属eterHow-Tofinduserby可以用以下的方式来查询已知的ponentUserTypetccUserType=( tccUser[0]=eterHow-To建立workflow通过以下的方式,建立一个已经存在的workflowtemplate,并将item粘到target ponenttasktemplate = .create(PROCESSNAME,PROCESS,WORKFLOWTEMPLATE ponent[],Target:请建立一个SetAndGetPropsValue.java,并且可以达到以下的建立新的Item类,MyItem,并在MyItemRevision上定义两种类型的性,一个是TypeReference(User),一个是String将 并布署到搜寻到一 ponentUser,并将这个object的reference存放到建的TypeReference属性将自定的字符串array存放到新建的Stringarray修改objectname以及objectdescription,自定义设定必须使用setTCProperties做为最后 eterHow-Togetobjectsby建议都建议都使ponents,因为这个method不会受到preferenceps objectsreferenced,则可以用以下的 ps3 如果要抓取当前对象被哪些对象使用,则可以用以下的 ps2 eterHow-Toexport/import将localfiles存放到Teamcenter,必须通过Dataset的形式 ,可以以下的方式来实 "textobjtcDataset.setFiles(newString[]{FULLFILEFILEFORMAT,newString[]{"Plain"},FILE将Dataset中存放的files汇出到localdisk请建立两个xrtFia和mFaImport两个dataset,一个是Text一个是MSExcel,并将local到这两个dataset将datasets粘贴到MyItemRevision点选MyItemRevision,并将粘贴在下面的Dataset汇出到localRichClientProgrammingCreatingaViewAddaCreateRichClientProgrammingCreatingaView续1SetactivepartCommandonlybeactivatedwithCustomDefineacustomview RichClientProgrammingCreatingaView续2 CreateaCustomView建立一个用户点选一个object时,可以通过getChild()打印出子对象在viewRichClientCreatingaRichClientApplicationandSendDefineaDefinea RichClientCreatingaRichClientApplicationandSendDefineaSendto Defineahandlerfor“Sendto <iterateRichClientCreatingaRichClientApplicationandSendDefineacommandfor“SendtoDefineadefinitionfor“SendtoExercise7(很少用到,了解建立一个 建立一个Sendto利用前述的步骤,定义出如下的RichClientProgrammingCustomizeShortcut Customizing Create Createacommandunder RichClientProgrammingCustomizetheToolbar 修改现有application的Toolbar(以MyTeamcenter示例 Create Createatoolbarunder Createacommandunderthe在myteamcenter窗口中建 立一个toolbar按鈕在实现以下的需弹出窗口显示选择的对如果没有选择对象则提示RichClientCustomizeFormandProperties XMLstylesheet AutomaticRichClientProgramming RichClientProgrammingFormsUsingXMLStyleSheet 式RichClientFormsUsingXMLStyleSheet ModifytheSummary/ViewerpaneinMy 信息,Viewer显示所有属性信 信息,Viewer显示表单专有属性信Properties 显示Property 语n.RENDERINGn 显示Summary 语
.REGISTEREDTO=.SUMMARYRENDERING=n n 显示Form 语
.SUMMARY_REGISTEREDTO=n.FORMRENDERING n .FORM_REGISTEREDTO=RichClientFormsUsingXMLStyleSheetØRichClientFormsUsingXMLStyleSheet ModifytheSummary/ViewerpaneinMyØRichClientFormsUsingXMLStyleSheet ModifytheSummary/ViewerpaneinMy Summary/ViewerViewerXML XMLelements pageTitleformatfirstcolumnsecondcolumnpropertyseparatorall Display RichClientOneColumnTwo ThinClientOneRichClientFormsUsingXMLStyleSheet ModifytheSummary/ViewerpaneinMyRichClientFormsUsingXMLStyleSheet ModifytheSummary/ViewerpaneinMy<propertyname="object_name"<propertyname="object_desc"<propertyname="owning_user"renderingHint="objectlink"modifiable="false"<propertyname="checked_out"<propertyname="checked_out_user"<propertyname="checked_out_date"<propertyname="checked_out_change_id"RichClientFormsUsingXMLStyleSheet ModifytheSummary/ViewerpaneinMy<propertyname="proj_assign_mod_date"<propertyname="project_ids"<pagetitle="All"<allRichClientFormsUsingXMLStyleSheet ModifytheSummary/ViewerpaneinMy 每一个renderinghint所使用的JavaBeansclass定义在 mon_<version>.jar的package renderinghintJavaBeansnDEFINITION=aaana rn_titled.DEFINITION=aana>RichClientFormsUsingXMLStyleSheet ViewerPaneRichClientForms 建立FormForm Twomethodsarerequiredtoimplementan RichClientForms Rendering RenderingContructor.Togetform loadRendering.ToinitializeformUI.Whenuserclickonviewtabordoubleclickonform,themethodiscalled. saveRendering.Tosaveformdata.WhenuserclickonSavebutton,themethodiscalled. setRenderingReadWrite.Toenable/disableUIcomponentsintheRichClientForms Rendering FormPanel ponentForm.getFormTCProperty(_”) get>Value() set>Value()> set>ValueData()eeDRichClientForms Rendering FormPanel package packageRichClientForms Rendering 程序框publicclassMyForm {publicMyForm {
}{}publicvoid{}}
RichClientForms Rendering 加publicvoidloadRendering()throws{setLayout(newVerticalLayout()); //布局管理器JPanelmainPanel=newJPanel(newPropertyLayout());projectId=newJTextField(26); serialNo=newmainPanel.add("1.1.right.center",newJLabel("ProjectID"));mainPanel.add("1.2.left.center",projectId);mainPanel.add("2.1.right.center",newJLabel("SerialNumber"));mainPanel.add("2.2.left.center",serialNo);add("unbound.bind",piProperty=form.getFormTCProperty(“project_id”);projectId.setText(piProperty.getStringValue());serialNo.setText(snProperty.getStringValue());}
RichClientForms Rendering 加publicvoid{piProperty.setStringValueData(projectId.getText());snProperty.setStringValueData(serialNo.getText());TCProperty[]ps=newTCProperty[2];ps[0]=ps[1]=}RichClientFormsUsingJavaBeans 建立FormForm 在packagecom.customer.forms建立Form的class ExtendJPanel implementthe ponentExerciseØ新增一个表单类型,并使用 Rendering方式显示表属Ø使用iTextField,iComboBox在form的UIRichClient plugin.xml->Runtime-RichClient HSSFWorkbookwb=new HSSFRowrow= HSSFCellStylestyle= HSSFCellcell=row.createCell((short) //Orange"foreground",foregroundbeingthefillforegroundnotthefont style= for(intx=0;x<1000;x++) //Createarowandputsomecellsinit.Rowsare0 for(inty=0;y<100;y++) cell=row.createCell((short) //Writetheoutputtoa FileOutputStreamfileOut=new RichClient //设置字体HSSFFontfont=设置字体大小;)设置字体名字;//设置样式HSSFCellStylestyle=设置底边框;设置底边框颜色;设置左边框;设置左边框颜色;//设置右边框设置右边框颜色;//设置顶边框设置顶边框颜色;在样式用应用设置的字体设置自动换行;设置水平对齐的样式为居中对齐设置垂直对齐的样式为居中对齐;ExerciseØMyteamcenter中增加菜单生成Ø将选择的对象的名称输入到excelØ在home下生成excel数据集,并将excel文件导入到数据集RichClientProgramming TC9.1中的界面开发将逐渐过渡到SWT üDisplay和Sü控件ü RichClientProgramming RichClientProgramming控件实例的构造:Control(Controlparent,intØØØLabelname=newLabel(shel,ØSWT.SNGLE单行ØSWT.BORDER边框ØSWT.MULTI多行Ø控件的Ø最好不要手动释放一个控件,而应该交由SWTRichClientProgrammingØButton、Label、ØØ RichClientProgrammingØ标准的SWT布局FillLayout:在容器中以相同的大小单行或单列的排列组FormLayout(SWT2.0的新特性):通过定义组件四个边的“粘贴”位置来排列组件, 的相对的组件可以父组件,也可以是同一容器的其它组üRichClientProgrammingØ布局实1.首先定义窗口和Display.getDefault().dispose();//移去平 启动画display=new =newS (display,SWT.TITLE);FormLayoutlayout=newFormLayout();layout.marginHeight=10; .setText("用户登录oRichClientProgrammingØ布局实2.创建窗口上的元素,其中下面的两个button由一个使用RowLayout组件来包容name=new ,name.setText("用户名nameText=new ,SWT.SINGLE|pass=new , passText=newText(s ,SWT.SINGLE|SWT.BORDER);bottom=newComposite(s ,SWT.NONE);RowLayoutrowLayout=newRowLayout();rowLayout.justify=true;//justify定义组件在容器中分散开,效果类似于swing的RichClientProgrammingØ布局实2.创建窗口上的元素,其中下面的两个button由一个使用RowLayout组件来包容name=new ,name.setText("用户名nameText=new ,SWT.SINGLE|pass=new , passText=newText(s ,SWT.SINGLE|SWT.BORDER);bottom=newComposite(s ,SWT.NONE);RowLayoutrowLayout=newRowLayout();rowLayout.justify=true;//justify定义组件在容器中分散开,效果类似于swing的RichClientProgrammingØ布局实mes离是父组件ctr()高度t的(s)为。FormDatadata=newFormData();data.top=newFormAtta oRichClientProgrammingØ布局实定义name文本输入的位置。它的顶边在 的中心位置(这是正确的表达,但程序是这样解释,事实上它的中心位置与在同一条水平线上),左边me 的右边有。data=newdata.top=newFormAtta ent(name,0,SWT.CENTER);data.left=newFormAtta ent(name,10,SWT.RIGHT);RichClientProgrammingØ布局实定义 的位置。它的顶边距 的底边有10个点数的移data=newdata.top=new RichClientProgrammingØ布局实定义pass文本输入的位置。它的顶边在 的中心位置(同),左边与name文本框的左边对data=newdata.top=newFormAtta ent(pass,0,SWT.CENTER);data.left=newFormAtta RichClientProgrammingØ布局实定义bottom组件的位置。它的顶边距 的底边15个点数,左与 的左边对齐,右边与pass文本输入的右边对齐data=newdata.top=newFormAtta ent(pass,15,SWT.BOTTOM);data.left=newFormAtta ent(pass,0,SWT.LEFT);data.right=newFormAtta ØRichClientProgramming Ø要自定 框,首先要继承üpublicclassMyDialogextendsØ定 框大小,需要重写getInitialSize方§protectedPointgetInitialSize()§returnnewØ定 框界面,需要重写createDialogArea方Ø自定 框按钮.需要重写createButton和initializeBounds
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- PEP三年级英语上册教师培训计划
- 秋季幼儿园家长健康意识提升措施
- 电力公司安全检查制度及计划
- 隧道工程质量监测与施工安全管理措施
- 2025教科版一年级科学室外教学计划
- 企业员工健康活动排球计划
- 促进五年级学生语言表达能力的措施
- 装修工程施工质量监管措施
- 大型会议安保方案管理计划
- 探究式学习在物理实验中的应用计划
- 天津2025年应急管理部天津消防研究所招聘27人历年参考题库(频考版)含答案解析
- 新农村建设之《农村自建房设计图纸38套》高清版
- 2024年徐州矿务集团第二医院高层次卫技人才招聘笔试历年参考题库频考点附带答案
- 彩钢瓦屋面渗漏水维修施工方案完整
- 2024年度大型演唱会主办方与演出艺人演出合同协议范本3篇
- 装配式建筑深化设计-1.2.3 装配式建筑深化设计拆分原47课件讲解
- 淹溺安全培训课件
- 【MOOC】园林植物应用设计-北京林业大学 中国大学慕课MOOC答案
- 组织部2024年双拥工作计划
- 2024年中国汽车出口与投资国别指南-泰国篇-中国汽车工业协会
- 《铁路轨道维护》课件-小型机械打磨钢轨作业
评论
0/150
提交评论