Esempio n. 1
0
        /// <summary>
        ///		Carga los datos del documento
        /// </summary>
        private void Load(Model.Solutions.ProjectModel project, DocumentModel document, string fileName)
        {
            MLFile fileML = new XMLParser().Load(fileName);

            // Carga los nodos
            if (fileML != null)
            {
                foreach (MLNode nodeML in fileML.Nodes)
                {
                    if (nodeML.Name == TagRoot || nodeML.Name == "Template" || nodeML.Name == "Section" || nodeML.Name == "TemplatePage" || nodeML.Name == "Feed")
                    {
                        // Carga los datos del documento
                        document.GlobalId        = nodeML.Nodes [TagID].Value;
                        document.IsRecursive     = nodeML.Attributes [TagIsRecursive].Value.GetBool(false);
                        document.Title           = nodeML.Nodes [TagTitle].Value;
                        document.Description     = nodeML.Nodes [TagDescription].Value;
                        document.KeyWords        = nodeML.Nodes [TagKeyWords].Value;
                        document.Content         = nodeML.Nodes [TagContent].Value;
                        document.ShowAtRSS       = nodeML.Nodes [TagShowAtRSS].Value.GetBool(false);
                        document.URLImageSummary = nodeML.Nodes [TagURLImageSummary].Value;
                        document.ModeShow        = (DocumentModel.ShowChildsMode)nodeML.Nodes [TagShowChilds].Value.GetInt((int)DocumentModel.ShowChildsMode.None);
                        document.IDScope         = (DocumentModel.ScopeType)nodeML.Nodes [TagScope].Value.GetInt((int)DocumentModel.ScopeType.Unknown);
                        document.DateNew         = nodeML.Nodes [TagDateCreate].Value.GetDateTime(DateTime.Now);
                        // Carga las plantillas
                        document.Templates = new TemplatesArrayRepository().Load(nodeML);
                        // Carga los hijos
                        document.Tags.AddRange(LoadFiles(nodeML, TagPageTag, project));
                        document.ChildPages.AddRange(LoadFiles(nodeML, TagPageChildPage, project));
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        ///		Carga los datos del documento
        /// </summary>
        public DocumentModel Load(Model.Solutions.ProjectModel project, string fileName)
        {
            DocumentModel document = new DocumentModel(new Model.Solutions.FileModel(project, fileName));

            // Carga el archivo
            Load(project, document, fileName);
            // Devuelve el documento
            return(document);
        }
Esempio n. 3
0
 /// <summary>
 ///		Carga el documento asociado a un archivo
 /// </summary>
 public DocumentModel Load(Model.Solutions.ProjectModel project, string fileName)
 {
     return(new DocumentRepository().Load(project, fileName));
 }
Esempio n. 4
0
        /// <summary>
        ///		Crea un archivo con el nombre pasado como parámetro
        /// </summary>
        private Model.Solutions.FilesModelCollection LoadFiles(MLNode nodeML, string tag, Model.Solutions.ProjectModel project)
        {
            Model.Solutions.FilesModelCollection files = new Model.Solutions.FilesModelCollection(project);

            // Carga los nodos
            foreach (MLNode childML in nodeML.Nodes)
            {
                if (childML.Name == tag)
                {
                    Model.Solutions.FileModel file = new Model.Solutions.FileModel(project);

                    // Asigna el nombre de archivo
                    file.FullFileName = System.IO.Path.Combine(project.File.Path, childML.Value);
                    // Añade el archivo a la colección
                    files.Add(file);
                }
            }
            // Devuelve el archivo
            return(files);
        }