Archive for the ‘OSS & Tech’ Category

sfAdminThemejRollerPlugin: Symfony admin generator on steroid

Tuesday, August 25th, 2009

It’s been a while since I wanted to work on my own admin generator theme. In symfony 1.0 the default admin generator was not really nice, it became a little bit better in 1.2 but still not to my taste (purely subjective I must admit ;-) . For example, one thing get me mad is the css for the table list and the filter, I believe that the table list should be maximized and filters available only when we need them.
I spent quite some time to modify some admin generator in some projects but you always end up doing the same thing over and over (see this screenshot of what I have done with the list view based on a standard admin generator)…it was time to make things more to my taste. I now have a pretty clear idea of things that I would like out of the box from my new admin generator. Let me be more specific with the complete list of things I would like:

  1. Change css style to a more modern style (again purely subjective ;-) that can be changed easily. For this I am using jQuery UI with their new theme roller system. The plugin is packaged with only one theme but it is extremely (too?) easy to change to your favorite theme (long term will be to use the upcoming html5 grid).
  2. The filter box is hidden by default with a button to show/hide a modal window with the list of available filters. This allows to have a larger space for the table list.
  3. In the new/edit views fieldsets are replaced by tabs (again jQuery UI).
  4. Add a show only view, it makes sense for some application to allow read-only access.
  5. filters ala iTunes smart playlist, meaning you select fields you want to filter and add them (nice to have but not so important, although useful if you have a lot of filter options)
  6. Print preview (configuration in generator.yml): simply a non paginated table easy to print with sortable column (javascript grid style)
  7. live search (configuration in generator.yml): be able to quickly filter the table list while typing a few characters, ajax style. I did that before for one specific module, I now have to make it part of the admin generator.
  8. export to CSV format: we could have a modal window to select the fields we would like to get and export them or simply a list defined in the generator.yml (which can include getters that are not database fields).
  9. export to PDF: does it make sense at all, I am not yet sure!
  10. Import CSV to database: to be able to simply upload a csv file of data to import through the admin generator.

The first 3 items are easy to do just by modifying existing admin generator templates and are indeed already packaged in the plugin. The rest need more work (still learning how admin generator are working deeply).
I am also trying as much as possible to keep all actions accessible without javascript and make sure that I do not break any default admin generator css classes and ids in case you need them.

Stop talking and show us the code“…here you go! It is published as a symfony plugin at http://www.symfony-project.com/plugins/sfAdminThemejRollerPlugin, meanwhile here are some screenshots:

jroller-list-themes.png
jroller-list-filters.png
jroller-form.png

How to install?

./symfony plugin:install sfAdminThemejRollerPlugin --stability=beta

When I say beta, it is beta ;-) I am not fully satisfied with the code and still thinking about the best approach for some features (not mentioning it’s my first play with admin generator). Feel free to give me feedback.
I will publish the code on github later to ease collaboration if any of you are interested. Anyway, it’s php right? so you can play with the code right now!

How to use it?

./symfony --theme=jroller doctrine:generate-admin

or if you have an existing admin generator, simply modify your generator.yml file with

theme: jroller

instead of theme: admin.

Configuration

I currently package jQuery 1.3.2 and jQuery UI 1.7.2 to make sure it can work out-of-the-box, but it is also easy to specify in your app.yml file that you do not want to use those versions (or because you already include those libraries in your project) and include your own jquery and UI.
jQuery UI is using at the minimum: Tabs, Dialog (Drag and drop and resizable recommended).

# inside your app.yml file
  sf_admin_theme_jroller_plugin:
    web_dir:      /sfAdminThemejRollerPlugin # specify specific folder where to pick your jquery stuff, ui and themes.
    use_jquery:   true # default. use the packaged jquery/UI
    theme:        redmond # default.
    css_reset:    true # default. reset default css (from Blueprint CSS)

What’s next?

I will try to implement the rest in the coming months (I just found out that sfDoctrineAdminGeneratorWithShowPlugin start to implement some of my ideas), again feel free to contribute to speed up the process.

Bugs? no way!

  • I still have a pixel problem with the caption and tfoot of my table, if anyone knows how to solve it?

You will probably find bugs, please report them.

Public SVN for CS4U

Tuesday, January 15th, 2008

Hi all,as promised earlier, here is the svn access to my billing system application source code:  http://svn.estadieu.com/cs4u/ . Enjoy it!It was my first symfony project, therefore the code is most probably not perfect :-( I hope it can be useful for some of you. 

how about a Document Management System?

Wednesday, November 7th, 2007

One of my client wants to change its current DMS used to manage safety, quality and environment documents (and based on MyDMS). After discussions we identify a list of basic features to develop a new version from scratch. One of the key element was to decide the technology we will use, and guest what what came on the top: Symfony.

One of the objective would be to release it later on as an open-source solution since there is no such solution yet in the symfony world. So what is best to start an open-source project than asking you guys what you would expect from a DMS?

Here is a first quick list that we identify already:

Generic

  • Open-source solution
  • Multi-languages support (I18N),
  • Fast search engine
  • RSS feeds

Document classification: Categories and Tags

  • List categories (folders) and attached documents according to user credential,
  • Allow document to be classified into several categories at the same time without duplicating the document itself,
  • Tags (keywords) for easy search with tagcloud,
  • Organization categories to allow view per department, unit,…
  • Notification list on categories

Documents

  • Upload any type of documents (can be specified of course),
  • Document versioning to keep track of all versions of a document + locking system for edition,
  • Document publishing status available: waiting approval, approved, revoked.
  • Document security status: public, internal use, restricted, confidential,
  • Document types (e.g. ‘Manual’, ‘Work Instruction’,…)
  • Expiration system for document with email alert to author.
  • Document translation manangement (a document can be in several languages for each version),
  • Document can have attached (or linked or related) documents (e.g. Work instruction have the complete list of related records)
  • A document can have no electronic document attached but simply a reference to a physical document.
  • Notification list per document
  • Star ala Gmail to create a list of personal favorite documents

Users

  • Simple workflow for reviewing and approving document before publising,
  • Comments on document,
  • Favorites (stars ala google): user documents to easily find documents user need the most and allow email alert whenever it is update,
  • personalized content: list of new document since last login, alert when a user document has received a comment,…
  • personal zone to store private documents

Advanced features:

  • Full-text search including search within PDF content (Xpdf or pdfstring ?)
  • LDAP integration
  • Barcode integration (Mozilla Prism based?)
  • Drag’n'drop of documents from desktop to the app as well as to move folders, documents,…
  • WebDAV support/integration?
  • Integration with desktop office tools?
  • Option: geolocalization for documents
  • dynamic folders (ala intelligent playlist in iTunes) based on criteria. Can be created globally or on a personal view. Can be created based on a specific search.
  • Notification messages on dynamic folders change or saved search.
  • RSS and iCal subscription for planned events such as time to review a document, expiration date…
  • Special type of document: groups of photos (allow a slideshow,…)

I have identified a certain number of existing Symfony plugins that can be useful for such a project, namely:

Optionally we can use as well:

Yes, it is now your time: share your view on DMS to see how we can start to build a generic enough solution for all. We are first looking at web-based features, we can imagine to have a 2nd phase for more advanced features that rely on desktop heavy solution…keep this for next year!

NotMac: a .Mac for all

Friday, October 5th, 2007

I love those guys! I went back to notMac Challenge website to see if someone was able to finally find a solution to simulate .Mac service from Apple with open-source code…and what did I find? YES, a guy named Ben Spink proposed a solution that seems to work. I hope I can try it soon…

Now there a business coming: setup a .mac competitor for 1/10 of the price!

NotMac