Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Very complicated solution
luiz@wise.com.br
#1 Posted : Wednesday, April 28, 2010 5:05:01 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
I develop a very complicated solution to one problem, and i will explain it here so you can tell me what i did wrong, and I probably did something wrong or else it woudn't be so complicated

I have some different king of content ( News, blog, pool, quiz, image galery) and i need a page to show all of them together, sorted by Creation Date, and a detail page that show the content in its own module

So my solution is this:

First I created a Module to create the content base Schema and folder, with 3 schemas, the content, the contenttag just to categorize, and the content type, to put to each type a list of content Templates that show their content

then in each other content I will create One after insert function with the insert in the content folder setting the correct type

I created a content template that show the list of contents, and this has a link to the detail Page (in this point I think that I need to pass a parameter to the content template setting the correct page to open, but it's not done yet)

this detail Content template has a position and it adds dynamically Another content template that has all the configuration to add the module passing the Userkey, I need this second content template because each of the detail will configure only the correct module to open, and this way I can use other people modules.

In fact I don't think this is a good implementation for some points

1) I lost my model typed implementation and repository methods

2) even this function can't be created and reused

3) I have part of my code inside kooboo and part inside a module project, It would be useful to create "Module Content Template" for example

4) Kooboo has some of the informaton persisted in the database and some in the file server, it would be better if it has the files persisted in the database, for example if we have two webservers pointing to a same kooboo database, if one of them doesn't have the file in the file server, it downloads the file form the db and use the file server then

5) what direction did I go wrong to mess this solution this way?
vincent
#2 Posted : Thursday, April 29, 2010 12:32:59 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 4/29/2010(UTC)
Posts: 62
Location: xiamen

Indeed, this is a pretty complicate situation. We should try to solve problem one by one. I have a few thoughts

1. what should be implemented as a module? A module should contains its own set of information without sharing with others. So it can installed into other instance has its independent development.

As you mentioned you have many different content type (news, poll, blog). You are storing them in the same folder with different "Content Type". This makes them linked tightly with each other. So you losing your type model or other things. Is it an idea to separate them? So that they can be developed and installed separately?

2. Module and position. A module should not contains any information regarding position. A module is a sub application, should and can be installed into any position in the later stage. Module should be totally seperated from Content template and layout template.

3. Layout template and content template. It was our idea that position tag should be defined in the layout template, and in the page configuration, you add all those modules in the right position. If you want to hide certain module based on certain condition, you can also do this in the layout template. In some cases, you may want to do this by API. That is also fine to do so.

Content template was meant for content display. For example, News can have only two content template, one is new list page, one is news detail page. This can be done by two content templates. It might not necessary to implement everything in a module.

4. Module content storage. A module does not necessary use Kooboo Content Repository for content storage. If you feel like a database table strorage looks good for you and we do not need the content inheritance of Kooboo repository, go ahead with what you get used to.

Do my answer makes some sense to you and helpful? Can you come back with smaller questions one by one?
luiz@wise.com.br
#3 Posted : Thursday, April 29, 2010 10:14:13 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
vincent wrote:

1. what should be implemented as a module? A module should contains its own set of information without sharing with others. So it can installed into other instance has its independent development.

As you mentioned you have many different content type (news, poll, blog). You are storing them in the same folder with different "Content Type". This makes them linked tightly with each other. So you losing your type model or other things. Is it an idea to separate them? So that they can be developed and installed separately?


I'm not storing them in the same folder, each module is independent, I have another folder that store a reference to each content and it's content type, and my idea is to use that schema script function to save in this folder in the after insert of the module folder, my point here is what I can use in the schema function, I mean, can I use A module repository class?
will it work only inserting from the admin panel or adding from the module it will work too?

vincent wrote:

2. Module and position. A module should not contains any information regarding position. A module is a sub application, should and can be installed into any position in the later stage. Module should be totally seperated from Content template and layout template.

I understand that, makes perfect sense, so let's change my idea
It would be nice if I Add a module with no UI, and use the module classes inside a conten template, this way I can create some complex logic outside kooboo and them use it inside kooboo, it's more like a library.
vincent wrote:

3. Layout template and content template. It was our idea that position tag should be defined in the layout template, and in the page configuration, you add all those modules in the right position. If you want to hide certain module based on certain condition, you can also do this in the layout template. In some cases, you may want to do this by API. That is also fine to do so.

Content template was meant for content display. For example, News can have only two content template, one is new list page, one is news detail page. This can be done by two content templates. It might not necessary to implement everything in a module.

What i did was to use a content template to show a module, but my major deal was about the code, in the previous question
vincent wrote:

4. Module content storage. A module does not necessary use Kooboo Content Repository for content storage. If you feel like a database table strorage looks good for you and we do not need the content inheritance of Kooboo repository, go ahead with what you get used to.

I prefer to use the kooboo storage, this can control some conflicts for me, and this is another module good point, is I use the module /home/generate to create the schema files I can use this script to create the schemas, is there another way to create a restore schemas?



with this explanations I ended up with only two suggestions:

a) Create a way to add a module library (no UI) and allow to use it inside content templates and schema functions

b) Create a way to import/export schema and folders, like module installation does, something like a kooboo database module


GazNewt
#4 Posted : Thursday, April 29, 2010 10:48:28 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 2/2/2010(UTC)
Posts: 122
Location: England
Have you tried writing a plugin and put that on the page? You can perform all your logic in there and pass values into ViewState for the content template to see. You could also add helper extension classes inside your plugin that would be available in your content template. At least I think you can, I'm sure I did this the other night while tinkering, so when you need access to your extensions from a content template just put your extension plugin into the page, which effectively loads your dll and your extensions (I may be wrong about this so will check later)
zguoqi
#5 Posted : Friday, April 30, 2010 6:22:08 PM(UTC)
Rank: Administration
Groups: Registered, Administrators

Joined: 9/2/2009(UTC)
Posts: 695
Location: xiamen
What Gaznewt said was very right. You can use the page plugin.

If you would like to add schema and folder by code, you can check the source code of our module template to see how we do it. Unfortunately it seems like we have not provided this API out yet.
Regards,

Vincent

Kooboo Team
luiz@wise.com.br
#6 Posted : Friday, April 30, 2010 9:07:23 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
I do this already, but my point is that, if you don't create a module, you can't create a schema, and it woud be nice to have this two king of projects

kooboo schema project and kooboo library
zguoqi
#7 Posted : Friday, April 30, 2010 9:44:40 PM(UTC)
Rank: Administration
Groups: Registered, Administrators

Joined: 9/2/2009(UTC)
Posts: 695
Location: xiamen
Luiz,

I agreed with you. We have realized this and will try to provide those functions.
Regards,

Vincent

Kooboo Team
luiz@wise.com.br
#8 Posted : Friday, April 30, 2010 9:48:53 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
thanks
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.190 seconds.