Updating all CustomProperties with a specific value
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Updating all CustomProperties with a specific value




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Updating all CustomProperties with a specific value  
Thomasbonielsen@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-07 06:17 PM

Hi All.

I have the following problem:
In our cms application we have alot of references to other postings
stored as a customProperty.

We know want to update all these properties. We have a function which
extracts all postings containing a customProperty with a value that
starts with "/Channels/".

We update all these (and their earlier revisions) and everything seems
fine. BUT. We wanted to be sure, that all references where updated so
we made query against the cms database:

select count(*) from NodeProperty where PropValue like '/Channels/
OLDVALUE/%' and expected this to be 0. However there are now more rows
than there was before.

When we do a:
select count(*) from NodeProperty where PropValue like '/Channels/
NEWVALUE/%'  we can confirm that almost 700 updates were made...

Should we be concerned that we have missed some CustomProperties in
some way?? Or does the NodeProperty table contain data about other
things than CustomProperties??

Thanks






[ Post a follow-up to this message ]



    Re: Updating all CustomProperties with a specific value  
Stefan Goßner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-07 06:17 PM

Hi Thomas,

this query will also return content from historical revisions.

Cheers,
Stefan


<Thomasbonielsen@gmail.com> wrote in message
news:1176817219.178155.311420@p77g2000hsh.googlegroups.com...
> Hi All.
>
> I have the following problem:
> In our cms application we have alot of references to other postings
> stored as a customProperty.
>
> We know want to update all these properties. We have a function which
> extracts all postings containing a customProperty with a value that
> starts with "/Channels/".
>
> We update all these (and their earlier revisions) and everything seems
> fine. BUT. We wanted to be sure, that all references where updated so
> we made query against the cms database:
>
> select count(*) from NodeProperty where PropValue like '/Channels/
> OLDVALUE/%' and expected this to be 0. However there are now more rows
> than there was before.
>
> When we do a:
> select count(*) from NodeProperty where PropValue like '/Channels/
> NEWVALUE/%'  we can confirm that almost 700 updates were made...
>
> Should we be concerned that we have missed some CustomProperties in
> some way?? Or does the NodeProperty table contain data about other
> things than CustomProperties??
>
> Thanks
>







[ Post a follow-up to this message ]



    Re: Updating all CustomProperties with a specific value  
Stefan Goßner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-07 06:17 PM

Hi Thomas,

just to add: to verify the change you should use the MCMS object model:
Searches.GetPostingsByCustomProperty(name,value)

Cheers,
Stefan


<Thomasbonielsen@gmail.com> wrote in message
news:1176817219.178155.311420@p77g2000hsh.googlegroups.com...
> Hi All.
>
> I have the following problem:
> In our cms application we have alot of references to other postings
> stored as a customProperty.
>
> We know want to update all these properties. We have a function which
> extracts all postings containing a customProperty with a value that
> starts with "/Channels/".
>
> We update all these (and their earlier revisions) and everything seems
> fine. BUT. We wanted to be sure, that all references where updated so
> we made query against the cms database:
>
> select count(*) from NodeProperty where PropValue like '/Channels/
> OLDVALUE/%' and expected this to be 0. However there are now more rows
> than there was before.
>
> When we do a:
> select count(*) from NodeProperty where PropValue like '/Channels/
> NEWVALUE/%'  we can confirm that almost 700 updates were made...
>
> Should we be concerned that we have missed some CustomProperties in
> some way?? Or does the NodeProperty table contain data about other
> things than CustomProperties??
>
> Thanks
>







[ Post a follow-up to this message ]



    Re: Updating all CustomProperties with a specific value  
Basildk


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-07 06:17 PM

On 17 Apr., 15:51, "Stefan Go=DFner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi Thomas,
>
> just to add: to verify the change you should use the MCMS object model:
> Searches.GetPostingsByCustomProperty(name,value)
>
> Cheers,
> Stefan
>
> <Thomasboniel...@gmail.com> wrote in message
>
> news:1176817219.178155.311420@p77g2000hsh.googlegroups.com...
>
>
> 
> 
> 
> 
> 
> 
> 
> 
>
> - Vis tekst i anf=F8rselstegn -

I thought that it also contained ealier revisions, and thats why i
also updatet these, so my users can revert back to ealier versions.
My concern is that i have missed something since i still see 2900 rows
with the old value... Does this table also contain CustomProperty for
deleted postings?? This could be the cause?

Btw.. thanks for the very quick reply, it is highly appreciated...







[ Post a follow-up to this message ]



    Re: Updating all CustomProperties with a specific value  
Stefan Goßner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-07 06:17 PM

Hi,

you cannot change content of historical revisions.
And yes: also content of delete pages are stored here.

Cheers,
Stefan


"Basildk" <Thomasbonielsen@gmail.com> wrote in message
news:1176818702.138007.267620@l77g2000hsb.googlegroups.com...
On 17 Apr., 15:51, "Stefan Goßner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi Thomas,
>
> just to add: to verify the change you should use the MCMS object model:
> Searches.GetPostingsByCustomProperty(name,value)
>
> Cheers,
> Stefan
>
> <Thomasboniel...@gmail.com> wrote in message
>
> news:1176817219.178155.311420@p77g2000hsh.googlegroups.com...
>
>
> 
> 
> 
> 
> 
> 
> 
> 
>
> - Vis tekst i anførselstegn -

I thought that it also contained ealier revisions, and thats why i
also updatet these, so my users can revert back to ealier versions.
My concern is that i have missed something since i still see 2900 rows
with the old value... Does this table also contain CustomProperty for
deleted postings?? This could be the cause?

Btw.. thanks for the very quick reply, it is highly appreciated...








[ Post a follow-up to this message ]



    Re: Updating all CustomProperties with a specific value  
Basildk


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-07 06:17 PM

On 17 Apr., 16:15, "Stefan Go=DFner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi,
>
> you cannot change content of historical revisions.
> And yes: also content of delete pages are stored here.
>
> Cheers,
> Stefan
>
> "Basildk" <Thomasboniel...@gmail.com> wrote in message
>
> news:1176818702.138007.267620@l77g2000hsb.googlegroups.com...
> On 17 Apr., 15:51, "Stefan Go=DFner [MSFT]"
>
>
>
>
>
> <stef...@online.microsoft.com> wrote: 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> I thought that it also contained ealier revisions, and thats why i
> also updatet these, so my users can revert back to ealier versions.
> My concern is that i have missed something since i still see 2900 rows
> with the old value... Does this table also contain CustomProperty for
> deleted postings?? This could be the cause?
>
> Btw.. thanks for the very quick reply, it is highly appreciated...- Skjul=
tekst i anf=F8rselstegn -
>
> - Vis tekst i anf=F8rselstegn -

Hi again.

Just to clarify, then this code does nothing other than updating the
inital WorkingRevision of the posting??


private void UpdateSingleRef(Posting p, string propertyName,
string newPath)
{
UpdateCmsRefManager man =3D new UpdateCmsRefManager();

//First update the workin revision . Approve
man.UpdateCustomProperty(p, propertyName, newPath, true);
count++;

//then update all earlier revistions. Dont approve.
PostingCollection pc =3D p.Revisions(true, true);
foreach (Posting posting in pc)
{
man.UpdateCustomProperty(posting, propertyName, newPath,
false);
count++;
}


}

Once again.. thanks 






[ Post a follow-up to this message ]



    Re: Updating all CustomProperties with a specific value  
Stefan Goßner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-07 06:17 PM

Yes. You just do it over and over again.
With other words: you create multiple more revisions with this code.

Cheers,
Stefan

"Basildk" <Thomasbonielsen@gmail.com> wrote in message
news:1176820041.719583.108890@p77g2000hsh.googlegroups.com...
On 17 Apr., 16:15, "Stefan Goßner [MSFT]"
<stef...@online.microsoft.com> wrote:
> Hi,
>
> you cannot change content of historical revisions.
> And yes: also content of delete pages are stored here.
>
> Cheers,
> Stefan
>
> "Basildk" <Thomasboniel...@gmail.com> wrote in message
>
> news:1176818702.138007.267620@l77g2000hsb.googlegroups.com...
> On 17 Apr., 15:51, "Stefan Goßner [MSFT]"
>
>
>
>
>
> <stef...@online.microsoft.com> wrote: 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> I thought that it also contained ealier revisions, and thats why i
> also updatet these, so my users can revert back to ealier versions.
> My concern is that i have missed something since i still see 2900 rows
> with the old value... Does this table also contain CustomProperty for
> deleted postings?? This could be the cause?
>
> Btw.. thanks for the very quick reply, it is highly appreciated...- Skjul
> tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -

Hi again.

Just to clarify, then this code does nothing other than updating the
inital WorkingRevision of the posting??


private void UpdateSingleRef(Posting p, string propertyName,
string newPath)
{
UpdateCmsRefManager man = new UpdateCmsRefManager();

//First update the workin revision . Approve
man.UpdateCustomProperty(p, propertyName, newPath, true);
count++;

//then update all earlier revistions. Dont approve.
PostingCollection pc = p.Revisions(true, true);
foreach (Posting posting in pc)
{
man.UpdateCustomProperty(posting, propertyName, newPath,
false);
count++;
}


}

Once again.. thanks 







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:57 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register