URL String Replacement

We have a content type which has a text field that houses a URL string. A portion of that string needs to be replaced e.g. the string in the field is http://XXXX.abc.com that string needs to be changed to http://YYYY.abc.com. This effects upwards of 1600 content types and I am looking for recommendations on a solution to implement the change without manually editinig each content type field.

Any ideas and/or assistance would be greatly appreciated.

Thanks,
MJW

MJW,

This operation needs to be performed on all existing records like a global find and replace, or do you need the operation applied as a field item transformer? What type of field is this [local or shared]?

I would definitely look at doing this via SQL. But on the flip side of things, could you handle this on the delivery tier? (ie a mod rewrite rule of sorts). I am not sure what you are using the url for, so this may not be an option.

You could also write a program that hits webservices / the java API and automatically check out items, edit it, and then check it back in (with a comment of course). This is probably the “official” way to do it as you would have revisions or at least a way of keeping an audit log of changes.

[QUOTE=Rileyw;20163]MJW,

This operation needs to be performed on all existing records like a global find and replace, or do you need the operation applied as a field item transformer? What type of field is this [local or shared]?[/QUOTE]

Hi Riley,
This is a local text field in the content type and yes, it is a global find and replace.

Thanks for your help!
Mike

[QUOTE=jitendra;20166]I would definitely look at doing this via SQL. But on the flip side of things, could you handle this on the delivery tier? (ie a mod rewrite rule of sorts). I am not sure what you are using the url for, so this may not be an option.

You could also write a program that hits webservices / the java API and automatically check out items, edit it, and then check it back in (with a comment of course). This is probably the “official” way to do it as you would have revisions or at least a way of keeping an audit log of changes.[/QUOTE]

The URL is used to connect to a Fusion server and directs users to a database faculty profile page. My first thought was to approach this via the Sql database. Of course, I have always been warned by Percussion to “Not to mess with the database” :slight_smile: That being said, I still think it may the best option but not sure of that approach or the steps to do a global replacement of a portion of a string?

Thanks fortyour help,
Mike

Jit’s solution may be best “approved” route. It is frustrating that CM System doesn’t have a built in “global find and replace” method, but you can use [FindItems](http://code.percussion.com/javadoc/cmsystem/7.0.3/com/percussion/webservices/content/IPSContentWs.html#findItems(com.percussion.search.objectstore.PSWSSearchRequest, boolean)) to locate all content items that match the desired criteria (e.g. “localField” equals “http://XXXX.acu.com”) then iterate over the results to perform the check out, edit, and check in flow.

Are you familiar with using CM System Web Services?

Jit, by chance do you have an example JSP demonstrating the check out, edit, and check in Web Services? :smiley: