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 #45113 is a reply to message #45112 ] Fri, 08 February 2008 00:23 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Regarding the sfGuard support, there is a sfGuard behaviour plugin which makes it possible to automatically set the user-id for classes when they do database actions (sfGuardPropelAuthoredBehaviorPlugin). I use it to automatically store the user who inserts rows in the database for assignments parcels and other important data-objects.

What you need to do to make this work is change your lib/model/class.php file and add something like this to it:

sfPropelBehavior::add('Assignment', array('sfGuardPropelAuthoredBehavior' => array('column' => 'created_by')));


behaviours are cool Wink


Leon
Re: Building Own Generator [message #45115 is a reply to message #45104 ] Fri, 08 February 2008 01:37 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
KRavEN wrote on Thu, 07 February 2008 20:10

lvanderree wrote on Thu, 07 February 2008 12:59

this 'solution' of yours (the original implementation) is wrong, because now the foreign-key-field is required if the foreign-value-field is required. Or in other words the plugin checks if the field mime_type is required instead of checking if sfPropelFileStorageInfo_id is required


Right, I didn't think it was the fix and didn't check it in. I was just letting you know what I did to get the exception to go away in the hopesthat this might help you narrow down the issue.

Your got me thinking though talking about the id being required, so I added it into my list and the problem goes away:

doesn't work:
    list:
      title:              File Manager
      display:            [_link, _size, sfPropelFileStorageInfo/mime_type, created_at, sfGuardUser/username]


works:
    list:
      title:              File Manager
      display:            [id, file_id, _link, _size, sfPropelFileStorageInfo/mime_type, created_at, sfGuardUser/username]
      hide:               [id, file_id]



I think one problem is that you shouldn't say sfPropelFileStorageInfo/mime_type, but file_info/mime_type

Unfortunately this doesn't work either, it brakes later on when file_info is translated to sf_propel_file_storage_info somehow... I will continue to investigate this tomorrow.


Leon
Re: Building Own Generator [message #45154 is a reply to message #45113 ] Fri, 08 February 2008 13:18 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
Thanks, I'll look at the sfPropelFileStoragePlugin and fix it when I get the chance. The support is supposed to be in there but it doesn't work.
Re: Building Own Generator [message #45155 is a reply to message #24107 ] Fri, 08 February 2008 13:43 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
How do you get sort working with partials?
Re: Building Own Generator [message #45159 is a reply to message #45155 ] Fri, 08 February 2008 14:41 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Sorting isn't really worked out yet.

I have an old implementation, which probably still works (but is not used anymore by me), this was implemented before we had the power of providing the tablename/fieldname structure. I want to use this new structure one day to make sorting work properly.

At the moment the old implementation still should work. You should define the sort-criteria in your generator.yml file under the field-properties, see:

http://trac.symfony-project.com/ticket/924

generator:

  class: sfPropelAdminGenerator 
  param:

    model_class: sfGuardUser
    theme: default

      list:

        title: Users 
        display: [ =username, _show_fullname, _show_emailaddress] 

        fields:
          show_fullname:
            name: Fullname 
            join_fields: [sfGuardUserPeer::ID, UserPeer::USERID] 
            sort_column: [UserPeer::FIRSTNAME, UserPeer::NAMEADDITIONS, UserPeer::LASTNAME]

          show_emailaddress:
            name: E-mailaddress
            sort_column: UserPeer::EMAILADDRESS



This is old code which probably still works, but sorting isn't my main priority at the moment...
In the future I want sorting to be done automatically for the foreign-fields. For partials something nicer can be invented probably...

[Updated on: Fri, 08 February 2008 14:44]


Leon
Re: Building Own Generator [message #45161 is a reply to message #45159 ] Fri, 08 February 2008 14:49 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I have found a new problem, regarding the pjs implementation.

My grid is less width when using the pjs implementation (not as wide as the entire browser) and when I load grids/lists dynamically I don't see any content at all.

I guess it is due to the order in which the code gets executed. I will first do a diff-test to see if there are any differences between the script-in-tags version and the pjs-script version, but I don't think this will show any problems.

Maybe the execution of the script should be done outside the pjs-file


Leon
Re: Building Own Generator [message #45162 is a reply to message #24107 ] Fri, 08 February 2008 14:54 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
It's more than likely an order issue as the code in the tags and the code in the .pjs file should be identical.

You might look at loading the code that you need for the dynamic items into a div like I did with the UploadPanel. This also helps lower initial load time.
Re: Building Own Generator [message #45167 is a reply to message #45162 ] Fri, 08 February 2008 15:25 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
if it is an order issue, you should probably have to deal with the same issue isn't it?

I was looking at your js of the file-uploadPanel and this code is really nice. Did you developed it with spket? One day when we have some more time we should definitely combine forces to improve the code generated by the theme to create the grids.

However I didn't see what you meant with loading the code into a div? I see you create the dialog from config-options, which is exactly what I had in mind for the future of the theme-generator, but I don't see what you mean with the "into a div"-part


Leon
Re: Building Own Generator [message #45168 is a reply to message #24107 ] Fri, 08 February 2008 15:43 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
Well, the UploadPanel extension is not my code. I'm just using it. I got it here http://max-bazhenov.com/dev/upload-dialog-2.0/index.php.

Check out my handler function:
function(){
  var panel = Ext.get('upload_panel');
  if(!panel){
    panel = Ext.get(document.body).createChild('<div id="upload_panel"></div>');
    panel.getUpdater().showLoadIndicator = false;
    panel.load({url: 'capacity/ajaxUpload', scripts: true, method: 'POST'});
  } else {
    UploadDialogController.init();
  } 
}


This loads the output of ajaxUpload into a div. ajaxUploadSuccess looks like this:
<?php use_helper('PJS') ?>
<head>
<?php use_stylesheet('/sfExtjsThemePlugin/UploadDialog/css/Ext.ux.UploadDialog.css') ?>
<?php use_javascript('/sfExtjsThemePlugin/UploadDialog/Ext.ux.UploadDialog.packed.js') ?>
<?php use_pjs('capacity/ajaxUploadJs') ?>
</head>


This loads the UploadDialog javascript, UploadDialog css, and my ajaxUploadJsSuccess.pjs. The ajaxUploadJsSuccess.pjs has an Ext.onReady that gets run when the div is finished loading because of the scripts:true config option in the upload handler.
Re: Building Own Generator [message #45174 is a reply to message #24107 ] Fri, 08 February 2008 16:50 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
How should list.hide work in the generator?

Everything looks as it should on the javascript side but the values don't get sent in the jsonList action.

I don't think this should be the case as I still need id's in the datastore even though I don't want to see them in my columnmodel.

I also think we should add another option for hidden to set the field hidden:true in the columnmodel instead of omitting it.
Re: Building Own Generator [message #45175 is a reply to message #45168 ] Fri, 08 February 2008 16:53 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
gzorg wrote on Fri, 08 February 2008 16:37

Thanx for your quick answer, and for the links i didn't found

As a first question I wonder simply how to transform the layout :

fo exemple I need to have filters in a Box not in a Tab but as a right box.

Is this type of param exist or not?

As I need to make a project to demonstrate capabilities of extjs on symfony in a couple of days, do you think I'd better make changes in a separate theme?




This is one of the things which isn't implemented yet, but on the wish-list. I wouldn't recommend on making your own seperate theme, but send me your patches/changes and I will do my best to merge them with the current theme, adding paramters whenever necessary in coordination with you. I would like to make one big theme which can handle a lot, so it can be used and tested and improved by many people.

As you can see in my live-demo: http://tejohnston.dynora.eu/backend_dev.php/ (username/password: admin) that it is possible to change the page in which a link is opened, this is done by altering the renderer in the generator.yml file.

the generator.yml file for this page is here:

generator:
  class:              sfExtjsPropelAdminGenerator
  param:
    model_class:      AssignmentParcel
    theme:            extjs

    related_tables:
      client_company:
        module_name: clientcompany
      agent_company:
        module_name: agentcompany    
    
    fields:
      assignment/subject:
        name:     Assignment
        params:
          header_valuePrefix:  "<i>Assignment</i>: "
          header_valueSuffix:  ""
      assignment/client_company/name:
        params:
          header_valuePrefix:  ", <i>Client</i>: "
          header_valueSuffix:  ""
      assignment/voyage/vessel/name:
        params:
          header_valuePrefix:  ", <i>Vessel</i>: "
          header_valueSuffix:  ""
      sf_guard_user/username:
        params:
          header_valuePrefix:  ", <i>Made by</i>: "
          header_valueSuffix:  ""
      assignment_id:
        class: hidden
          
      subject:
        name:     Subject
        params:
          renderer:  "return renderLinkWithBase('Parcel: ' + value, params, record, 'type=\"parcel\" assignmentid=\"'+record.data['assignment_parcel-assignment_id']+'\" assignmenttextcontent=\"Assignment: '+record.data['assignment_parcel-assignment-subject']+'\"');"
      product/name:
        name:     Product
      country/name:
        name:     Origin
      quantity:
        params:
          renderer: "return renderWeight(value)"
           
    list:
      title:      Assignment overview
      
      display:        [=subject, product/name, country/name, quantity, stowage]
      grouping:       
        field:        assignment/subject
        display:      [=assignment/subject, assignment/client_company/name, assignment/voyage/vessel/name]

      peer_method:    doSelectLeftJoinAssignment
      
      actions:
        add_assignment:
          name:   Add new assignment 
          class:  btn_create
          handler_function: "App.openAssignment('create_assignment', '/backend_dev.php/assignment/create', 'New Assignment');"
        _separator:     -
        _refresh:       -
        _upload: -
        _fill:          -
        _pdf:           -
        _print:         -
      
    edit:
      display: []
      
      pages:
        general:
          title: Parcel General
          display:    [assignment_id, assignment_parcel_id, subject, product/name, country/name, quantity, stowage]
        bl:
          title: Bill of Lading
          display:    [subject]
        timelog:
          title: Timelog
          display:    [subject]
        surveyor:
          title: Surveyor
          display:    [subject]
        laboratory:
          title: Laboratory
          display:    [subject]
        report:
          title: Report
          display:    [subject]
        invoice:
          title: Invoice
          display:    [subject]
        finish:
          title: Finished
          display:    [subject]
      


Changing the location of the filters isn't possible yet, but if you provide a patch I would like to merge it of course. I also offer to help wherever I can to accomplish this, but I do have my own agenda: getting graduated asap... Wink However all you people's additions can help me in getting graduated sooner, so I like to help as much as I can.

One other note: providing the fields on which you want to filter isn't as nice as for the display fields yet (with tablename/fieldname) this is another todo..


Leon
Re: Building Own Generator [message #45177 is a reply to message #45174 ] Fri, 08 February 2008 16:58 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I didn't really thought about the list.hide yet. I found its existence during development and re-used it everywhere I could, but I didn't really tested it on anything yet.

I agree that list.hide should be visible in the json-data. I think we only have to take a look at __json_td.php

hiding fields is already possible, but again not very well tested. you can define your fields to be hidden-fields:

You can see from my previous post this line:
      assignment_id:
        class: hidden


That is what you are looking for I guess...


Leon
Re: Building Own Generator [message #45178 is a reply to message #24107 ] Fri, 08 February 2008 16:59 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
If you make a layout it's easy to change the location of the filterPanel and the gridPanel by overriding _list_ajax_tabpanel.

Here's how I override mine:
      MainLayout.getCenter().add(gridPanel).show();
      MainLayout.getWest().add(formPanel).show();
      MainLayout.getLayout().doLayout();
      MainLayout.getWest().getComponent(1).expand();
Re: Building Own Generator [message #45180 is a reply to message #45177 ] Fri, 08 February 2008 17:05 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
lvanderree wrote on Fri, 08 February 2008 09:58

I didn't really thought about the list.hide yet. I found its existence during development and re-used it everywhere I could, but I didn't really tested it on anything yet.

I agree that list.hide should be visible in the json-data. I think we only have to take a look at __json_td.php

hiding fields is already possible, but again not very well tested. you can define your fields to be hidden-fields:

You can see from my previous post this line:
      assignment_id:
        class: hidden


That is what you are looking for I guess...


Well, actually, setting hidden:true in the columnmodel will be the same as if you clicked the arrow in the grid column header, choose columns, and uncheck a column. They're just initially rendered unchecked so you can go in and check them if you want to see them.

I've already resolved the datastore not having list.hide column data. I just didn't want to change it if that was your intended behavior. Should have a checkin ready shortly.
Re: Building Own Generator [message #45181 is a reply to message #45180 ] Fri, 08 February 2008 17:15 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
making list.hide hide columns, which can be recalled from the grid-menu would be even nicer, definately wanted behaviour never thought about. Sounds nice Very Happy


Leon
Re: Building Own Generator [message #45215 is a reply to message #45181 ] Sat, 09 February 2008 17:51 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I don't know where I've gotten myself into, but expect a major change.

I am implementing the new field-naming convention, in which you have to define foreign-keys instead of table-names/php-names (something appeared to be mixed up as well).

This should result in a fix for the ambiguity-problem where you can have multiple foreign-keys to the same foreign-table and resolve the issue which showed up in the sfPropelFileStoragePlugin where the table-name doesn't matches the tables-PHPname.

At first I had the silly hope that it would only be a matter of changing the parsing of the generator.yml file, but it shows out it affects everything, even the json-data will have different field-names so it can handle the ambiguity-problem. And so the html-fields should have different properties as well.

To make things complete old functions can't be used anymore, because the use or PhpNames, which isn't valid at all time, or the depend on table-lookups to resolve foreign-keys which isn't possible when you have multiple-foreign-keys to a same table.


Leon
Re: Building Own Generator [message #45253 is a reply to message #45215 ] Mon, 11 February 2008 03:07 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I am almost there,

I again see the grid and sorting works.

However drop-down combo-boxes and partials are broken and everything is in a very unstable (not well tested) state. Also the code can use some clean-up. I haven't tested yet if saving works again, and also the edit-pages haven't been looked at yet.

I have decided not to commit yet, until things are a little more stable, but expect this to happen at the beginning of this week (probably tuesday).

The consequence of this change will be that probably all your generator.yml files are corrupt after my commit!

It doesn't require much or difficult changes, but it probably does affect all your generator.yml files.
As soon as you have defined a foreign-relationship in your display-field (like country/name) you will see an error.

The new syntax will be foreign-key/foreign-fieldname

so instead of country/name you now say country_id/name
the naming for local fields remain the same and recursion still works by defining multiple foreign-keys, like city_id/country_id/name.


Leon
Re: Building Own Generator [message #45292 is a reply to message #45253 ] Mon, 11 February 2008 16:03 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Grids are fully functional again: including sorting on foreign-fields, grouping and master-detail.

I am now going to look at the edit-pages.

I am thinking about committing this evening, since this Thursday will be the last day I will be working, before I leave for one week to vacation Surprised. this way I can give feedback for three days if someone has some problems. (which probably should be enough I guess, to solve the missed bugs).

Important changes in the code are that the $checkname and $class are now obsolete. Everything gets resolved by there table-(foreign)field-names, which makes things a lot cleaner/nicer.

In the code you now still see lots of fragments like:
          $columnName = $column->key;

          list($class, $checkName) = explode('/', $columnName, 2);
           
          if (strtolower($class) != strtolower($tableName))
          {
            $class = $tableName;
            $checkName = $columnName;
          }   


this all gets handled by $column->key (which holds the key you defined in the generator.yml file, for instance city_id/country_id/name for a client_company )

you can get the column for a key by calling:
$column = $this->getColumnForFieldName($key); 


tableNames can be acquired by calling $column->getTableName()
and ClassNames by calling $column->getTable()->getPhpName()
and PeerNames by calling getTable()->getPhpName().'Peer'

although I don't think you will ever need this if I did my work correctly Wink


Leon
Re: Building Own Generator [message #45329 is a reply to message #45292 ] Tue, 12 February 2008 02:05 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Update: almost there, but not committing this night.

todo: partials and saving from edit-pages (saving from list works)

after that, code-cleanup (mostly remove/replace old code and all remove commented code)


Leon
Re: Building Own Generator [message #45378 is a reply to message #24107 ] Tue, 12 February 2008 15:08 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
If you've got something working, check it in and I can help cleanup if you want.
Re: Building Own Generator [message #45380 is a reply to message #45378 ] Tue, 12 February 2008 15:40 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
OK I will, give me one minute Wink

Almost everything works now, except saving from edit-pages. I am working on that, it is due to the new field-names which are not handled.

A small bug is known when you change a value with a drop-down combo-box, this works, but the content of this field gets empty and when you sort the entire column gets empty. this is probably due to javascript and the new field-naming.

I haven't tested it on the sfFileStoragePlugin yet. Only on my country-city example...

A lot of clean-up is desired, old style of check-name derived from column-name, derived from column->key and class-name is now obsolete. everything is resolved from the column->key which is the same as foreign-key(s)/field-name.

I will fix one show-stopper and then commit.


Leon
Re: Building Own Generator [message #45392 is a reply to message #45380 ] Tue, 12 February 2008 17:43 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Commit complete, please note that this makes your current generator.yml files broken

Upgrade your generator.yml files by replacing table-names by foreign-keys!

Like country/name to country_id/name


Leon
Re: Building Own Generator [message #45595 is a reply to message #24107 ] Fri, 15 February 2008 18:16 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
grouping appears to be broken somewhere starting in getGroup, but even fixing it there caused the groups to show but not open. I'll look into it more when I get some time.
Re: Building Own Generator [message #45610 is a reply to message #45595 ] Fri, 15 February 2008 20:14 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Sorry was a little quiet this week, need to write some reports.

Today I am leaving to Austria for a week, I will be back at sunday the 24th.

About the grouping,
are you absolutely sure your genererator is correct? For me the grouping and master/detail is working.

Here some examples:


Grouping of city's per country
generator:
  class:              sfExtjsPropelAdminGenerator
  param:
    model_class:      City
    theme:            extjs

    fields:
      country_id/name:
        name: Country name
        params:
          editable: true
      country_id/abbreviation: 
        name: Abbreviation
        params:
          editable: true

    list:
      display:    [=name, country_id/name, country_id/abbreviation]
      filters:    [name, country_id/name]

      grouping:
        field:  country_id/name

    edit:
      actions: []


master-detail as in my graduation project:
generator:
  class:              sfExtjsPropelAdminGenerator
  param:
    model_class:      AssignmentParcel
    theme:            extjs

    related_tables:
      client_company:
        module_name: clientcompany
      agent_company:
        module_name: agentcompany    
    
    fields:
      assignment_id/subject:
        name:     Assignment
        params:
          header_valuePrefix:  "<i>Assignment</i>: "
          header_valueSuffix:  ""
      assignment_id/client_company_id/name:
        params:
          header_valuePrefix:  ", <i>Client</i>: "
          header_valueSuffix:  ""
      assignment_id/voyage_id/vessel_id/name:
        params:
          header_valuePrefix:  ", <i>Vessel</i>: "
          header_valueSuffix:  ""
      created_by/username:
        params:
          header_valuePrefix:  ", <i>Made by</i>: "
          header_valueSuffix:  ""
      assignment_id:
        class: hidden
          
      subject:
        name:     Subject
        params:
          renderer:  "return renderLinkWithBase('Parcel: ' + value, params, record, 'type=\"parcel\" assignmentid=\"'+record.data['assignment_parcel-assignment_id']+'\" assignmenttextcontent=\"Assignment: '+
record.data['assignment_parcel-assignment-subject']+'\"');"
      product/name:
        name:     Product
      country/name:
        name:     Origin
      quantity:
        params:
          renderer: "return renderWeight(value)"
           
    list:
      title:      Assignment overview
      
      display:        [=subject, product_id/name, country_id/name, quantity, stowage]
      grouping:       
        field:        assignment_id/subject
        display:      [=assignment_id/subject, assignment_id/client_company_id/name, assignment_id/voyage_id/vessel_id/name]

      peer_method:    doSelectLeftJoinAssignment
      
      actions:
        add_assignment:
          name:   Add new assignment 
          class:  btn_create
          handler_function: "App.openAssignment('create_assignment', '/backend_dev.php/assignment/create', 'New Assignment');"
        _separator:     -
        _refresh:       -
        _upload: -
        _fill:          -
        _pdf:           -
        _print:         -
      
    edit:
      display: []
      
      pages:
        general:
          title: Parcel General
          display:    [assignment_id, assignment_parcel_id, subject, product_id/name, country_id/name, quantity, stowage]
        bl:
          title: Bill of Lading
          display:    [subject]
        timelog:
          title: Timelog
          display:    [subject]
        surveyor:
          title: Surveyor
          display:    [subject]
        laboratory:
          title: Laboratory
          display:    [subject]
        report:
          title: Report
          display:    [subject]
        invoice:
          title: Invoice
          display:    [subject]
        finish:
          title: Finished
          display:    [subject]
      




Good luck and please keep posting on the forum, I will read everything when I'll get back!


Leon
Re: Building Own Generator [message #45611 is a reply to message #24107 ] Fri, 15 February 2008 20:20 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
I'm sure grouping on a foreign key will work, it's the grouping on a regular field that's broken. My generator doesn't have any foreign keys.

generator:
  class:                  sfExtjsPropelAdminGenerator
  param:
    model_class:          Tasklist
    theme:                extjs    
    adapter:              yui
    pjs:                  true
    list:
      display:        [ready, device, start, end, username, updated_at]
      grouping:
        field:        start


gets me an error about tasklist/start not in TaskListPeer
Re: Building Own Generator [message #45612 is a reply to message #45611 ] Fri, 15 February 2008 20:27 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Goodpoint never tested that...

Sorry I can't help you anymore, I am sure this shouldn't be too hard.

Initial Idea: test for a slash in the group-by parameter and if it doesn't contain a slash simple set the option of the grid to this field and everywhere else ignore the grouping


Leon
Re: Building Own Generator [message #46218 is a reply to message #24107 ] Sun, 24 February 2008 12:14 Go to previous messageGo to next message
Fusion  is currently offline Fusion
Messages: 1
Registered: February 2008
Junior Member
lvanderree,
I really like sfExtjs2Plugin (only found about it last night! Surprised )

Question, though: what license is it released under?
Is it GPL, LGPL, BSD..?
I may consider using it in a commercial project so I would really like to know.

Thanks,
-Chris.
Re: Building Own Generator [message #46224 is a reply to message #46218 ] Sun, 24 February 2008 13:15 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Hello all!

As from today I am back in business. Has there been made any progress last week? I didn't see any snv-commits but maybe some local improvements have been made.

@Fusion I am not the only one who is about the sfExtjs2(theme)plugin, but as far as I know it is all community work which can be used for whatever you like. No license has been added to it, but I think it would be far to let it match the symfony and extjs licenses. It would be nice however to return some community work, in the form of code-improvements, functionality-improvements, testing and providing feedback. This way we can together create a superb framework.


Leon
Re: Building Own Generator [message #47235 is a reply to message #46224 ] Thu, 06 March 2008 22:05 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
What has happened to the community?

I am currently writing documentation about my project (the beginning of my master-thesis, describing my project from company-centered-design till Development techniques like development-techniques and the Symfony framework). I only have 5 weeks left to make something to finish a test-version of my application, so soon I will continue the implementation.

Hasn't anyone else continued the development? The version which is currently in SVN isn't bug-free (to mention an understatement).


Leon
Re: Building Own Generator [message #47296 is a reply to message #47235 ] Fri, 07 March 2008 13:00 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
I am still working on things, just busy with a lot of work projects right now. Fortunatly, portions of the work projects, once working, can be made generic/configurable and pushed into the generator.

I'm putting the finishing touches on chained comboboxes in the filter tab now. I've also implemented some filter state and tabPanel state persistance with cookies.

I plan to keep contributing to the project as it is now the starting off point for most of my projects. The more of my common functions I get into the generator the less I have to override.
Re: Building Own Generator [message #47299 is a reply to message #47296 ] Fri, 07 March 2008 13:17 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
Great to here that it is the base of your projects. After I will be graduated (hopefully somewhere in June) I am planning to start my own company and will keep using this plugin as well as the base for my projects.

For now I think I will continue the development already this weekend, or maybe the beginning of next week.

Good to hear that the development is continuing not only by me Wink


Leon
Re: Building Own Generator [message #47332 is a reply to message #47299 ] Fri, 07 March 2008 15:48 Go to previous messageGo to next message
lukas  is currently offline lukas
Messages: 28
Registered: November 2007
Location: Switzerland
Junior Member
sorry leon!

i'm in the same state as KRaVEN above... therefore never writing here. Our Hosting-Panel is still undeployed thus no access available. All the work we done on that (and several other project) is pushed into our framework thirdBase.

You can read more about it here:
http://blog.codebase.ch/?p=31

yes, we're open to cooperate Smile

Regarding sfExtjsThemePlugin:
Some possible bugs / question regarding PJS:
- When i try to do something like town_id/country_id/name (town_id is in the table address) WHITOUT pjs it breaks. When i do it with pjs, it works.
- PJS does not work in the layout as presented in the blog above. This because PJS code is not loaded / executed in code which is loaded via ext load params / method (even if scripts: true). anybody an idea what's wrong there? For sfExtjsAppPlugin (see blog above) i didn't use PJS. does that have an impact?
- Some weird thing (non PJS): on tables with multiple row indexes i make grouped views. tough the jsonList-Request submits all aproppriate data, only one set is shown per group. (e.g. sf_guard_user_groups, grouped by group_id/name, primary key: group_id AND user_id shows one user per group no matter how many there are retrieved on jsonList)

One patch which does the following (all non-pjs only):
- Hack to eliminate "misspelled" camelize classes (like sfGuard...)
- Using credentials brought a lot of 'echo "\n ' text into the generated code. removed the echo "\n.
- The filter_add_handler directive in allows you to specify a function which gets the filter Panel formPanel as parameter. Used to export your filters.
- The list_action_handler: allows you to overwrite the common action handler: All the default actions are opened with this handlers. All the other actions can have a handler_url instead of a handler_function configured and will then be opened with this handler. The handler has to accept these params: url, action_name, action_title

The params are placed in app.yml thus systemwide.

The patch is attached (made with eclipse now). I hope it helps Smile

Leon's not alone. a lot of people are listening Very Happy

lukas

Re: Building Own Generator [message #47339 is a reply to message #47332 ] Fri, 07 March 2008 16:12 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
Quote:

- PJS does not work in the layout as presented in the blog above. This because PJS code is not loaded / executed in code which is loaded via ext load params / method (even if scripts: true). anybody an idea what's wrong there?

With PJS I've found if you're loading a pjs file into a div it needs to be inside <head> tags otherwise the scripts:true doesn't work right.

I use PJS a lot to load code for entire grids after initial render and it works very well for me. For a good example look at the code for the file upload action.

[Updated on: Fri, 07 March 2008 16:13]

Re: Building Own Generator [message #47755 is a reply to message #47339 ] Thu, 13 March 2008 13:12 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
KRavEN,

I still don't understand that pjs files are working flawlessly for you. When I enable the pjs implementation, my grid is a mess:
1. Its width isn't 100% anymore,
2. Only the headers of the grouped rows are shown, none of the rows belonging to the group will appear.

If I disable the pjs-switch "everything" works out fine.

The only difference when changing the pjs-switch is this code:
<?php if ($this->getParameterValue('pjs', sfConfig::get('app_sf_extjs_theme_plugin_pjs', false))): ?>
  use_helper('PJS');
  use_pjs('<?php echo $this->getModuleName() ?>/listJs')
<?php else: ?>
  include_partial('list_ajax_layout')
<?php endif; ?>


The code in the list_ajax_layout ad listJS files are the same.

The results:
NO-PJS result good
http://fun4me.demon.nl/~leon/TEJ-noPJS.png

WITH PJS result bad
http://fun4me.demon.nl/~leon/TEJ-PJS.png

I like to use PJS files, but for some reason (I suspect the loading order) it get all messed up. Any ideas about/experiences with it?

[Updated on: Thu, 13 March 2008 13:13]


Leon
Re: Building Own Generator [message #47761 is a reply to message #24107 ] Thu, 13 March 2008 14:05 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
Could you throw up a couple of test pages, one with it on and one with it off so I can take a look with firebug?
Re: Building Own Generator [message #47771 is a reply to message #47761 ] Thu, 13 March 2008 15:40 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I've created to projects on my web-server, its a copy of my graduation-project, besides the difference of setting the pjs-switch to true (in the app.yml file) they are identical.

pjs: off, everything OK
http://fun4me.demon.nl/tejohnston-pjs_off/backend_dev.php/

pjs: on, NOT ok.
http://fun4me.demon.nl/tejohnston-pjs_on/backend_dev.php/

you can login with admin: admin


Leon
Re: Building Own Generator [message #47776 is a reply to message #47771 ] Thu, 13 March 2008 16:28 Go to previous messageGo to next message
KRavEN  is currently offline KRavEN
Messages: 213
Registered: May 2007
Faithful Member
your problem is that with PJS on it includes the listJs.pjs file AND it includes the javascript in the body of listAjaxSuccess.php. If you go to the net tab in firebug and look at the response from backend_dev.php you will see what I mean.

Check listAjaxSuccess.php in your cache line 23 through 32 should look like:

$sfExtjs2Plugin->load();
?>

<?php
  // javascript layout 
  use_helper('PJS');
  use_pjs('tejohnsonston-pjs_on/listJs')
?>

<div id="sf_admin_container">

[Updated on: Thu, 13 March 2008 16:30]

Re: Building Own Generator [message #47787 is a reply to message #47776 ] Thu, 13 March 2008 19:23 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
First the good news, I am back in business,
fixed the first bug today (you can now again save from the detailed-edit-pages)

The slightly worser news, I don't understand it KRavEN...

The code in my cache for listAjaxSuccess is just like you described so without the include of list_ajax_layout.

I also see in firebug in the "Net" panel that listJs.pjs is loaded right after main.js

But as you can see, this doesn't work out.


I don't know what I should see under the repsonse tab of backend_dev.php? but when I look at the Script tab at backend_dev.php I see

389<div id="content">
390
391
392
393
394
395<div id="sf_admin_container">


which shows that the included listAjaxSuccess.php starts with sf_admin_container, and not with the javasacript.

Any new tips/ideas?


Leon
Re: Building Own Generator [message #47844 is a reply to message #47787 ] Fri, 14 March 2008 14:11 Go to previous messageGo to next message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
KRavEN, sorry sorry sorry...

I found out there was a difference between listJsSucccess.pjs and _list_ajax_layout.php, which was the cause of the broken grouping when using the PJS implementation.

However there still is one minor difference, and that is the width of the grid: when using PJS the grid does not have a width of 100%...

If you or anyone else knows what causes this problem, please tell me.

I will try to move more javascript in the PJS files, which makes debugging much easier.


Leon
Re: Building Own Generator [message #48341 is a reply to message #24107 ] Mon, 24 March 2008 00:48 Go to previous messageGo to previous message
lvanderree  is currently offline lvanderree
Messages: 652
Registered: June 2007
Location: Netherlands
Faithful Member
I've made a simple presentation to explain how I use the sfExtjsThemePlugin with Symfony to generate the pages I had defined in my functional design-sketches. It is not polished yet, but maybe anyone wants to take a look at it to understand how things work, or to give me feedback about how to improve it.

The main idea behind it is to quickly inform my supervisor why I use Symfony, with ExtJs (and this plugin) to implement the design-sketches in a real application, explain why it is a lot of work, and point at him what still needs to be done.

I've noticed their still are bugs in the generator, related to all the (different) naming of variables in ExtJs grids, data-readers, data-stores, JSON data, Php-objects. This does not really show up in this presentation (yet), since it is very hard to describe all these details in an understandable overview.

UPDATE: I've got an updated version of the presentation in my new post

[Updated on: Tue, 25 March 2008 13:44]


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