コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Page.cs プロジェクト: solutionexchange/RustyLogic
        public string Preview(Project project, ProjectVariant projectVariant, LanguageVariant languageVariant)
        {
            string rqlStatement =
                "<IODATA>" +
                "<PREVIEW " +
                "url=\"/cms/ioRD.asp\" " +
                "webcompliance=\"1\" " +
                "querystring=\"Action=Preview&amp;projectguid=" + project.GuidString + "&amp;" +
                "pageguid=" + GuidString + "&amp;" +
                "projectvariantguid=" + projectVariant.GuidString + "&amp;" +
                "languagevariantid=" + languageVariant.Language + "&amp;\" />" +
                "</IODATA>";

            return(Session.Execute(rqlStatement));
        }
コード例 #3
0
        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;
        }