Hi,
for old uri, use parameter 'old_uri_prefix' and for new uri use parameter
'new_uri_prefix'.
example:
old_uri_prefix : http://hdl.handle.net
new_uri_prefix :http://my-own-url



On Tue, Feb 11, 2014 at 1:36 AM, ataurrehman [via DSpace] <
[email protected]> wrote:

> Dear Esa
>
> This is what I was looking.  There are lot of entries with
> http://hdl.handle.net and i want to replace it with http://my-own-url.
>  Please tell me which variables to replace with old entry (
> http://hdl.handle.net) and new entry (http://my-own-url)?
>
> Regards,
>
> Ata
>
> esa wrote
> Hi,
>
> try use this, i have make a function on posgre to change the canonical URl
> for the old items.
>
> CREATE OR REPLACE FUNCTION update_dc_indentifier_uri_prefix
> (new_uri_prefix TEXT, old_uri_prefix TEXT)
> RETURNS INTEGER
> AS $$
> DECLARE
> uri_database_old   CURSOR FOR SELECT metadata_value_id, text_value
>                                                         FROM metadatavalue
>                                                         WHERE
> metadata_field_id ='25';
> metadata_id metadatavalue.metadata_value_id%TYPE;
> uri_old metadatavalue.text_value%TYPE;
> BEGIN
>                 RAISE NOTICE 'Open the Cursor...';
>                 OPEN uri_database_old;
>                 LOOP
>                         RAISE NOTICE 'Fetch the cursor into variable...';
>                         FETCH uri_database_old INTO metadata_id, uri_old;
>                         IF NOT FOUND THEN
>                                 EXIT;
>                         END IF;
>                         RAISE NOTICE 'update a new URI...';
>                         UPDATE metadatavalue
>                         SET text_value = REPLACE (uri_old ,$2 ,$1)
>                         WHERE metadata_field_id = '25'
>                         AND metadata_value_id = metadata_id;
>                 END LOOP;
>                 RAISE NOTICE 'close the cursor...';
>                 CLOSE uri_database_old;
>                 RAISE NOTICE 'The process is completed...';
>                 RETURN 0;
> EXCEPTION
>                 WHEN OTHERS THEN
>                         RAISE EXCEPTION 'Process in the function fail !!';
>
> END
> $$ language PLPGSQL
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://dspace.2283337.n4.nabble.com/How-change-uri-handle-from-http-hdl-handle-net-to-http-myip-in-all-items-tp3285730p4671278.html
>  To unsubscribe from How change uri handle from http://hdl.handle.net/ to
> http://myip in all items, click 
> here<http://dspace.2283337.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3285730&code=ZXNhLmZhdXppQGdtYWlsLmNvbXwzMjg1NzMwfDE5MjIwODIyMDU=>
> .
> NAML<http://dspace.2283337.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Regards,


Esa Fauzi




--
View this message in context: 
http://dspace.2283337.n4.nabble.com/How-change-uri-handle-from-http-hdl-handle-net-to-http-myip-in-all-items-tp3285730p4671291.html
Sent from the DSpace - Tech mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to