Microsoft Content Management Server - Unable to delete revisions of a posting

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > March 2005 > Unable to delete revisions of a posting





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Unable to delete revisions of a posting
André van 't Hoog

2005-03-23, 7:47 am


We are trying to delete all revisions of a specific posting using the
following code snippet:

PostingCollection postColl = enginePosting.Revisions();

if (postColl != null && postColl.Count > 0)
{
foreach(Posting posting in postColl)
{
posting.Delete();
}
}

This fails with the following message: "Cannot modify read only object. The
target object is read only and it cannot be modified.".

I have also noticed that putting posting.CanDelete within the foreach-loop
always returns false.

Is there any way of deleting revisions of a posting using the API? Or can
this only be done via the Site Manager?

B.t.w., we are using CMS2002 SP1a.

Thanks and regards,

André








Stefan [MSFT]

2005-03-23, 7:47 am

Hi Andre,

it is not possible to delete revisions using code.
Only using SiteManager.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights
Book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"André van 't Hoog" <vanthoog@evident.nl.ihatespam> wrote in message
news:uMdmQa5LFHA.3960@TK2MSFTNGP12.phx.gbl...
>
> We are trying to delete all revisions of a specific posting using the
> following code snippet:
>
> PostingCollection postColl = enginePosting.Revisions();
>
> if (postColl != null && postColl.Count > 0)
> {
> foreach(Posting posting in postColl)
> {
> posting.Delete();
> }
> }
>
> This fails with the following message: "Cannot modify read only object.

The
> target object is read only and it cannot be modified.".
>
> I have also noticed that putting posting.CanDelete within the foreach-loop
> always returns false.
>
> Is there any way of deleting revisions of a posting using the API? Or can
> this only be done via the Site Manager?
>
> B.t.w., we are using CMS2002 SP1a.
>
> Thanks and regards,
>
> André
>
>
>
>
>
>
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com