Re: [Dspace-tech] small correction for dspace_migrate

2009-09-09 Thread Stuart Lewis
Hi John,

Thanks for spotting that. I've opened a JIRA issue for it to make sure  
it gets addressed before 1.6 is released:

  - http://jira.dspace.org/jira/browse/DS-303

Thanks,


Stuart Lewis
IT Innovations Analyst and Developer
Te Tumu Herenga The University of Auckland Library
Auckland Mail Centre, Private Bag 92019, Auckland 1142, New Zealand
Ph: 64 9 373-7599 x81928
http://www.library.auckland.ac.nz/


On 9/09/2009, at 6:22 AM, John Davison wrote:

 Collection-based export is working as expected when using the -m
 (migrate) flag in DSpace 1.5.2 with one exception.

 /bin/export ItemExport --type=COLLECTION --id=collID --dest=dest_dir  
 --number=seq_num -m

 This will correctly remove the handle file, as well as the following
 metadata fields from dublin_core.xml:
  dcvalue element=date qualifier=accessioned/dcvalue
  dcvalue element=date qualifier=available/dcvalue
  dcvalue element=date qualifier=issued/dcvalue*
  dcvalue element=description qualifier=provenance/dcvalue
  dcvalue element=format qualifier=extent/dcvalue
  dcvalue element=format qualifier=mimetype/dcvalue
 (*Date.issued is retained if the item has been published before.)

 It also removes dc.identifier.uri in all cases. The dspace_migrate
 script uses a regular expression to only remove identifier.uri fields
 that start with http://hdl (retaining non-handle based identifier.uri
 elements), while ItemExport.java is eliminating all identifier.uri  
 fields.

 Line 474:
if ((!migrate) ||
(migrate  !(
 (dcv.element.equals(date) 
 qualifier.equals(issued)) ||
 (dcv.element.equals(date) 
 qualifier.equals(accessioned)) ||
 (dcv.element.equals(date) 
 qualifier.equals(available)) ||
 (dcv.element.equals(identifier) 
 qualifier.equals(uri)) ||
 (dcv.element.equals(description) 
 qualifier.equals(provenance)) ||
 (dcv.element.equals(format) 
 qualifier.equals(extent)) ||
 (dcv.element.equals(format) 
 qualifier.equals(mimetype)
{
out.write(utf8, 0, utf8.length);


 -John



 Stuart Lewis wrote:
 Hi John,


 I was transferring a few collections from a DSpace 1.5.2 development
 server to a production instance this morning and encountered a small
 issue with the dspace_migrate bash script.
 Since the item exporter in 1.6 has a migrate option (-m flag) this
 script might get removed, so I'm posting this simple fix just in  
 case
 anyone else encounters the same problem.


 Thanks for reporting this problem. The -m 'migrate' flag was
 introduced in 1.5.2, so you could try running that instead. It would
 be good to know if it works for you to give us more confidence in
 removing the dspace_migrate script. We also have an open issue to  
 make
 the -m 'migrate' flag more configurable 
 (http://jira.dspace.org/jira/browse/DS-287
 )

 I've noted the bug in the JIRA issue to remove the dspace_migrate
 script, so if we decide not to remove it, then we can make sure it
 gets fixed before we release 1.6.

 Thanks,


 Stuart Lewis
 IT Innovations Analyst and Developer
 Te Tumu Herenga The University of Auckland Library
 Auckland Mail Centre, Private Bag 92019, Auckland 1142, New Zealand
 Ph: 64 9 373-7599 x81928
 http://www.library.auckland.ac.nz/







--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


Re: [Dspace-tech] small correction for dspace_migrate

2009-09-08 Thread John Davison
Collection-based export is working as expected when using the -m 
(migrate) flag in DSpace 1.5.2 with one exception.

/bin/export ItemExport --type=COLLECTION --id=collID --dest=dest_dir 
--number=seq_num -m

This will correctly remove the handle file, as well as the following 
metadata fields from dublin_core.xml:
  dcvalue element=date qualifier=accessioned/dcvalue
  dcvalue element=date qualifier=available/dcvalue
  dcvalue element=date qualifier=issued/dcvalue*
  dcvalue element=description qualifier=provenance/dcvalue
  dcvalue element=format qualifier=extent/dcvalue
  dcvalue element=format qualifier=mimetype/dcvalue
(*Date.issued is retained if the item has been published before.)

It also removes dc.identifier.uri in all cases. The dspace_migrate 
script uses a regular expression to only remove identifier.uri fields 
that start with http://hdl (retaining non-handle based identifier.uri 
elements), while ItemExport.java is eliminating all identifier.uri fields.

Line 474:
if ((!migrate) ||
(migrate  !(
 (dcv.element.equals(date)  
qualifier.equals(issued)) ||
 (dcv.element.equals(date)  
qualifier.equals(accessioned)) ||
 (dcv.element.equals(date)  
qualifier.equals(available)) ||
 (dcv.element.equals(identifier)  
qualifier.equals(uri)) ||
 (dcv.element.equals(description)  
qualifier.equals(provenance)) ||
 (dcv.element.equals(format)  
qualifier.equals(extent)) ||
 (dcv.element.equals(format)  
qualifier.equals(mimetype)
{
out.write(utf8, 0, utf8.length);


-John



Stuart Lewis wrote:
 Hi John,

   
 I was transferring a few collections from a DSpace 1.5.2 development
 server to a production instance this morning and encountered a small
 issue with the dspace_migrate bash script.
 Since the item exporter in 1.6 has a migrate option (-m flag) this
 script might get removed, so I'm posting this simple fix just in case
 anyone else encounters the same problem.
 

 Thanks for reporting this problem. The -m 'migrate' flag was  
 introduced in 1.5.2, so you could try running that instead. It would  
 be good to know if it works for you to give us more confidence in  
 removing the dspace_migrate script. We also have an open issue to make  
 the -m 'migrate' flag more configurable 
 (http://jira.dspace.org/jira/browse/DS-287 
 )

 I've noted the bug in the JIRA issue to remove the dspace_migrate  
 script, so if we decide not to remove it, then we can make sure it  
 gets fixed before we release 1.6.

 Thanks,


 Stuart Lewis
 IT Innovations Analyst and Developer
 Te Tumu Herenga The University of Auckland Library
 Auckland Mail Centre, Private Bag 92019, Auckland 1142, New Zealand
 Ph: 64 9 373-7599 x81928
 http://www.library.auckland.ac.nz/


   


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


[Dspace-tech] small correction for dspace_migrate

2009-09-04 Thread John Davison
I was transferring a few collections from a DSpace 1.5.2 development 
server to a production instance this morning and encountered a small 
issue with the dspace_migrate bash script.
Since the item exporter in 1.6 has a migrate option (-m flag) this 
script might get removed, so I'm posting this simple fix just in case 
anyone else encounters the same problem.

Transferring Items Between DSpace Instances: 
http://www.dspace.org/1_5_2Documentation/ch09.html#N1382D
DSpace System Documentation lists the auto-generated fields the 
dspace_migrate script removes from dublin_core.xml prior to moving a 
collection (date.accessioned, date.available, description.provenance, 
etc.). The script also removes the handle file.
When I attempted to import the collection into the production instance, 
I ended up with two handles-- one newly created and one left over from 
the dev server because it was still listed in the dublin_core.xml file 
as a dc.identifier.uri value.

Here's the fix:
Lines 101 and 104 perform the deletion of several element/qualifier 
pairs from the dublin_core.xml metadata, but a small typo occurs twice 
on the lines that should remove the handle. Removing one character from 
both lines fixes the problem.
This:
| $SED /element=\identifier\ qualifier=\uri\\http:\/\/hdl/d
Should be this:
| $SED /element=\identifier\ qualifier=\uri\http:\/\/hdl/d

Note: removing the extra escape character (backslash \) before the 
greater than () symbol causes the script to correctly remove any 
dc.identifier.uri that starts with http://hdl without removing any 
non-handle URIs nor removing any local accession numbers stored in 
dc.indentifer.other.

I hope this helps,
John Davison
OhioLINK DRC







--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


Re: [Dspace-tech] small correction for dspace_migrate

2009-09-04 Thread Stuart Lewis
Hi John,

 I was transferring a few collections from a DSpace 1.5.2 development
 server to a production instance this morning and encountered a small
 issue with the dspace_migrate bash script.
 Since the item exporter in 1.6 has a migrate option (-m flag) this
 script might get removed, so I'm posting this simple fix just in case
 anyone else encounters the same problem.

Thanks for reporting this problem. The -m 'migrate' flag was  
introduced in 1.5.2, so you could try running that instead. It would  
be good to know if it works for you to give us more confidence in  
removing the dspace_migrate script. We also have an open issue to make  
the -m 'migrate' flag more configurable 
(http://jira.dspace.org/jira/browse/DS-287 
)

I've noted the bug in the JIRA issue to remove the dspace_migrate  
script, so if we decide not to remove it, then we can make sure it  
gets fixed before we release 1.6.

Thanks,


Stuart Lewis
IT Innovations Analyst and Developer
Te Tumu Herenga The University of Auckland Library
Auckland Mail Centre, Private Bag 92019, Auckland 1142, New Zealand
Ph: 64 9 373-7599 x81928
http://www.library.auckland.ac.nz/


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech