|
问题:* a) D% h4 m' C6 i: s
如何通过文本(xml)文件创建、填充一个值列表?
7 F _7 v1 u7 u2 b, U8 c0 P& F: A, d/ F0 w/ r* ]! G/ s: _6 I
解决方案:: [2 Z2 }' X" O5 `# i$ v
你可以创建一个XML文件来创建你需要的LOV. * y4 ?! P; y7 y% [- `, v, B+ t
5 @, b% J& Z' _9 g! B# @3 _
步骤1. 创建一个新的文件lov_import.xml,添加下面的文件头,
; @3 j" `# g# U, G7 t; Y
; W* [- @7 N4 O- m* c c--------------------lov_import.xml-----------------------------------
( W D( H" J2 q<?xml version="1.0" encoding="utf-8"?>
8 t9 v/ e( z/ a# q! ~, R<plmxml_busLMXMLBusinessTypes xmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">
0 d3 J d2 H1 t3 g
7 y6 \6 M# A! `6 U- d* S 步骤2.添加LOV名称和类型定义
6 {5 e$ |7 q: c4 s1 ?' X2 g. B9 t( l& T1 y( v
--------------------lov_import.xml-----------------------------------; `! u( r+ X* v3 z- b: @, i
<?xml version="1.0" encoding="utf-8"?>
* }! h- e8 F! }+ H<plmxml_busLMXMLBusinessTypes xmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">
! z0 }9 n/ n5 i# S<!-- name, type, Usage, etc -->) M: g2 }% ~! ]+ G, S8 P
<plmxml_busistOfValues id="id1" name="name_of_the_lov" lovType="listOfValuesString" lovUsage="exhaustive" valueType="string">
% |6 y% ~6 _* s3 e0 n9 W1 |0 a+ m( t$ \* {0 I
步骤3. 添加值列表的选项, % h6 N" c/ Q; v Q7 d) r) A; C
$ r! Y+ X5 J8 i5 a; @, h5 k4 m
--------------------lov_import.xml----------------------------------- h J1 g- _& O7 q' V% Q B" l( t
<?xml version="1.0" encoding="utf-8"?># u: @5 X. w9 T6 o
<plmxml_busLMXMLBusinessTypes
! z( L' g! s! H5 E9 W6 mxmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">
/ e' S' i* ] w<!-- name, type, Usage, etc -->/ {! F9 N. b, [% w* t& f- B
<plmxml_busistOfValues id="id1" name="name_of_the_lov" lovType="listOfValuesString" lovUsage="exhaustive" valueType="string">
) T* f0 x: X1 u, w<!-- option values for the lov -->
5 L( [+ u3 K5 ]<plmxml_busovValueDetails id="id2" indexValue="0" stringValue="test1"></plmxml_busovValueDetails>
6 M/ f' p& D% M+ ?# w( ~5 m<plmxml_busovValueDetails id="id3" indexValue="1" stringValue="test2"></plmxml_busovValueDetails>
, n4 w5 E1 K9 R1 h- [* k- J<plmxml_busovValueDetails id="id4" indexValue="2" stringValue="test3"></plmxml_busovValueDetails>; p+ v( C. b, s: }# p- H
<plmxml_busovValueDetails id="id5" indexValue="3" stringValue="test4"></plmxml_busovValueDetails>; e$ e3 r/ Q4 T9 v3 f& C
<plmxml_bus:LovValueDetails id="id6" indexValue="4" stringValue="test5"></plmxml_bus:LovValueDetails>% G2 c% g8 b/ b, S% H6 P
<plmxml_bus:LovValueDetails id="id7" indexValue="5" stringValue="test6"></plmxml_bus:LovValueDetails>/ p# D6 @: s: j9 V% V% U
3 {0 \- N, Q6 i% j 步骤4. 添加结束部分,
# h0 T3 C: ]/ s. o" U
/ D9 j% U7 c9 Y4 F/ Q. E% I--------------------lov_import.xml-----------------------------------6 ~: s7 K/ r+ ~& p) P; ~
<?xml version="1.0" encoding="utf-8"?>
N% w4 y- A1 w<plmxml_busLMXMLBusinessTypes
" b" y, i. R- axmlns:plmxml_bus="http://www.plmxml.org/Schemas/PLMXMLBusinessSchema" schemaVersion="5.1">6 A. _, T: |6 L8 p& r
<!-- name, type, Usage, etc -->
% j! _+ a+ D$ m$ A# j<plmxml_bus:ListOfValues id="id1" name="name_of_the_lov" lovType="listOfValuesString" lovUsage="exhaustive" valueType="string">4 q5 t% t+ N7 z
<!-- option values for the lov -->
0 W" _! t, k1 _<plmxml_bus:LovValueDetails id="id2" indexValue="0" stringValue="test1"></plmxml_bus:LovValueDetails>8 R: j+ y8 [# `# U9 ~8 Y
<plmxml_bus:LovValueDetails id="id3" indexValue="1" stringValue="test2"></plmxml_bus:LovValueDetails>) I a2 k' g6 A! r: F3 x z- t
<plmxml_bus:LovValueDetails id="id4" indexValue="2" stringValue="test3"></plmxml_bus:LovValueDetails>: ?- n1 K$ y0 v3 J$ _. O
<plmxml_bus:LovValueDetails id="id5" indexValue="3" stringValue="test4"></plmxml_bus:LovValueDetails>
* S1 p. P( k2 I& g<plmxml_bus:LovValueDetails id="id6" indexValue="4" stringValue="test5"></plmxml_bus:LovValueDetails>8 N; Q W" e; f2 a! S9 f
<plmxml_bus:LovValueDetails id="id7" indexValue="5" stringValue="test6"></plmxml_bus:LovValueDetails>
4 l, \7 B/ {# Q1 `! G, R* O6 Y<!-- Close -->
9 V+ H& o: j/ U</plmxml_bus:ListOfValues>6 s: f! r0 u% D$ M5 t9 @
</plmxml_busLMXMLBusinessTypes>$ k! n3 W+ z2 I5 S) R
-------------------- complete lov_import.xml----------------------------------1 o1 m7 M% X- w# Q; d
' r- r. A9 \7 H- Q x" n# V- ^% q
步骤5. 在TCEng的DOS窗口中,运行下面的命令plmxml_import 导入值列表, %iman_bin%\plmxml_import.exe -u=infodba -p=infodba -g=dba -xml_file=c:\lov_import.xml1 w- {8 X" C+ ]/ U7 J) @$ B# {
- W+ A; C& u9 z. Z (注意: 每一个ID和索引值必须是递增的. 例如,
z9 i' h8 O: ^( L; j' m7 nid="id2" indexValue="0"
7 A9 a8 W }7 }) B) `' n( [, Wid="id3" indexValue="1" ( z) k0 @6 a0 K1 ^% H" ?8 X9 K
id="id4" indexValue="2"
3 w J, w5 D4 M3 Oid="id5" indexValue="3" 7 A- C6 n! {0 E1 R* p
id="id6" indexValue="4"
! X+ H+ q' L- i) y)
3 P% I0 ] }# f' b. e3 a/ _8 a8 |3 ]5 d5 w3 {" `
注意:
% Y2 R, [4 ` W1 j对于listOfValuesString类型的值列表来说,选项lovUsage可以是exhaustive 或者是 suggestive。) T; V7 g+ a4 _6 U8 q' S
# l1 K( W1 g* r0 c# R Exhaustive: 定义了所有可能的有效选项,如果你输入了一个并不在列表中的值, ,系统将提示错误。
* J' p( H! h8 D3 }* m* a! X# G! J" g" }9 C. ?; J
SUGgestive : 定义了一些建议的有效值。例如,你可以在值列表中定义一些常见的描述。因为描述可以接受任意的字符串,你可以从列表中选择描述,或者是你自己输入数据。 |
|