Check in templates via script
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Check in templates via script

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Lta
Guest





Posted: Mon Nov 14, 2005 5:50 pm    Post subject: Check in templates via script Reply with quote

we are running scripts to modify the custom properties of all templates on
out site.

All works well but the templates remain checked out and this causes errors
on all machines except the machine script was run on.

we use:

Microsoft.ContentManagement.Publishing.CmsApplicationContext context =
new Microsoft.ContentManagement.Publishing.CmsApplicationContext();
context.AuthenticateAsCurrentUser(Microsoft.ContentManagement.Publishing.PublishingMode.Update);
Microsoft.ContentManagement.Publishing.TemplateGallery gallery =
(Microsoft.ContentManagement.Publishing.TemplateGallery)context.Searches.GetByPath("/Templates/LtaOnlineV2");
Assert.AreEqual("LtaOnlineV2", gallery.Name);
Assert.IsTrue(gallery.CanSetProperties);
CheckGallery(gallery);
context.CommitAll();
context.Dispose();

I hoped .CommitAll() and .Dispose() would check in but it dosen't. How
should we check in all templates after the script has run?

Thanks

John
Back to top
Stefan [MSFT]
Guest





Posted: Mon Nov 14, 2005 5:50 pm    Post subject: Re: Check in templates via script Reply with quote

Hi John,

you need to submit the template to check it in before you run the commit.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Lta" <Lta@discussions.microsoft.com> wrote in message
news:0ED38D44-8561-471D-B1A7-FA946E483018@microsoft.com...
Quote:
we are running scripts to modify the custom properties of all templates
on
out site.

All works well but the templates remain checked out and this causes errors
on all machines except the machine script was run on.

we use:

Microsoft.ContentManagement.Publishing.CmsApplicationContext context =
new Microsoft.ContentManagement.Publishing.CmsApplicationContext();
context.AuthenticateAsCurrentUser(Microsoft.ContentManagement.Publishing.PublishingMode.Update);
Microsoft.ContentManagement.Publishing.TemplateGallery gallery =
(Microsoft.ContentManagement.Publishing.TemplateGallery)context.Searches.GetByPath("/Templates/LtaOnlineV2");
Assert.AreEqual("LtaOnlineV2", gallery.Name);
Assert.IsTrue(gallery.CanSetProperties);
CheckGallery(gallery);
context.CommitAll();
context.Dispose();

I hoped .CommitAll() and .Dispose() would check in but it dosen't. How
should we check in all templates after the script has run?

Thanks

John
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB