Subversion Repositories SmartDukaan

Rev

Rev 69 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 73
Line 1... Line 1...
1
def debug() :
1
def contentModel2Struct(expslide) :
2
    import sys
2
    struct = {}
3
    print sys.path
-
 
4
    
3
    
5
    print "expFacetDef=" + `expFacetDef`
4
    # Set children slide structures
6
    print "expEntity=" + `expEntity`
5
    if expslide.hasChildrenSlides() :
-
 
6
        expchildrenslides = expslide.getExpandedChildrenSlides()
7
    if vars().has_key('feature'):
7
        childrenstructs = {}
-
 
8
        for expchildslide in expchildrenslides :
-
 
9
            childstruct = contentModel2Struct(expchildslide) 
-
 
10
            
-
 
11
            # REVISIT - ID in place to label
-
 
12
            slidelabel = expchildslide.getSlideDefinition().getLabel() 
8
        print "feature=" + `feature`
13
            print "slidelabel=" + slidelabel
-
 
14
            childrenstructs[slidelabel] = childstruct
9
        
15
            
-
 
16
        struct['childrenslides'] = childrenstructs
-
 
17
    
-
 
18
    # Set feature structures
10
    if vars().has_key('featureDef'):
19
    if expslide.hasFeatures() :
-
 
20
        expfeatures = expslide.getExpandedFeatures()
-
 
21
        featurestructs = {}
11
        print "featureDef=" + `featureDef`
22
        for expfeature in expfeatures :
12
        
23
            
-
 
24
            # REVISIT - ID in place to label
-
 
25
            featurelabel = expfeature.getFeatureDefinition().getLabel()
-
 
26
            print "featurelabel=" + featurelabel 
13
    if vars().has_key('slide'):
27
            if expfeature.hasBullets() :
-
 
28
                bulletsstruct = []
-
 
29
                expbullets = expfeature.getExpandedBullets()
-
 
30
                for expbullet in expbullets :
-
 
31
                    if expbullet.isComposite() :
-
 
32
                        primitivedataobjects = expbullet.getDataObject().getPrimitiveDataObjects()
-
 
33
                        for primitivedataobject in primitivedataobjects :
-
 
34
                            bulletvalue = primitivedataobject.getValue()
-
 
35
                            print "bulletvalue=" + bulletvalue
-
 
36
                            bulletsstruct.append(bulletvalue)
-
 
37
                         
-
 
38
                    elif expbullet.isEnumerated() :
-
 
39
                        bulletvalue = expbullet.getExpandedEnumDataObject().getEnumValue().getValue()
-
 
40
                        print "bulletvalue=" + bulletvalue
-
 
41
                        bulletsstruct.append(bulletvalue)
-
 
42
                    
14
        print "slide=" + `slide`
43
                    else :
-
 
44
                        bulletvalue = expbullet.getDataObject().getValue()
-
 
45
                        print "bulletvalue=" + bulletvalue
-
 
46
                        bulletsstruct.append(bulletvalue)
-
 
47
                        
-
 
48
                featurestructs[featurelabel] = bulletsstruct
15
        
49
            else :
-
 
50
                # Set to empty list, this is to accomodate bullet-less features
16
    if vars().has_key('slideDef'):
51
                featurestructs[featurelabel] = []
-
 
52
    
17
        print "slideDef=" + `slideDef`
53
        struct['features'] = featurestructs
-
 
54
    
-
 
55
    return struct
-
 
56
    
-
 
57
            
18
58