PLM之家PLMHome-国产软件践行者

Teamcenter SOA 开发基础代码解析

[复制链接]

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

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

admin 楼主

2015-2-3 08:45:06

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

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

x
8 v; ?, W' }2 y$ A
Teamcenter SOA 开发基础代码解析
/ B2 D, V, \" q) @9 Z& N% E- r* An instance of the Connection object is created with implementations of the. V" ?3 X: q- w7 J% D: |. b0 X
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners
/ L+ @1 R, C* E* intefaces. This client application performs the following functions:
, A9 @1 S5 U: n5 S, ^9 p* 1. Establishes a session with the Teamcenter server
  k9 r1 J7 [9 K6 I1 I' R* 2. Display the contents of the Home Folder
( l: _5 p, Z; v: }' {  g5 h* 3. Performs a simple query of the database7 ^! \( v0 t( s' y6 f/ V; c2 z5 v
* 4. Create, revise, and delete an Item- e0 e& |1 {9 T8 ~) V& w7 X. k
( w- k# T& C" @* l
" f1 T1 F) E1 N- f# o9 j' @. y0 V
public class Hello
# z0 ^  m( J7 H{5 Z/ Y. S4 j! F' f$ x/ H* \
/**& e" h% K9 D. m- S; F& b# z
* @param args -help or -h will print out a Usage statement
, f1 v6 [* I8 h. m3 f- h; \*/
% p1 K  _* \7 P; }/ C5 a+ |/ Xpublic static void main(String[] args)
( o' a! a0 w9 \- q. b: _3 @{
6 b6 g5 @8 j. f  B/ Gif (args.length > 0)
. J" K- |% |( U2 K0 K; r2 e{0 q& J9 g. a9 |$ t
if (args[0].equals("-help") || args[0].equals("-h"))
+ q7 O3 k, [0 M3 M9 W' w% @{
: B, k, p! \  M/ {) a) z* r  PSystem.out.println("usage: java [-Dhost=http://server:port/TC] com.teamcenter.hello.Hello");
: y! m6 b; Q& w% F  g2 tSystem.exit(0);
! H$ t' C- g7 K4 E& C}
+ J8 c8 k* r- @" N8 R. ?}* i# H" T7 Z) N' ?
// Get optional host information6 K8 s! H- _5 }+ q. }
String serverHost = "http://localhost:7001/tc";5 _0 A5 f+ l  h1 r
String host = System.getProperty("host");6 D( h& B$ t+ x# s9 a+ }
if (host != null && host.length() > 0)
- r3 @4 n2 q4 i9 [; P/ b6 }{
1 s/ \5 y* Q0 o2 e: FserverHost = host;) A- T( ^5 i0 R/ r( N- _4 u3 v
}
& s. k& s8 a- C9 A& kSession session = new Session(serverHost);
8 e) ^" z2 V% k# X% |: y- AHomeFolder home = new HomeFolder();
9 Z% `9 y1 M7 b- o6 c" ]Query query = new Query();
: j4 @" |) b+ S- c2 p- i3 j$ YDataManagement dm = new DataManagement();0 Y* n& q* V  J
// Establish a session with the Teamcenter Server
. K5 I2 D& d/ G6 d5 l1 j* R" @User user = session.login();* n! r/ z. H0 r5 A9 z
// Using the User object returned from the login service request/ f! g( z+ A$ R* C: j' \
// display the contents of the Home Folder& ^( W: K1 k, V* v! m
home.listHomeFolder(user);# @3 R2 R* ~$ y1 ^/ t/ J
// Perform a simple query of the database) l8 Z0 U. C- q% L" x5 e
query.queryItems();% C1 W9 y7 H9 ?9 A% r
// Perform some basic data management functions
5 t3 Z( t: k/ f$ Mdm.createReviseAndDelete();
1 H; U9 F$ \5 ~# p: S// Terminate the session with the Teamcenter server- q& j  U% u; ?
session.logout();
; M: w8 W2 p5 \8 R, D( m0 {! D5 u}- X* }# G; t2 S9 M/ Y4 r1 L7 Y4 r
}0 A* e2 Y" i# w6 r  N0 z7 a8 u
# a/ i8 F7 a: f( e3 f. ]3 q
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了