[TYPO3-irre] irre: record selector in 1:n relations

belbono belbono at gmx.de
Mon Aug 13 12:15:19 CEST 2007


Oliver Hader wrote:
> Hi Alex,
>
> belbono schrieb:
>   
>> hi
>>
>> i´m developing an extension for my bachelor thesis and therefore i need
>> to analyse every way of getting data into typo3.
>>     
>
> Great. "Inline Relational Record Editing" was the topic of my diploma
> thesis as well. What is the title of your thesis?
>   
i've to develop an extension for the management of scientific 
literature. additionally data should be stored in an oracle database 
(which is another problem, because with the main mysql database it makes 
two db-connections to manage) and the output should contain a function 
to export the records into bibtex format.
>   
>> according to the irre-tutorial extension i build up my tables and
>> configuration. my extension will manage scientifical publications
>> including some export funcionality.
>> so i got a relation between a book and a publisher table.
>> in my book table i have a publisher field that is configured as 'inline'
>> and refers to the publisher table, by setting foreign_table,
>> foreign_field and foreign_table_field, just as it is shown in the example.
>> the problem now is, that i want to choose from existing records in
>> publications. in m:n relations with an intermediate table you have a
>> nice option with a record selector, but i think this is not possible in
>> my 1:n relation. i only can add new publishers - what is quite
>> unneccesary for a books released under the same publisher.
>>     
>
> 1:n relationships do not offer such behaviour in general. If you want to
> relate one publisher to many books on the other hand, it's not a 1:n
> anymore, but a m:n relationship.
>   
hm i see. but i thought that i don't need an intermediate table, since i 
only need one single publisher-id in my book table to refer to the 
publisher.
so i only want to refer from books to a single publisher. i don't want 
to refer from one publisher to several books, since the publication 
itself (book, article, ...) is the 'center'.


that's why i thought i don't need an intermediate table ... or is there 
gernerally something wrong in this approach?
>   
>> due to a record selector needs a configured select field on the other
>> side (the foreign table), i tried to configure the uid field in my
>> publisher table a such a field.
>> so i got a selector field in my 'add book' dialog which shows every
>> existing publisher, but i cannot choose anyone of them.
>>     
>
> What happens if you select one of the records in the selector-box? Do
> you get any errors (e.g. JavaScript errrors)?
>   
no, there are no errors. i had some test values for publishers. they are 
shown in a selectorbox and one is already selected. selecting another 
from the list just changes nothing.

>   
>> a solution of this might be to add another intermediate table, but i
>> don't like this idea, because such a table unneccesary.
>>     
>
> Why? Only the following model is necessary:
> [book] --- 1:n ---> [intermediate table] <--- 1:n --- [publisher]
>
>   
yes, this could fix my problem, but up to now i wanted to keep table 
definitions slim...
> olly
>   

alex


More information about the TYPO3-project-irre mailing list