Changeset 1631 for ComponentRegistry/branches/jeaferversion/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/model/CMDModelFactory.as
- Timestamp:
- 11/28/11 15:46:02 (13 years ago)
- Location:
- ComponentRegistry/branches/jeaferversion
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/jeaferversion/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/model/CMDModelFactory.as
r1578 r1631 1 1 package clarin.cmdi.componentregistry.editor.model { 2 2 import clarin.cmdi.componentregistry.common.ComponentMD; 3 import clarin.cmdi.componentregistry.common.CommentMD; 3 4 import clarin.cmdi.componentregistry.common.ItemDescription; 5 import clarin.cmdi.componentregistry.common.CommentDescription; 4 6 import clarin.cmdi.componentregistry.editor.ValueSchemeItem; 5 7 6 8 import mx.collections.ArrayCollection; 7 9 import mx.collections.XMLListCollection; … … 22 24 var cmdComp:CMDComponent = createComponent(component); 23 25 result.cmdComponents.addItem(cmdComp); 26 } 27 return result; 28 } 29 30 public static function createCommentModel(xml:XML, description:CommentDescription):CMDSpec { 31 var result:CMDSpec = new CMDSpec(xml.@isProfile == "true"); 32 result.headerName = xml.Header.Name; 33 result.headerId = xml.Header.ID; 34 result.headerDescription = xml.Header.Description; 35 var comments:XMLList = xml.elements(CommentMD.CMD_COMMENT); 36 for each (var comment:XML in comments) { 37 var cmdComp:CMDComment = createComment(comment); 38 result.cmdComponents.addItem(cmdComp); 39 } 40 return result; 41 } 42 43 private static function createComment(xml:XML):CMDComment { 44 var result:CMDComment = new CMDComment(); 45 result.componentId = xml.@ComponentId; 46 result.profileId = xml.@ProfileId; 47 result.creatorName = xml.@creatorName; 48 result.filename = xml.@filename; 49 result.registerDate= xml.@registerDate; 50 result.commentId= xml.@commentId; 51 var comments:XMLList = xml.comments(); 52 for each (var comment:XML in comments) { 53 var cmdComment:CMDComment = createComment(comment); 54 result.cmdComments.addItem(cmdComment); 24 55 } 25 56 return result;
Note: See TracChangeset
for help on using the changeset viewer.