DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
EXT: Book Database¶
Author: | Kasper Skårhøj |
---|---|
Created: | 2002-11-01T00:32:00 |
Changed by: | Mario Birkigt |
Changed: | 2005-02-10T14:07:39 |
Classification: | Description of the Typo3 Frontend Plugin: Book Database |
Author: | Mario Birkigt |
Email: | mario.birkigt(AT)t-online.de |
Info 3: | |
Info 4: |
EXT: Book Database¶
Extension Key: bookdb
Copyright 2003, Mario Birkigt, <mario.birkigt(AT)t-online.de>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.com
Table of Contents¶
EXT: Book Database 1
Introduction 1
What does it do? 1
Screenshots 1
Users manual 5
Search for books in the database 5
Input a book 10
Change an entry for a book 10
The “Other Tables” 11
Configuration 13
Known problems 16
To-Do list 16
Changelog 16
Introduction¶
What does it do?¶
Book database is a plugin for managing books and magazines in a company or at home. It offers the possibilities of search, input and changing of books and associated data.
Screenshots¶
Users manual¶
Search for books in the database¶
The Book Database plugin starts with a search mask. Here you can do a search in the database. Which search mask is used depends on configuration of the value SearchFormStyle in the plugin configuration options. The following “Search Mask” is provided through the configuration of SearchFormStyle =new. This is also the default configuration.
The old Search Mask is still available, if the value for SearchFormStyle is empty.
At first you can choose the radio button “Display All”, which simply displays all items in the database.
In this case the results are ordered by an internal ID. If you hit the button ”Title” the search results are ordered by title.
If you hit the button ”Author” the search results are ordered by author.
The following radio buttons: Place, Category, Publishing Company, Type and Language do an exact search for the selected value from the associated option field.
The above search would display all books which are at the place “Place 2”.
For the other items: Title, Author, Key Words and Content description you can provide a search expression. The values have to be separated by spaces. If you use a plus before a value, this value is required in search results. The search is case insensitive.
The above search would find all books containing the substrings web and progarmming in their title.
If the value begins with a minus sign, this value may not be contained in the search results
The above search would find all books containing web , but not containing php in their title.
If a value starts with no sign and there is more than one value. The serach expression is handled with an or linkage, this means not all values must be contained in the search results.
The above search would find all books containing web and all books containing database in their title.
Another feature for search is the ability to search for whole phrases. If you want to do this, just put the phrase between quotation marks “phrase” or single quotation marks 'phrase'.
The above example shows how to search for the phrase “Basic Web” and produces the following result.
If your search produces no results and the search form is displayed again, the following Message appears.
Input a book¶
To Input a new book you must fill in the required fields, otherwise an error message appears.
The data you already had input isn't lost. It is displayed again. The only thing you have to do is to enter a new place for the book in the input field or choose an existing from the select-box and press save again. If anything is right a new empty input mask appears. If you enter an ISBN for a book, that already exists in the database, the input is rejected with an error message: “This book already exists in the database, but the book is displayed for changing the entry. The same happens if the title and the author are identical to an entry in the database. For the values: Publishing Company, Place, Category, Type and Language you have 2 choices for input: a selection field and a text input field. The value in the text input feld is preferred from these two fields. Only if the text input field is empty, the value from the selection field is stored. If you know the ISBN for a book, you can fill in this in the field labeled ISBN and hit the WWW-Button. The script tries to fetch the information from amazon.de, and provides the values in the appropriate fields, if a book was found.
Change an entry for a book¶
To change a book you can input the ID or the ISBN if you know these, and the book is displayed for change, if it's existing in the database. You can also use the button browse, to browse the db and select an item for change. If you have a large database you can restrict the items to be displayed with input values in the following fields: Title, Author, Publishing Company, Place, Category, Type and Language. Choose the book for change with the butoon Change. If you made your changes, push the button “Submit Changes” and the changed entry for the book is saved. If you want to delete a book, push the button Delete and the book is deleted from the database. Assuming that you know what you are doing, there is no additional question if you want to delete this book.
The “Other Tables”¶
The so called other tables are all tables except the main table. They are used to store: Publishing Company, Place, Category, Type and Language. You can edit the entrys in these tables after pushing the button “Other Tables” in the Input Mask.
In the upper part you can choose one of the other tables, where you want to add, change or delete an item. Below you can add a new item to the selected table. In the lower part the items of the seleted table are displayed, so you can choose an item to change or delete. You can't delete an item, which ID is still used as an entry in the main table.
Configuration¶
Install the plugin with the extension manager. The following tables are created during installation process:
tx_bookdb_book¶
Table
tx_bookdb_book
Meaning
the main table used for storing book data: isbn, title, author, publishing date, edition, key words and a content description
tx_bookdb_booklanguage¶
Table
tx_bookdb_booklanguage
Meaning
the table used to store the different languages
tx_bookdb_booktype¶
Table
tx_bookdb_booktype
Meaning
the table used to store the booktype
tx_bookdb_category¶
Table
tx_bookdb_category
Meaning
the table used to store the category
tx_bookdb_place¶
Table
tx_bookdb_place
Meaning
the table used to store the place where the book is
tx_bookdb_publ_comp¶
Table
tx_bookdb_publ_comp
Meaning
the table used to store the publishing company
If the webserver containing the Typo3 installation lies behind a proxy, the plugin uses cURL to fetch data from the web. This requires that the cURL library must be installed. You must set the constant useProxy to 1 and fill in the correct values in the constant Proxy as shown below.
There are two different page types represented by two Plugin Options. The Code field is no longer used to configure the plugin.
Search - the page for searching the db and displaying the results
Input - the page for insert new books and change of existing books
With the constant ItemDisplayCount you can limit the number of items displayed for search results, browse the database and editing of the other tables. The default value is 10.
You can choose which fields in the input form are required to fill in with the RequiredInputFields constant. The required fields are marked with an asterisk.
In the screenshot the fields title and place are marked as required for filling in.
The default value is a string containing all fields, which make no sense for practice, but you can easily delete the not required fields. With the RequiredFieldsStyle you can adjust how the labels for the reqired fields should look if they aren't filled in.
Another constant provided is ResultFields , which is controlling the fields to be displayed for search results.
With the constant EmptyValue you can set a value to be displayed instead of empty fields. If you change this value in the Typoscript Constant Editor, you must also change this value in the other tables: publ_comp, place, category, booktype, booklanguage, or the old entry for empty fields would be handled as an normal entry.
For the meaning of the other Typoscript constants according to style please look at the section Reference later in this document.
((generated))¶
Reference¶
TypoScript constants explained
templateFile¶
Property
templateFile
Data type
file
Description
File used as HTML-Template
Default
typo3conf/ext/bookdb/pi1/bookdb_template.tmpl
Language¶
Property
Language
Data type
string
Description
Language used for Field-Labels, Headers, Messages
Default
useProxy¶
Property
useProxy
Data type
int[0-1]
Description
If you want to use a proxy, set this value to 1
Default
0
Proxy¶
Property
Proxy
Data type
string
Description
a string which consists of ip-address and port of the proxy, separated with a colon127.0.0.1:8080
Default
ItemDisplayCount¶
Property
ItemDisplayCount
Data type
int[1-100]
Description
Number of rows to display the search results and the entrys of the other tables
Default
HeaderStyle¶
Property
HeaderStyle
Data type
string
Description
contains the style for the headers
Default
font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular; color: #23058C; font-size: 16px; font-weight: bold; text-align: center;
FieldLabelStyle¶
Property
FieldLabelStyle
Data type
string
Description
contains the style for field-labels and fields
Default
font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular; color: #23058C; font-size: 12px; border-width: 2px;
InputStyle¶
Property
InputStyle
Data type
string
Description
contains the style for input fields
Default
font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular; color: #23058C; font-size: 12px; border: 1px dotted #CCCCCC;
InputFieldSizes¶
Property
InputFieldSizes
Data type
string
Description
adjust the width of the input fields: id,isbn,title,author,publ_date, edition,publ_comp,place,category,booktype,booklanguage,key_words,con tent_desc
Default
80,80,400,400,130,130,190,190,190,190,190,400,400
ButtonStyle¶
Property
ButtonStyle
Data type
string
Description
contains the style for buttons
Default
font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular; color: #23058C; font-size: 12px; border:2px solid #23058C;
TableButtonStyle¶
Property
TableButtonStyle
Data type
string
Description
contains the style for buttons within a table for sorting or displaying details
Default
TableButtonStyle=font-family: Arial,Helvetica,Geneva,Swiss,SunSans- Regular; color: #23058C; font-size: 12px; border:2px solid #FFFFFF; background-color: #FFFFFF;
InputTableStyle¶
Property
InputTableStyle
Data type
string
Description
contains the “style” of the table used for input and change mask
Default
'width="100%" cellspacing="3" cellpadding="3"'
OutputTableStyle¶
Property
OutputTableStyle
Data type
string
Description
contains the “format” of the table sused for displaying search results and book details and the table used for browsing the db
Default
border="1px" bordercolor="#23058C" frame="box" rules="all" cellpadding="5" width="100%" style="border-collapse: collapse; border- color: #23058C;"
ErrorMessageStyle¶
Property
ErrorMessageStyle
Data type
string
Description
contains the style for error messages
Default
font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular; color: #FF0000; font-size: 12px; font-weight: bold; text-align: center;
RequiredFieldsStyle¶
Property
RequiredFieldsStyle
Data type
string
Description
contains the style for required fields when they are not filled
Default
font-family: Arial,Helvetica,Geneva,Swiss,SunSans-Regular; color: #FF0000; font-size: 12px; font-weight: bold; text-align: center;
RequiredInputFields¶
Property
RequiredInputFields
Data type
string with csv values
Description
contains the required fields for input and change separated by commas
Default
title,author,publ_comp,edition,isbn,publ_date,place,category,booktyp e,booklanguage,key_words,content_desc
ResultFields¶
Property
ResultFields
Data type
string with csv values
Description
the fields to be displayed for search results
Default
title,author,publ_comp,edition,isbn,publ_date,place,category,booktyp e,booklanguage
EmptyValue¶
Property
EmptyValue
Data type
string
Description
the value which is displayed for an empty field
Default
---
SearchFormStyle¶
Property
SearchFormStyle
Data type
String
Description
selects if the new search mask with checkboxes will be displayed or the old one with radiobuttons
Default
new
ISBN¶
fieldlabel
ISBN
internal fieldname
isbn
Title¶
fieldlabel
Title
internal fieldname
title
Author¶
fieldlabel
Author
internal fieldname
author
Publishing Date¶
fieldlabel
Publishing Date
internal fieldname
publ_date
Edition¶
fieldlabel
Edition
internal fieldname
edition
Publishing Company¶
fieldlabel
Publishing Company
internal fieldname
publ_comp
Place¶
fieldlabel
Place
internal fieldname
place
Category¶
fieldlabel
Category
internal fieldname
category
Type¶
fieldlabel
Type
internal fieldname
booktype
Language¶
fieldlabel
Language
internal fieldname
booklanguage
Key Words¶
fieldlabel
Key Words
internal fieldname
key_words
Content Description¶
fieldlabel
Content Description
internal fieldname
content_desc
Known problems¶
To-Do list¶
I'm planning to rewrite the extension using the PEAR classes and Smarty as template engine, to provide more flexibility for the design of the pages displayed in the frontend.
Changelog¶
- 0.0.1 first version
- 0.0.2 finnish translation added, thanks to translator
- 0.0.4 minor layout changes for search and input formremoved checking if book exists, so it's possible to have several copies of the same book
- 0.0.5 italian translation added, thanks to translator
- 0.1.0 automatic language recognition addeda new Search Mask with 'AND' linked search fields is available with the constant SearchFormStyle=newthanks to Daniel Pötzingerit is possible to configure one or more starting points (for the plugin) for a search page, so that only values from these pages will be found through search
- 0.1.2 changed pagetype configuration from code field to to configuration with flexforms
EXT: Book Database - 18