Save() public method

public Save ( ) : void
return void
Beispiel #1
0
        public void GenericContent_KeepReferenceAfterUndocheckout()
        {
            //create page template
            PageTemplate samplePageTemplate = new PageTemplate(TestRoot);
            samplePageTemplate.Name = "Sample Page Template";
            samplePageTemplate.Binary = CreateBinaryDataFromString("<html><head></head><body></body></html>");
            samplePageTemplate.Save();

            Page samplePage = new Page(TestRoot);

            samplePage.Name = "SamplePage";

            //set reference
            samplePage.PageTemplateNode = samplePageTemplate;

            samplePage.Save();
            samplePage.CheckOut();
            samplePage.UndoCheckOut();

            //asserts
            CheckPageTemplateInPage(samplePage, samplePageTemplate.Id);

        }
Beispiel #2
0
		private static void CreateTestPageTemplate()
		{
			PageTemplate pt = null;

			pt = new PageTemplate(Node.LoadNode(_rootNodePath));
			pt.Name = _testPageTemplateName;
			BinaryData binaryData = new BinaryData();
			binaryData.FileName = new BinaryFileName(_testPageTemplateName);
			string streamString = _pageTemplateHtml;

			Stream stream = Tools.GetStreamFromString(streamString);
			binaryData.SetStream(stream);

			pt.Binary = binaryData;
			pt.Save();

			_pageTemplatePath = pt.Path;
		}
Beispiel #3
0
		private PageTemplate CreatePageTemplate(string name)
		{
			PageTemplate pageTemplate = Node.LoadNode(string.Concat(this.TestRoot.Path, "/", name)) as PageTemplate;
			if (pageTemplate == null)
			{
				pageTemplate = new PageTemplate(this.TestRoot);
				pageTemplate.Name = name;
				pageTemplate.Binary = CreateBinaryFromString("TestPageTemplateVersion.bnr", "<html><body></body></html>");
				pageTemplate.Save();
			}
			return pageTemplate;
		}