Rev 73 | Rev 1936 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
def contentModel2Struct(expslide) :struct = {}# Set children slide structuresif expslide.hasChildrenSlides() :expchildrenslides = expslide.getExpandedChildrenSlides()childrenstructs = {}for expchildslide in expchildrenslides :childstruct = contentModel2Struct(expchildslide)# REVISIT - ID in place to labelslidelabel = expchildslide.getSlideDefinition().getLabel()print "slidelabel=" + slidelabelchildrenstructs[slidelabel] = childstructstruct['childrenslides'] = childrenstructs# Set feature structuresif expslide.hasFeatures() :expfeatures = expslide.getExpandedFeatures()featurestructs = {}for expfeature in expfeatures :# REVISIT - ID in place to labelfeaturelabel = expfeature.getFeatureDefinition().getLabel()print "featurelabel=" + featurelabelif expfeature.hasBullets() :bulletsstruct = []expbullets = expfeature.getExpandedBullets()for expbullet in expbullets :if expbullet.isComposite() :primitivedataobjects = expbullet.getDataObject().getPrimitiveDataObjects()for primitivedataobject in primitivedataobjects :bulletvalue = primitivedataobject.getValue()print "bulletvalue=" + bulletvaluebulletsstruct.append(bulletvalue)elif expbullet.isEnumerated() :bulletvalue = expbullet.getExpandedEnumDataObject().getEnumValue().getValue()print "bulletvalue=" + bulletvaluebulletsstruct.append(bulletvalue)else :bulletvalue = expbullet.getDataObject().getValue()print "bulletvalue=" + bulletvaluebulletsstruct.append(bulletvalue)featurestructs[featurelabel] = bulletsstructelse :# Set to empty list, this is to accomodate bullet-less featuresfeaturestructs[featurelabel] = []struct['features'] = featurestructsreturn struct