public WebPage(String _html, WebFolder _folder, String _template, String _content) { name = _html; folder = _folder; template = _template; content = _content; }
public static WebFolder loadFolder(EnamlData silk, string path, string name, WebFolder parent) { WebFolder folder = new WebFolder(name, parent); string fullpath = (path.Length > 0) ? path + "." + name + "." : ""; List <String> pagenames = silk.getPathKeys(fullpath + "pages"); foreach (String pagename in pagenames) { WebPage page = WebPage.loadPage(silk, fullpath + "pages", pagename, folder); folder.pages.Add(page); } List <String> resourcenames = silk.getPathKeys(fullpath + "resources"); foreach (String resname in resourcenames) { WebResource resource = WebResource.loadResource(silk, fullpath + "resources", resname, folder); folder.resources.Add(resource); } List <String> foldernames = silk.getPathKeys(fullpath + "folders"); foreach (String foldername in foldernames) { WebFolder subfolder = WebFolder.loadFolder(silk, fullpath + "folders", foldername, folder); folder.folders.Add(subfolder); } return(folder); }
public WebSite() { version = "1.0.0"; silkroot = ""; devroot = ""; prodroot = ""; root = null; }
public WebFolder(String _name, WebFolder _parent) { name = _name; parent = _parent; pages = new List <WebPage>(); resources = new List <WebResource>(); folders = new List <WebFolder>(); }
public static WebPage loadPage(EnamlData silk, string path, string name, WebFolder folder) { String fullpath = path + "." + name; String html = silk.getStringValue(fullpath + ".html", ""); String template = silk.getStringValue(fullpath + ".template", ""); String content = silk.getStringValue(fullpath + ".content", ""); WebPage page = new WebPage(html, folder, template, content); return(page); }
public static WebSite loadSilkFile(string filename) { WebSite site = new WebSite(); site.silkroot = Path.GetDirectoryName(filename); EnamlData silk = EnamlData.loadFromFile(filename); site.version = silk.getStringValue("Silk.version", ""); site.devroot = silk.getStringValue("Silk.devroot", ""); site.prodroot = silk.getStringValue("Silk.prodroot", ""); site.root = WebFolder.loadFolder(silk, "", "root", null); return(site); }
public static WebResource loadResource(EnamlData silk, string path, string name, WebFolder folder) { String respath = silk.getStringValue(path + "." + name + ".path", ""); String resname = Path.GetFileName(respath); respath = Path.GetDirectoryName(respath); WebResource resource = new WebResource(resname, respath, folder); return(resource); }
public WebResource(String _name, String _path, WebFolder _folder) { filename = _name; filepath = _path; folder = _folder; }