[Dspace-tech] Potential Bug in SolrBrowseCreateDAO

2014-04-25 Thread Christian Scheible
Hi together,

I found a potential Bug in 
org.dspace.browse.SolrBrowseCreateDAO.additionalIndex(Context, 
DSpaceObject, SolrInputDocument).
At least the comment suggests (and it makes sense) that withdrawn items 
schould not be indexed. But the if clause says:
if it is archived OR withdrawn => start indexing.

The code is in line 131 and looks like:

  // now index the new details - but only if it's archived and not withdrawn
 if (item.isArchived() || item.isWithdrawn())

Regards
Christian

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
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] R: Potential Bug in SolrBrowseCreateDAO

2014-04-25 Thread Andrea Bollini
Thanks Christian to have reported that. The comment is wrong it was introduced 
when discovery was used only for search.
SolrBrowse needs to have withdrawn items in the index because a browse 
withdrawn (and also private) items function exist.
I'm out of office so it will be appreciate if you can fire a jira issue or a PR 
to record the need to fix the comment.
Best,
Andrea



Inviato da Samsung Mobile

 Messaggio originale Da: Christian Scheible 
 Data:25/04/2014  09:48  
(GMT+01:00) A: dspace-tech  
Oggetto: [Dspace-tech] Potential Bug in SolrBrowseCreateDAO 

Hi together,

I found a potential Bug in 
org.dspace.browse.SolrBrowseCreateDAO.additionalIndex(Context, 
DSpaceObject, SolrInputDocument).
At least the comment suggests (and it makes sense) that withdrawn items 
schould not be indexed. But the if clause says:
if it is archived OR withdrawn => start indexing.

The code is in line 131 and looks like:

  // now index the new details - but only if it's archived and not withdrawn
 if (item.isArchived() || item.isWithdrawn())

Regards
Christian

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
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
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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] R: Potential Bug in SolrBrowseCreateDAO

2014-04-25 Thread Christian Scheible

Hi Andrea,

I created issue DS-1985 to record the need to fix it.

Best Christian



Am 25.04.2014 10:17, schrieb Andrea Bollini:
Thanks Christian to have reported that. The comment is wrong it was 
introduced when discovery was used only for search.
SolrBrowse needs to have withdrawn items in the index because a browse 
withdrawn (and also private) items function exist.
I'm out of office so it will be appreciate if you can fire a jira 
issue or a PR to record the need to fix the comment.

Best,
Andrea



Inviato da Samsung Mobile


 Messaggio originale 
Da: Christian Scheible
Data:25/04/2014 09:48 (GMT+01:00)
A: dspace-tech
Oggetto: [Dspace-tech] Potential Bug in SolrBrowseCreateDAO

Hi together,

I found a potential Bug in
org.dspace.browse.SolrBrowseCreateDAO.additionalIndex(Context,
DSpaceObject, SolrInputDocument).
At least the comment suggests (and it makes sense) that withdrawn items
schould not be indexed. But the if clause says:
if it is archived OR withdrawn => start indexing.

The code is in line 131 and looks like:

  // now index the new details - but only if it's archived and not 
withdrawn

 if (item.isArchived() || item.isWithdrawn())

Regards
Christian

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
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


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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] Statistics (Minho or whatever)

2014-04-25 Thread biblioteca
 

Hi!

We want to improve the statistics menu in our DSpace XMLUI (Mirage
theme) website and we have seen the RepositoriUM from Minho statistics
addon. 

The problem is that we are using DSpace 4.0 and some of the explanations
of the documentation are old. Is there any way to implement that patch
on the 4.0 version?

If not, what solution do you have to improve the native DSpace
statistics? 

Thank you! 

 --
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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] Browse authority controlled author names by text value, not by authority key

2014-04-25 Thread Daniel Scharon
Hi Keiji,

thank you for the info! 

> This value is set in org.dspace.browse.SolrBrowseCreateDAO.additionaIndex()
> using the value returned by getLabel() method of your class implementing
> ChoiceAuthority interface.
> 
> Maybe your class return the value of second parameter "key" as-is in the same
> manner as LCNameAuthority. 

Yes, this is the case.

> 
> Another way is editing SolrBrowseCreateDAO class itself. Replace the
> following lines
> 
> https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/browse/SolrBrowseCreateDAO.java#L217-227
> 
> to
> 
> if (!ignorePrefered)
> {
> preferedLabel = values[x].value;
> }
> 
> But in this case, when more than one name has the same authority code,
> each name is counted and displayed separately. So I do not recommend.

SolrBrowseCreateDAO seems to check (lines 205-16) whether
browse.authority.ignore-prefered is set within
config/modules/discovery.cfg in a similar manner as SolrServiceImpl
checks (lines 975-985) whether index.authority.ignore-prefered is set to
true. 

The option for Discovery is documented here:
https://wiki.duraspace.org/display/DSDOC4x/Discovery#Discovery-GeneralDiscoverysettings%28config/modules/discovery.cfg%29
whereas I can't find any documentation for the browse option
browse.authority.ignore-prefered

Setting index.authority.ignore-prefered for example like this
index.authority.ignore-prefered.dc.contributor.author=true
works flawlessly and the discovery sidebar lists the text values and not
the authority keys. But setting browse.authority.ignore-prefered doesn't
seem to have any effect, neither globally like
browse.authority.ignore-prefered=true
nor specifically like
browse.authority.ignore-prefered.author=true

Note: We always use this option in combination with
"authority.ignore-variants"

Is there any possibility we can take advantage of that option?

The demosite (demo.dspace.org) seems to use choice authority for authors
but still succeeds to display the text values and not the authority keys
for browsing. Does anybody know how this is solved there?


Best regards,
Daniel



> 2014-04-16 23:30 GMT+09:00 Daniel Scharon :
> > Hello all,
> >
> > we have successfully implemented authority control for author names.
> > But now it seems, that the authors' names listed for browsing/discovery
> > are being retrieved (and indexed) from the authority key instead of the
> > metadata text value.
> >
> > For our users this would mean that they would see author names with
> > absolutely no meanings to them (like "abc1234").
> >
> > So I tried to set the author index to be retrieved by the text value:
> > webui.browse.index.2 =
> > author:metadataAuthority:dc.contributor.author:text
> >
> > But this doesn't show any effect; even after a complete reindexing the
> > author names are still listed with their authority values.
> >
> > Any hints on how to solve this?
> >
> > Kind regards,
> > Daniel
> >
> >
> > --
> > Daniel Scharon
> > KIM, Room B 705
> > University of Konstanz
> > 78457 Konstanz, Germany
> >
> > Tel: +49 7531 88-2951
> > XMPP/E-Mail: daniel.scha...@uni-konstanz.de
> > Web: http://www.kim.uni-konstanz.de
> >
> > --
> > Daniel Scharon
> > KIM, Room B 705
> > University of Konstanz
> > 78457 Konstanz, Germany
> >
> > Tel: +49 7531 88-2951
> > XMPP/E-Mail: daniel.scha...@uni-konstanz.de
> > Web: http://www.kim.uni-konstanz.de
> >
> > --
> > Learn Graph Databases - Download FREE O'Reilly Book
> > "Graph Databases" is the definitive new guide to graph databases and their
> > applications. Written by three acclaimed leaders in the field,
> > this first edition is now available. Download your free book today!
> > http://p.sf.net/sfu/NeoTech
> > ___
> > 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
> 
> 
> 

-- 
Daniel Scharon
KIM, Room B 705
University of Konstanz
78457 Konstanz, Germany

Tel: +49 7531 88-2951
XMPP/E-Mail: daniel.scha...@uni-konstanz.de
Web: http://www.kim.uni-konstanz.de


smime.p7s
Description: S/MIME cryptographic signature
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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] itemupdate issue

2014-04-25 Thread Monika C. Mevenkamp

I stole code from  app.itemupdate | AddBitstreamsAction  trying to come up with 
a program that can replace the bitstream contents of an item with a new version 
of the bitstream. I got real close but noticed that deleting  the item after 
the addition of the bitstream fails. The error

ERROR: update or delete on table "item" violates foreign key constraint 
"bi_5_dmap_item_id_fkey" on table "bi_5_dmap"

When I ran out of ideas I tested the item updater directly:
/bin/dspace itemupdate -e 
moni...@princeton.edu -s dest -A

with a directory that I created with export. I did change the contents to 
include a new file for the item.  After the command I can see the new file just 
fine - along with the pre existing bitstream. But deleting/expunging fails with 
the above message.

Any ideas anybody  ?


Here an explanation why I am doing this: I want  to put a cronjob together that 
works on all pdf bitstreams in items that are in the workflow for a given 
community.  The cronjob is supposed to glue a cover page in front of all those 
bitstreams and replace the existing one with the new one.   I have the ‘list 
all interesting bitstreams’ code more or less in place. It is fairly generic 
and I will eventually send a PR.  I have a way of copying the bitstream files 
from the system, to a temp location. I know how to glue the cover page. The 
last step - insert the updated bitstream proofs to be challenging. I am tempted 
to copy the bitstream over the old one in the assetstore and adjust the shasum 
in the database directly. BUT … well it is not quite the right thing todo …

And just for reference the code snipped that I use to replace an item

Here is the code snipped I use to replace a bitstream:

private Bundle[] replaceBitstream() throws SQLException, IOException, 
AuthorizeException {
Item item = (Item) bit.getParentObject();
if (bit.getFormat().getMIMEType().equals(fileFormat) && 
!ignoreFormatMismatch) {
throw new RuntimeException("format mistmatch");
}

Bundle[] bundles = bit.getBundles();
for (Bundle bdl : bundles) {
Bitstream nBit = bdl.createBitstream(stream);
nBit.setName("cp:" + bit.getName());   // changed name to make sure 
this is not the cause of the error
nBit.setDescription(bit.getDescription());
nBit.setSource(bit.getSource());
nBit.setUserFormatDescription(bit.getFormatDescription());
nBit.setUserFormatDescription(bit.getFormatDescription());
bdl.removeBitstream(bit);
}
item.update();
context.commit();
return bundles;
}



Monika


Monika Mevenkamp
phone: 609-258-4161
Lewis Library,Washington Road and Ivy Lane, Princeton University, Princeton, NJ 
08544


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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] Suppress Access-controlled Items from Sitemap Generator

2014-04-25 Thread Terry Brady
We have a large collections of items that is visible only to our university
community.

 These items appear in our sitemap (We are running DSpace 3.1).  When our
site is crawled, this triggers a large number of errors.

Ideally, we would like to suppress items, collections, and communities
without anonymous access from our sitemap.  Has anyone addressed this
issue?

Based on a quick scan of code, I presume that I might need to change the
queries invoked in org.dspace.app.sitemap.GenerateSitemaps to check for
anonymous access.

I would appreciate any advice that you can offer.

Thanks, Terry

-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://www.library.georgetown.edu/lit/code
202-687-7053
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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] itemupdate issue

2014-04-25 Thread Hilton Gibson
Hi Monica

Please see: https://jira.duraspace.org/browse/DS-1619 and
https://jira.duraspace.org/browse/DS-1920
This probably applies after an upgrade from 1.8.2.

Cheers

hg

*Hilton Gibson*
Ubuntu Linux Systems Administrator
JS Gericke Library
Room 1025D
Stellenbosch University
Private Bag X5036
Stellenbosch
7599
South Africa

Tel: +27 21 808 4100 | Cell: +27 84 646 4758
http://scholar.sun.ac.za
http://bit.ly/goodir
http://library.sun.ac.za
http://za.linkedin.com/in/hiltongibson


On 25 April 2014 21:48, Monika C. Mevenkamp  wrote:

>
>  I stole code from  app.itemupdate | AddBitstreamsAction  trying to come
> up with a program that can replace the bitstream contents of an item with a
> new version of the bitstream. I got real close but noticed that deleting
>  the item after the addition of the bitstream fails. The error
>
>  ERROR: update or delete on table "item" violates foreign key constraint
> "bi_5_dmap_item_id_fkey" on table "bi_5_dmap"
>
>  When I ran out of ideas I tested the item updater directly:
> /bin/dspace itemupdate -e moni...@princeton.edu -s dest -A
>
>with a directory that I created with export. I did change the contents
> to include a new file for the item.  After the command I can see the new
> file just fine - along with the pre existing bitstream. But
> deleting/expunging fails with the above message.
>
>  Any ideas anybody  ?
>
>
>  Here an explanation why I am doing this: I want  to put a cronjob
> together that works on all pdf bitstreams in items that are in the workflow
> for a given community.  The cronjob is supposed to glue a cover page in
> front of all those bitstreams and replace the existing one with the new
> one.   I have the ‘list all interesting bitstreams’ code more or less in
> place. It is fairly generic and I will eventually send a PR.  I have a way
> of copying the bitstream files from the system, to a temp location. I know
> how to glue the cover page. The last step - insert the updated bitstream
> proofs to be challenging. I am tempted to copy the bitstream over the old
> one in the assetstore and adjust the shasum in the database directly. BUT …
> well it is not quite the right thing todo …
>
>  And just for reference the code snipped that I use to replace an item
>
>   Here is the code snipped I use to replace a bitstream:
>
>private Bundle[] replaceBitstream() throws SQLException,
> IOException, AuthorizeException {
>   Item item = (Item) bit.getParentObject();
>   if (bit.getFormat().getMIMEType().equals(fileFormat) &&
> !ignoreFormatMismatch) {
>   throw new RuntimeException("format mistmatch");
>   }
>
>   Bundle[] bundles = bit.getBundles();
>   for (Bundle bdl : bundles) {
>   Bitstream nBit = bdl.createBitstream(stream);
>   nBit.setName("cp:" + bit.getName());   // changed name
> to make sure this is not the cause of the error
>   nBit.setDescription(bit.getDescription());
>   nBit.setSource(bit.getSource());
>
> nBit.setUserFormatDescription(bit.getFormatDescription());
>
> nBit.setUserFormatDescription(bit.getFormatDescription());
>   bdl.removeBitstream(bit);
>   }
>   item.update();
>   context.commit();
>   return bundles;
>   }
>
>
>
>
>  Monika
>
>  
>  Monika Mevenkamp
> phone: 609-258-4161
> Lewis Library,Washington Road and Ivy Lane, Princeton University,
> Princeton, NJ 08544
>
>
>
>
> --
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> ___
> 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
>
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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] Suppress Access-controlled Items from Sitemap Generator

2014-04-25 Thread Terry Brady
Here is the solution I am considering in  org.dspace.app.sitemap.
GenerateSitemaps.

Replace
ItemIterator allItems = Item.findAllAnon(c);

With
String myQuery = "SELECT * FROM item WHERE in_archive='1' " +
"and exists (select 1 from resourcepolicy " +
"where item.item_id=resource_id and resource_type_id=2 and
epersongroup_id=0)";

TableRowIterator rows = DatabaseManager.queryTable(c, "item",
myQuery);

ItemIterator allItems = new ItemIterator(c, rows);

Please let me know if you have any thoughts.

Terry



On Fri, Apr 25, 2014 at 4:47 PM, Terry Brady  wrote:

> We have a large collections of items that is visible only to our
> university community.
>
>  These items appear in our sitemap (We are running DSpace 3.1).  When our
> site is crawled, this triggers a large number of errors.
>
> Ideally, we would like to suppress items, collections, and communities
> without anonymous access from our sitemap.  Has anyone addressed this
> issue?
>
> Based on a quick scan of code, I presume that I might need to change the
> queries invoked in org.dspace.app.sitemap.GenerateSitemaps to check for
> anonymous access.
>
> I would appreciate any advice that you can offer.
>
> Thanks, Terry
>
> --
> Terry Brady
> Applications Programmer Analyst
> Georgetown University Library Information Technology
> https://www.library.georgetown.edu/lit/code
> 202-687-7053
>



-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://www.library.georgetown.edu/lit/code
202-687-7053
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
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