This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » Building Own Generator  (4) 7 Vote(s)
Re: Building Own Generator [message #50826 is a reply to message #50787 ] Fri, 25 April 2008 11:59 Go to previous messageGo to next message
lukas  is currently offline lukas
Messages: 28
Registered: November 2007
Location: Switzerland
Junior Member
lvanderree wrote on Thu, 24 April 2008 18:40


I am going to re-implement the edit-stores/readers
...
How do the other guru's like the new implementation of the edit-pages?



I leave you the choice if I'm guru or not:-) But I like it. Nice Job. I considered lazy loading a must-have for our project here, but on a long term view. The applications we have now aren't that big. But since you're on it, we'll move to pjs now to.

Quote:


At the moment I am very happy with the lazy-loading, which is possible because of the using.js script and the pjs-plugin. And I am very happy with the generated script ... which creates a new panel-object and registers it as a new xtype-object. (this is what I want to accomplish as well for the list-pages for the long-term).


I examined several lazy loading possibilities for my own diploma 2 yrs ago (basically the same topic i'm working in right now). From what I know about LL and Ext, I can say that your solution will work and scale very well. I'm excited about it.

But I'd like a second expertise from the "other guru's" (hi guys) here about a related yet different topic:
Since sfExtjsThemePlugin has lazy loading now, it'd be nice to have an app generator who does the same. The thoughts we made over here go a bit further, imagine this use case:
- Your app loads several List-Grids in a Tabbed Panel.
- The Filters are loaded east, a help text is loaded west.
- If the tab focus changes the filters and help text should change too.
- The components that display the filters and the help text should be exchangeable whitout changes to the app.

Our Solution looks like this:
index.php/fa/701/0/
In the UseCase above this would mean:
- Theres an openInWorkbench handler and a workbench channel.
- The tabbed panel has a consumer registered to the workbench channel.
- The consumer adds a tab for every item it gets from the channel. (consumers are plugins for ext.component)
- Each tab has a controller for the channel help and one for the channel filter.
- The controller fires on activate (onControllerIdActivated) and destroy (onControllerIdRemoved).
- The east panel is connected to the filter channel.
- The west panel is connected to the channel help.
- The filter channel has the handler addFilter(element)
- The help channel has the handler showHelp(identifier)

How is this connected with sfExtjsThemePlugin?
- addFilter is set as the filter_add_handler in app.yml
- The openInWorkbench is set as the grid_open_link in app.yml
- showHelp is called by the tabpanel if a tab is added.

What happens now:
On load all the related information is loaded too, the items are added to their channels, more precise to the components registered in the respective channel.
When the user changes or closes tabs, the id is passed to the channels by the controllers. The items which were loaded with the respective controller id are displayed or removed.
btw: consumer stores are no datastores or something like that: They usually just have to now which part of a layout (eg an accordion in a west panel) the consumer has to activate (in case of accordion: unfold or remove the one loaded with the controller_id, fold everything else)

What has a developer to code to make it work?
basically nothing:
- You can configure your channels in a yml
- You can add the Controllers and Consumers as plugins to the components.
- The code to register the Controllers, Consumers and handlers is generated.
- Various partials of sfExtjsAppElementsPlugin will provide an easy changeable app Framework.
- You have to code the handlers in your application, but there will be helpers.
- You will be able to configure several behaivours (e.g. what to do if a consumer has no item in store for a controller_id)
- Everything is an xtype, thus easy customizeable if you want special things (e.g. with consumers on components which need custom load / store actions)

Are There long-term todos?
- At the moment the whole channels have to be loaded statically. We will make it possible to add channels dynamically
- Connect this to StateProviders.

Now, do you...
...think this is usable to build symfony / sfExtjs*Plugin?
...know a more simple solutions? (if yes: how? Requirements: Intercomponent-communication but the components don't have to know each other.)
...have some more ideas / suggestions?

Thanks for looking into it. Your 2cents are worth a lot for us.

greetz
lukas

Re: Building Own Generator [message #50834 is a reply to message #50826 ] Fri, 25 April 2008 13:02 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Everyone can be a guru, Life is what you make of it Wink And looking at what you have in mind right now, I don't think you even had to doubt about it...

I am very exited about your ideas, only looked shortly at them right now, but later today/tonight I will have more time to take a look at it and give my comments.

Inter-module communication is a problem we really have to take a good look at.


Leon
Re: Building Own Generator [message #50903 is a reply to message #24107 ] Sun, 27 April 2008 22:58 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Well it took a while, but here my thoughts.


It took me a while to understand everything you described and I still don't have a full picture of how to implement everything, while keeping things flexible.

The thing is I don't think all modules (and views per module (list/edit)) will require a filter and a help-panel, or to be more precisely:
- some views might require other panels than a help or filter panel, some might require more than 2 extra panels, some maybe less.

Even though this makes things harder, I don't think it is wise to restrict ourself to the described layout.

Maybe we should extend the description of your use-cases to a real example to make things more clear. I think the city-country-example would be nice for this, this is simple and everyone can understand it.
A City has
- a PrimaryKey,
- a name (text) and
- is related to a country (foreign key)

A Country has:
- a PrimaryKey,
- a name (text)

I think there are two things very important for an application-plugin:
1. a window-manager (to handle the layout problems as described by me above) and
2. an event-manager as already described by you, but we might need to describe this more precisely (as said at the moment I can't tell how to implement things precisely).

Let me first further explain the window manager, although I haven't completely thought this out yet, but at the moment I see this:
The City-module has (just as most modules) a list and a edit(detailed)-view.

The City-List can have (as you described):
- a content-panel containing the (editable) grid -> for the content of the tab-panel
- a filter panel -> in the east
- a info panel -> in the west
- maybe a detailed panel -> in the south, but maybe you want to open these detailed pages as new tabs in the tab-panel.
- maybe you want to define even more panels in your layout (in that case north,east, south, west and content isn't enough, hence my idea about wanting this more flexible with some kind of window-manager)

Take now for example a City-Edit-page (with the content in the tab-panel)
- a content-panel contains the form -> tab-panel
- a info-panel -> in the west
(- a filter won't be necessary)

Now take for example a Country-Edit-page
- a content-panel contains the form -> tab-panel
- a info-panel can now contain E.G. a list of links to all cities which lie in this country -> in the west

For some applications you might want to have the panel-setup you described, but for others you might want to have other layouts, however you probably want to reuse your modules in different applications with different layouts, so the window-manager should in my opinion handle some kind of mapping of the panels a module has and the panels a layout has to offer.

One thing which can make this a lot easier however is to let all modules exist of only one content-panel (which can contain the info and filter panels). This way all other panels will of course automatically show-up with the content panel, when you select a certain tab (they are in fact part of that same tab).

If you want modules to exist out of multiple panels (in which your content panel is the only content for the tab, and the other panels are shown next to the tab-panel) you should find some way to implement a state manager which holds the current states of the other panels (E.G. the content of the filters). A solution to this can be to use card-layouts which show the corresponding panel of the content-panel, but what to do if for instance one view (E.G. list) contains a panel (filter) while another view (edit) doesn't contain a panel, not even an alternative for that same panel...

I think the first solution with only one content-panel which contains all other panels (grid/form and filter and info) would make things a lot easier, however also less flexible, since all panels are always along to each other.


For the event-manager I think there are three situations:
1. You want to have inter-module-communication (from panel to panel from the same module, E.G. from edit-page to list when saving a new item which reloads the grid)
2. Pretty similar, module-to-module-communication (E.G. when you change the name of a country you not only want to update the list (or edit-page if you made the change in an editable-grid), but you also want to update the corresponding cities (both list and edit-pages)
3. Last but not least, I think you want to be able to react on event send from the server, E.G. when another user added a new country, you want your country-list to automatically contain this new country.

This is all very well possible I think, with your description of channels with consumers and handlers. However I don't complete understand the handler-channel implementation.
Take for example a Country-module,
- the Country-List would have a country-changed-Consumer (to handle for new and changed cities events)
- an editable-Country-List would also have a country-changed-Controller (to throw events when a country is changed in the country-grid)
- a Country-Edit-page would have both a consumer and a controller for country-changed-events on the country-changed-channel.
The country-changed-channel should automatically be created when the first consumer or controller registers itself on the (at that time non-existing) channel.

In the same way you can add City-Edit-pages in this story, by letting them consume on the country-changed-channel. However this would probably make a big mess when you have multiple city-edit-pages and country-edit-pages with their country-list and city-list pages open. So maybe we should set some properties for channel, I am currently thinking of 3-4:
1. the module-name (E.G. country)
2. the event-name (E.G. added, changed, deleted, etc)
3. the id of the affected item
4. maybe a 4th can be a reference to the sender of the event (as is seen in a lot of event-handling implementations)
maybe these first two can define the channel name, and the consumer can decide itself what it does with the id-property(#3) but it gets all messages on the channel, or maybe it is even better to replace the 3th propertie by a class which can contain multiple (user defined) properties.

I haven't really thought about the option of events from the server, and how it would register itself, but it can make use of the same principles of consumers and controllers.

Maybe you can tell where handler come along in this story and of course what you all think about this.

Ps. please don't feel this as an attack, I just want to reflect my ideas and opinion, so we can add a new flexible plugin which is useful for many people.


Leon
Re: Building Own Generator [message #50904 is a reply to message #24107 ] Sun, 27 April 2008 23:09 Go to previous messageGo to next message
DrCore  is currently offline DrCore
Messages: 59
Registered: August 2007
Member
Just checked back on the status of this project trying to merge some of my generator functions into the extjstheme project. Unfortunately I found the following problems:

sfExtjsPropelAdminGenerator.php
Line 197, in previous lines you used '[?php ?]' instructions but these instructions will not be interpreted into '<?php ?>' if you return them. However if you use 'print $html;' it will work.

I'm afraid there is another problem like this one. The source code produced after generating still contains some
[?php if ($sf_user->hasCredential('campaigncreation')): ?]

[?php endif; ?]
instructions.

I'll try and have a deeper look in the coming week.
Re: Building Own Generator [message #50927 is a reply to message #24107 ] Mon, 28 April 2008 11:29 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Hi Andre, nice to see you back again.

I'm sorry that I broke the i18n-, credential and other [?php-tags, I would be happy to restore their functionality, but at that time hadn't found a nice solution yet. it would be great if you can take a look at this.

NOW SOMETHING COMPLETELY ELSE

I don't know if you have noticed but there where many issues around the new ExtJS dual-licensing model. They now using a dual-license model with both GPL v3 and a commercial license. I have contacted the ExtJS team about our plugin and how we could continue without violating their license. They had a suggestion to become a sub-project of Ext and also use the dual license model.

I have nothing against this, but of course I cannot decide this on my own. They are open for feedback and other suggestions. For more info about their license please take a look at: http://extjs.com/products/license.php


Leon
Re: Building Own Generator [message #50928 is a reply to message #50903 ] Mon, 28 April 2008 11:33 Go to previous messageGo to next message
lukas  is currently offline lukas
Messages: 28
Registered: November 2007
Location: Switzerland
Junior Member
Thanks for the answer leon. I'll look in it this afternoon, and will reply in the evening.
Re: Building Own Generator [message #50929 is a reply to message #50928 ] Mon, 28 April 2008 11:41 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
looking forward to it, things could get real nice if everything is possible Surprised

Ps. next few days will get a little strange, since it will be queens-day at Wednesday here in Holland. So there will be parties starting from from Tuesday evening and at Thursday it will be Ascension Day, so everyone will be free (on labour day Rolling Eyes )

I think I will be working on Thursday, but this way you can all be prepared...


Leon
Re: Building Own Generator [message #50966 is a reply to message #24107 ] Mon, 28 April 2008 16:39 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I've committed the initial implementation for the loading of data for the edit-pages.

Current todo's:
- data is not auto-loaded (you have to press a reload-button)
- I don't set a filter for the requested primary-key yet
- only the first tab-page of a tabbed-edit-form is loaded (don't know why)
-drop-down combo-boxes seem to brake loading

The new implementation for the edit-pages contain only one form, and in this form the different tabpapges are part of the form, as can be seen in the last example at:
http://www.extjs.com/deploy/dev/examples/form/dynamic.html

any help again appreciated


Leon
Re: Building Own Generator [message #50972 is a reply to message #50966 ] Mon, 28 April 2008 17:31 Go to previous messageGo to next message
clad  is currently offline clad
Messages: 23
Registered: April 2008
Junior Member
I all.

Since the beginning that i use sfExtjs2Plugin and sfExtjsThemePlugin i have the same problem and i know i'm not the same in this case.

the problem is that I don't know how to create a grid with data in a database with sfExtjs2Plugin .

sfExtjsThemePlugin create a grid but it's difficult to customize it...For exemple i don't know if we are forced to have the grid in a tabpanel (since new modification of generator) or if we can have only a grid (not in a tabpanel).

I don't know if we can put a listener to show details of a row like in this example http://extjs.com/deploy/dev/examples/form/form-grid.html

The simplest for me will probably be to create a grid with sfExtjs2Plugin but it's never work...

I know i must have a columModel and a datastore but there is no simple exemple on the net.

An other solution could be to use only js file and put in on symfony pages but i still have the same problem: i don't know how to do to make a liaison with a database with symfony...


such of questions with no responses....
If someone know how to do a grid with sfExtjs2Plugin or know if my question about sfExtjsThemePlugin are possible please post.

thanks by advance

Clad

[Updated on: Mon, 28 April 2008 17:35]

Re: Building Own Generator [message #50981 is a reply to message #50972 ] Mon, 28 April 2008 18:26 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
clad wrote on Mon, 28 April 2008 17:31

I all.

Since the beginning that i use sfExtjs2Plugin and sfExtjsThemePlugin i have the same problem and i know i'm not the same in this case.

the problem is that I don't know how to create a grid with data in a database with sfExtjs2Plugin .

sfExtjsThemePlugin create a grid but it's difficult to customize it...For exemple i don't know if we are forced to have the grid in a tabpanel (since new modification of generator) or if we can have only a grid (not in a tabpanel).

I don't know if we can put a listener to show details of a row like in this example http://extjs.com/deploy/dev/examples/form/form-grid.html



As said before, this is all possible and certainly desired, however I cannot tell if it is all implemented yet. But you are free to change anything to your liking. Unfortunately since everything is in active development and not stabalised yet is very hard to provide you with more info or examples.

So for now you probably have to dive in the code yourself and look for what is already implemented or else make changes to implement it yourself

clad wrote on Mon, 28 April 2008 17:31



The simplest for me will probably be to create a grid with sfExtjs2Plugin but it's never work...

I know i must have a columModel and a datastore but there is no simple exemple on the net.




for that the best example is probably

http://backoffice.kaffill.de/ext2/ext2

it would again require work from you to find out what is possible with the sfExtjs2Plugin, and how to implement the examples from extjs.com

clad wrote on Mon, 28 April 2008 17:31



An other solution could be to use only js file and put in on symfony pages but i still have the same problem: i don't know how to do to make a liaison with a database with symfony...



I wouldn't recommend this, since it is not maintainable, when your project grows/changes, but this certainly is possible.

For that you still want to have a pager and other tools to transform the data from your database to json-data and setup an action.class.php to execute actions.

clad wrote on Mon, 28 April 2008 17:31



such of questions with no responses....
If someone know how to do a grid with sfExtjs2Plugin or know if my question about sfExtjsThemePlugin are possible please post.

thanks by advance

Clad



I am afraid you have to dive a little deeper into Symfony and make some changes to the sfExtjsThemePlugin yourself or start trying to experiment with the sfExtjs2Plugin.


Leon
Re: Building Own Generator [message #51058 is a reply to message #24107 ] Tue, 29 April 2008 14:23 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
We have trac!!!

http://trac.symfony-project.com/query?component=sfExtjsTheme Plugin&order=priority

this will probably help in maintaining some kind of overview.


Leon
Re: Building Own Generator [message #51070 is a reply to message #51058 ] Tue, 29 April 2008 16:39 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
related fields/drop-down comboboxes should again work,

From now on I will (try) to add all todo's to the ticket-system


Leon
Re: Building Own Generator [message #51081 is a reply to message #37603 ] Tue, 29 April 2008 18:05 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
hey Leon,

How do you do credentials in the generator? For instance if I wanted only users with the edit credential to be able to edit a field?
Re: Building Own Generator [message #51143 is a reply to message #24107 ] Wed, 30 April 2008 14:42 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
Leon,

Just saw this over on the ExtJs forums:

http://extjs.com/forum/showthread.php?t=33316

It's an extension for the famfamfam silk icon set. I think it would be a good replacement for the currently included silk icons. Sure beats doing custom css for buttons and such.
Re: Building Own Generator [message #51220 is a reply to message #51143 ] Thu, 01 May 2008 17:35 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Hi KRavEN,

I implemented credentials by simply re-using the code as written in the default theme. I haven't tested any code yet, but it should work just like normally in symfony. (if not, I probably haven't implemented it yet at all required places... which is a probably the biggest security issue right now)

The silk-extension looks nice, fine by me to implement it.

Does anyone has any thoughts about the licensing of extjs? and to make the sfExtjsThemePlugin part of Ext JS?

Ps. I've added it to trac: http://trac.symfony-project.com/query?component=sfExtjsTheme Plugin&order=priority

[Updated on: Thu, 01 May 2008 17:40]


Leon
Re: Building Own Generator [message #51254 is a reply to message #24107 ] Fri, 02 May 2008 11:08 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I've implemented saving from edit-pages,
it need some testing and tweaking.

For a demo see:
http://fun4me.demon.nl/test/test_dev.php

for more info see:
http://trac.symfony-project.com/ticket/3456#comment:1
and
http://trac.symfony-project.com/ticket/3434#comment:1


Leon
Re: Building Own Generator [message #51269 is a reply to message #51220 ] Fri, 02 May 2008 15:54 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
lvanderree wrote on Thu, 01 May 2008 10:35

Hi KRavEN,

I implemented credentials by simply re-using the code as written in the default theme. I haven't tested any code yet, but it should work just like normally in symfony. (if not, I probably haven't implemented it yet at all required places... which is a probably the biggest security issue right now)

I tried it and it will keep the data out of the datastore but the column for the data still gets rendered. Maybe you can provide an example generator.yml so I can ensure that I'm doing it correctly?
Re: Building Own Generator [message #51273 is a reply to message #51269 ] Fri, 02 May 2008 16:33 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
As said, I haven' tested it yet.

You are probably doing it in the right way (since it isn't mentioned in the datastore), but the code in the generator presumably has a flaw.

I assume you now talk about grids not edit-pages (since you mentioned columns, not fields)

You probably want to take a look at:
_list_ajax_columnmodel.php: 49

I already had a todo there since I didn't trust it (don't know who wrote it this way), at line 50 a [?php-if-credential-check (php-template-code) is implemented, but below it all generator-code(<?phph) is placed which does not return any template code ([?php), till line 87 which closes the template-if

Everything gets added to the array $cmOptions, which has nothing todo with the if-credential-checks in the template.

I think best thing to solve this, is to start using the sfExtjs2Plugin for the grid as well. Just like I do in _edit_ajax_form_inner.php at line 61 is add the output of printXtypeEditField to the template-array $form_config['items'][] which gets processed at runtime (in the template) and is making use of the sfExtjs2Plugin.

This would require some rewriting, but it would be a nice start to this ticket http://trac.symfony-project.com/ticket/3432

You can also see this in your template, there will be a credential-check without any code within the if-statement....


If you need help, please ask me. I will continue my development in the edit-pages for now.
I think I first try to fix the open-panel->key-finder, and after that implement the drop-down-combo-boxes-autoloading and after that try to implement event-handlers. (Could use your help/ideas for that Lukas)

[Updated on: Sun, 04 May 2008 21:46]


Leon
Re: Building Own Generator [message #51282 is a reply to message #51273 ] Fri, 02 May 2008 19:04 Go to previous messageGo to next message
kubens  is currently offline kubens
Messages: 89
Registered: February 2006
Location: Germany
Member
Great job guys Very Happy I following this thread as good as I can and it is very impressive what is reached in the meantime. Unfortunatelly I am totally lost in projects. Therefore I can not provide you my help, but in conjunction of 'Writing a Big Application in Ext' I can provide you at least one of my little proof of concept studies which may is usefull for your visions Wink

One basic class for the default application:

http://extjs.kaffill.de/site.js/extjs/app/ext-app-wak.js

Two classes which extended the basic class:

http://extjs.kaffill.de/site.js/extjs/app/ext-app-wak-news.j s
http://extjs.kaffill.de/site.js/extjs/app/ext-app-wak-news-c ategory.js

Additional little features:

- Load application classes dynamically once per first request
- Hotkey-Support (Insert / Crtl+Enter)

There are still little problems which I did not solved at this moment, but as mentioned above it is just a proof of concept Wink


Br
Wolfgang
Re: Building Own Generator [message #51287 is a reply to message #51282 ] Fri, 02 May 2008 20:58 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Hi Kubens,

great to hear from you again!

Your example always was a great help to me, and this one again shows what I had in mind for the re-implementation of the grid-panel ( http://trac.symfony-project.com/ticket/3432#preview ).

keyboard-listeners are nice Surprised

I just using.js to dynamically(/lazy) load new files. I prefer this above loading it with a panel (I think you still do it this way, but didn't checked it). One of the big differences is that in my case the js-file is added in firebug as a new script, and can be debugged, while in your case I can still see the javascript being loaded in the console as a ajax-request. (you can see this in my live demo http://fun4me.demon.nl/test/test_dev.php , when clicking on a city, after this the editAjaxJs.pjs can be found under the scripts and breakpoints can be set)


Leon
Re: Building Own Generator [message #51359 is a reply to message #51287 ] Sun, 04 May 2008 16:17 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Hi KRavEN,

are you willing to (help) re-implement(ing) the forms, as described at http://trac.symfony-project.com/ticket/3432#comment:3

This will solve your issue with the column-credentials and the other issues mentioned at trac. It will also again improve the maintainability.

Lukas, have you already got some ideas about how to implement a application-wide event-manager?

[Updated on: Sun, 04 May 2008 21:45]


Leon
Re: Building Own Generator [message #51381 is a reply to message #51359 ] Mon, 05 May 2008 02:42 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I've started with the initial implementation of event-throwing. It works for now when saved.
For implementation test, please check:
http://fun4me.demon.nl/test/test_dev.php/city/create
or by editing an item, E.G.:
http://fun4me.demon.nl/test/test_dev.php/city/edit/id/74

You get a alert when you successfully saved an item, which is caught in the main-app (that is why it won't be shown from the grid, I don't listen to events there...)

the saved event can be used to reload the grid,
I am planning on also implementing a delete-event, which makes it possible to automatically close a edit-window/edit-tab (depending on your implementation)

Besides I am struggling with making autoHeight to work. There is a problem with forms within a border-layout: see http://extjs.com/forum/showthread.php?t=34561

I can set the height manually, but it should be possible to automatically resolve the height, isn't it...

For an example look at the grid with cities and click the add country button, which pops up a new window with height 0

[Updated on: Mon, 05 May 2008 03:06]


Leon
Re: Building Own Generator [message #51421 is a reply to message #51381 ] Mon, 05 May 2008 15:02 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I've improved the event handlers, added new events for closing windows and deleted items


Leon
Re: Building Own Generator [message #51424 is a reply to message #51359 ] Mon, 05 May 2008 15:42 Go to previous messageGo to next message
lukas  is currently offline lukas
Messages: 28
Registered: November 2007
Location: Switzerland
Junior Member
Hi Leon,

i just wanted to say: sorry, but business is eating my time.

I've read your answer, and agree in most points. I'm now on a prototype today, which comes out of the considerations of your answers. It'll fully integrate with the latest svn of the theme plugin.

In the meantime my mate diego does the testing and a virtual appliance.

Then we'll give out a public demo, wiki and svn/source somewhen this week (expect). so we have something real (as "real" as software can be) to talk about.

Some other thing I also thought about: The licensing. Since you want to open a business, I'd consider it a good idea to go with the Extjs subproject: They do have a lot of interesting references ( http://extjs.com/company/customers.php ) who could help your marketing. From the technical site it could be good to be a "Partner" too. Since symfony is MIT-Public, I think there shouldn't be a problem with the symfony project.
We discussed also internally about it, and we'd like to be part in this by kinda triple play:
  • sfExtjs2Plugin -> for symfony apps with some ext parts
  • sfExtjsThemePlugin -> for symfony apps with generated modules (-> "a little bit more Extjs")
  • sfExtjsAppElementsPlugin -> for symfony apps that are fully ext based (this is what we would like to maintain)

This triple play would give developers the ability to use the first, the first two or all three plugins, depending on what they want to do. (eg: for just some forms in ext, one could use sfExtjs2Plugin, for generator based grids sfExtjsThemePlugin is additionally needed. For a complete app containing Event- / Layout- and WindowManager, a help system, a login and profile functionality, you'd need sfExtjsAppElementsPlugin also.)

So that'd be my proposal on the licensing thing. I'd be glad if you could consider this proposition.

But I'd like to wait a little bit on cooking that high: Let's see how this works out and discuss it at the end of leons diploma time. (@leon: if you want, you could give a date-to-decide: not to soon to stop you from working, but soon enough to write it under "achievements" in your diploma-doc Smile)

greetz
lukas
Re: Building Own Generator [message #51427 is a reply to message #51424 ] Mon, 05 May 2008 16:06 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
lukas wrote on Mon, 05 May 2008 15:42

Hi Leon,

i just wanted to say: sorry, but business is eating my time.



no problem what so ever, good to hear you are busy with it.

lukas wrote on Mon, 05 May 2008 15:42



I've read your answer, and agree in most points. I'm now on a prototype today, which comes out of the considerations of your answers. It'll fully integrate with the latest svn of the theme plugin.

In the meantime my mate diego does the testing and a virtual appliance.

Then we'll give out a public demo, wiki and svn/source somewhen this week (expect). so we have something real (as "real" as software can be) to talk about.



I am very interested in your results, and feel free to keep me updated or propose things Wink This way we can possible also prevent double work and make things interact smoothly between each other.

I am currently implementing even-listeners making the grid and the opened edit-widows interact with eachother. First basic: when saved/deleted in editor -> reload grid. After that the other way around: when saved in grid -> reload editors, after that only corresponding editor/lists should be listening (depending on ids and module-names)

lukas wrote on Mon, 05 May 2008 15:42


Some other thing I also thought about: The licensing. Since you want to open a business, I'd consider it a good idea to go with the Extjs subproject: They do have a lot of interesting references ( http://extjs.com/company/customers.php ) who could help your marketing. From the technical site it could be good to be a "Partner" too. Since symfony is MIT-Public, I think there shouldn't be a problem with the symfony project.
We discussed also internally about it, and we'd like to be part in this by kinda triple play:
  • sfExtjs2Plugin -> for symfony apps with some ext parts
  • sfExtjsThemePlugin -> for symfony apps with generated modules (-> "a little bit more Extjs")
  • sfExtjsAppElementsPlugin -> for symfony apps that are fully ext based (this is what we would like to maintain)

This triple play would give developers the ability to use the first, the first two or all three plugins, depending on what they want to do. (eg: for just some forms in ext, one could use sfExtjs2Plugin, for generator based grids sfExtjsThemePlugin is additionally needed. For a complete app containing Event- / Layout- and WindowManager, a help system, a login and profile functionality, you'd need sfExtjsAppElementsPlugin also.)

So that'd be my proposal on the licensing thing. I'd be glad if you could consider this proposition.

But I'd like to wait a little bit on cooking that high: Let's see how this works out and discuss it at the end of leons diploma time. (@leon: if you want, you could give a date-to-decide: not to soon to stop you from working, but soon enough to write it under "achievements" in your diploma-doc Smile)

greetz
lukas


Thank you for coming back to this. As far as I see it now I totally agree with you. I haven't really invested much time in licensing right now, I know the MIT-license will allow virtually everything and GPLv3 is more strict about what you can and cannot do (protecting your work somewhat more), but great idea to wait with the decision until I have graduated. That was my idea as well, but wanted to know in advance what you people are thinking about it.

About graduation, I think this will be somewhat delayed because of the amount of work still to be done... It will probably be at the end of August.


Leon
Re: Building Own Generator [message #51433 is a reply to message #51427 ] Mon, 05 May 2008 17:09 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
The listeners are working, take a look at

http://fun4me.demon.nl/test/test_dev.php

and add/edit/remove cities.

The code can again use some clean-up (I prefer to make more use of [?php tags, instead of <?php and the use of include_partial can be improved I think.)

I again made more use of the sfExtjs2Plugin, to improve maintainability.

The event-listeners need to be improved, event-throwers might need to throw more info (more arguments, like the module-name).


Leon
Re: Building Own Generator [message #51447 is a reply to message #24107 ] Tue, 06 May 2008 00:46 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I 've started re-implementing the list-code in maintainable-style: creating new Js-Classes, like the edit-pages

For now please check listAjaxGridPanelJsSuccess.pjs
It is not used, nor finished yet! For now it returns the same code as the template, but nicer.

We can create 1 listAjaxGridPanelJs.pjs file (just like the current editAjaxJs.pjs file), which contains all code to show a grid WITH columnmodel, datastore, toolbars, renders, etc. I think this has my preference.

Then you can say
grid_panel = new Ext.Panel({xtype: 'listcitygridpanel'});


So you have the same amount of php files, but they end up in one listAjaxGridPanelJs.pjs file.
For the filter page you would again have a listAjaxFilterJs.pjs

Also for the related fields with drop-down-combo-boxes we can do the same and define new xtypes for them and use them in the above .pjs files.

Then to define the final page, with grid and filter, you would have a file called listAjaxJs.pjs which contains the definition for a new xtype with these panels.

I think this sounds nice.

Ps. shortcuts:
http://fun4me.demon.nl/test/test_dev.php/js/city/editAjaxJs. pjs
and
http://fun4me.demon.nl/test/test_dev.php/js/city/listAjaxGri dPanelJs.pjs

[Updated on: Tue, 06 May 2008 00:48]


Leon
Re: Building Own Generator [message #51552 is a reply to message #24107 ] Wed, 07 May 2008 15:23 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I am continuing with the reimplementation of the grid/list in object-extension style in pjs-files

Current result (although sometimes still using hardcoded test-values):
http://fun4me.demon.nl/test/test_dev.php/js/city/listAjaxGri dPanelJs.pjs
and it does things Surprised
http://fun4me.demon.nl/test/configstyle.html

I think this code should be easier to read/maintain and it can be extended again in javascript Surprised

all you have to do is include the pjs file in your document head and add a form with xtype 'list<module-name>gridpanel' or call new Ext.app.sx.ListCityGridPanel() and everything else will be taken care of!!!

the listAjaxGridPanelJs.pjs results in one big list of code containing everything to show a grid. Its source is spread over the same amount of templates. You probably don't want the columnmodel, datastore, etc (from the helpers) to be generated by their own .pjs file since this would increase the loading latency (loading many small files takes more time than 1 big file). Maybe we can also minify the result of this .pjs file to reduce the file size Surprised

This implementation should also take care of the column-credential checks KRavEN.

I will further restore functionality now, since the proof of concept works


Leon
Re: Building Own Generator [message #51602 is a reply to message #51552 ] Thu, 08 May 2008 12:43 Go to previous messageGo to next message
dan_bas
Messages: 12
Registered: May 2008
Location: Italy
Junior Member
Hi lvanderree, it's my first time in this forum.
I'm following with interest your progress with your sfExtjsTheme plugin.

I'm recently started a new big project to develope a really big and complex web application and although we are only at the first release candidate version, I decided to use the 1.1 branch of symfony.

Now I'would like to know from you, if it will be possible in the short, that your plugin, that depends on sfExtjs2Plugin and sfPJSPlugin, also will work in this branch.

Excuse me for my bad english and thank you advance.
Re: Building Own Generator [message #51606 is a reply to message #51602 ] Thu, 08 May 2008 13:26 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Hi dan_bas,

I am sorry, but I can't tell. I haven't tried...

I am currently only working in Symfony 1.0.*, in the future (probably August) I want to upgrade to 1.1, but I am afraid it will take to much time for now to upgrade the complete plugin.

For now my goals are:
1. to first stabilise the code somewhat,
2. make it do what I need it to do for my graduation project
3. graduate
4. continue to improve the plugin (upgrade to sf1.1 is one of the improvements)

You are of course free to check out yourself if it works, and make changes to make it work. I am also willing to help you with this, but I really want to graduate someday not too far from now Wink

Also other improvements and changes are welcome, and if anyone has any ideas/tips or feedback he is more than welcome to share them


Leon
Re: Building Own Generator [message #51625 is a reply to message #24107 ] Thu, 08 May 2008 19:46 Go to previous messageGo to next message
dan_bas
Messages: 12
Registered: May 2008
Location: Italy
Junior Member

Thank you for your rapid response lvanderree.
Quote:


I am sorry, but I can't tell. I haven't tried...


I've already tried before, and I saw that Actually there are problems.


Quote:

I am currently only working in Symfony 1.0.*, in the future (probably August) I want to upgrade to 1.1, but I am afraid it will take to much time for now to upgrade the complete plugin.

For now my goals are:
1. to first stabilise the code somewhat,
2. make it do what I need it to do for my graduation project
3. graduate
4. continue to improve the plugin (upgrade to sf1.1 is one of the improvements)

You are of course free to check out yourself if it works, and make changes to make it work. I am also willing to help you with this, but I really want to graduate someday not too far from now Wink


Ok, if you think
Quote:


that your graduation is more important than my needs, it's up to you Wink

Quote:

Also other improvements and changes are welcome, and if anyone has any ideas/tips or feedback he is more than welcome to share them


Hmm.. I'm thinking to start with symfony 1.0 and make the upgrade (hopefully painless) to 1.1 in the near future, maybe in August Wink looking at what happens in the meantime

Ciao
Re: Building Own Generator [message #51626 is a reply to message #51625 ] Thu, 08 May 2008 20:12 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Again a fast answer Surprised

I have thought about it, but unless you can buy my graduation I will first continue to work on my project Wink

As said I will continue making the plugin more stable. I more and more get the idea about how to develop in php and javascript (I was pretty experienced in (chronicle order, and among others) basic, visual basic, Java and C#, but to do this really well is something different, javascript because it isn't really object-oriented even though ExtJs comes close, PHP because of the challenge to make the most out of the generator which results in usable templates and can reuse as much code as possible (by using libraries and other plugins)),
making it work on both all kind of servers as well as all kind of clients,
making the most of the generator to make fast development (eventually Wink) possible, while keeping it completely flexible.

I am not a big fan of CRUD, since it is not maintainable, and not a big fan of DSLs (even though creating this generator comes pretty close) and want to see if administration-generation can be a solution to improving development times (although at the moment I can say a good start-up is pretty cumbersome)

As said I will do my best to support everyone and hope to get useful feedback/ideas/implementations in return, with the idea to improve the plugin more and more.


Leon
Re: Building Own Generator [message #51643 is a reply to message #51626 ] Thu, 08 May 2008 23:38 Go to previous messageGo to next message
dan_bas
Messages: 12
Registered: May 2008
Location: Italy
Junior Member
I see lvanderree, I am agree with you and I appreciate your effort as the effort of the other people that share the fruits of their own work done often in the little free time. I will try at least to be a usefull tester Wink
Re: Building Own Generator [message #51785 is a reply to message #24107 ] Mon, 12 May 2008 02:17 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
The list has been reimplemented.

BE AWARE AN SVN-UPDATE WILL HAVE MAJOR IMPLICATIONS!!!
But now things are getting much nicer, if you ask me...

For a demo again see:
http://fun4me.demon.nl/test/test_dev.php

the pjs-plugin is now absolutely required, so I removed its config-option, which was obsolete.

There is a new config option: module_returs_layout
you can (and probably want to) disable this and define your own layout in the layout.php file, and only get a variable with the panel from the module's-action. It is enabled by default to show you results immediately without any setup.
See my example to see how to setup your layout.php once you disabled it.

partials which are obsolete (and soon to be deleted) are:
- _list_ajax_layout.php
- _list_ajax_gridpanel.php
(possibly more)
I left these in the repository for now, since not everything is implemented in the new style yet, and maybe we want to use it as a reference. Main functionality has been implemented you see a list and it can be easily setup.

I am aware that the create buttons don't function, and that editing a city will make the entire page reload.
This is because event handlers need to be implemented for this.

The gridpanel (with its stores and everything) is now defined in the listAjaxGridPanelJs.pjs file. All partials it uses should (eventually) have a _js suffix in their file name.
Still some todo's to possibly split related datastores/editors in their own pjs file, have yet to find a nice solution for them)

Attached is the source of the demo site.

Ps. please be aware of trac: http://trac.symfony-project.com/query?component=sfExtjsTheme Plugin&order=status

[Updated on: Wed, 14 May 2008 13:10]


Leon
Re: Building Own Generator [message #51928 is a reply to message #51785 ] Wed, 14 May 2008 01:48 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
At the moment the internet connections in Holland are very unstable due to a problem at one of our major providers, so if you can't reach the live demo, please try again some time later...

I've updated the svn with my latest code, which adds the possibility to open new edit-panels as a new tab-panel.

I think this is the way it should be done (with unobtrusive js, using classes and attributes in namespaces)

Please check out the live demo at:
http://fun4me.demon.nl/test/test_dev.php

Obviously thing aren't finished yet, only the links in the grid work, the buttons aren't re-implemented yet, but this can be done in a similar way.

event-handlers/firers should be further implemented, and the panel should update its title after loading is done.

the new layout.php (which contains the code to define the tabpanel and some event handlers) and the projects app.yml can be found in the attachment.

[Updated on: Wed, 14 May 2008 13:11]


Leon
Re: Building Own Generator [message #51929 is a reply to message #51928 ] Wed, 14 May 2008 01:51 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Please give some feedback.

What do you think of this implementation.
Can somethings be improved and if so, how?

Are there already some svn-updates/patches from you, or do you hate me for making these major changes... Shocked It's all for the greater good Rolling Eyes


Leon
Re: Building Own Generator [message #51940 is a reply to message #51929 ] Wed, 14 May 2008 09:01 Go to previous messageGo to next message
dan_bas
Messages: 12
Registered: May 2008
Location: Italy
Junior Member
Hi lvanderree

lvanderree wrote on Wed, 14 May 2008 01:51

Please give some feedback.

What do you think of this implementation.
Can somethings be improved and if so, how?

Are there already some svn-updates/patches from you, or do you hate me for making these major changes... Shocked It's all for the greater good Rolling Eyes


You are right, but I still have problems to run my layout.php with the various generators, templates and actions of the various moduls of my application, using your plugin.

My application must show a viewport in which a tab-panel contains four panels, none of which selected by default. It must be possible, by selecting panels, to display different contents from different modules, which for some panels must be grids.

Furthermore I thought to interact with the grids (to add and to modify data), not through new panels or tab-panels, but by opening windows.

What do you think, I am completely doing wrong ?

I know, you were waiting for some feedback and I am asking to you to waste your time with my problems Wink









Re: Building Own Generator [message #51942 is a reply to message #51940 ] Wed, 14 May 2008 09:17 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Hi dan_bas,

it is hard to say what you are doing wrong, if I can't see any of your code/results...

Please take a look at the latest test.tgz code. It contains a layout.php which uses a tabpanel.

In your case you probably want to preload some of the listMODULEgridPanelJs.pjs and/or editMODULEpanelJs.pjs from your modules by hard-coding them in your layouts include-section.
Then you can define your tabPanel with
items: [
  {
    xtype: 'listmodule11gridpanel',
    title: 'title 1'
  },{
    xtype: 'listmodule12gridpanel',
    title: 'title 2'
  },{
    xtype: 'listmodule13gridpanel',
    title: 'title 3'
  },{
    xtype: 'listmodule14gridpanel',
    title: 'title 4'
  },
]


And you proabably don't need the line:
<?php echo $sf_data->getRaw('sf_content') ?>


but removing this line makes it impossible to open a link (from your grid) in a new browser-window. In that case you won't see the editor, but the same tabpabel with the 4lists.

We have to figure out a way to detect which page is being requested, and make the appropriate tab-page, or edit-panel be activated.


Leon
Re: Building Own Generator [message #51955 is a reply to message #51940 ] Wed, 14 May 2008 10:49 Go to previous messageGo to next message
clad  is currently offline clad
Messages: 23
Registered: April 2008
Junior Member
dan_bas wrote on Wed, 14 May 2008 09:01

Hi lvanderree

lvanderree wrote on Wed, 14 May 2008 01:51

Please give some feedback.

What do you think of this implementation.
Can somethings be improved and if so, how?

Are there already some svn-updates/patches from you, or do you hate me for making these major changes... Shocked It's all for the greater good Rolling Eyes


You are right, but I still have problems to run my layout.php with the various generators, templates and actions of the various moduls of my application, using your plugin.

My application must show a viewport in which a tab-panel contains four panels, none of which selected by default. It must be possible, by selecting panels, to display different contents from different modules, which for some panels must be grids.

Furthermore I thought to interact with the grids (to add and to modify data), not through new panels or tab-panels, but by opening windows.

What do you think, I am completely doing wrong ?

I know, you were waiting for some feedback and I am asking to you to waste your time with my problems Wink








hi !

I'm trying to do the same thing like you, having several panel with several grid and for CRUD ,opening in a window and not in a tabpanel but it's difficult Sad
Re: Building Own Generator [message #51956 is a reply to message #51955 ] Wed, 14 May 2008 10:54 Go to previous messageGo to previous message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
when i am at the university later today I will show an example. i think I've got an idea to open links in new windows.


Leon
Previous Topic:i18n form question
Next Topic:German symfony workshops/trainings
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software