\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
\part{About Groo}
Groo was written in PHP 5.1 with Horde 3.1.

The archived CVS repository can be downloaded from <a href="ftp://ftp.horde.org/pub/archive/">ftp://ftp.horde.org/pub/archive/</a>.

\section{High-level use cases}
At a minimum, Groo should allow a user to:

\begin{itemize}
\item catalog her books, by typing ISBNs or scanning barcodes


\item invite friends who will have access to her books


\item ask to borrow a book


\item approve lending of a book


\end{itemize}
After the basics are done, we also want our user to be able to:

\begin{itemize}
\item search, tag, comment, recommend and rate books in her collective catalog


\item get e-mail remembering to return a book, or to ask for a book which is overdue


\item arrange the exchange of books, either setting up meetings or scheduling drops


\end{itemize}
\section{Basic entities}
The main entities in the Groo system are \textbf{Users}, \textbf{Books} and \textbf{Items}. Users are basically managed and stored by the Horde infrastructure.

\subsection{Books vs. Items}
What we call a Book in Groo is not a physical object, but rather a certain edition of a work, such as "PHP in a Nutshell, ISBN: 0596100671". An Item is a particular physical instance or exemplar of a Book, such as my own copy of "PHP in a Nutshell". Eventually Items will also refer to DVDs, LPs, CDs.

So Groo has a public database of Books, and private collections of Items, which are the user's book collections. The collections are implemented as Horde shares.

\section{Application components}
\subsection{groo\_books}
Each record represents a book in print, usually identified by an ISBN. Since older books don't have an ISBN, the primary key is and internal sequence. When the ISBN is NULL the title must not be NULL (but this is not enforced at this time).

Books have a one-to-many relationship with Items (see groo\_items groo\_items).

Books have a many-to-many relationship to Creators (see groo\_creators and groo\_l\_book\_creator).

The title field is indexed for full text search.

<pre><code class="language-sql">CREATE TABLE groo\_books (
    book\_id INT UNSIGNED NOT NULL,
    isbn13 CHAR(14),        -- ISBN13 + 1 DIGIT = GTIN
    title VARCHAR(255),     -- Either isbn13 or title must not be null
    title\_sort VARCHAR(255),-- Title for sorting purposes (article at end)
    edition VARCHAR(63),    -- Ex: 1st; extended ultimate director's cut edition
    publisher VARCHAR(63),
    issued CHAR(10),        -- publication date in partial ISO-8601 format Ex: 1999-12
    metadata\_status VARCHAR(32),           -- status of the data in this record
    metadata\_source VARCHAR(32) NOT NULL,  -- source of the data in this record
    metadata\_modified\_dt TIMESTAMP,
    created\_dt DATETIME NOT NULL,
--
    PRIMARY KEY (book\_id),
    UNIQUE (isbn13),
    FULLTEXT (title)
);
</code></pre>

\noindent\rule{\textwidth}{1pt}
\subsection{groo\_creators}
The name field is indexed for full text search.

<pre><code class="language-sql">CREATE TABLE groo\_creators (
    creator\_id INT UNSIGNED NOT NULL,
    name VARCHAR(255) NOT NULL,
    metadata\_source VARCHAR(32) NOT NULL,
    metadata\_modified\_dt TIMESTAMP,
    created\_dt DATETIME NOT NULL,
--
    PRIMARY KEY (creator\_id),
    FULLTEXT (name)
);
</code></pre>

\noindent\rule{\textwidth}{1pt}
\subsection{groo\_l\_book\_creator}
This table establishes the many-to-many relationship between Books and Creators

<pre><code class="language-sql">CREATE TABLE groo\_l\_book\_creator (
    book\_id INT UNSIGNED NOT NULL,
    creator\_id INT UNSIGNED NOT NULL,
    role CHAR(16),                    -- author, translator, editor, illustrator etc.
    citation\_order SMALLINT UNSIGNED, -- the order in which the creator name appears
--
    PRIMARY KEY (book\_id, creator\_id)
);
</code></pre>

\noindent\rule{\textwidth}{1pt}
\section{groo\_items}
This table structured was borrowed from Mnemo (the mnemo\_memos table). The only change, besides the fieldnames, was the addition of the item\_book\_id field, which is a foreign key linking to the groo\_books table.

Both item\_id and item\_uid are randomly generated unique strings. A recent discussion on the \textit{dev} list concluded with Chuck saying that id fields (such as item\_id) in Horde apps should be converted back to integers. Item\_uid will continue as is, because it is used for syncing to external devices. I don't know wether Groo items could be usefully synced to a cell phone or PDA, but for the time being the field stays.

<pre><code class="language-sql">CREATE TABLE groo\_items (
    item\_owner      VARCHAR(255) NOT NULL, -- id of the Horde share which owns this item
    item\_id         VARCHAR(32) NOT NULL,  -- id of the item (a random string)
    item\_uid        VARCHAR(255) NOT NULL, -- uid of the item, for syncing to external devices
    item\_desc       VARCHAR(255) NOT NULL, -- short description of the item
    item\_body       TEXT,                  -- user comments on the item
    item\_book\_id    INT UNSIGNED NOT NULL, -- the book of which this item is a copy
    item\_category   VARCHAR(80),           -- one of the user defined categories
    item\_private    SMALLINT NOT NULL DEFAULT 0, -- boolean?
    item\_modified   TIMESTAMP,             -- used to sort items by date of change
--
    PRIMARY KEY (item\_owner, item\_id)
);
</code></pre>

\noindent\rule{\textwidth}{1pt}
\subsection{groo\_remote\_queries}
This table is used by the Fetch.php module to record transactions with the remote metadata sources.

Calling \texttt{./Fetch.php --fetch-untitled} via the command line adds a record in this table for each Book without a title added since the last fetch operation.

Fetch.php then passes the list of queries to the fetch drivers (currently only Amazon.php is implemented). The fetch drivers should be prioritized, that is, the first one invoked should be the one most likely to have the metadata. For US books, Amazon.com is a good first choice because it has book covers (the Library of Congress catalog is more complete but does not have the convers).

<pre><code class="language-sql">CREATE TABLE groo\_remote\_queries (
    query\_id INT UNSIGNED NOT NULL AUTO\_INCREMENT,
    metadata\_source VARCHAR(32) NOT NULL,   -- eg: amazon.com, bn.br etc.
    param\_name VARCHAR(32) NOT NULL,        -- eg: asin, isbn etc.
    param\_value VARCHAR(255) NOT NULL,      -- eg: 0486273474
    last\_attempt\_num INT UNSIGNED DEFAULT 0,-- fetch attempts counter
    last\_attempt\_dt DATETIME,
    query\_status CHAR(32),                  -- interna status string, eg: SUCCESS, NOT\_FOUND
    message TEXT,                           -- the actual message returned by the remote system
    record\_modified\_dt TIMESTAMP,
    created\_dt DATETIME NOT NULL,
--
    PRIMARY KEY (query\_id),
    UNIQUE (metadata\_source, param\_name, param\_value)
);
</code></pre>

\noindent\rule{\textwidth}{1pt}
\subsection{groo\_item\_leases}
This is intended to control the lease of items between users. No code dealing with this has been implemented yet. The plan is to try to leverage the Nag (tasks) functionality do implement this, so some of the fields below may turn out to be redundant.

<pre><code class="language-sql">CREATE TABLE groo\_item\_leases (
    lease\_id INT UNSIGNED NOT NULL,
    item\_id INT UNSIGNED NOT NULL,  -- leased item id
    requester\_uid VARCHAR(255),     -- who asked to borrow
    lease\_status CHAR(32),          -- internal status string, eg: PENDING, OVERDUE
    return\_condition TEXT,          -- optional owner comment on the state of the returned item
    start\_dt DATETIME,              -- start of the lease period
    end\_dt DATETIME,                -- end of the lease period
    returned\_dt DATETIME,           -- date when the item was returned to the owner
    record\_modified\_dt TIMESTAMP,
    created\_dt DATETIME NOT NULL,
--
    PRIMARY KEY (lease\_id)
);
</code></pre>
\section{Personal libary managers}
There are many sofware products, free or commercial, to help people manage their personal libraries.

\subsection{Desktop}
\includegraphics{http://www.delicious-monster.com/images/librarypage/screenshots/cover\_BIG.jpg}

\subsubsection{Delicious Library (<a href="http://www.delicious-monster.com/\">http://www.delicious-monster.com/\textbackslash\{\}</a>)}
\begin{itemize}
\item Pros: excellent UI; can read barcodes via iSight web cam; MacOSX compatible


\item Cons: limited to Amazon.com catalog; MacOSX only; proprietary software


\end{itemize}
\subsubsection{Personal Library Manager (<a href="http://www.thebottle.org/\">http://www.thebottle.org/\textbackslash\{\}</a>)}
\begin{itemize}
\item Easy navigation to browse through books


\item Title, Author, Publisher, Category, Pages, Status, Rating, Description, and Cover fields


\item Title and author search


\item Filter through books marked "Not Read", "Finished", or "Read Again"


\item Compact and repair the database


\end{itemize}
\subsection{Web based}
\subsubsection{BookCrossing (<a href="http://www.bookcrossing.com/\">http://www.bookcrossing.com/\textbackslash\{\}</a>)}
This is a thriving community site which encourages people to pass on their books, even to total strangers, by leaving them in public places. Each book carries a message explaining the idea to whoever found it, and a unique identifier that can be used to track where the book has been previously. This is a fantastic idea, and the first approach to try to manage the Book Commons. However, it is not really a personal library manager in the sense that you do not control your books, but only track them.

\section{The Book Commons}
Is the collection of all books which freely circulate among people. Most of them are unaccounted for.

I may borrow a book from someone, forget to return it, and then pass it on to somebody else.

\subsection{Liberated books}
Groo users will be able to "liberate" some of their books, which then become available to all users as part of the book commons. A liberated book can be held by anyone as long as no one else wants to borrow it. If you are holding a liberated book and another person asks for it, you are required to pass it on within a certain period.

\section{What is a collective library?}
It's the collection of all books belonging to you and to your friends which are available for lending. The catalog of such a library is the union of the catalog of your personal collection plus your friends personal collections. Therefore, the catalog is different for each user.

There are other <a href="https://wiki.horde.org/PersonalLibraryManagers">PersonalLibraryManagers</a> available, and you can use the <a href="http://wanderingbooks.org">WanderingBooks.org</a> site just to manage your personal library. But our idea is to enable groups of people to create collective libraries, which will be richer than the sum of their personal libraries because of the resulting interaction and socializing.

\section{Logistics and socializing}
Because a collective library has no building, users will be motivated to arrange meetings to exchange books. These can be done at their workplaces, schools, cafes, pubs etc. The system will help arrange such meetings, reminding each user which to books to bring and collect. The need to personally meet other users is seen as a feature of the system, providing a good excuse for interacting with like-minded people.

\end{document}
