Ignore:
Timestamp:
11/28/11 15:46:02 (13 years ago)
Author:
jeafer
Message:

Jean-Charles branch initial commit,
Changes regarding comment on the ComponentRegistry service.
Get comment from RestService? to Database access (CommentsDao?) implemented.
TestComment? class in development

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  
    11package clarin.cmdi.componentregistry.editor.model {
    22        import clarin.cmdi.componentregistry.common.ComponentMD;
     3        import clarin.cmdi.componentregistry.common.CommentMD;
    34        import clarin.cmdi.componentregistry.common.ItemDescription;
     5        import clarin.cmdi.componentregistry.common.CommentDescription;
    46        import clarin.cmdi.componentregistry.editor.ValueSchemeItem;
    5 
     7       
    68        import mx.collections.ArrayCollection;
    79        import mx.collections.XMLListCollection;
     
    2224                                var cmdComp:CMDComponent = createComponent(component);
    2325                                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);
    2455                        }
    2556                        return result;
Note: See TracChangeset for help on using the changeset viewer.