PLM之家PLMHome-工业软件践行者

Teamcenter SOA 开发基础代码解析

[复制链接]

2015-2-3 08:45:06 5468 0

admin 发表于 2015-2-3 08:45:06 |阅读模式

admin 楼主

2015-2-3 08:45:06

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
' R+ d5 e  V" j
Teamcenter SOA 开发基础代码解析
  S; _; o5 }; Q  a0 M* An instance of the Connection object is created with implementations of the
' Y! {- [! T! o- @# [" n* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners6 n2 R, t( D2 a& I! \  a
* intefaces. This client application performs the following functions:, K$ {! d5 b' @% b1 H' Z: f
* 1. Establishes a session with the Teamcenter server) q( |* _# x: E# @6 q
* 2. Display the contents of the Home Folder
8 u* M, A4 z" W' r0 D* 3. Performs a simple query of the database: n0 k# `8 \: y( n# i' o* T
* 4. Create, revise, and delete an Item
3 D1 P: r3 E# G9 \0 p
6 j0 h5 T8 W. A& ^" _0 z2 e$ |- R: g3 r$ g# g' ]
public class Hello) l. M( ]& y9 n5 M4 K, v7 O
{
7 z! v* H2 ?8 E* r6 z; |/**9 U8 ?) p+ p- [4 ~8 C
* @param args -help or -h will print out a Usage statement, b/ |. P8 m( ^
*/
8 S0 E: A  Q- I' v; Vpublic static void main(String[] args)$ K% m" d6 g8 s: f
{' I  T# i" ^: C
if (args.length > 0)
* j1 C& E) J& J* b- f+ S  W{: z, `$ O; C  J7 J5 _
if (args[0].equals("-help") || args[0].equals("-h"))
) X7 L9 w  U$ t, k, E4 @8 k{
* U) u4 {6 f% }) q# rSystem.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");
% b1 {5 z: G3 N# H* `$ {& qSystem.exit(0);
  K8 e8 B  H* S( |" p" C/ J: u}& w+ d: h- }& z( Q2 J% K8 _
}
, l; _, O% Q, E// Get optional host information
4 b% ~/ I. }) k+ d9 V7 K: z. z& VString serverHost = "http://localhost:7001/tc";9 Y( O7 R! I9 g1 ~' [3 N) T9 _
String host = System.getProperty("host");
, W8 ]$ b# v$ m8 ~8 h6 u, F9 z8 Oif (host != null && host.length() > 0)
& t% Z: q: `, e- E, V$ W2 }$ ~) p8 w0 J{
: R- _; ~0 F* x  K6 z; N( Y0 `9 N" KserverHost = host;# X, M* y0 E1 z/ B" k+ d5 U
}" ^. [. F# O% j" @
Session session = new Session(serverHost);9 `6 D) }8 [2 h) @% i) Q  u4 _
HomeFolder home = new HomeFolder();6 b5 L; ?1 d( P
Query query = new Query();
+ f2 `" w/ I4 eDataManagement dm = new DataManagement();
+ U6 z" ~+ b& |+ {// Establish a session with the Teamcenter Server
+ B# v* ?! b  U1 c3 q! \User user = session.login();
! R, S# H& N: r/ G/ B) E- H// Using the User object returned from the login service request
) J; V  N. H! S7 ~, K// display the contents of the Home Folder4 t# h1 |  T% r) c) ^, B
home.listHomeFolder(user);
1 N, `$ H5 V+ J2 {2 K. M// Perform a simple query of the database2 z" `) V) k4 F. m' ?3 Y$ F1 Z) ~
query.queryItems();6 t4 T( A0 x, E/ O. B) p. U* S
// Perform some basic data management functions
. N) C. h) y5 X5 ndm.createReviseAndDelete();
' O( n  z! a. |& [7 U$ x// Terminate the session with the Teamcenter server$ H! i* C3 J' n. o: e8 g
session.logout();/ l3 p/ E; M7 x1 B: T0 j
}
# r# K% K5 r/ w* m9 z8 e}
: p( q8 ^7 [4 p. D7 I( u. o: j6 z" ?
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了