| 82 |
naveen |
1 |
print "expFacetDef=" + `expFacetDef`
|
|
|
2 |
print "expFeatureDef=" + `expFeatureDef`
|
|
|
3 |
print "possibleValues=" + `possibleValues`
|
|
|
4 |
|
|
|
5 |
facetDefID = expFacetDef.getID()
|
|
|
6 |
xmlsnippet = "\t<Facet>\n"
|
|
|
7 |
xmlsnippet += "\t\t<FacetDefinitionID>" + str(facetDefID) + "</FacetDefinitionID>\n"
|
|
|
8 |
|
|
|
9 |
target = expFacetDef.getTarget()
|
|
|
10 |
xmlsnippet += "\t\t<Label>" + target + "</Label>\n"
|
|
|
11 |
|
|
|
12 |
expBulletDef = expFeatureDef.getExpandedBulletDefinition();
|
|
|
13 |
if expBulletDef.isMultivalue() :
|
|
|
14 |
ismultivalue = "true"
|
|
|
15 |
else :
|
|
|
16 |
ismultivalue = "false"
|
|
|
17 |
|
|
|
18 |
xmlsnippet += "\t\t<IsMultivalue>" + ismultivalue + "</IsMultivalue>\n"
|
|
|
19 |
|
|
|
20 |
xmlsnippet += "\t\t<HierarchyType>Flat</HierarchyType>\n"
|
|
|
21 |
|
|
|
22 |
xmlsnippet += "\t\t<NullBehavior>Reject</NullBehavior>\n"
|
|
|
23 |
|
|
|
24 |
datatypeDef = expBulletDef.getDatatypeDefinition()
|
|
|
25 |
|
|
|
26 |
datatype = "string"
|
|
|
27 |
if expBulletDef.isEnumerated() :
|
|
|
28 |
datatype = "string"
|
|
|
29 |
elif expBulletDef.isComposite() :
|
|
|
30 |
datatype = "string"
|
|
|
31 |
else :
|
|
|
32 |
datatype = datatypeDef.getName()
|
|
|
33 |
|
|
|
34 |
xmlsnippet += "\t\t<Datatype>" + datatype + "</Datatype>\n"
|
|
|
35 |
|
|
|
36 |
# Learned or fixed values
|
|
|
37 |
xmlsnippet += "\t\t<FacetValues>\n"
|
|
|
38 |
|
|
|
39 |
for value in possibleValues :
|
|
|
40 |
xmlsnippet += "\t\t\t<FacetValue>\n"
|
|
|
41 |
xmlsnippet += "\t\t\t\t<Value>" + value + "</Value>\n"
|
|
|
42 |
xmlsnippet += "\t\t\t</FacetValue>\n"
|
|
|
43 |
|
|
|
44 |
xmlsnippet += "\t\t</FacetValues>\n"
|
|
|
45 |
|
|
|
46 |
xmlsnippet += "\t</Facet>\n"
|