|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter SOA开发源码分享:获取所有的item版本信息4 v4 s& U ?8 m5 J3 I
1 A8 B* l# l V( {3 t
9 _0 T3 R3 \. O! Q& e8 @
public static void getAllItemRevisionsOfItem(ModelObject[] item_list)" a* H9 Q( b$ {5 g8 F' a
{
! k/ M' i. o$ |: e6 Q# B3 r if(item_list == null) return;
8 m2 t! _* q+ j8 L- [1 S* N& F/ J2 @
SimpleDateFormat format = 1 o& l. w* z0 T) B! G7 u4 m3 v
new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));
1 N! ?; a- Z4 g( [) R. o+ A. m- b' P( z1 v; ?6 V0 h, e n ~
for (int ii = 0; ii < item_list.length; ii++)/ N2 f$ P$ A2 c( T) r
{# ~8 q o) p0 i( o
System.out.println("\nItem Revision List\tLast Modified");9 F) b' p6 s; x. h5 h* N1 I/ h. M
System.out.println("====================\t=============");
3 U( v9 Y X W4 B( U
; W9 ]% |) w% x& X% U DataManagementService dm = 0 O1 N% ~/ R1 a; x( y
DataManagementService.getService(Session.geTConnection());
2 S# t) O, j* s0 {$ T+ D
, M- v8 o) y E K! ^, N3 ] String[] attributes = {"revision_list"};& v/ |' M, d/ q1 S
dm.getProperties(item_list, attributes);
& v& H; T# c( S6 G- |9 m! q, g+ p( U$ V9 a, F
try: C8 E& ~7 C; k2 G3 C4 O1 q
{) Z9 ~& C4 {+ e( c
ModelObject[] rev_list = 1 d. w$ E8 q3 S [' v) ]! y
((Item) item_list[ii]).get_displayable_revisions();. `& b1 _* n7 z! @( g6 ]3 M8 [
for (int kk = 0; kk < rev_list.length; kk++)/ C3 H( V' R6 q+ K$ ^1 x
{9 N9 l* g, k4 I( Z
String objectString =" k- z. k5 J8 |: k: C+ O8 t
((WorkspaceObject) rev_list[kk]).get_object_string();/ ^" n/ i+ H: M4 B8 y
Calendar lastModified = % g, S' {; o! M; r0 u4 q3 n. n
((POM_application_object) rev_list[kk]).get_last_mod_date();
3 M/ X" G3 c& j2 M b System.out.println(objectString + "\t\t" + # a+ J* ]3 G8 x- C! O. A
format.format(lastModified.getTime()));
, e% K+ w+ X* T, k; I4 o$ p }( X0 Z5 e# N# `
}+ ]" n" c6 u# I% A/ q) [3 V
catch (NotLoadedException e)
3 |4 v9 Y9 g0 T% N {/ n& Q+ A5 H: ^" s: b
System.out.println(e.getMessage());0 Y1 \. K- Z' r, [: M
}+ ^/ {; B' b+ f! |1 G" s
}3 r6 M) O2 `% a' E: l
}% ~( J. S( A( J5 M) D7 B
|
|