.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt :Created: 2007-08-14T11:09:38 :Changed: 2007-08-14T11:23:03 :Email: tim.wentzlau@auxiliorl.com :Info 2: :Info 3: :Info 4: Extension Key: **auxdataviewer** Copyright 2006-2007, tim.wentzlau@auxiliorl.com, 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 .. _generated: ((generated)) ============= .. _Table-of-Contents: Table of Contents ----------------- **EXT:DB App builder 1** **Introduction 1** What does it do? 1 **Users manual 2** Requirements 2 Overview of the process 2 What is going on 2 Defining the tables 3 Defining Data Views 3 Front end rendering 8 **Administration 10** Master/slave relations between grids and records 10 Styling the views 10 Static extension template TS properties 10 Support for multiple languages 11 Extending your application with Typo Script in DAB views 11 Extend TCA for your tables 13 Extending your DAB application with PHP 13 **Tutorial 14** General information 14 Defining tables 14 Defining the views 22 Creating page structure 31 **Known problems 34** **To-Do list 34** **Changelog 34** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ DB App Builder (DAB) makes it is possible to create DB applications in Typo3 without the need to write extensions in PHP or greatly reduces the needs for PHP programming. It is designed as a RAD tool that makes the default DB coding trivial and fast. DB App Builder extents the Extension Kick starter with extra an extra section where it is possible to define FE data views that are rendered with the FE content element *Data View* (a part of this extension). **Features in DAB** - DB grids and lists with master/slave relations to other grids and input forms on the same page or other pages. - Ajax support where master/slave relations are handled without page reload. - Graceful degradation in browsers that do not support Javascript and Ajax, all most all functionality is retained but with page reload. - Support all features that are possible to define in TCA. - Support for FE access control. - FE editing, as forms or directly in DB grids. - Support for events like onSelect and onCreate where SQL statements and PHP code may be executed. - The created DB applications are possible to upload to TER for sharing with the Typo3 community. - Extensive support for CSS. **Example of a small DAB application** |img-1| .. _Users-manual: Users manual ------------ .. _Requirements: Requirements ^^^^^^^^^^^^ Before you are able to use DAB you must install the extension *Extesnion Kickstarter* and learn how to define tables and relations. There exists several videos about the kickstarter on typo3.org but *Extension Kickstarter episode III* is the most important. .. _Overview-of-the-process: Overview of the process ^^^^^^^^^^^^^^^^^^^^^^^ **1. Define the tables** With DAB you start as normal in the Extension Kickstarter by defining the tables. **2. Define the data views** After tables and relations are created you move on to define the data views in the Data view section. A data view is a set of definitions that specify how tables should be presented in the front end. In a data view you specify the fields that should be visible, sort order and master/slave relations between data views. **3. Render the Data views in front end** Each data view is rendered in the front end with the plug-in Data view (a part of this extension). By placing all views on one or more pages you are making the actual implementation of your DAB application. .. _What-is-going-on: What is going on ^^^^^^^^^^^^^^^^ What DAB does behind the scene when rendering the data views in the front end is basically to create the SQL query that fetch the data from the table specified in the data view. The construction of the SQL query is based on the table definitions as they are stored in TCA and the settings of a data view. The constructed SQL query is executed and the result set is applied to a HTML template. .. _Defining-the-tables: Defining the tables ^^^^^^^^^^^^^^^^^^^ When creating a DAB application the tables and relations are defined as normal in the extension kick starter. .. _img-2-Defining-Data-Views: |img-2| Defining Data Views ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The next step is to create the data views of each table. Data views are defined in the Data view section click on the plus next to the section title and the settings for a single data view of one table could be created. |img-3| |img-4| |img-5| .. _Data-view-settings: Data view settings """""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _Name: Name ~~~~ .. container:: table-row Property Name Description The name of the data view is use to identify the view. .. _Description: Description ~~~~~~~~~~~ .. container:: table-row Property Description Description A short description of the data view. .. _View-Type: View Type ~~~~~~~~~ .. container:: table-row Property View Type Description How should the view be rendered. As a list, grid, form/record or dropdown. .. _Data-set: Data set ~~~~~~~~ .. container:: table-row Property Data set Description Select the table that should be viewed .. _Fields: Fields ~~~~~~ .. container:: table-row Property Fields Description Select the fields that should be visible. The fields appear in the same order in the front end. .. _External-fields: External fields ~~~~~~~~~~~~~~~ .. container:: table-row Property External fields Description Fields that are relations to other tables uses by default the defined label field in the foreign table. If you want to display another value in the foreign table it is possible to define it here as an external field. Enter the name of the table where the foregin field should be fetched from and the name of the new field. Click on Add. |img-6| Enter the keyfield (normally uid) the field to use in the foreign table and the field in this view that controls the releation. |img-7| .. _Calculated-fields: Calculated fields ~~~~~~~~~~~~~~~~~ .. container:: table-row Property Calculated fields Description Here it is possible to define extra fields that may contain sql expressions. Alternativly it is possible to make calculations in PHP events (see later in this documentation) .. _Default-sort-field: Default sort field ~~~~~~~~~~~~~~~~~~ .. container:: table-row Property Default sort field Description By default DAB uses the field defined as sort field in TCA for the table, but you can change it here. .. _Default-group-by: Default group by ~~~~~~~~~~~~~~~~ .. container:: table-row Property Default group by Description Select the field you want to group by. .. _Category-field: Category field ~~~~~~~~~~~~~~ .. container:: table-row Property Category field Description In list view you may specify a field that is used as category header. The resulting SQL then sort the result set by the category field. In the list output the values of the category is used as header. .. _FE-user-field: FE user field ~~~~~~~~~~~~~ .. container:: table-row Property FE user field Description Select a filed that have a relation to the fe\_user table. The selected field will automatically be bound to the current FE user when FE users create records. You may combine this setting with the FE Owner only property in the FE view in order to show only records that are owned by the current FE user. .. _Filter: Filter ~~~~~~ .. container:: table-row Property Filter Description Additional expressions that goes into the where part of the generated SQL query .. _Master-views: Master views ~~~~~~~~~~~~ .. container:: table-row Property Master views Description In this section you specify the views that may control this view this defines the master/slave relations. Select the view that should control this view click Add. |img-8| Select the fields that makes up the relation (defaults is based on TCA) |img-9| .. _Default-action: Default action ~~~~~~~~~~~~~~ .. container:: table-row Property Default action Description Select the action that is executed when a FE user clicks on an item in the list grid or dropdown. .. _Template: Template ~~~~~~~~ .. container:: table-row Property Template Description If the default template does not fulfill your requirements you may make your own and specify it here .. _Style-prefix: Style prefix ~~~~~~~~~~~~ .. container:: table-row Property Style prefix Description This values is appended to the main div tag of the rendered DAB component. It makes it possible to make specialized CSS styling .. _TS: TS ~~ .. container:: table-row Property TS Description Here it is possible to make extended configuration of the data view see later this manual for an in depth coverage of this field. .. ###### END~OF~TABLE ###### .. _Default-FE-view-settings: Default FE view settings """""""""""""""""""""""" In this section it is possible to define the default values in the FE Data View plug-in when a view is selected in the plug-in. |img-10| .. ### BEGIN~OF~TABLE ### .. _Visible-fields: Visible fields ~~~~~~~~~~~~~~ .. container:: table-row Property Visible fields Description Select the fields that should be visible in the view. .. _Editable-fields: Editable fields ~~~~~~~~~~~~~~~ .. container:: table-row Property Editable fields Description Select the fields that are editable. If a field is not defined as visible only editable the field is only visible when the view is in edit mode. .. _Show-Header: Show Header ~~~~~~~~~~~ .. container:: table-row Property Show Header Description When set in Grid mode the column headers are displayed. When set in Single record mode the field names are displayed. .. _Show-navigator: Show navigator ~~~~~~~~~~~~~~ .. container:: table-row Property Show navigator Description In grid and list mode the navigator is shown . .. _Grid-buttons: Grid buttons ~~~~~~~~~~~~ .. container:: table-row Property Grid buttons Description What buttons should be displayed for the grid or list .. _Row-buttons: Row buttons ~~~~~~~~~~~ .. container:: table-row Property Row buttons Description What buttons that should be displayed for a row in a grid. Normally only one of the edit buttons should be displayed. Edit sets a slave view in edit mode. Edit row activates in line editing directly in the grid. Edit record switches from grid view to a form where it is possible to edit The edit buttons are only shown if the FE user are allowed to edit the records. .. _Grid-height: Grid height ~~~~~~~~~~~ .. container:: table-row Property Grid height Description Defines the height of the grid. .. _Grid-header-height: Grid header height ~~~~~~~~~~~~~~~~~~ .. container:: table-row Property Grid header height Description Defines the height of the header of the grid. Unfortunally it is not possible to define this in CSS alone as scrolling in the grid needs some calculation to work in some browsers. As a result you have set the height here and in the CSS. .. _Image-width: Image width ~~~~~~~~~~~ .. container:: table-row Property Image width Description Default width of images .. _Image-height: Image height ~~~~~~~~~~~~ .. container:: table-row Property Image height Description Default height of images .. _Max-grid-list-rows: Max grid/list rows ~~~~~~~~~~~~~~~~~~ .. container:: table-row Property Max grid/list rows Description Maximum number of rows in a grid. If the number of records in a query is greater that this value the Navigator is activated. .. _Show-empty-values: Show empty values ~~~~~~~~~~~~~~~~~ .. container:: table-row Property Show empty values Description If set empty values are shown in single record. .. _Show-label-field-as-header: Show label field as header ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property Show label field as header Description If the view mode is single record the label field is shown as a header of the record and the page title is set to the value of the label field. .. _Edit-fields-inline: Edit fields inline ~~~~~~~~~~~~~~~~~~ .. container:: table-row Property Edit fields inline Description Forces inline edit of rows in grid mode. .. _Use-Ajax: Use Ajax ~~~~~~~~ .. container:: table-row Property Use Ajax Description Activates Ajax support. Activate only Ajax when needed. Ajax support gives a little extra page generation overhead. .. _Public-edit: Public edit ~~~~~~~~~~~ .. container:: table-row Property Public edit Description Allows all fe-users to edit and update the view. In this mode chacpta is automatically turned on to prevent spam. .. _View-only-FE-owner-records: View only FE owner records ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. container:: table-row Property View only FE owner records Description When set only records that are owned by the current FE user are displayed. For this to work a FE owner field must be defined in the view (see above). .. ###### END~OF~TABLE ###### When you have finished your work in the kick starter you should write and install your extension. .. _Front-end-rendering: Front end rendering ^^^^^^^^^^^^^^^^^^^ To display a data view you should use the FE plug-in Data view (a part of this extension). .. _Include-static-extension-template: Include static extension template """"""""""""""""""""""""""""""""" The first thing to do is to select the static template for the DAB view. This may be done in your main TS-template, select the “Data view (auxdataviewer)” template. |img-11| .. _FE-content-element: FE content element """""""""""""""""" Go to the page where you want to display the data view and insert the Data view content element. |img-12| Select the view name and fill in fields in the fields on the tabs. |img-13| .. _Definition-of-properties: Definition of properties """""""""""""""""""""""" .. ### BEGIN~OF~TABLE ### .. _View: **View** ~~~~~~~~ .. container:: table-row sheet **View** Property View name Description .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Lookup records in Description .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Create records in Description .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Use Ajax Description Activates Ajax support. Activate only Ajax when needed. Ajax support gives a little extra page generation overhead. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Show debug info Description .. _Template: **Template** ~~~~~~~~~~~~ .. container:: table-row sheet **Template** Property Template file Description .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Style prefix Description .. _Layout: **Layout** ~~~~~~~~~~ .. container:: table-row sheet **Layout** Property Show Header Description When set in Grid mode the column headers are displayed. When set in Single record mode the field names are displayed. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Show navigator Description In grid and list mode the navigator is shown . .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Grid buttons Description What buttons should be displayed for the grid or list .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Row buttons Description What buttons that should be displayed for a row in a grid. Normally only one of the edit buttons should be displayed. Edit sets a slave view in edit mode. Edit row activates in line editing directly in the grid. Edit record switches from grid view to a form where it is possible to edit The edit buttons are only shown if the FE user are allowed to edit the records. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Grid height Description Defines the height of the grid. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Grid header height Description Defines the height of the header of the grid. Unfortunally it is not possible to define this in CSS alone as scrolling in the grid needs some calculation to work in some browsers. As a result you have set the height here and in the CSS. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Image width Description Default width of images .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Image height Description Default height of images .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Max grid/list rows Description Maximum number of rows in a grid. If the number of records in a query is greater that this value the Navigator is activated. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Show empty values Description If set empty values are shown in single record. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Show label field as header Description If the view mode is single record the label field is shown as a header of the record and the page title is set to the value of the label field. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Edit fields inline Description Forces inline edit of rows in grid mode. .. _Sub-page: **Sub page** ~~~~~~~~~~~~ .. container:: table-row sheet **Sub page** Property Single view Description Page to change to when viewing a single record. DAB will change to this page if the View Type is List and the default selection is View or items in the list have a view button. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Print single Description Page to change to when viewing a single record. DAB will change to this page if the View Type is List or Grid and the default action is print or items in the list have a print button. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Print list Description Page to change to when view a list and the user click on the grid button print. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Edit single Description .. _Access: **Access** ~~~~~~~~~~ .. container:: table-row sheet **Access** Property Public edit Description Allows all fe-users to edit and update the view. In this mode chacpta is automatically turned on to prevent spam. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property View only FE owner records Description When set only records that are owned by the current FE user are displayed. For this to work a FE owner field must be defined in the view (see above). .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Allow edit Description Only fe users that belongs to selected FE usergroups are allowed to edit records. .. _Unknown-Property: ((Unknown Property)) ~~~~~~~~~~~~~~~~~~~~ .. container:: table-row sheet Property Description .. ###### END~OF~TABLE ###### .. _Administration: Administration -------------- DAB is designed to be a RAD tool, but also allows more fine grained control extending functionality with Typo Script and support for PHP. Finally the template files that are used supports styling with CSS and allows styling of all data views and single views. .. _Upgrading-from-versions-previous-to-version-1-0-0: Upgrading from versions previous to version 1.0.0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you have installed an older version of DAB you may need to perform several steps when upgrading to version 1.0.0. First of all you have to run the Update tool in the extension manager in order to convert old DAB plugin content elements to the new Data viewer content element. |img-14| Next you will have to go thru all views defined in the kickstarter to set new options and check that master views ect. Are converted correctly. Finally you have to go thru all views on FE pages to set new functionality there. I am sorry for the inconvenience but these changes where needed in order to gain the benefit of ease of use. .. _Master-slave-relations-between-grids-and-records: Master/slave relations between grids and records ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Master/slave relations between grids and records are setup in the Data view section in the kickstarter. When rendered in the front end DAB depends on the evaluation order of the components on a page to generate the master slave relations. This means that a master must be evaluated before a slave when a page is generated. In other words master grids should generally be on top of a slave. If Templa voila is used as pages templating system a pages is generated by the order of fields in the template DS. .. _Styling-the-views: Styling the views ^^^^^^^^^^^^^^^^^ The default template that comes with the extension is based on CSS styling. The DAB components are designed so they can share styles but also allows you to style each component individually. The default template is located in EXT:aux\_dataviewer/res/template.tmpl and the default style sheet is located in EXT:aux\_dataviewer/static/setup. To allow for flexiable styling each row, button field etc. has several css class names. As an example a record field in a grid may have the following classes: dvGridRow dvField dvType\_#TYPE# dvField\_#NAME# dvEven Where #TYPE# is substituted with the field type and #NAME# is substituted with the name of the field. Use FireFox and FireBug to examine the active styles. .. _Static-extension-template-TS-properties: Static extension template TS properties ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _charset: charset """"""" .. container:: table-row TS field charset Description The charset that should be used with AJAX default UTF-8 .. _disableAJAX: disableAJAX """"""""""" .. container:: table-row TS field disableAJAX Description Disables AJAX regardless of settings in the FE views. May be useful if security flaws are discovered in XAJAX. default false .. _template: template """""""" .. container:: table-row TS field template Description File that holds the template default Standard template that comes with the extension. .. _dateFormat: dateFormat """""""""" .. container:: table-row TS field dateFormat Description Format of date fields default %d-%m-%Y .. _timeFormat: timeFormat """""""""" .. container:: table-row TS field timeFormat Description Format of time fields default %H:%M .. _dateTimeFormat: dateTimeFormat """""""""""""" .. container:: table-row TS field dateTimeFormat Description Format of dateTime fields default %d-%m-%Y %H:%M .. _timeSecFormat: timeSecFormat """"""""""""" .. container:: table-row TS field timeSecFormat Description Format of timeSec fields default %H:%M:%S .. _buttons: buttons """"""" .. container:: table-row TS field buttons Description Defines the icon images or text on the buttons in the views. The buttons that could be used are: edit, rowedit, recedit, print, view,new, delete, start,end, next, prev, sortDesc, sortAsc, sortBullet, select, go, update, back. Each button has two fields .icon and .text. .icon takes precedence over .text and defines the path to the buttons icon. .text holds a textual representation of a button. **Example** : plugin.tx\_auxdataviewer\_pi1{ buttons{ edit.icon=EXT:auxdataviewer/res/icons/buttons/edit.png end.text=>\| } if the image files are PNG type DAB will apply the needed filters in IE 6 and below. default .. _indicators: indicators """""""""" .. container:: table-row TS field indicators Description Specifies the AJAX indicator to show when the views update. It is possible to use graphical or textual indicators. Possible indicators are grid, list and single. example plugin.tx\_auxdataviewer\_pi1{ indicators{ grid.icon=EXT:auxdataviewer/res/icons/indicators/ajax-loader-gray.png single.text=Updating record.... } If you want an indicator that matches your colors and design you may find `http://www.ajaxload.info `_ useful. default .. ###### END~OF~TABLE ###### .. _Support-for-multiple-languages: Support for multiple languages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DAB supports the language features in the extension kickstarter. If you specify different table field labels for each language in the kickstarter and set the config.language in the setup part of your (main) ts-template, then DAB automatically fetches the field labels for the selected language. .. _Extending-your-application-with-Typo-Script-in-DAB-views: Extending your application with Typo Script in DAB views ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It is possible to let DAB build more advanced SQL queries by adding Typo Script to a Data View in the Extension Kick starter. **Notice** You can not specify any of these typo script values to normal Template extensions. The typoscript that is described below is only valid in the TS section of the data view in the Extension kick starter .. _sql: sql """ .. ### BEGIN~OF~TABLE ### .. _distinct: distinct ~~~~~~~~ .. container:: table-row Property distinct Data type Boolean Description Adds the distinct keyword to the SQL query Example: sql.disctinct=true Default false .. _fields: fields ~~~~~~ .. container:: table-row Property fields Data type String Description A list of extra fields that should be included in the query these fields are not visible in the view as they goes directly into the sql query. Are reachable in PHP classes. Example: sql.fields=field1, field2 Default .. ###### END~OF~TABLE ###### .. _ExtraFields: ExtraFields """"""""""" **(deprecated, is build into the kickstarter now)** The extraFields section works pretty much like TCA here it is possible to define additional fields in the data view. These fields are all lookups to other tables. Also look at the extra fields section in the data view section in the kickstarter. .. ### BEGIN~OF~TABLE ### .. _label: label ~~~~~ .. container:: table-row Property label Data type string Description Name of the field Default If omitted DAB will use the name of the foreign field defined in TCA .. _type: type ~~~~ .. container:: table-row Property type Data type string Description Only allowed value right now is select Default .. _foreignTable: foreignTable ~~~~~~~~~~~~ .. container:: table-row Property foreignTable Data type string Description Name of foreign table Default .. _foreignField: foreignField ~~~~~~~~~~~~ .. container:: table-row Property foreignField Data type string Description Name of field to include Default If omitted the label field for the foreign table is used. .. _KeyField: KeyField ~~~~~~~~ .. container:: table-row Property KeyField Data type String Description Name of the field in this views record that should be used for lookup. Default .. _expr: expr ~~~~ .. container:: table-row Property expr Data type String list Description A list of the following values: required, uppder, lower Default .. _visible: visible ~~~~~~~ .. container:: table-row Property visible Data type Boolean Description Is the field visible in the view. If false the extra field could be used in filter values ect. Default true .. ###### END~OF~TABLE ###### **Example:** :: extraFields { artistlink{ label=Artist web site type=select foreignTable=tt_auxcdcollection_artist foreignField=website keyField=artist visible=true } } .. _Events: Events """""" It is possible to define a kind of TS events that is executed when a record is created (onNew), updated(onUpdate), deleted (onDelete) or selected (onSelect). All these events will execute additional SQL queries besides from the main SQL query. The intension with these events are to support updates in other tables based on user selection. Currently these SQL functions supported setField, selectInto and deleteFrom. Events are defined in the following way :: events{ onNew{ 10{ function=setField field=feuser value=###feuser### } } } .. _Functions: Functions """"""""" **setField** Will execute a SQL query:UPDATE **table** SET **field** = **value** WHERE **condition** .. ### BEGIN~OF~TABLE ### .. _table: table ~~~~~ .. container:: table-row Property table Data type string Description Table to update Default The table defined for this view .. _conditon: conditon ~~~~~~~~ .. container:: table-row Property conditon Data type string Description Where clause it is possible to use the markers: ###masteruid### ###feuser### ###uid### Default Uid=###uid### .. _value: value ~~~~~ .. container:: table-row Property value Data type string Description A value or one of the markers ###masteruid### ###feuser### ###uid### Default .. _field: field ~~~~~ .. container:: table-row Property field Data type string Description Field to update Default .. _masterView: masterView ~~~~~~~~~~ .. container:: table-row Property masterView Data type string Description View to control the the marker ###masteruid### If masterView is set DAB will substitute ###masteruid### with the dvid value of the masterView. See section about Cursors for the meaning of a views dvid Default If not set ###masteruid### will be substituted with the value of this views dvid. .. ###### END~OF~TABLE ###### **selectInto** Will execute a query:INSERT INTO **dstTable** (pid,tstamp,crdate,cruser ... **dstFields** ) SELECT **srcFields** FROM **srcTable** WHERE **condition** .. ### BEGIN~OF~TABLE ### .. _dstTable: dstTable ~~~~~~~~ .. container:: table-row Property dstTable Data type string Description Table to insert rows into Default .. _srcTable: srcTable ~~~~~~~~ .. container:: table-row Property srcTable Data type string Description Table to get rows from Default .. _dstFields: dstFields ~~~~~~~~~ .. container:: table-row Property dstFields Data type string Description Fields to update in the destination table Default .. _srcFields: srcFields ~~~~~~~~~ .. container:: table-row Property srcFields Data type string Description Fields to get values from in the source table Default .. _condition: condition ~~~~~~~~~ .. container:: table-row Property condition Data type string Description Condition to select rows from the source table. It is possible markers ###masteruid### ###feuser### ###uid### Default .. _MasterView: MasterView ~~~~~~~~~~ .. container:: table-row Property MasterView Data type string Description View to control the the marker ###masteruid### If masterView is set DAB will substitute ###masteruid### with the dvid value of the masterView. See section about Cursors for the meaning of a views dvid Default if not set ###masteruid### will be subsitutet with the value of this views dvid. .. ###### END~OF~TABLE ###### **deleteFrom** Will execute the query:DELETE FROM **table** WHERE **condition** .. ### BEGIN~OF~TABLE ### .. _table: table ~~~~~ .. container:: table-row Property table Data type string Description Table to delete rows from Default .. _condition: condition ~~~~~~~~~ .. container:: table-row Property condition Data type string Description Condition that should control which rows to delete from the table. Default .. _masterView: masterView ~~~~~~~~~~ .. container:: table-row Property masterView Data type string Description View to control the the marker ###masteruid### If masterView is set DAB will substitute ###masteruid### with the dvid value of the masterView. See section about Cursors for the meaning of a views dvid Default if not set ###masteruid### will be subsitutet with the value of this views dvid.if not set ###masteruid### will be subsitutet with the value of this views dvid. .. ###### END~OF~TABLE ###### .. _Extend-TCA-for-your-tables: Extend TCA for your tables ^^^^^^^^^^^^^^^^^^^^^^^^^^ Normal practice is to define all additional TCA settings in the file tca.php in your extension. Because the extension kickstarter rewrites tca.php you may loose these extra settings. If you need to add extra TCA information use the file dab\_tca.php in the ext:dab/user/dab\_tca.php this file is saved from rewriting in the kickstarter. Example of how to add extra TCA information: $TCA["tx\_auxproductsupport\_prodversion"]["ctrl"]["label\_alt"] = 'version'; $TCA["tx\_auxproductsupport\_prodversion"]["ctrl"]['label\_alt\_force' ]=true; .. _Extending-your-DAB-application-with-PHP: Extending your DAB application with PHP ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DAB supports PHP by automatically creating a class for each data view that is created in the Extension Kickstarter. These classes are located under EXT:your\_extension/DAB/user/views. The methods in these classes are called as events and currently DAB supports the following events: onBeforeInsert, onAfterInsert, onBeforeUpdate, onAfterUpdate, onSelect onDelete and onGetText. Parameters and return values are described in the PHP class files. **IMPORTANT** DAB is a RAD tool and kindly **saves** your modified PHP view class files from being deleted if you want to define new tables and data views in the Extension kick starter. .. _Tutorial: Tutorial -------- This tutorial demonstrates how to create the extension **CD collection 2** it is possible to download it from TER (auxcdcollection). When creating a DAB application you start as normal in the kickstarter by defining general information and tables. .. _General-information: General information ^^^^^^^^^^^^^^^^^^^ Fill in the name of the extension, author etc. Very important is to enter that this extension depends on DAB the extension key for DAB is auxdataviewer. If you don't and uploads this extension to TER other Typo3 users may come in troubles if they have not installed DAB. |img-15| .. _Defining-tables: Defining tables ^^^^^^^^^^^^^^^ The next step is to define the tables that should be used in our DAB application. This is done as normal in the tables section. In our application we need the tables artist, cd and category. **Artist table** |img-16| |img-17| **Category Table** Define the music category table |img-18| |img-19| **CD Table** |img-20| |img-21| |img-22| |img-23| |img-24| .. _Defining-the-views: Defining the views ^^^^^^^^^^^^^^^^^^ The next step is to create the views that is done in the DataView section in the Kickstarter menu. |img-3| **Artist View** |img-25| |img-26| |img-27| **CD view** |img-28| In the picture above the masterview is created by selection the name of the master view in the “Add new view master” and then click add: |img-29| The next step is to match the fields that makes up the releation |img-30| After that select the default settings for the view |img-31| |img-32| CD info view |img-33| Notice above the external field website. It is defined selecting the view and enter a name |img-34| Next match the relation by selecting artist in the Master field and website in Label field |img-35| Next fill in the default settings notice that the external field now appears in the field list. |img-36| |img-37| |img-38| All tables and views are defined the next step is to create the extension and install it. Click on the button View Result Click write to create the extension. Install the extension. .. _Creating-page-structure: Creating page structure ^^^^^^^^^^^^^^^^^^^^^^^ Before we are able to view any thing in FE we need to create a page to show in FE and a sys folder to hold the records. |img-39| In the DAB data folder you should create some records for category, artist and cd. In the example below i have only created CD records for U2. |img-40| |img-41| |img-42| On the FE page you should insert the content element Data view in order to see the data views defined in the extension kickstarter. The artist view |img-43| The CD view |img-44| the Cd detail view |img-45| In templavoila it should look something like that |img-46| |img-1| And in the front end it should look like this. Thats all it takes to make a DAB application. .. _Known-problems: Known problems -------------- \- No support for RTE when using AJAX .. _To-Do-list: To-Do list ---------- - - Extended support for PHP so it is possible to access DAB information in the normal FE plug-ins - Inline master/slave details in grids - Tree component - support for DAM .. _Changelog: Changelog --------- - Version 0.0.1 Initial upload - version 0.0.2 updated the manual with a tutorial. - Version 0.0.3 Wrong manual uploaded. - Version 0.0.4 Fixed issue with wrong TCA information that caused trouble in BE. - Version 0.0.5 - Ajax support - Full TCA support - new templates with better CSS support - Extended Dataview section in Kickstarter - version 1.0 - converted to a content element. - most options may now be controlled by the content element. - Default template for grids works in IE, FireFox, Opera, Safari, Konqueror. - External and calculated fields may be defined in the kickstarter. |img-47| - 35 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 539 .. :id: grafik4 .. :name: grafik4 .. :width: 669 .. |img-2| image:: img-2.png .. :align: left .. :border: 0 .. :height: 461 .. :id: grafik2 .. :name: grafik2 .. :width: 401 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 308 .. :id: grafik7 .. :name: grafik7 .. :width: 194 .. |img-4| image:: img-4.png .. :align: left .. :border: 0 .. :height: 587 .. :id: grafik3 .. :name: grafik3 .. :width: 609 .. |img-5| image:: img-5.png .. :align: left .. :border: 0 .. :height: 612 .. :id: grafik36 .. :name: grafik36 .. :width: 608 .. |img-6| image:: img-6.png .. :border: 0 .. :height: 105 .. :id: grafik32 .. :name: grafik32 .. :width: 220 .. |img-7| image:: img-7.png .. :align: bottom .. :border: 0 .. :height: 55 .. :id: grafik33 .. :name: grafik33 .. :width: 477 .. |img-8| image:: img-8.png .. :align: left .. :border: 0 .. :height: 35 .. :id: grafik34 .. :name: grafik34 .. :width: 157 .. |img-9| image:: img-9.png .. :align: left .. :border: 0 .. :height: 37 .. :id: grafik35 .. :name: grafik35 .. :width: 344 .. |img-10| image:: img-10.png .. :align: bottom .. :border: 0 .. :height: 476 .. :id: grafik37 .. :name: grafik37 .. :width: 610 .. |img-11| image:: img-11.png .. :align: left .. :border: 0 .. :height: 155 .. :id: grafik38 .. :name: grafik38 .. :width: 536 .. |img-12| image:: img-12.png .. :align: left .. :border: 0 .. :height: 294 .. :id: grafik18 .. :name: grafik18 .. :width: 217 .. |img-13| image:: img-13.png .. :align: left .. :border: 0 .. :height: 325 .. :id: grafik1 .. :name: grafik1 .. :width: 669 .. |img-14| image:: img-14.png .. :align: left .. :border: 0 .. :height: 267 .. :id: grafik28 .. :name: grafik28 .. :width: 669 .. |img-15| image:: img-15.png .. :align: left .. :border: 0 .. :height: 326 .. :id: grafik5 .. :name: grafik5 .. :width: 389 .. |img-16| image:: img-16.png .. :align: left .. :border: 0 .. :height: 344 .. :id: grafik6 .. :name: grafik6 .. :width: 386 .. |img-17| image:: img-17.png .. :align: left .. :border: 0 .. :height: 706 .. :id: grafik8 .. :name: grafik8 .. :width: 531 .. |img-18| image:: img-18.png .. :align: left .. :border: 0 .. :height: 269 .. :id: grafik14 .. :name: grafik14 .. :width: 423 .. |img-19| image:: img-19.png .. :align: left .. :border: 0 .. :height: 600 .. :id: grafik15 .. :name: grafik15 .. :width: 537 .. |img-20| image:: img-20.png .. :align: left .. :border: 0 .. :height: 404 .. :id: grafik9 .. :name: grafik9 .. :width: 469 .. |img-21| image:: img-21.png .. :align: left .. :border: 0 .. :height: 597 .. :id: grafik10 .. :name: grafik10 .. :width: 539 .. |img-22| image:: img-22.png .. :align: left .. :border: 0 .. :height: 700 .. :id: grafik11 .. :name: grafik11 .. :width: 521 .. |img-23| image:: img-23.png .. :align: left .. :border: 0 .. :height: 753 .. :id: grafik12 .. :name: grafik12 .. :width: 557 .. |img-24| image:: img-24.png .. :align: left .. :border: 0 .. :height: 142 .. :id: grafik13 .. :name: grafik13 .. :width: 548 .. |img-25| image:: img-25.png .. :align: left .. :height: 745 .. :id: Objekt1 .. :name: Objekt1 .. :width: 616 .. |img-26| image:: img-26.png .. :align: left .. :height: 401 .. :id: Objekt2 .. :name: Objekt2 .. :width: 614 .. |img-27| image:: img-27.png .. :align: left .. :height: 485 .. :id: Objekt3 .. :name: Objekt3 .. :width: 616 .. |img-28| image:: img-28.png .. :align: left .. :height: 757 .. :id: Objekt4 .. :name: Objekt4 .. :width: 614 .. |img-29| image:: img-29.png .. :align: left .. :height: 36 .. :id: Objekt7 .. :name: Objekt7 .. :width: 146 .. |img-30| image:: img-30.png .. :align: left .. :height: 149 .. :id: Objekt8 .. :name: Objekt8 .. :width: 315 .. |img-31| image:: img-31.png .. :align: left .. :height: 396 .. :id: Objekt5 .. :name: Objekt5 .. :width: 611 .. |img-32| image:: img-32.png .. :align: left .. :height: 516 .. :id: Objekt6 .. :name: Objekt6 .. :width: 617 .. |img-33| image:: img-33.png .. :align: left .. :height: 732 .. :id: Objekt9 .. :name: Objekt9 .. :width: 614 .. |img-34| image:: img-34.png .. :align: left .. :height: 103 .. :id: Objekt12 .. :name: Objekt12 .. :width: 350 .. |img-35| image:: img-35.png .. :align: left .. :border: 0 .. :height: 107 .. :id: grafik16 .. :name: grafik16 .. :width: 626 .. |img-36| image:: img-36.png .. :align: left .. :border: 0 .. :height: 399 .. :id: grafik17 .. :name: grafik17 .. :width: 372 .. |img-37| image:: img-37.png .. :align: left .. :height: 382 .. :id: Objekt11 .. :name: Objekt11 .. :width: 617 .. |img-38| image:: img-38.png .. :align: left .. :border: 0 .. :height: 158 .. :id: grafik19 .. :name: grafik19 .. :width: 616 .. |img-39| image:: img-39.png .. :align: left .. :border: 0 .. :height: 52 .. :id: grafik20 .. :name: grafik20 .. :width: 155 .. |img-40| image:: img-40.png .. :align: left .. :border: 0 .. :height: 113 .. :id: grafik21 .. :name: grafik21 .. :width: 295 .. |img-41| image:: img-41.png .. :align: left .. :border: 0 .. :height: 172 .. :id: grafik22 .. :name: grafik22 .. :width: 368 .. |img-42| image:: img-42.png .. :align: left .. :border: 0 .. :height: 332 .. :id: grafik23 .. :name: grafik23 .. :width: 443 .. |img-43| image:: img-43.png .. :align: left .. :border: 0 .. :height: 308 .. :id: grafik24 .. :name: grafik24 .. :width: 623 .. |img-44| image:: img-44.png .. :align: left .. :border: 0 .. :height: 265 .. :id: grafik25 .. :name: grafik25 .. :width: 586 .. |img-45| image:: img-45.png .. :align: left .. :border: 0 .. :height: 326 .. :id: grafik26 .. :name: grafik26 .. :width: 669 .. |img-46| image:: img-46.png .. :align: left .. :border: 0 .. :height: 277 .. :id: grafik27 .. :name: grafik27 .. :width: 250 .. |img-47| image:: img-47.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102