|
问题:
9 ?1 M3 [& W7 `如何通过文本(xml)文件创建、填充一个值列表? 8 L7 n6 L2 V% q$ R
. O4 U" Q% }3 Q0 \ A, a5 ]0 A( y4 q
解决方案:
" p9 ~. Q4 C- s# C0 Z你可以创建一个XML文件来创建你需要的LOV. ( z$ @. g8 E( q e
9 ^/ q* z4 H- v1 z/ t) o+ d5 N4 N
步骤1. 创建一个新的文件lov_import.xml,添加下面的文件头, 7 a( m# R2 \' {6 C/ J9 I7 U8 l
2 A! d# B$ f+ ^1 n$ ^$ s/ f
--------------------lov_import.xml-----------------------------------% z* u8 f: M' O; P! p: u! B
<?xml version="1.0" encoding="utf-8"?>' p& v" \$ P' ^
<plmxml_busLMXMLBusinessTypes xmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">1 c- |4 L7 }5 a
0 W3 b( M: y1 W) E7 m1 R 步骤2.添加LOV名称和类型定义
) G9 l4 l4 d# L Y0 G
3 _5 D& G! c6 B1 r1 e--------------------lov_import.xml-----------------------------------
9 F4 U: y- d" f3 ?- V, R<?xml version="1.0" encoding="utf-8"?>& U5 u$ Y8 u0 d; P9 v Q
<plmxml_busLMXMLBusinessTypes xmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">
M1 h$ V; G0 z+ |4 |<!-- name, type, Usage, etc -->( V3 E/ }1 f$ H
<plmxml_busistOfValues id="id1" name="name_of_the_lov" lovType="listOfValuesString" lovUsage="exhaustive" valueType="string">: S- f) c) x- e1 P0 X. @ U
% J: d8 T6 J+ r4 m( |- X+ {+ Z( P
步骤3. 添加值列表的选项, 6 E g1 D1 K) U3 |( q
, k B/ v* ^ ~
--------------------lov_import.xml-----------------------------------
% |* n; y0 l9 V' N$ B: P/ Z<?xml version="1.0" encoding="utf-8"?>
: L6 @ i3 g5 F0 }5 h<plmxml_busLMXMLBusinessTypes
% v& r$ j+ W! G3 T; ~xmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">5 T9 g) P8 C; L' R( I3 j) h
<!-- name, type, Usage, etc -->
5 T" ~9 l( b' v+ @6 ~7 i' K% [<plmxml_busistOfValues id="id1" name="name_of_the_lov" lovType="listOfValuesString" lovUsage="exhaustive" valueType="string">
1 V( @ g5 R$ d3 a<!-- option values for the lov -->
' T+ O( h! d( w7 t# j/ N5 [$ @% J7 f' @<plmxml_busovValueDetails id="id2" indexValue="0" stringValue="test1"></plmxml_busovValueDetails> ^. k) c, ]8 r' z- l! c! h( g
<plmxml_busovValueDetails id="id3" indexValue="1" stringValue="test2"></plmxml_busovValueDetails>
3 ^4 @8 s' z+ w<plmxml_busovValueDetails id="id4" indexValue="2" stringValue="test3"></plmxml_busovValueDetails>+ H J5 |0 C0 T/ s
<plmxml_busovValueDetails id="id5" indexValue="3" stringValue="test4"></plmxml_busovValueDetails>
# V$ y: G( S. \- ?<plmxml_bus:LovValueDetails id="id6" indexValue="4" stringValue="test5"></plmxml_bus:LovValueDetails>+ H" _- M& j' R0 d% V
<plmxml_bus:LovValueDetails id="id7" indexValue="5" stringValue="test6"></plmxml_bus:LovValueDetails>- R# M/ h8 N2 T5 D/ x$ m# c
: {, N# i$ g( u6 }4 O# w 步骤4. 添加结束部分,
$ S( B1 o' X! y' ]1 X! F l" y# U
" m9 D! N- t& C7 {4 \--------------------lov_import.xml-----------------------------------) d0 O1 A1 X- S' ^& k$ t0 ?0 _ B' D: H
<?xml version="1.0" encoding="utf-8"?>1 W4 X( Y/ a. n7 l
<plmxml_busLMXMLBusinessTypes
! S' U1 b$ n- I! {xmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">) e# r# U* B; L! x' I
<!-- name, type, Usage, etc -->% V3 }" F* {+ N' V" I6 u
<plmxml_bus:ListOfValues id="id1" name="name_of_the_lov" lovType="listOfValuesString" lovUsage="exhaustive" valueType="string">/ \( d/ v0 J( j- O% l5 S
<!-- option values for the lov --> 4 \8 O/ v0 r A h7 i# X
<plmxml_bus:LovValueDetails id="id2" indexValue="0" stringValue="test1"></plmxml_bus:LovValueDetails>
* @2 j& x0 A% r( _% U3 V$ J<plmxml_bus:LovValueDetails id="id3" indexValue="1" stringValue="test2"></plmxml_bus:LovValueDetails>
, B/ ^2 j8 B" k u<plmxml_bus:LovValueDetails id="id4" indexValue="2" stringValue="test3"></plmxml_bus:LovValueDetails>0 |1 @& n# ~5 m. e
<plmxml_bus:LovValueDetails id="id5" indexValue="3" stringValue="test4"></plmxml_bus:LovValueDetails>. g% ^3 X( B8 a4 l/ t
<plmxml_bus:LovValueDetails id="id6" indexValue="4" stringValue="test5"></plmxml_bus:LovValueDetails>
% z. t$ |' l# U* b# d5 |<plmxml_bus:LovValueDetails id="id7" indexValue="5" stringValue="test6"></plmxml_bus:LovValueDetails>
4 y( H, b- N# i<!-- Close -->
6 L) L9 ` A& s# T: z# r% f</plmxml_bus:ListOfValues>* [* D" s: N& V
</plmxml_busLMXMLBusinessTypes>
+ }: f: d, _* C: C4 u& b-------------------- complete lov_import.xml----------------------------------5 A% j1 ?% q9 Z, i
/ k" h6 W* [6 z, L) x8 L 步骤5. 在TCEng的DOS窗口中,运行下面的命令plmxml_import 导入值列表, %iman_bin%\plmxml_import.exe -u=infodba -p=infodba -g=dba -xml_file=c:\lov_import.xml
* L; v) Z# K% U7 ^) u/ P; }
) N8 B3 J L- s) A( q. |! W (注意: 每一个ID和索引值必须是递增的. 例如, ) h% o; p9 U4 E; |3 E
id="id2" indexValue="0"
2 E3 i% Z- A! ~id="id3" indexValue="1" 9 {" ^2 Q; s# ^ M$ L
id="id4" indexValue="2"
% X3 |9 R% n2 }# v8 jid="id5" indexValue="3" 7 ]+ S) O: M9 i" ^8 f, k
id="id6" indexValue="4"
) n- @& Z) S Y5 E- [# E A" q)
9 x' X+ E7 j% U, t/ a. U. `- c0 Y! T4 ?* O2 _. F* T9 G0 T
注意:
2 W6 l- ~% M6 V对于listOfValuesString类型的值列表来说,选项lovUsage可以是exhaustive 或者是 suggestive。" G/ e* c- w7 a, j
; T6 s6 B# n3 ~+ ~+ G u Exhaustive: 定义了所有可能的有效选项,如果你输入了一个并不在列表中的值, ,系统将提示错误。" F/ m% b. a5 F: K( d
! p; Q2 i& a% l% b
SUGgestive : 定义了一些建议的有效值。例如,你可以在值列表中定义一些常见的描述。因为描述可以接受任意的字符串,你可以从列表中选择描述,或者是你自己输入数据。 |
|