Re: [Dspace-tech] Author sorting

2008-08-06 Thread Kasthuri, Sriram
 
I feel the problem is not with the postgres version. If you look into
org.dspace.browse.BrowseItem.java you can see the below SQL's holding
the values for browse display and you can notice the query is not
ordered by the text_value. We have our dspace running on 1.4.2 and I'm
not sure whether it's already been taken care in 1.5 version.

You need to change it as below and run your build script for compiling
the class to make the browse display ordered by Author


/** query to get the text value of a metadata element only (qualifier is
NULL) */
private String getByMetadataElement = SELECT
text_value,text_lang,element,qualifier FROM metadatavalue,
metadatafieldregistry, metadataschemaregistry  +
WHERE metadatavalue.item_id = ?  +
 AND
metadatavalue.metadata_field_id =
metadatafieldregistry.metadata_field_id  +
 AND metadatafieldregistry.element
= ?  +
 AND
metadatafieldregistry.qualifier IS NULL  +
 AND
metadatafieldregistry.metadata_schema_id=metadataschemaregistry.metadata
_schema_id  +
 AND
metadataschemaregistry.short_id = ? order by text_value;

/** query to get the text value of a metadata element and
qualifier */
private String getByMetadata = SELECT
text_value,text_lang,element,qualifier FROM metadatavalue,
metadatafieldregistry, metadataschemaregistry  +
WHERE metadatavalue.item_id = ?  +
 AND
metadatavalue.metadata_field_id =
metadatafieldregistry.metadata_field_id  +
 AND metadatafieldregistry.element
= ?  +
 AND
metadatafieldregistry.qualifier = ?  +
 AND
metadatafieldregistry.metadata_schema_id=metadataschemaregistry.metadata
_schema_id  +
 AND
metadataschemaregistry.short_id = ? order by text_value;

/** query to get the text value of a metadata element with the
wildcard qualifier (*) */
private String getByMetadataAnyQualifier = SELECT
text_value,text_lang,element,qualifier FROM metadatavalue,
metadatafieldregistry, metadataschemaregistry  +
WHERE metadatavalue.item_id = ?  +
 AND
metadatavalue.metadata_field_id =
metadatafieldregistry.metadata_field_id  +
 AND metadatafieldregistry.element
= ?  +
 AND
metadatafieldregistry.metadata_schema_id=metadataschemaregistry.metadata
_schema_id  +
 AND
metadataschemaregistry.short_id = ? order by text_value;



Cheers,
Sri

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Blanco,
Jose
Sent: 05 August 2008 19:07
To: dspace-tech@lists.sourceforge.net
Subject: [Dspace-tech] Author sorting

I was hoping that the our new version of postgres ( 8.1.11 ) would solve
the problem we see when authors are browsed.  Here is the problem:

Suppose we have the following 3 authors:

 Ta, A
 Ta, Z
 Tab, A

I would expect them to show up in the oder shown above when browsing by
author, but instead I get:

 Ta, A
 Tab, A
 Ta, Z

Which as you can see is not really the desired behavior. I created a
test table and loaded these values into a field of type text, and then
issued the following query:

 select * from test order by 1;
   a

 Ta, A
 Tab, A
 Ta, Z
(3 rows)

So I can see why Dspace is displaying this in this order.

The funny thing is that I'm fairly certain that I have seen the desired
ordering in some Dspace instances, so I'm not sure why ours is not
sorting correctly.  I'm running dspace 1.5.  Does this have to do with a
postgres or dspace setting?

Thank you!
Jose


-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK  win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net

Re: [Dspace-tech] Author sorting

2008-08-06 Thread Mark H. Wood
Well, it does indeed seem that this is not dependent on the PostgreSQL
version, because I see the same incorrect behavior out of version
8.3.3.

The immediate problem is not the lack of ORDER BY; the immediate
problem is that ORDER BY does not seem to work for these data.  I
tried the same experiment, completely unconnected with DSpace, and got
the same result:  b sorts before some , and after others...or,
more likely, the data are returned in entry order regardless of ORDER
BY.  I've tested both CHAR and VARCHAR and they both do this.  INT
columns are ordered properly.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



pgplKeVAPPbeU.pgp
Description: PGP signature
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


Re: [Dspace-tech] Author sorting

2008-08-06 Thread Kasthuri, Sriram
We are using postgresql v 7.3 and it worked fine with ORDER BY
text_value. But not sure whether anything got changed in the later
versions of postgre?

- Sri
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark H.
Wood
Sent: 06 August 2008 14:26
To: dspace-tech@lists.sourceforge.net
Subject: Re: [Dspace-tech] Author sorting

Well, it does indeed seem that this is not dependent on the PostgreSQL
version, because I see the same incorrect behavior out of version
8.3.3.

The immediate problem is not the lack of ORDER BY; the immediate
problem is that ORDER BY does not seem to work for these data.  I
tried the same experiment, completely unconnected with DSpace, and got
the same result:  b sorts before some , and after others...or,
more likely, the data are returned in entry order regardless of ORDER
BY.  I've tested both CHAR and VARCHAR and they both do this.  INT
columns are ordered properly.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


Re: [Dspace-tech] Author sorting

2008-08-06 Thread Blanco, Jose
When I was on version 7.3.15 of postgres I tested the order by just as I
described in my original email, and it gave me the undesired results.  

There must be some sort of setting to make this work.  I have seen sites
where it works just fine.

-Jose

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Kasthuri, Sriram
Sent: Wednesday, August 06, 2008 9:30 AM
To: Mark H. Wood; dspace-tech@lists.sourceforge.net
Subject: Re: [Dspace-tech] Author sorting

We are using postgresql v 7.3 and it worked fine with ORDER BY
text_value. But not sure whether anything got changed in the later
versions of postgre?

- Sri
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark H.
Wood
Sent: 06 August 2008 14:26
To: dspace-tech@lists.sourceforge.net
Subject: Re: [Dspace-tech] Author sorting

Well, it does indeed seem that this is not dependent on the PostgreSQL
version, because I see the same incorrect behavior out of version 8.3.3.

The immediate problem is not the lack of ORDER BY; the immediate problem
is that ORDER BY does not seem to work for these data.  I tried the same
experiment, completely unconnected with DSpace, and got the same result:
b sorts before some , and after others...or, more likely, the data
are returned in entry order regardless of ORDER BY.  I've tested both
CHAR and VARCHAR and they both do this.  INT columns are ordered
properly.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge Build the coolest Linux based applications with Moblin SDK 
win great prizes Grand prize is a trip for two to an Open Source event
anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


[Dspace-tech] Author sorting

2008-08-05 Thread Blanco, Jose
I was hoping that the our new version of postgres ( 8.1.11 ) would solve
the problem we see when authors are browsed.  Here is the problem:

Suppose we have the following 3 authors:

 Ta, A
 Ta, Z
 Tab, A

I would expect them to show up in the oder shown above when browsing by
author, but instead I get:

 Ta, A
 Tab, A
 Ta, Z

Which as you can see is not really the desired behavior. I created a
test table and loaded these values into a field of type text, and then
issued the following query:

 select * from test order by 1;
   a

 Ta, A
 Tab, A
 Ta, Z
(3 rows)

So I can see why Dspace is displaying this in this order.

The funny thing is that I'm fairly certain that I have seen the desired
ordering in some Dspace instances, so I'm not sure why ours is not
sorting correctly.  I'm running dspace 1.5.  Does this have to do with a
postgres or dspace setting?

Thank you!
Jose

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech