Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
    webui.browse.index.1 = dateissued:dc.date.issued:date:full
    webui.browse.index.2 = author:dc.contributor.*:text:single
    webui.browse.index.3 = title:dc.title:title:full
    webui.browse.index.4 = subject:dc.subject.*:text:single
    webui.browse.index.5 = dateaccessioned:dc.date.accessioned:date:full
    
    # and some extra examples ones
    # webui.browse.index.6 = type:dc.type:text:single
    # webui.browse.index.7 = itemstatus:icadmin.status:text:single

...

Code Block
    NOTE: a potential problem arises.  The "sort" fields need to be singular, while the "value" field can be multiple.  That is, an item 
    may have more than one author as the value to browse on, but may not have more than one title as the value to sort on.  In the cases
    where an item has more than one value in the sort metadata, the code will select only the first value that is returned.  This is a 
    caveat that people configuring their system will need to be aware of

...

The following are variables that will need to be passed into the Browse engine in order for appropriate results to be returned: *

  • type: the type of browse being undertaken. This will be used to identify the Browse Index from the config

...

  • sortBy: which of the available sort options in config is to be sorted by

...

  • order: which way to interpret the sortBy. ASC or DESC

...

  • value: a specific value to browse upon. For example "Jones, Richard" to view all items where I am the author (in conjunction with type=author, of course)

...

  • resultsperpage: number of results to display on the page at any one time

...

  • community: the community we are browsing in

...

  • collection: the collection we are browsing in

...

  • next: the id of the item to be at the top of the "next" page

...

  • prev: the id of the item to be at the top of the "previous" page

...

  • focus: the target point in the listing to point the browse. This will be utilised by the paging system

...

  • year: the year to use as a focus in date browse

...

  • month: the month to use as a focus in date browse

...

  • startsWith: the characters to use for a stem search. Will be used with the focus

...

  • vfocus: the string to form the focus for single browse contexts added 29-11-2006

NOTE: "next" and "prev" are not clearly defined as to what the best way to obtain them is, and exactly what their relationship to "focus" is. It may be that "next" and "prev" are only used in the Servlet/UI layer to represent the "focus" for the next and previous functionality.

...

Code Block
    SELECT * FROM <index>
    WHERE sort_value [<|=] [<value> | _focus_]
        [AND collection_id = _collection_] 
        [AND community_id = _community_]
    ORDER BY <sortBy> <order>
    LIMIT <resultsperpage + 1>

...

Code Block
    SELECT COUNT(*) FROM <index> 
    WHERE value [<|_] <focus>

...

Code Block
    SELECT * FROM <index>
    WHERE sort_value [<|=] [<value> | _focus-value_]
        [AND collection_id = _collection_] 
        [AND community_id = _community_]
    ORDER BY <sortBy> <order>
    LIMIT <resultsperpage + 1>

...

Ongoing programmers notes

...

  • Here's an oddity which rings a bell from the last time I looked at the Browse code. It seems that the result of a SELECT COUNT(star) query, despite being a number can't be retrieved using the TableRow.getIntColumn() method. I'm trying TableRow.getStringColumn and Integer.parseInt, but I have a horrible feeling that won't work either.
    • Nope, as anticipated:
Code Block
    Exception:
    java.lang.IllegalArgumentException: Value for number is not an integer
        at org.dspace.storage.rdbms.TableRow.getIntColumn(TableRow.java:162)

...

  • type = dateissued | author | title | subject
  • order = ASC | DESC
  • value = [free text]
  • focus = [item id]
  • rpp = [integer: 1 - X]
  • sort_by = [integer: 1 - N]

The full browse URL is of the form:

...

Code Block
  A summary of the URL parameters tested above
 |-
 ! test !! mode !! type !! order !! value !! focus !! vfocus !! rpp !! sort_by
 |-
 | 1 || Full/Item || dateissued || ASC || N/A || 3 || N/A || 12 || 0 
 |-
 | 2 || Full/Item || dateissued || DESC || N/A || 5 || N/A || 10 || 1
 |-
 | 3 || Single/Value || author || ASC || - || N/A || - || 25 || N/A
 |-
 | 4 || Single/Value || author || DESC || - || N/A || Boothroyd, Betty || 3 || N/A
 |-
 | 5 || Full/Item || title || ASC || N/A || 13 || N/A || 5 || 2
 |-
 | 6 || Full/Item || title || DESC || N/A || - || N/A || 30 || 2
 |-
 | 7 || Single/Value || subject || DESC || - || N/A || - || 10 || N/A
 |-
 | 8 || Single/Value || subject || ASC || - ||  N/A || fdsa || 10 || N/A
 |-
 | 9 || Single/Value with Value || author || ASC || Jones, Richard || N/A || - || 10 || 1
 |-
 | 10 || Single/Value with Value || author || DESC || Jones, Richard || N/A || submit 13 || 5 || 1
 |-
 | 11 || Single/Value with Value || author || ASC || Eagle, Eddie || N/A || - || 10 || 2
 |-
 | 12 || Single/Value with Value || subject || DESC || asdf || N/A || - || 10 || 1

...

Code Block
    SELECT * FROM <index>
    WHERE sort_value [[<|=] [<value> | _focus-value_] | LIKE <starts_with>% ]
       [AND collection_id = _collection_] 
       [AND community_id = _community_]
    ORDER BY <sortBy> <order>
    LIMIT <resultsperpage + 1>

...

Code Block
   Listing over 3 columns: dc.date.issued,dc.title.null,dc.contributor.* starting with value: 2006-11|| 
   Sorting by: dc.date.issued ASC(option 0)||
   {{Item ID: 1 :: [dc.date.issued:2006-11-16T17.08.11Z][dc.title.null:Submit 1][dc.contributor.*:Jones, Richard]}}
   {{Item ID: 2 :: [dc.date.issued:2006-11-16T17.08.42Z][dc.title.null:submit 2][dc.contributor.*:Jones, Richard]}}
   {{Item ID: 3 :: [dc.date.issued:2006-11-16T17.09.05Z][dc.title.null:submit 3][dc.contributor.*:Jones, Richard]}}  
   {{Item ID: 4 :: [dc.date.issued:2006-11-16T17.09.26Z][dc.title.null:submit 4][dc.contributor.*:Jones, Richard]}}
   {{Item ID: 5 :: [dc.date.issued:2006-11-16T17.09.52Z][dc.title.null:submit 5][dc.contributor.*:Jones, Richard]}}  
   {{Item ID: 6 :: [dc.date.issued:2006-11-16T17.10.18Z][dc.title.null:submit 6][dc.contributor.*:Jones, Richard]}}  
   {{Item ID: 7 :: [dc.date.issued:2006-11-16T17.10.43Z][dc.title.null:submit 7][dc.contributor.*:Jones, Richard]}}
   {{Item ID: 8 :: [dc.date.issued:2006-11-16T17.11.08Z][dc.title.null:submit 8][dc.contributor.*:Jones, Richard]}}
   {{Item ID: 9 :: [dc.date.issued:2006-11-16T17.11.30Z][dc.title.null:submit 9][dc.contributor.*:Jones, Richard]}}
   {{Item ID: 10 :: [dc.date.issued:2006-11-16T17.11.56Z][dc.title.null:submit 10][dc.contributor.*:Jones, Richard]}}
   {{Item ID: 11 :: [dc.date.issued:2006-11-16T17.12.19Z][dc.title.null:submit 11][dc.contributor.*:Jones, Richard]}}||

...

Code Block
    SELECT * FROM <index>
    WHERE sort_value [<|=] [<value> | _starts_with_]
      [AND collection_id = _collection_] 
      [AND community_id = _community_]
    ORDER BY <sortBy> <order>
    LIMIT <resultsperpage + 1>

...

Code Block
    BrowseInfo String Representation: Browsing 6 to 16 of 27 in index: dateissued(data type: date, display type: full)||
    Listing over 3 columns: dc.date.issued,dc.title.null,dc.contributor.* starting with value: 2006-11-30||
    Sorting by: dc.date.issued DESC(option 0)||
    {{Item ID: 22 :: [dc.date.issued:2006-11-16T17.17.24Z][dc.title.null:submit 22][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 21 :: [dc.date.issued:2006-11-16T17.16.02Z][dc.title.null:submit 21][dc.contributor.*:Jones, Richard]}}  
    {{Item ID: 20 :: [dc.date.issued:2006-11-16T17.15.42Z][dc.title.null:submit 20][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 19 :: [dc.date.issued:2006-11-16T17.15.19Z][dc.title.null:submit 19][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 18 :: [dc.date.issued:2006-11-16T17.14.58Z][dc.title.null:submit 18][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 17 :: [dc.date.issued:2006-11-16T17.14.37Z][dc.title.null:submit 17][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 16 :: [dc.date.issued:2006-11-16T17.14.16Z][dc.title.null:submit 16][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 15 :: [dc.date.issued:2006-11-16T17.13.52Z][dc.title.null:submit 15][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 14 :: [dc.date.issued:2006-11-16T17.13.31Z][dc.title.null:submit 14][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 13 :: [dc.date.issued:2006-11-16T17.13.09Z][dc.title.null:submit 13][dc.contributor.*:Jones, Richard]}}
    {{Item ID: 12 :: [dc.date.issued:2006-11-16T17.12.45Z][dc.title.null:submit 12][dc.contributor.*:Jones, Richard]}}||

...

Code Block
                /*
                 * When the user is browsing with the most recent items first,
                 * the browse code algorithm doesn't quite do what some people
                 * might expect. For example, if in the index there are entries:
                 * 
                 * Mar-2000 15-Feb-2000 6-Feb-2000 15-Jan-2000
                 * 
                 * and the user has selected "Feb 2000" as the start point for
                 * the browse, the browse algorithm will start at the first
                 * point in that index *after* "Feb 2000". "Feb 2000" would
                 * appear in the index above between 6-Feb-2000 and 15-Jan-2000.
                 * So, the browse code in this case will start the browse at
                 * "15-Jan-2000". This isn't really what users are likely to
                 * want: They're more likely to want the browse to start at the
                 * first Feb 2000 date, i.e. 15-Feb-2000. A similar scenario
                 * occurs when the user enters just a year. Our quick hack to
                 * produce this behaviour is to add "-32" to the startsWith
                 * variable, when sorting with most recent items first. This
                 * means the browse code starts at the topmost item in the index
                 * that matches the user's input, rather than the point in the
                 * index where the user's input would appear.
                 */

...

OK, so now we have enough confidence to invest some time building the UI for this browse code. We have already attacked the logic of the display to generate the strings used for debug above, so it will be a matter of applying that logic to a nicer interface, with a variety of widgets. There is no need to significantly redesign the Browse UI, so the following outlines are almost identical except in some minor ways, to the existing interface.Single/Value Browseh1. When we are looking at a single value browse, such as "by author", the page would look as follows:

!browse-ui-single.png!Image Added
Full/Item & Value Browseh1. When looking at a list of actual items, such as "by title" or we are looking at a list of items associated with a value browse such as "items by author X", the page would look as follows:

! browse-ui-full.png Image Added
!Navigation Elementsh1. These two navigation elements will be used on both the above pages. The first will be used whenever the type is "title" or "text" and the second when the type is "date". This will also be dependent on which value we are sorting by (i.e. whether it's text or date) Image Modified


Still More Programmer's Notes

...

Code Block
  plot "browse.uat.dat" u 1:4 w linespoints

!Browse.uat.dat!