Exemple #1
0
 public void AddElement(AtomElement element)
 {
     if (element != null)
     {
         elements.Add(element);
     }
 }
Exemple #2
0
        private RepositoryWorkspace ParseWorkspace(XmlReader reader)
        {
            RepositoryWorkspace workspace = new RepositoryWorkspace();

            reader.Read();
            while (true)
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    AtomElement element = ParseWorkspaceElement(reader);

                    if (element != null && element.Object is cmisRepositoryInfoType)
                    {
                        workspace.Id = ((cmisRepositoryInfoType)element.Object).repositoryId;
                    }

                    workspace.AddElement(element);
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    break;
                }
                else
                {
                    if (!reader.Read())
                    {
                        break;
                    }
                }
            }

            reader.Read();

            return(workspace);
        }
Exemple #3
0
        private AtomEntry ParseEntry(XmlReader reader)
        {
            AtomEntry entry = new AtomEntry();

            reader.Read();
            while (true)
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    AtomElement element = ParseElement(reader);

                    if (element != null)
                    {
                        entry.AddElement(element);

                        if (element.Object is cmisObjectType && ((cmisObjectType)element.Object).properties != null)
                        {
                            foreach (cmisProperty prop in ((cmisObjectType)element.Object).properties.Items)
                            {
                                if (PropertyIds.ObjectId == prop.propertyDefinitionId)
                                {
                                    entry.Id = ((cmisPropertyId)prop).value[0];
                                }
                            }
                        }
                        else if (element.Object is cmisTypeDefinitionType)
                        {
                            entry.Id = ((cmisTypeDefinitionType)element.Object).id;
                        }
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    break;
                }
                else
                {
                    if (!reader.Read())
                    {
                        break;
                    }
                }
            }

            reader.Read();

            return(entry);
        }
Exemple #4
0
        private AtomElement ParseChildren(XmlReader reader)
        {
            AtomElement result         = null;
            string      childName      = reader.LocalName;
            string      childNamespace = reader.NamespaceURI;

            reader.Read();
            while (true)
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (AtomPubConstants.NamespaceAtom == reader.NamespaceURI && AtomPubConstants.TagFeed == reader.LocalName)
                    {
                        result = new AtomElement(childNamespace, childName, ParseFeed(reader));
                    }
                    else
                    {
                        skip(reader);
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    break;
                }
                else
                {
                    if (!reader.Read())
                    {
                        break;
                    }
                }
            }

            reader.Read();

            return(result);
        }
Exemple #5
0
 public void AddElement(AtomElement element)
 {
     if (element != null)
     {
         elements.Add(element);
     }
 }
Exemple #6
0
        private AtomElement ParseChildren(XmlReader reader)
        {
            AtomElement result = null;
            string childName = reader.LocalName;
            string childNamespace = reader.NamespaceURI;

            reader.Read();
            while (true)
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (AtomPubConstants.NamespaceAtom == reader.NamespaceURI && AtomPubConstants.TagFeed == reader.LocalName)
                    {
                        result = new AtomElement(childNamespace, childName, ParseFeed(reader));
                    }
                    else
                    {
                        skip(reader);
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    break;
                }
                else
                {
                    if (!reader.Read()) { break; }
                }
            }

            reader.Read();

            return result;
        }