public static void Publish(Page page, Project project) { ProjectVariant defaultProjectVariant = null; LanguageVariant defaultLanguageVariant = null; // Default to the display project variant foreach (ProjectVariant variant in ProjectVariant.List()) { if (variant.UsedForDisplay) { defaultProjectVariant = variant; break; } } // Default to the project's selected language variant foreach (LanguageVariant variant in LanguageVariant.List()) { if (variant.CurrentlySelected) { defaultLanguageVariant = variant; break; } } //return Publish(page, project, defaultProjectVariant, defaultLanguageVariant, null); }
public string Preview(Project project, ProjectVariant projectVariant, LanguageVariant languageVariant) { string rqlStatement = "<IODATA>" + "<PREVIEW " + "url=\"/cms/ioRD.asp\" " + "webcompliance=\"1\" " + "querystring=\"Action=Preview&projectguid=" + project.GuidString + "&" + "pageguid=" + GuidString + "&" + "projectvariantguid=" + projectVariant.GuidString + "&" + "languagevariantid=" + languageVariant.Language + "&\" />" + "</IODATA>"; return(Session.Execute(rqlStatement)); }
public static void Publish(Page page, Project project, ProjectVariant projectVariant, LanguageVariant languageVariant, User user) { string rqlStatement = "<IODATA user=\"remote\">" + "<PROJECT guid=\"" + project.GuidString + "\">" + "<PAGE guid=\"" + page.GuidString + "\">" + "<EXPORTJOB action=\"save\" generatenextpages=\"0\" generaterelativepages=\"0\" "; if (user != null) { rqlStatement += "email=\"" + user.GuidString + "\""; } rqlStatement += "toppriority=\"0\" reddotserver=\"\" application=\"\" " + "generatedate=\"0\" startgenerationat=\"0\">" + "<LANGUAGEVARIANTS action=\"checkassigning\">" + "<LANGUAGEVARIANT guid=\"" + languageVariant.GuidString + "\" checked=\"1\"/>" + "</LANGUAGEVARIANTS>" + "<PROJECTVARIANTS action=\"checkassigning\">" + "<PROJECTVARIANT guid=\"" + projectVariant.GuidString + "\" checked=\"1\"/>" + "</PROJECTVARIANTS>" + "</EXPORTJOB>" + "</PAGE>" + "</PROJECT>" + "</IODATA>"; xmlDoc.LoadXml(Session.Execute(rqlStatement)); XmlNode xmlNode = xmlDoc.GetElementsByTagName("EXPORTJOB")[0]; Guid guid = new Guid(xmlNode.Attributes.GetNamedItem("guid").Value); //xmlNode = LoadXml(); PublishingJob publishJob = null; if (xmlNode != null) { publishJob = new PublishingJob(xmlNode); } //return publishJob; }