Re: [Dspace-tech] problems with collections views with DSpace upgrade to 4.1

2014-07-25 Thread SUZUKI Keiji
Hi Jim,

Problem 2 seems  a bug. Change the following line

https://github.com/DSpace/DSpace/blob/dspace-4.1/dspace-api/src/main/java/org/dspace/search/DSIndexer.java#L604

From:

if (!liveDocs.get(i))

To:

if (liveDocs != null  !liveDocs.get(i))


Problem 1 seems a config setting. From version 4, discovery search
provider is used as a default, so you have to comment out the discovery
setting and comment in the lucene setting in Additional configuration
for Recent Submissions code section.

Regards,
Keiji Suzuki




2014-07-25 3:46 GMT+09:00 Halliday, James Leonard jhall...@indiana.edu:

  Hi everyone,



 I am upgrading an instance of DSpace from 1.5.2 to 4.1, and I’m running
 into 2 problems after the upgrade. They may be related, so I’m posting them
 both here together. First off, note that I’m using legacy lucene indexing
 and XMLUI, and I’m using code that has worked for 2 other DSpace upgrades.



 Problem #1: The collection pages are blank after the upgrade. In other
 words, the collection pages don’t show the usual content in the main part
 of the page (the “search within this document type”, “browse by”, and
 “recent submissions” are all missing). The sidebar is there, and I can
 search or browse the collection just fine by using the sidebar, but the
 main part of the page doesn’t show. Strangely, I can switch to any other
 theme, including Classic and Kubrick, and the same problem occurs. If I
 view the DRI and XML versions of those pages I can see that the “recent
 submissions” node is not present at all. If I create new collections, they
 exhibit the same problem. I do not have this problem in the older 1.5.2
 instance.



 Problem #2: When running an index-lucene-init it works just fine, but
 running index-lucene-update crashes every time with:

  java.lang.NullPointerException

 at org.dspace.search.DSIndexer.cleanIndex(DSIndexer.java:604)

 at org.dspace.search.DSIndexer.main(DSIndexer.java:507)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

 at java.lang.reflect.Method.invoke(Method.java:606)

 at
 org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:225)

 at
 org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:77)



 Can anyone help me with this? I’m more concerned about #1 than #2, because
 I won’t be able to put this repository into production until I resolve this
 issue.



 Thanks!



 -  Jim Halliday

 -  Indiana University


 --
 Want fast and easy access to all the code in your enterprise? Index and
 search up to 200,000 lines of code with a free copy of Black Duck
 Code Sight - the same software that powers the world's largest code
 search on Ohloh, the Black Duck Open Hub! Try it now.
 http://p.sf.net/sfu/bds
 ___
 DSpace-tech mailing list
 DSpace-tech@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dspace-tech
 List Etiquette:
 https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette




-- 
鈴木敬二@江別市
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

[Dspace-tech] Vagrant project

2014-07-25 Thread Jozef Misutka
Dear all,

we have published a vagrant box project for our LINDAT/CLARIN repository
based on DSpace which could be useful for the DSpace community as well.
We do know about https://github.com/DSpace/vagrant-dspace but we found it
unsuitable for our needs (however, we have used a small part of the dspace
module definition).

Our box has been tested with the virtualbox provider with most of the
installation done by puppet provisioning.
When the *dspace4* box is up (the default one - lindat - is our
repository!), you will get a development environment on Ubuntu12.04 with
munin, monit, phppgadmin, probe + few others and with DSpace remotely
debuggable on port 8000 with solr visible.
You can easily change the source directory to be present in a shared
directory (so you do not need to do additional github magic) but it is off
by default because of the performance.
You can easily modify java/tomcat version for 6,7 (tutorial for java8
installation is included in the files).
More documentation (mostly for the lindat box) and source code is available
at https://github.com/ufal/lindat-repository-vagrant .

In case you have vagrant and virtualbox installed, try it with:

git clone https://github.com/ufal/lindat-repository-vagrant.git
cd lindat-repository-vagrant  vagrant up dspace4

(note the dspace4 at the end), wait for a moment or two and open
http://33.33.33.79 in your browser for the overview page.

Kind regards,
Jozef Misutka
_
LINDAT/CLARIN repository manager
http://lindat.cz
UFAL, Charles University in Prague
http://ufal.mff.cuni.cz/
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

[Dspace-tech] Fwd: Display error msg on Collections page when user is not authorized to view Items

2014-07-25 Thread Shazia Sathar
Just checking to see if anyone has any ideas to share?  Basically, I would
like that an error message be shown if a user is not authorized to view a
particular collection. By default, an empty collection page is shown which
gives the impression of an empty collection
I am using DSpace version 4.1, jspui version.

Please let me know if you need any additional information.

Regards,
Shazia

-- Forwarded message --
From: Shazia Sathar ssat...@uic.edu
Date: Wed, Jul 16, 2014 at 1:20 PM
Subject: Display error msg on Collections page when user is not authorized
to view Items
To: DSpace Tech dspace-tech@lists.sourceforge.net


Hello All,

I am working on a request for change in my DSpace installation. The
requirement is that an error message like Access Denied be displayed on
the Collections page when a logged-in user tries to access a Collection
that he/she is not authorized to access.
The default behavior is that no Items are displayed and is there a way to
change this and add an error msg?

Here is what I tried:
In *HandleServlet.java*, I modified the code and added:
collectionHome()
{
 ...
if (AuthorizeManager.authorizeActionBoolean(context, community,
Constants.DEFAULT_ITEM_READ))
{
// set a variable to indicate read access and hence display
the community heorarchy
request.setAttribute(read.access, Boolean.TRUE);
}
 else
{
request.setAttribute(read.access,
Boolean.FALSE);
}

..
}

*collection-home.jsp*
...
Boolean readAccess =(Boolean)request.getAttribute(read.access);
boolean read_access = (readAccess== null ? false :
readAccess.booleanValue());
...
% if(!read_access) { %
p style=color:red; font-size:16 Access Denied /p
% }

In he UI, I have  a Collection C1 with the following policies:
C1:
DEFAULT_ITEM_READ  : Group (COLLECTION_25_DEFAULT_ITEM_READ)
DEFAULT_BITSTREAM_READ: Group (COLLECTION_25_DEFAULT_ITEM_READ)

The only member in group COLLECTION_25_DEFAULT_ITEM_READ is user A.

When I log in as user A, I get the Access Denied error message on all
Collections including C1. I'm not sure what I'm missing here? I'm not sure
if I am looking at the right permissions.

Does anyone know of an alternate approach- from the CollectionItemList.java
perhaps?


Regards,
Shazia
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

[Dspace-tech] SolrException error

2014-07-25 Thread Stephano John
Dear all,

I have installed dspace 4.1, but when i click on browse by (title, author
or subject) also when you click on community created i get the following
error:

org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException:
Server at http://localhost:8080/solr/search returned non ok status:500,
message:Internal Server Error

I have tried to search through there are lot of suggestions on how to
solve the problem including the permissions of the [dspace] , [webapps  -
were the Solr resides] ,also [tomcat webapps (also solr is in it)]

After changing permissions and others trials i still get the same error,
also when i run http://localhost:8080/solr/; in url i get the following
errors.


statistics:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
Cannot create directory: /usr/local/dspace/solr/statistics/data/index

search:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
Cannot create directory: /usr/local/dspace/solr/search/data/index

oai:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
Cannot create directory: /usr/local/dspace/solr/oai/data/index

urgent help is needed

Kind regards
Stephano John





Send DSpace-tech mailing list submissions to
   dspace-tech@lists.sourceforge.net

 To subscribe or unsubscribe via the World Wide Web, visit
   https://lists.sourceforge.net/lists/listinfo/dspace-tech
 or, via email, send a message with subject or body 'help' to
   dspace-tech-requ...@lists.sourceforge.net

 You can reach the person managing the list at
   dspace-tech-ow...@lists.sourceforge.net

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of DSpace-tech digest...


 Today's Topics:

1. help to imbed images/icons in news-xmlui.xml
   (Peter Sichilyango Tutu)
2. Dspace - 4.2 - jspui of windows - internal system   error
   message (c_sugumaran)
3. Re: Dspace - 4.2 - jspui of windows - internal system   error
   message (c_sugumaran)
4. problems with collections views with DSpace upgrade to 4.1
   (Halliday, James Leonard)
5. Re: problems with collections views with DSpace upgrade to
   4.1 (Hilton Gibson)


 --

 Message: 1
 Date: Thu, 24 Jul 2014 17:45:24 +0200
 From: Peter Sichilyango Tutu petertu...@gmail.com
 Subject: [Dspace-tech] help to imbed images/icons in news-xmlui.xml
 To: dspace-tech@lists.sourceforge.net
 Message-ID: 01cfa756$4bbfa2b0$e33ee810$@com
 Content-Type: text/plain; charset=us-ascii

 Hello Guys,

 Please help me on this one. I want to embed images /icons in my
 news-xmlui.xml document and link them to both internal and external
 resources. I have  several images that I have placed in my images
 directory
 and I would like to link them from there.I tried using the figure
 element
 and linked to the images in my local images directory,but they are not
 being
 displayed on the home page.But, when I change the source and link them to
 external images(i.e images hosted on remote sites) they are rendered on
 the
 home page.

 I am using dspace 3.2 xmlui. Please help.



 Regards,



 Peter

 -- next part --
 An HTML attachment was scrubbed...

 --

 Message: 2
 Date: Thu, 24 Jul 2014 10:52:06 -0700 (PDT)
 From: c_sugumaran csuguma...@gmail.com
 Subject: [Dspace-tech] Dspace - 4.2 - jspui of windows - internal
   system  error message
 To: dspace-tech@lists.sourceforge.net
 Message-ID: 1406224326352-4674260.p...@n4.nabble.com
 Content-Type: text/plain; charset=us-ascii

 We are using Dspace ver 3.1 (Windows version)  in windows server - 2003
 os,
 using jsput - as given in file DS-LPSC-FP.pdf . This is in operational
 server mode.

 As we want to introduce, DISCOVERY concept, We tried to download the
 Version
 4.1.  But build failure message has come as given in files (2 - parts)
 dspace-build-failure - 1  2.

 Now, when we download and install the Version 4.2 (windows - version) -
 After installation, the jspui page is giving as Internal system error as
 given in file DS-42-JSPUI-PAGE.JPG. Here we could not sign as
 Administrator.

 But the XMLUI is working properly as given in DS-42-XMULI-PAGE.JPG

 As we have already done some customization in our operational server in
 jspui of windows version, we prefer the same in version 4.2 also.

 Can any one tried to install in (OS-Win) jspui. of Version 4.2.

 Is it is a bug in the Version 4.2 jspui of OS-Win. ?

 or is it a local problem for me only ? if so, either developer or any one
 can point out the bug in this.

 We need the views from Developers and users at the earliest.

 Yours
 C. Sugumaran
 Scientist / Engr SF,
 DDH / LPSC / ISRO
 TRIVANDRUM









 --
 View this message in context:
 http://dspace.2283337.n4.nabble.com/Dspace-4-2-jspui-of-windows-internal-system-error-message-tp4674260.html
 Sent from the DSpace - 

[Dspace-tech] What is your setup?

2014-07-25 Thread Luiz dos Santos
I’m starting in the DSpace so I would like to share with guys my setup, I
want improve my productivity. So I decided to ask you about your setup? I'm
think about to buy a macbook to me, Anybody over ther use mac to code
DSpace?

My Setup:
Hardware
-i7 core 1.8GHz
-8 GB (Ram)
-Windows 8.1 pro

Software
-Java SE 1.7.0_51
-Netbeans 8.0
-Maven 3.1.1
-Ant 1.93
-Git 1.9.0
-Postgree 9.1.12

Regards
Luiz
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

[Dspace-tech] Can't create webapp MBean for XOAI with DSpace 4.1

2014-07-25 Thread Christian Scheible
Hi together,

I have a problem with the oai webapp. I wanted to register a service to 
dspace-service in the dspace-oai module. But I allways get the error: 
DSpace Kernel must not be null. If I check the tomcat logs I see:
Can't create webapp MBean But the oai webeapp is running and working.

When shuting down tomcat there is the follwing error in tomcat logs:

Exception sending context destroyed event to listener instance of class 
org.dspace.app.util.DSpaceContextListener
java.lang.NullPointerException
 at 
org.dspace.app.util.DSpaceContextListener.contextDestroyed(DSpaceContextListener.java:146)
 at 
org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5014)
 at 
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5659)
 at 
org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
 at 
org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575)
 at 
org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1564)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)

So it seems to me that there is a problem when starting the webapp. Has 
anybody the same problems or a solution?

Regards

-- 
Christian Scheible
Softwareentwickler / Abt. Content-basierte Dienste
Kommunikations-, Informations- und Medienzentrum (KIM)
Universität Konstanz
78457 Konstanz
+49 (0)7531 / 88-2857
Raum B 703


--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


Re: [Dspace-tech] Dspace - 4.2 - jspui of windows - internal system error message

2014-07-25 Thread c_sugumaran
Thank you Mrs. Monika,

I have attached the log files of yesterday 24-07-14 (As soon as version 4.2
installed) and today when we opened the dspace - error message 25-07-14.

Can any one go through it and point out the mistakes

Yours 
C.Sugumaran
DDH / LPSC / ISRO
TRIVANDRUM dspace.txt
http://dspace.2283337.n4.nabble.com/file/n4674277/dspace.txtAND 
dspace.txt http://dspace.2283337.n4.nabble.com/file/n4674277/dspace.txt  



--
View this message in context: 
http://dspace.2283337.n4.nabble.com/Dspace-4-2-jspui-of-windows-internal-system-error-message-tp4674260p4674277.html
Sent from the DSpace - Tech mailing list archive at Nabble.com.

--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


Re: [Dspace-tech] What is your setup?

2014-07-25 Thread Pottinger, Hardy J.
Hi, Luiz, I currently run an old 2010 era MBP, though it's been through a few 
rounds of updates. It has the i7 proc, 8GB RAM, and a solid state drive. 
However, I only rarely build directly on this MBP, I either build on our 
development server (RHEL6) or on my Vagrant-DSpace workspace [1] Since I'm used 
to working in Vim day to day, I just haven't taken the steps necessary to run 
Vagrant-DSpace with an IDE, though it would be pretty straightforward to do 
(just share the dspace-src and dspace folders with the host system, and then 
run an IDE on the host). If you haven't yet checked out Vagrant-DSpace, you 
might want to. It's a really quick and easy way to get started, and to organize 
your work.

--Hardy

[1] https://github.com/DSpace/vagrant-dspace


From: Luiz dos Santos [luiz...@gmail.com]
Sent: Friday, July 25, 2014 8:20 AM
To: dspace-tech@lists.sourceforge.net
Subject: [Dspace-tech] What is your setup?

I’m starting in the DSpace so I would like to share with guys my setup, I want 
improve my productivity. So I decided to ask you about your setup? I'm think 
about to buy a macbook to me, Anybody over ther use mac to code DSpace?

My Setup:
Hardware
-i7 core 1.8GHz
-8 GB (Ram)
-Windows 8.1 pro

Software
-Java SE 1.7.0_51
-Netbeans 8.0
-Maven 3.1.1
-Ant 1.93
-Git 1.9.0
-Postgree 9.1.12

Regards
Luiz
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

[Dspace-tech] Modifying Discovery

2014-07-25 Thread Fredrick, Rose L.
Hello,
We are running DSpace 3.2 with Oracle and have implemented Discovery on our 
test server.  We successfully added a new facet to Discovery, but the facet 
will only list new items that we have submitted after implementing Discovery.  
We have items pre-Discovery that have data in the correct metadata field, but 
are not displaying in Discovery's sidebar under our new corresponding facet.  
The default facets for Discovery are working with our older items.  We have 
stopped the server, run update-discovery-index -b -f, and restarted.  Has 
anyone come across this or have any ideas on what to try next?

Thanks,

Rose Fredrick

Creighton University

Health Sciences Library

--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Re: [Dspace-tech] ant fresh_install error

2014-07-25 Thread Tim Donohue
Hi Andy,

It sounds like the dspace.hostname setting in your build.properties 
file is either missing or commented out.  Here's what it should look like:

https://github.com/DSpace/DSpace/blob/master/build.properties#L28

If this property is missing, then it is unable to be specified in the 
final dspace.cfg file, and 'ant' will throw an error similar to what 
you've seen.

- Tim

On 7/24/2014 3:03 PM, Andy Kirkyla wrote:
 Folks,

 I trust all is well.

 I am trying to do a fresh install of DSpace 4.2

 [dspace@BTNYSLDVA01 dspace-4.2-build]$ ant fresh_install
 Buildfile:
 /home/dspace/DSpace-dspace-4.2/dspace/target/dspace-4.2-build/build.xml

 BUILD FAILED
 /home/dspace/DSpace-dspace-4.2/dspace/target/dspace-4.2-build/build.xml:88:
 Property dspace.hostname was circularly defined.
 Does anybody know what I am doing wrong.

Thanks.

 Andy




 --
 Want fast and easy access to all the code in your enterprise? Index and
 search up to 200,000 lines of code with a free copy of Black Duck
 Code Sight - the same software that powers the world's largest code
 search on Ohloh, the Black Duck Open Hub! Try it now.
 http://p.sf.net/sfu/bds



 ___
 DSpace-tech mailing list
 DSpace-tech@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dspace-tech
 List Etiquette: 
 https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


Re: [Dspace-tech] ant fresh_install error

2014-07-25 Thread Andy Kirkyla
Dear Tim,

   I trust all is well.

   That was the issue.

   Thanks for your help.

Andy


On Fri, Jul 25, 2014 at 1:50 PM, Tim Donohue tdono...@duraspace.org wrote:

 Hi Andy,

 It sounds like the dspace.hostname setting in your build.properties file
 is either missing or commented out.  Here's what it should look like:

 https://github.com/DSpace/DSpace/blob/master/build.properties#L28

 If this property is missing, then it is unable to be specified in the
 final dspace.cfg file, and 'ant' will throw an error similar to what you've
 seen.

 - Tim


 On 7/24/2014 3:03 PM, Andy Kirkyla wrote:

 Folks,

 I trust all is well.

 I am trying to do a fresh install of DSpace 4.2

 [dspace@BTNYSLDVA01 dspace-4.2-build]$ ant fresh_install
 Buildfile:
 /home/dspace/DSpace-dspace-4.2/dspace/target/dspace-4.2-build/build.xml

 BUILD FAILED
 /home/dspace/DSpace-dspace-4.2/dspace/target/dspace-4.2-
 build/build.xml:88:
 Property dspace.hostname was circularly defined.
 Does anybody know what I am doing wrong.

Thanks.

 Andy




 
 --
 Want fast and easy access to all the code in your enterprise? Index and
 search up to 200,000 lines of code with a free copy of Black Duck
 Code Sight - the same software that powers the world's largest code
 search on Ohloh, the Black Duck Open Hub! Try it now.
 http://p.sf.net/sfu/bds



 ___
 DSpace-tech mailing list
 DSpace-tech@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dspace-tech
 List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+
 Etiquette


--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

[Dspace-tech] Looking for feedback on bulk command line apps

2014-07-25 Thread Monika C. Mevenkamp

I developed a set of four related command line apps for dspace:
1) a lister / report generator
2) a policy tool, that adds / removes policies
3) a metada tool, that adds / removes specific metadata  values
4) a bitstream replacer tool

All expect 4 work on a set of dspace objects specified by two command line 
arguments:
--root  ROOT  - where ROOT is a handle  or  object type follow by an ID
--type  TYPE  - where TYPE is  one of  collection, item, bundle, or 
bitstream

—-root COLLECTION.10  --type BITSTREAM
means work on all bitstreams in collection with ID 10
--root handle/12345  --type ITEM
means work on all items contained in the object designated by handle

There is an additional argument, --doWorkFlowItems, that restricts sets to 
items in workflows and by extension to bundles or bitstreams in items in 
workflows.


The lister generates tsv or txt formatted output, printing properties of the 
selected set of DSpace objects. Its  --include option determines which 
properties are printed.  You can choose to print IDs and handles, as well as 
policy information, or specify select item metadata fields. You can include an 
items 'withdrawn' status or a bundle's embargo state. Bitstream reports may 
print mimeType, checksum, ...   When printing DSpace objects, you can choose to 
print properties of enclosing Dspace objects. For example when printing  
bitstreams in a collection, you can include bundle names,  item handles, even 
item metadata values by using options like these:
--include 
'object,name,mimeType,BUNDLE.name,ITEM.handle,ITEM.dc.contributor,author'

The lister works nicely with the other commands, since all four commands use 
the same mechanism to select the objects they work on. For example you might 
use the lister to review which DSpace objects need policy or metadata changes. 
After applying changes, it comes in handy, when making sure the changes 
performed are in fact the ones, that were intended.


The policy tool decides which action to apply to each DSpaceObject selected by 
the --root and --type parameters based on three options:
--action   [ADD | DEL ]  - whether to add or delete policies
--dspace_action  [READ | WRITE | REMOVE | ... ]
--who [group  | eperson]

For example
dspace bulk-pols -r handle/712657 -t BITSTREAM —action ADD  —dspace_action 
WRITE --who EPERSON.monikam
gives the eperson monikam WRITE priviledges  on all bitstreams 
contained in the object  behind the given handle, which may be a community, 
collection, or item.

dspace bulk-pols -r handle/712657 -t BITSTREAM -a DEL -d READ -w 
GROUP.Anonymous
removes the READ permission from the Anonymous group

The metadata tool works similar to the policy tool. Of cause it makes only 
sense to apply to item sets.

The bitstream replacer works on single bitstreams. It is related to the other 
tools in that it selects the bitstream to work on in the same fashion, aka with 
--root and --type arguments.

I developed these commands in connection with a project here at Princeton, 
where I needed to  add a cover page to all bitstreams in original bundles in a 
community. The lister gave me the list of bitstreams. Printing the list in txt 
format, allowed me to grep for name=ORIGINAL. I included the mimeType in the  
listing, so I would only work on pdf documents. Including the internalId 
allowed me to use the file right from the assetstore and stick it into my  ‘add 
the cover page’ script. I  replaced the old bitstream using the IDs, printed 
earlier, to define the —root parameter to  the bitstream replacer.  Finally I 
used the lister to check on the access policies of the bitstreams.  Right now I 
run the lister command in a cronjob to watch the submission progress in one of 
our communities.

I wrote more detailed documentation which is part of the pull request that I 
created for this code. Here at Princeton we are still running 1.8. The bulk-do 
code mostly lives in its own package and should play well with version 3 (I 
have not tried it). The PR is based on the master.  In other words unless you 
run pre 1.8,  merging this into your version should be relatively painless - 
and it goes without saying - I'd help sort out conflicts.

The PR is HEREhttps://github.com/DSpace/DSpace/pull/560 and the documentation 
is 
THEREhttps://github.com/akinom/DSpace/blob/prq_bulk_commands/dspace-api/src/main/java/org/dspace/app/bulkdo/README.md

I believe this code would be useful for many DSpace administrators.  It would 
be straight forward to add a JSON/XML output format to offer this functionally 
in the REST API.  So please have a look, send feedback, and possibly step up as 
a volunteer tester / reviewer.


Monika

—
Monika Mevenkamp
phone: 609-258-4161
123 693 Alexander Street, Princeton University, Princeton, NJ 08544
--
Want fast and easy access to all the code in your