[daisy] Bi-directional links

Marc Portier mpo at outerthought.org
Thu Oct 25 01:23:49 CDT 2007



MichaelM wrote:
> 
> hepabolu wrote:
>> MichaelM said the following on 23/10/07 18:06:
>>> We are evaluating Daisy for the purpose of recording software
>>> specifications
>>> and corresponding test specifications.
>>> I am wondering whether bi-directional links (or relationships) can be
>>> defined in Daisy.
>>>
>>> Example: If I have 2 document types:
>>> 1. Function
>>> 2. Testcase
>> Some simple ideas:
>> - You can of course create the links manually.
>> - You might use some simple queries based on a field. Example: add a 
>> multivalue field to both  document types and use it as a tag. Then add a 
>> query to each document type that selects all document of the other 
>> document type with a specific tag.
>> - Each document can show a list of referrers. If you check the code on 
>> how that is done you can embed it in you document styling. So you create 
>> one direction by hand and get the other for free.
>>
> 
> Helma, thanks for your suggestions. Some follow-up questions:
> 
> 1. Creating the links manually, I understand. Not really desirable.
>

dunno what was implied here, but if this is about using the standard 
'links' feature then those can be queried in both directions as well

see query language in documentation for LinksTo(), LinksFrom()

> 2. Tag solution. If I understand you correctly, we would have to create a
> separate field value for each function and each testcase? We will have
> hundreds of each so the maintance of the list could be quite unpleasant.
> Could it be populated by a query?
>

nope.


First: The advantage of using these 'tags' or 'fields' of type link over 
the standard links is that you can give these 'link-fields' some 
meaning.  This will allow to differentiate between sorts of links, e.g 
links to 'features' versus links to 'tests' etc etc.

but you obviously do _not_ want to have a linkfield-type defined per 
document: as in  linktype to 'specific-test-whatever-x' that would be 
the VALUE of a link-fieldtype that points to 'tests'



So when having doctype 'MyFeature'
you can easily create a 'MyFeatureLink' fieldtype that is of type link, 
and is made 'multivalue'  you can make the selection-list be populated 
by the query for .... where documentType='MyFeature'

you then add this field to any document that should have links to 
documents of type MyFeature

(it even gets better: if you have a lot of those features, you can 
povide a similar MyParentFeatureLink doctype to interconnect features 
and then change the earlier fieldtype to be 'hierarchical' and then make 
it be populated as a 'parent-linked hierarchical field'...)

> 3. Showing a list of referrers: That sounds interesting. Could you please
> give me a pointer on how this could be done? (I am new to Daisy)
> 

menu: Actions > Referers



Anyway: please read up on query language and schema features.
[1] http://cocoondev.org/daisydocs-2_1/373-cd/9-cd.html
[2] http://cocoondev.org/daisydocs-2_1/373-cd/378-cd.html

and then play around with those...

(Which might be good advise for people being around since daisy's 1.x as 
well. There have been quite some useful additions to the moddeling over 
our last iterations that you don't want to miss out on)

regards,
-marc=



More information about the daisy mailing list