[GeoNetwork-users] Search and replace.

Hi all,

I am doing a gap analysis for the Ordnance Survey against some statutory
requirements. One of the trickier ones is doing search and replace of
text on all metadata items within a group. Has anyone found a way to do
this? More detail follows...

1. A user loads n xml records, with the text "University of
Somewhere" in a data element.
2. The University then changes its name to "Somewhere University"
3. All the records need to have every instance of "U of S" changed
to "S U".

I have come up with two options so far...

(1) Go into the database and write a clever update statement, taking
care not to mess up the xml tags. Rebuild the SOLR database.

(2) Export everything using the CSW/ISO interface and use a script
to (a) split into files and (b) make the changes, then bulk import.

I'd be delighted to hear of any clearer ways, or any plan to implement
this in the main project.

Thanks in advance.

Justin.

This email is only intended for the person to whom it is addressed and may contain confidential information. If you have received this email in error, please notify the sender and delete this email which must not be copied, distributed or disclosed to any other person.

Unless stated otherwise, the contents of this email are personal to the writer and do not represent the official view of Ordnance Survey. Nor can any contract be formed on Ordnance Survey's behalf via email. We reserve the right to monitor emails and attachments without prior notice.

Thank you for your cooperation.

Ordnance Survey
Romsey Road
Southampton SO16 4GU
Tel: 08456 050505
http://www.ordnancesurvey.co.uk

Hi Justin,

Another alternative could be to use the MassiveXslProcessing class to set up
such a process.
You will find more information about this process here [1], directly in the
source code of the class, as a documentation.

HTH,
Cheers,

Mathieu

[1]
http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/trunk/web/src/main/java/org/fao/geonet/services/metadata/MassiveXslProcessing.java?revision=6132&view=markup
<http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/trunk/web/src/main/java/org/fao/geonet/services/metadata/MassiveXslProcessing.java?revision=6132&view=markup&gt;

On Tue, Jun 22, 2010 at 11:59 AM, Justin Rowles (C) <
Justin.Rowles@anonymised.com> wrote:

Hi all,

I am doing a gap analysis for the Ordnance Survey against some statutory
requirements. One of the trickier ones is doing search and replace of
text on all metadata items within a group. Has anyone found a way to do
this? More detail follows...

1. A user loads n xml records, with the text "University of
Somewhere" in a data element.
2. The University then changes its name to "Somewhere University"
3. All the records need to have every instance of "U of S" changed
to "S U".

I have come up with two options so far...

(1) Go into the database and write a clever update statement, taking
care not to mess up the xml tags. Rebuild the SOLR database.

(2) Export everything using the CSW/ISO interface and use a script
to (a) split into files and (b) make the changes, then bulk import.

I'd be delighted to hear of any clearer ways, or any plan to implement
this in the main project.

Thanks in advance.

Justin.

This email is only intended for the person to whom it is addressed and may
contain confidential information. If you have received this email in error,
please notify the sender and delete this email which must not be copied,
distributed or disclosed to any other person.

Unless stated otherwise, the contents of this email are personal to the
writer and do not represent the official view of Ordnance Survey. Nor can
any contract be formed on Ordnance Survey's behalf via email. We reserve the
right to monitor emails and attachments without prior notice.

Thank you for your cooperation.

Ordnance Survey
Romsey Road
Southampton SO16 4GU
Tel: 08456 050505
http://www.ordnancesurvey.co.uk

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

Hi Jules,

On Tue, Jun 22, 2010 at 2:16 PM, Justin Rowles (C) <
Justin.Rowles@anonymised.com> wrote:

Thanks very much Mathieu, that looks like a very very good place to work
from. I’ll chuck a ‘no-change’ xsl in and have a play. Excellent javadoc
btw.

Do you know if there are links to the metadata.xxx.yyy user interfaces in
the default install, or is just a set of urls I’ll need to document? (I
shall have to make this fairly user-friendly)

There is no specific documentation for that for the time being.... :frowning:

I can see that these are admin (& useradmin) functions only, so I shan’t be
surprised if they’re not documented. Would the preferred solution be for me
to add documentation to the Manual?

Indeed it could be great to add a kind of How-to or to add a specific
chapter for that in the developer documentation.
As we are refactoring (thanks Jeroen! :wink: ) the documentation, it could be
nice to see how we could add your contribution on that part if you would
like to contribute.

Cheers,

Mathieu

Thanks again,

Justin.

------------------------------

*From:* Mathieu Coudert [mailto:mathieu.coudert@anonymised.com]
*Sent:* 22 June 2010 11:17
*To:* Justin Rowles (C)
*Cc:* geonetwork-users@lists.sourceforge.net
*Subject:* Re: [GeoNetwork-users] Search and replace.

Hi Justin,

Another alternative could be to use the MassiveXslProcessing class to set
up such a process.

You will find more information about this process here [1], directly in the
source code of the class, as a documentation.

HTH,

Cheers,

Mathieu

[1]
http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/trunk/web/src/main/java/org/fao/geonet/services/metadata/MassiveXslProcessing.java?revision=6132&view=markup

<http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/trunk/web/src/main/java/org/fao/geonet/services/metadata/MassiveXslProcessing.java?revision=6132&view=markup&gt;

On Tue, Jun 22, 2010 at 11:59 AM, Justin Rowles (C) <
Justin.Rowles@anonymised.com> wrote:

Hi all,

I am doing a gap analysis for the Ordnance Survey against some statutory
requirements. One of the trickier ones is doing search and replace of
text on all metadata items within a group. Has anyone found a way to do
this? More detail follows...

1. A user loads n xml records, with the text "University of
Somewhere" in a data element.
2. The University then changes its name to "Somewhere University"
3. All the records need to have every instance of "U of S" changed
to "S U".

I have come up with two options so far...

(1) Go into the database and write a clever update statement, taking
care not to mess up the xml tags. Rebuild the SOLR database.

(2) Export everything using the CSW/ISO interface and use a script
to (a) split into files and (b) make the changes, then bulk import.

I'd be delighted to hear of any clearer ways, or any plan to implement
this in the main project.

Thanks in advance.

Justin.

This email is only intended for the person to whom it is addressed and may
contain confidential information. If you have received this email in error,
please notify the sender and delete this email which must not be copied,
distributed or disclosed to any other person.

Unless stated otherwise, the contents of this email are personal to the
writer and do not represent the official view of Ordnance Survey. Nor can
any contract be formed on Ordnance Survey's behalf via email. We reserve the
right to monitor emails and attachments without prior notice.

Thank you for your cooperation.

Ordnance Survey
Romsey Road
Southampton SO16 4GU
Tel: 08456 050505
http://www.ordnancesurvey.co.uk

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

This email is only intended for the person to whom it is addressed and may contain confidential information. If you have received this email in error, please notify the sender and delete this email which must not be copied, distributed or disclosed to any other person.

Unless stated otherwise, the contents of this email are personal to the writer and do not represent the official view of Ordnance Survey. Nor can any contract be formed on Ordnance Survey's behalf via email. We reserve the right to monitor emails and attachments without prior notice.

Thank you for your cooperation.

Ordnance Survey
Romsey Road
Southampton SO16 4GU
Tel: 08456 050505http://www.ordnancesurvey.co.uk