Category: CreaLabs

P4A 3 continues growing

Following the previous post, here you have the new things I’ve coded:

- POT file for the new translation system was prepared and committed to p4a/i18n/templates/p4a.pot
- P4A_Generate_Default_Label() global function was added, it takes a string such as “this_is_field” and returns “This is a field”, useful to generate labels from field names and other things
- P4A_Button and P4A_Widget were ported to P4A_Generate_Default_Label() to generate default labels
- default labels are now generated with ucfirst function instead of ucwords
- P4A toolbars and P4A_Table were ported to the new translation system
- translations are now applied at rendering time, not at build time
- P4A_Highlight_AccessKey() global function was added
- P4A_Widget::setLabel() does not automatically create accesskey now, it would cause problems with translations
- P4A_Object::intercept() and P4A_Object::actionHandler() now turn action name to lower before processing
- P4A_Menu now uses P4A_Highlight_AccessKey()
- P4A_Widget::setValue() and getValue() methods were removed because they’ve not all widgets have a value
- P4A_Button::setValue() and getValue() methods were removed, use setLabel() and getLabel() which are logically correct
- README file was updated, dropping some old browsers support and removing PHP4
- P4A_Button are now rendered as HTML buttons
- P4A_Button::setVisible() method now has a second parameter “visible”, check the reference
- all constructors were converted to PHP5 naming (public function __construct)
- P4A_Button::setIcon() now supports a path to an image instead of the icon name
- “currency” format/normalize was removed, it was never used and should not be handled in an application contest (you won’t print € only because your application is running with an european locale)
- P4A_Href widget was removed
- P4A_DB::limitQuery(), selectLimit() getError(), getNativeError(), query() and close() methods were removed because they can’t work with Zend_DB
- P4A_DB::rollback() and select() methods were added
- P4A_DB::fetchOne(), fetchCol(), fetchRow() and fetchAll() methods were added for Zend_Db naming convention compatibility
- P4A_Fieldset now uses getLabel() instead of getTitle() to render its legend, setTitle() and getTile() are now deprecated
- P4A_DB::get*() and query*() methods are now deprecated

and my updated TODO:

- check p4a_button sizes when we have a toolbar with buttons with icons and without icons
- implement application level translations
- port sample_i18n to the new translation system
- spread about the new translation system so users start translate
- check db_source for aliases
- try to detect the decimal format and use it during formatting
- check p4a_table ordering
- custom formatter for date/time/etc
- make ui.datepicker.js work with our new date format definitions (maybe call p4a by ajax to reformat)
- change p4a_table_col image handling, we’ve to pass by index.php and not phpthumb.php
- integrate p4a_base_mask in core and port samples to it
- remove p4a_icon and port its funcionalities inside p4a_image
- auto addaction on intercept and implementmethod when the action is a browser action
- implement db_source::setquery, maybe separate db_sources
- implement p4a_table::addCheckboxCol

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

P4A 3 starts roaring

Back from the weekend in Dublin it’s time to write an update on my nightly coding sessions on P4A 3.

Well, a bunch of things were already done, porting to Zend Framework seems to be easier than what I expected, I’m working hard (you know time is always low) and I still have many many things to do but things start working and this is really exciting.

Here you have a changelog of what I did in the past weeks:

- Zend Framework 1.0.3 was added
- Database connection now relies on Zend_DB PDO adapters
- check_configuration.php was ported to Zend_DB to check the database connection
- P4A_DB_Source was ported to Zend_DB (not completely done and tested, check the TODO list)
- P4A_DB_Source::setFields() syntax was changed, now you must provide only fields from the main table and not from joines ones
- P4A_DB_Source::addJoin() syntax was changed, join type param was dropped and now you have a third param to pass the columns you want to extract from the joined table (default extracts all columns)
- P4A_DB_Source now has many methods to add joins: addJoinCross(), addJoinFull(), addJoinInner(), addJoinLeft(), addJoinNatural(), addJoinRight()
- P4A_I18N does not manage charset anymore, only UTF-8 will be supported from now on
- P4A_I18N numbers format/normalization now relies on Zend_Locale
- P4A_I18N dates format/normalization now relies on Zend_Date and Zend_Locale
- P4A_I18N::getCountry() was renamed to getRegion()
- P4A_I18N::autoFormat() was renamed to format()
- P4A_I18N::autoUnFormat() was renamed to format()
- P4A_Number format/normalization class was removed
- P4A_Date format/normalization class was removed
- all P4A i18n format definition files were removed
- translation messages files were reorganized and renamed
- days and months translations were removed from translation messages files (now they’re provided by Zend_Locale)
- yes/no translations were removed from translation messages files (now they’re provided by Zend_Locale)
- boolean normalization works much better now (eg for italian language: it detects “sì” or “si” or “s” without case difference and the same engine works for every language)

and a TODO list of what I need to keep in my mind:

- “time” format/normalize
- “currency” format/normalize
- move translations to Zend_Translate (in progress)
- check db_source with multivalues
- check db_source for aliases
- make ui.datepicker.js work with our date format definitions
- rename constructors to __construct

Many of you would like to know what we’ll do with the graphic layer… actually we’ve decided to stop experiments on extjs and other javascript frameworks, they’ve been too time-consuming and we found bugs and limitations thus, at the moment, we’re keeping the old rendering layer. Being real, I think that P4A 3 will still generate the HTML markup but we’ll rewrite the CSS from scratch without relying on javascript frameworks that seem to not fit our needs.

Stay tuned! ;-)

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

P4A 2.2.2, hot fix for a db_source bug

Changelog:

- Major bugfix on P4A_DB_Source::saveRow(), the patch from Edr (introduced in 2.2.0) was removed and a few checks were added to prevent inconsistency
- some little bugs on P4A_DB_Source were fixed

Download P4A 2.2.2

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

P4A 3 rendering layer discussion

This post will not be easy to write… I’ll try to explain you what kept us really busy in the past 2 weeks. ok a screenshot could help me :-)

In the P4A 3 roadmap post, I told you about a new widget rendering system… I didn’t post more technical info intentionally, I wanted to create a bit of suspense :) but I also wanted to do some tests before publishing news.

For P4A 3 we’d like to have a killer graphic with killer features (resizable widgets, border layouts, beautiful and powerful menu and so on) thus we looked to the biggest javascript frameworks out there: extjs and dojo. Both have great features and both have issues.

Extjs as really a killer graphic layout, and it’s released under LGPL3 (developers wrote some licensing notes that I can’t really understand… actually I think that those notes could conflict with LGPL3 itself) but it has not an open SVN and development is quite closed. Another note: only community support is for free.

Dojo is more polite with licensing and it’s released under BSD, but I don’t like the graphic layout too much and the way you’ve to code your applications writing a non-standard HTML with dojo-only attributes. It has some accessibility features.

Some considerations:

  • In my tests I found bugs in both frameworks
  • porting P4A to one of these tools is a “1 way road”
  • relying the rendering layer to a 3rd party project means we’ve to 1000% trust this project
  • these tools do not have a good print CSS support

We would have a 3rd option: continue on our road with quite standard HTML but rewrite our CSS from scratch with a CSS reset and a modular design which will give us better control.

I wrote extjs developers to know if they’re interested in a collaboration with P4A, I’m waiting for an answer but I’m looking for your considerations too, community it’s important to me, please let me know what you think and what are your experiences with those tools (or suggest others).

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

P4A 2.2.1, first maintenance release for 2.2 serie

Changelog:

- multicheckbox field and multiselect field now support saving in single table field
- P4A_Field::setMultivalueSeparator method was added
- a bug with images on p4a_table wal solved
- rich_textarea “Full” theme was added
- jQuery::form was updated to 2.01
- a bug with empty “file” fields submitted with an ajax call was solved

Download P4A 2.2.1 here

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

Remastering an “Ubuntu alternate” ISO with Ubuntu Customization Kit - the complete guide

You have an Ubuntu alternate ISO and you want to customize it, to do things with ease you choose to do that with Ubuntu Customization Kit which will handle most of the tasks for you.

Preamble

This guide is written with the SVN version of Ubuntu Customization Kit, thus somethings (actually only minor things such as log messages) could be different from the ones you’ll get with your copy of UCK.

Prerequisites

To remaster an Ubuntu alternate ISO you need to:

  • be running an Ubuntu based distro on your host system in order to install and run UCK successfully
  • have UCK installed in your Ubuntu box. In order to install it go to the UCK’s website, click download and select the debian package. After downloading the package install it with the usual tools (dpkg or gdebi or whatever).
  • have an Ubuntu alternate ISO downloaded somewhere in your hard disks.

First step: extract the ISO

An ISO image is a single file, you can’t modify it in any way keeping it “as is”, thus you’ll use UCK to extract its contents to a directory with this command:

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-unpack-iso ubuntu-7.10-server-i386.iso
Mounting ISO image…
Unpacking ISO image…
Unmounting ISO image…

Ok all went perfectly, now you’ll find the contents of your ISO in the “~/tmp/remaster-iso” directory

Second step: prepare the remastering environment

This step creates a new package repository inside your remastering directory (~/tmp/remaster-iso/pool/extras), in that repository you can now put all the packages you want to be added to the new ISO.

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-prepare-alternate
now you can copy your packages in /home/fabrizio/tmp/remaster-iso/pool/extras, customize preseed files or do other customizations

Third step: adding new software

Alternate ISO system only manages deb packages thus you need to have deb packages for all the software you need to add to your new ISO.
There’s only one thing you have to do, copy the deb packages to the ~/tmp/remaster-iso/pool/extras directory, that’s all.

IMPORTANT: Added packages are not automatically installed by the Ubuntu installer on my target system

If you add software to the extras pool you can have two reasons:

  • you want those packages to be automatically installed into your target system
  • you want those packages to be available on cd/dvd to be optionally installed into your target system after a choice of the user (Ubuntu text installer handle this within “tasksel”)

If your option is the first then adding the deb packages to the extras directory won’t be enough, you’ll have to modify the preesed file, what is a preseed file? It’s a file which tells the Ubuntu installer what to do, it’s a way to script it.

Preseed files have their own syntax but for the purpose of this small guide I suggest you to take a deep read of the “modify installer behaviour using a preseed file” guide.

The “install cd customization” guide is really big but you don’t need to study it all, you can read only the “modify installer behaviour using a preseed file” section just because UCK covers all other sections for you.

Forth step: modify software that already was in the original ISO

Sometimes you could want to modify default configurations of software which is bundled with the default ISO, in order to do that you’ve to:

  • locate the original deb package within the remaster-iso/pool tree
  • delete it
  • create a new deb package for the software, with all your customizations inside it
  • copy your new deb package to the position where the original one was (eg: ~/tmp/remaster-iso/pool/main/a/apache2)

You need to delete the original package to avoid possible conflicts.

Fifth step: finalize the remastering environment

Ubuntu alternate ISO system works with signed Ubuntu repository thus you’ll have to regenerate all the metadata files for your updated/new repositories and than sign it with GPG. If one of these conditions are not met the installer will hang telling that your ISO is corrupted.

When I was writing alternate support for UCK this was one of the most difficult part to code and this would be difficult for you too if you were not using UCK :)

If you don’t have it, create a personal GPG key before going ahead. Remember also to write down the ID of GPG key, it should be printed by the key generation process or you can read it with the gpg --list-keys command.

Now simply let UCK do the work for you with:

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-finalize-alternate 691D19E1

UCK will then do a lot of things, download files from the Internet and do all the tasks we were talking before, the operation could last a few minutes and you’ll see a lot of log lines. You’ll be asked to type the password for your GPG key, this should happed 3 times.

When the process will be finished you’ll be ready to repack your ISO.

Sixth step: pack your new ISO

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-pack-iso

A lot of log lines will be printed in this phase too, don’t worry about those if you don’t see any strange error message.
Ok that’s all, finally you did it, where’s your new ISO file? Here:

fabrizio@fabrizio-laptop:~$ ls -lah ~/tmp/remaster-new-files/
totale 501M
drwxr-xr-x 2 root root 4,0K 2007-11-27 11:49 .
drwxr-xr-x 5 root root 4,0K 2007-11-27 11:49 ..
-rw-r–r– 1 root root 500M 2007-11-27 11:49 livecd.iso

Now you’re free to burn it, test it with qemu/virtualbox/vmware or whatever ;-)

Closing notes

This guide should be pretty exhaustive, if you encounter errors, misspellings or have any suggestion, please feel free to drop a comment!

And… remember to DIGG this guide using the button here below :-)

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

Ubuntu Customization Kit 2.0.1

A small maintenance release to fix a few bugs, mainly focused on the “alternate” ISO remastering.
Here you have the complete changelog:

GUI:

  • version number shown in uck-gui was fixed

Backend:

  • when unpacking an “alternate” ISO now we don’t try to parse the filesystem manifest
    because it doesn’t exist
  • uck-remaster-finalize-alternate now can handle new releases of ubuntu-keyring package

Package:

  • fakeroot dependency was added

Links:
Download UCK 2.0.1
UCK’s official website

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

P4A 3.0 roadmap

ok here you have:

  • brand new widget rendering system, it will provide a new experience from the users point of view, a richer set of widgets and the best browser support (we’re doing deep tests right now, more info will follow)
  • PHP5 only
  • add Zend Framework
  • replace adodb with Zend_DB
  • define which database engine will be supported (I think MySQL, PostgreSQL, Oracle, SQLite) and drop support for all the others
  • solve definitively all the problems with all supported databases
  • replace our date parsing/formatting library with Zend_Date
  • drop all localization formats and use Zend_Locale’s (which uses unicode.org formats)
  • replace our numbers/currency formatting library with Zend_Locale
  • replace our translation library with Zend_Translate
  • make every output string to be translated and make the translation system work the way gettext work (making possible to include partial translations)
  • create a tiny php5 optimized library to replace phpThumb
  • completely remove PEAR

Yes, it will be a huge, massive and killer release, I promise it will rock!

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

P4A 2.2 is finally out

This is the month of the big releases :-) first was UCK 2.0 a few days ago, now it’s time for P4A - PHP For Applications 2.2!

Highlights of this release:

  • Prototype/scriptaculous were dropped and jQuery was added. Thanks to jQuery and some wonderful plugins we added a new color picker field type, the ajax file upload feature, some great improvements to the popup system also with the ability to block the underlying interface and a beautiful audio/video preview system.
  • Answering to many request the tooltip system was implemented, $field->setTooltip() and you’ve done the work of providing information about fields on your mask.
  • Another requested feature: field autocomplete, similar to the google suggest one, enjoy it
  • A smooth “helpers system” was introduced, now everyone can really write plugins for P4A, overriding core mothods without having to patch framework’s file (this only works with PHP5)
  • The getid3 library was added, its work is to read all data from multimedia files and pass them to P4A that will use them and store them. Now we have a better width/height/mime-type detection for many and many multimedia file formats.
  • …and many many improvements and bugfixes, check the changelog for the complete list

Upgrade:
You should have no problems directly upgrading from 2.0.6 to 2.2.0, otherwise write us on the help forum!

Download:
Can’t you wait? Here you have:
P4A 2.2.0 download

Future:
You already know that we can’t stop, things are already moving… we’ll publish more info very soon, also because I’m going to commit some preliminary tests for the next big step: P4A 3.0. Don’t miss it, I swear you’ll like it.

Technical note:
If you use P4A SVN, please switch to the 2.2 branch and don’t use the main trunk anymore!!! That’s because we’re working on it for P4A 3.0!

see you :)

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google

Ubuntu Customization Kit 2.0 is finally out!

It’s been a long journey, the new release is out after more than 6 months of work, adding features and fixing bugs thanks to the help of the community.

What’s the main goal of UCK 2.0? Becoming the de-facto standard base for Ubuntu remastering operations.
How this goal is achieved? Building a complete and stable API system.
Looking at the new UCK you’ll notice that we’ve splitted all the features in small scripts that could could simply include in batch processing or more advanced remastering software.

A deep look at the binaries:

uck-gui
uck-remaster

These are the 2 files you already had in previous releases, the first is the GUI system to easily access the most common functionalities and automatically build a custom Ubuntu ISO without dealing with CLI. The second one is the main backend point of access. This is called by uck-gui to script all the remastering steps. You can use it if you save the configuration files created by uck-gui for a re-processing.

But the most important thing, the API I was talking about is here:

uck-remaster-chroot-rootfs
uck-remaster-clean
uck-remaster-finalize-alternate
uck-remaster-pack-initrd
uck-remaster-pack-iso
uck-remaster-pack-rootfs
uck-remaster-prepare-alternate
uck-remaster-remove-win32-files
uck-remaster-unpack-initrd
uck-remaster-unpack-iso
uck-remaster-unpack-rootfs

Use this scripts to access to ALL the features of UCK, also minor ones that are not used by the GUI. If you want to take a quick look to the options check UCK API reference.

You can notice a small utility to quickly remove win32 related files and a set of scripts to work with alternate ISOs (one of the most difficult part of the game…).

Future?
As I already told I wish that we could join reconstructor to build THE solid Ubuntu remastering framework, much more helpful and optimized that the DELL’s DRU.

I think the core system is pretty complete now, we could add more “bling” features trying to automate tasks such as gfxboot/usplash customization and so on but… we still have to think a bit about that, stay tuned :-)

Download links:

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google