Microsoft Content Management Server - Updating all CustomProperties with a specific value

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > April 2007 > Updating all CustomProperties with a specific value





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 Updating all CustomProperties with a specific value
Thomasbonielsen@gmail.com

2007-04-17, 1: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

Stefan Goßner [MSFT]

2007-04-17, 1: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
>



Stefan Goßner [MSFT]

2007-04-17, 1: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
>



Basildk

2007-04-17, 1: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...


Stefan Goßner [MSFT]

2007-04-17, 1: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...



Basildk

2007-04-17, 1: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

Stefan Goßner [MSFT]

2007-04-17, 1: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


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com