[Yanel-dev] organization of data

Evaldas Taroza etaroza at optaros.com
Mon Feb 25 13:55:28 CET 2008


simon litwan wrote:
> Evaldas Taroza schrieb:
> 
> i think it even would make sense to allow a resource to contain the 
> jelly scripts since they are highly resource specific. i anyway would 
I would say that it is only sometimes the case. Resource types are 
reusable (across realms) entities. So I don't think it is a good idea to 
package all the templates into the resource jar (unless they are 
considered as 'default' templates), because everyone who is using a 
resource will most likely want to have his/her own custom templates.

> suggest to add two methode to the resource class.
> public InputStream getHtdocs(String path) ;
> public InputStream getYanelHtdocs(String path);
> 
> which lets you programmatically  access htdosc/yanel-htodcs.
> 
> then we could introduce a kind a protocol in the rc. e.g. htdocs:// 
> resp. yanelhtdocs://
> 
>      <view id="tablelist" type="jelly">
>        <xslt>/xslt/usecase.xsl</xslt>
>        <template>htdocs://create-tablelist-shortcut.jelly</template>
>        <mime-type>text/html</mime-type>
>      </view>
> 
> this would use the jelly provided by the resource via htdocs.
> one could overwrite the jelly by omitting the protocol and point to a 
> jelly in the realms data repository.
I certainly agree, that accessing static resources of a resource type 
should be done differently than it is now. A different scheme (like 
htdocs://) could be a nice solution, but we need to think of identifying 
the resource itself.

Evaldas

> 
> BTW:
> i think if the method public InputStream getHtdocs(String path) would 
> access the data via package resolving we would go a step forward to 
> provide resource-types as packages (which i consider very important.)
> 
> simon
>>
>>
>> Michael Wechner wrote:
>>> Evaldas Taroza wrote:
>>>
>>>> Hi,
>>>> Maybe we should think about how to better organize data in the 
>>>> repository. I mean we need some conventions. Currently we just put 
>>>> everything into /data and that's it. So javascripts, xslt, jelly, 
>>>> css together with the actual content gets there. I don't think it is 
>>>> nice. Because some of the scripts (like jelly, xslt) belong to some 
>>>> of the content and is not reusable,
>>>
>>>
>>> reusable refering to what? Re reusing with the different realms?
>> Yes, realm. Usually when we write a jelly script, or XSLT it won't 
>> make sense in other contexts. Also, some jellys make sense only for 
>> one resource configuration only, although there might be some global 
>> xslts.
>>
>>>
>>>> so they should lie somewhere logically close to each other.
>>>
>>>
>>> to each other what?
>> For instance, all the jelly scripts and xslt about the image gallery 
>> should be somewhere in the same place, it's like a bunch of scripts 
>> that are used by one .yanel-rc file. So it should be somehow easy and 
>> natural to find these scripts after you look into .yanel-rc.
>>
>>>
>>>>
>>>> I saw Josias is using some layout according to usecases.
>>>>
>>>> Has anyone suggestions about the conventions?
>>>
>>>
>>> I very much agree that we should tell people about best practice, 
>>> whereas feel free to make a proposal ;-)
>> Yes, I agree, the conventions I am talking about could be like best 
>> practices.
>>
>> For me the best thing would be to keep .yanel-rc together with 
>> dependent scripts (jelly and xslt). So I would have something like:
>> .../gallery/
>>   C/[with all the .yanel-rc, jelly, xslt files for creating]
>>   R/[with all the .yanel-rc, jelly, xslt files for reading]
>>   U/[with all the .yanel-rc, jelly, xslt files for modifying]
>>   D/[with all the .yanel-rc, jelly, xslt files for deleting]
>> .../wiki/
>>   C/
>>   R/
>>   U/
>>   D/
>> ...etc.
>>
>> This way it is clear what content are we talking about, what are the 
>> resources used for CRUD and what are related scripts(if any). This 
>> proposal, however, implies mixing what we currently keep in separate 
>> folders: 'data' and 'res-configs', so I am not sure how to configure 
>> everything.
>>
>> What do you think?
>>
>> Evaldas
>>
>>
> 
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
> 


-- 
+41 79 616 53 76
www.linkedin.com/in/taroza

Optaros - www.optaros.com


More information about the Yanel-development mailing list