Example #1
0
 public LinkView(Guid mapUid, IGlymaRelationship relationship, XmlDocument doc, XmlElement parent, LinkType linkType)
     : this(doc, parent, linkType)
 {
     AddAttributeByKeyValue("id", mapUid.ToLongString());
     AddAttributeByKeyValue("created", relationship.Created);
     AddAttributeByKeyValue("lastModified", relationship.LastModified);
 }
Example #2
0
 public void AddRelationship(IGlymaRelationship relationship)
 {
     if (!Relationships.Contains(relationship))
     {
         Relationships.Add(relationship);
     }
 }
Example #3
0
 public void AddRelationship(IGlymaRelationship relationship)
 {
     if (!Relationships.Contains(relationship))
     {
         Relationships.Add(relationship);
     }
 }
Example #4
0
 public LinkView(Guid mapUid, IGlymaRelationship relationship, XmlDocument doc, XmlElement parent, LinkType linkType)
     : this(doc, parent, linkType)
 {
     AddAttributeByKeyValue("id", mapUid.ToLongString());
     AddAttributeByKeyValue("created", relationship.Created);
     AddAttributeByKeyValue("lastModified", relationship.LastModified);
     
 }
Example #5
0
        private LinkType GetLinkType(IGlymaRelationship relationship)
        {
            LinkType linkType = LinkType.RespondsTo;

            if (relationship != null && relationship.NodeFrom != null && relationship.NodeFrom.NodeType != null)
            {
                switch (relationship.NodeFrom.NodeType.Name)
                {
                case "CompendiumDecisionNode":
                    linkType = LinkType.Resolves;
                    break;

                case "CompendiumReferenceNode":
                    // not currently part of our schema of node types, but this is the correct LinkType
                    linkType = LinkType.Specializes;
                    break;

                case "CompendiumNoteNode":
                    linkType = LinkType.ExpandsOn;
                    break;

                case "CompendiumConNode":
                    linkType = LinkType.ObjectsTo;
                    break;

                case "CompendiumProNode":
                    linkType = LinkType.Supports;
                    break;

                case "CompendiumArgumentNode":
                    //not currently part of our schema of node types, but this is the correct LinkType
                    linkType = LinkType.Challenges;
                    break;

                case "CompendiumIdeaNode":
                    linkType = LinkType.RespondsTo;
                    break;

                case "CompendiumMapNode":
                    linkType = LinkType.RespondsTo;
                    break;

                case "CompendiumQuestionNode":
                    linkType = LinkType.RespondsTo;
                    break;

                case "CompendiumListNode":
                    // not currently part of our schema of node types, but this is the correct LinkType
                    linkType = LinkType.RespondsTo;
                    break;

                default:
                    linkType = LinkType.RespondsTo;
                    break;
                }
            }
            return(linkType);
        }
Example #6
0
 public void AddLink(Guid mapId, IGlymaRelationship relationship)
 {
     if (!IsRelationshipExist(relationship))
     {
         var xmlLink = new Link(mapId, relationship, Doc, _xmlElementLinks);
         xmlLink.CreateElement();
         Relationships.Add(relationship);
     }
 }
Example #7
0
 public void AddLink(Guid mapId, IGlymaRelationship relationship)
 {
     if (!IsRelationshipExist(relationship))
     {
         var xmlLink = new Link(mapId, relationship, Doc, _xmlElementLinks);
         xmlLink.CreateElement();
         Relationships.Add(relationship);
     }
 }
Example #8
0
 public Link(Guid mapId, IGlymaRelationship relationship, XmlDocument doc, XmlElement parent)
     : base(doc, relationship, parent)
 {
     _mapId        = mapId;
     _relationship = relationship;
     AddAttributeByKeyValue("id", _relationship.Id.ToLongString());
     AddAttributeByKeyValue("created", _relationship.Created);
     AddAttributeByKeyValue("lastModified", _relationship.LastModified);
     AddAttributeByKeyValue("author", "Glyma");
     AddAttributeByKeyValue("from", _relationship.From.ToLongString());
     AddAttributeByKeyValue("to", _relationship.To.ToLongString());
 }
Example #9
0
 public Link(Guid mapId, IGlymaRelationship relationship, XmlDocument doc, XmlElement parent)
     : base(doc, relationship, parent)
 {
     _mapId = mapId;
     _relationship = relationship;
     AddAttributeByKeyValue("id", _relationship.Id.ToLongString());
     AddAttributeByKeyValue("created", _relationship.Created);
     AddAttributeByKeyValue("lastModified", _relationship.LastModified);
     AddAttributeByKeyValue("author", "Glyma");
     AddAttributeByKeyValue("from", _relationship.From.ToLongString());
     AddAttributeByKeyValue("to", _relationship.To.ToLongString());
     
 }
Example #10
0
 public LinkBase(XmlDocument doc, IGlymaRelationship relationship, XmlElement parent) : base(doc, parent)
 {
     if (this is ReferenceLink)
     {
         LinkType = LinkType.About; //reference links are About, note this is different to a CompendiumReferenceNode
     }
     else
     {
         LinkType = GetLinkType(relationship);
     }
     int linkTypeNum = (int)LinkType;
     AddAttributeByKeyValue("type", linkTypeNum.ToString());
     AddAttributeByKeyValue("label", "");
     AddAttributeByKeyValue("originalid", "");
 }
Example #11
0
        public LinkBase(XmlDocument doc, IGlymaRelationship relationship, XmlElement parent) : base(doc, parent)
        {
            if (this is ReferenceLink)
            {
                LinkType = LinkType.About; //reference links are About, note this is different to a CompendiumReferenceNode
            }
            else
            {
                LinkType = GetLinkType(relationship);
            }
            int linkTypeNum = (int)LinkType;

            AddAttributeByKeyValue("type", linkTypeNum.ToString());
            AddAttributeByKeyValue("label", "");
            AddAttributeByKeyValue("originalid", "");
        }
Example #12
0
 private LinkType GetLinkType(IGlymaRelationship relationship)
 {
     LinkType linkType = LinkType.RespondsTo;
     if (relationship != null && relationship.NodeFrom != null && relationship.NodeFrom.NodeType != null)
     {
         switch (relationship.NodeFrom.NodeType.Name)
         {
             case "CompendiumDecisionNode":
                 linkType = LinkType.Resolves;
                 break;
             case "CompendiumReferenceNode":
                 // not currently part of our schema of node types, but this is the correct LinkType
                 linkType = LinkType.Specializes;
                 break;
             case "CompendiumNoteNode":
                 linkType = LinkType.ExpandsOn;
                 break;
             case "CompendiumConNode":
                 linkType = LinkType.ObjectsTo;
                 break;
             case "CompendiumProNode":
                 linkType = LinkType.Supports;
                 break;
             case "CompendiumArgumentNode":
                 //not currently part of our schema of node types, but this is the correct LinkType
                 linkType = LinkType.Challenges;
                 break;
             case "CompendiumIdeaNode":
                 linkType = LinkType.RespondsTo;
                 break;
             case "CompendiumMapNode":
                 linkType = LinkType.RespondsTo;
                 break;
             case "CompendiumQuestionNode":
                 linkType = LinkType.RespondsTo;
                 break;
             case "CompendiumListNode":
                 // not currently part of our schema of node types, but this is the correct LinkType
                 linkType = LinkType.RespondsTo;
                 break;
             default:
                 linkType = LinkType.RespondsTo;
                 break;
         }
     }
     return linkType;
 }
Example #13
0
 private bool IsRelationshipExist(IGlymaRelationship relationship)
 {
     return Relationships.Any(q => q.ProxyRelationship.Id == relationship.ProxyRelationship.Id);
 }
Example #14
0
 private bool IsRelationshipExist(IGlymaRelationship relationship)
 {
     return(Relationships.Any(q => q.ProxyRelationship.Id == relationship.ProxyRelationship.Id));
 }