Marco's Component Maker for Joomla! 2.5 and 3.x

marco component's builder for Joomla! 1.5

Creating components for Joomla! 2.5 and Joomla! 3.5 is a very time consuming activity because you have to write an high number of file to manage every single piece of information, not only at DB table level, but also at DB field level.

However much of this code is just a mechanical writing... So why rewrite it every time?

This is why I wrote Marco's Component Maker for Joomla! 2.5 and Joomla! 3.5 (formerly Joomla Component Builder), for me it was useful, I hope it is for you.

 

Building components for Joomla!2.5 & Joomla!3.5

 

New version 2.5.01: Joomla! 2.5 and Joomla! 3.x support

but this is not a good news..

Please Note:
Joomla extensions' team has eliminated the "Tools" category and they will no longer allow listings of tools like this.
So, most likely, this will be the latest release of 'Joomla Component Builder', all plans for J3.5 are suspended.
Please note also that instructions in this page could be out-dated and there is no more support; refer to the comments at the end of the page for a little help.
Sorry, marco

 

"piutost che niènt, l'è mei piutost"

After the joomla's team decision, we released a very alpha version, so don't belive all works fine with code.

We released this alpha only for give a little help with repetitive actions to developers, because, how we said in the heading "rather than nothing, it is better rather" (idiomatic phrase in the old slang of Milan).

 

Scaffolding the CRUD

The "database first" approach

This is the way I'm used to walk when I'm programming. First I design the database structure, with entities and relationships, then I write the code to manage the data.

This program reads the database structure, lets you to select tables and fields and it writes the scaffolding structure for the CRUD, so you have (almost) only  to implement the business logic code.

You can create the CRUD for a lot of tables in a few minutes. Of course this program is not perfect, but it will speed up your work considerably.

 

 

FEATURES

  • generates full working components
  • retrieves the necessary data directly from a MySQL database
  • Create controllers, models, views, tables and templates for any of the selected tables
  • auto determins primary key field (must be numeric)
  • creates the files needed to edit individual records and to display the listing of tables
  • generates installable components
  • is based on customizable templates to generate the php files of Joomla
  • templates are based on the component com_hello so you can refer to the documentation of Joomla!
  • Joomla 2.5 and 3.x native code generation but still alpha

 

REQUIREMENTS

  • runtime NET 4.0+
  • MySql Connector-Net 6.4.4+ from http://dev.mysql.com/downloads/connector/net/. please note: latest connector doesn't register themself into 'Reference Assemblies' so 'MySql.Data.dll' in in to the package. may be you don't need to install the connector. try without install first.
  • a mysql db access via TCP / IP installed the tables containing the data for the management of which is to create the component
  • a little 'patience as it is still in beta ...
  • knowledge of PHP programming and management of MySQL server. This is a tool for developer, NOT A TOY!

As you understood, this is a machine translation. Not always I have time to translate the text, so I limit myself to some corrections: sorry...

 

Creating the MVC CRUD (scaffold)

INSTRUCTIONS 

Please, read carefully the instructions and the articles about the sample component before asking for help. The program is provided free, but without any support. anyway I try to respond to every mail.

1.

please, READ THIS FOXED PAGE till the end. thanks.

download the package: Joomla! generator components (downloads are at the end of the page, before comments) and unzip it in a folder.

 

2.

note: in v2.5+ you can also edit setting for mysql server from program data grid

change JoomlaComponentBuilder.exe.config (marcoComponentMaker.exe.config since v 1.1) to meet your MySQL server settings and add the connectionStrings

<?xml version = "1.0" encoding = "utf-8"?>
<configuration>
<connectionStrings>
<add name = "testserver" ProviderName = "MySql.Date.MySqlClient "connectionString =" Server = 192.168.10.76; vmtest1 Database = uid = root; =;"/> Pwd
</ connectionStrings>
</ configuration>

you would enter:

  • mnemonic IP address or server (Server)
  • database name to use (Database)
  • username (UID) [must be able to see the tables needed to component]
  • Password (PWD)

 

Note on MySQL Connector 6.2.2:

This version of the connector has a bug: the insertion of a key without the corresponding value generates a runtime error, so if you wish to access the DB without a password, and you omit the value for password, you have not to insert the Pwd keyword.

the connection string, instead of:

<add name="testServer" providerName="MySql.Data.MySqlClient" connectionString="Server=192.168.10.76;Database=vmtest1;Uid=root;Pwd=;"/>

becomes:

<add name="testServer" providerName="MySql.Data.MySqlClient" connectionString="Server=192.168.10.76;Database=vmtest1;Uid=root;/>

(ip and databases values are just examples)

 

Newer MySQL Connector driver:

To use a new MySQL driver with this build of the program open marcoComponentMaker.exe.config and locate the line

<bindingRedirect oldVersion="6.2.3.0" newVersion="6.2.3.0"/>

insert the driver build version as newVersion pararameter.

At the time of writing, the latest version of the mysql connector is 6.3.5, so, if you have downloade this one, change previous line to:

<bindingRedirect oldVersion="6.2.3.0" newVersion="6.3.5.0"/>

 

 

3. run the program.

fill in the fields:

  • Component Name: the name of the component
  • Safe Name: the name (without _ or other strange characters, using only lowercase letters) for use in models. ... Controllers
  • Table prefix: used to install Joomla (Prefix Table) [part of the name to be replaced with'#__', typical 'jos_']
  • License: license for generated files (do do)
  • Render "text" fields as: default renderer for text type(tinytext, text, mediumtext, longtext) fields
    • textarea: default html <textarea>
    • rte editor: Joomla! rte editor
  • Render "datetime" fields as: default renderer for datetime type(date, time, timestamp, datetime) fields
    • calender: Joomla! js calendar
    • string: default html <input>
  • Output Version: targeted Joomla! version. Note: code generated is J3 compatible: no need to select J3.0.
  • Generate translation file: create a translation file for each selected language (you have to translate... of course)

 

4. Select the DB server

You can edit setting for mysql server from program data grid. Yuo can add, edit or remove servers. remember tha you also have to set a schema (ie a database)

 

5. Select the tables to use.

Select the database tables for which will be created the scaffold (or CRUD or BREAD or the f***ing bizword of the moment).

fill in the fields:

  • Select: Select the tables that will be part of the component
  • Table Name: (read only) the name of the table in the DB
  • Single record object handler name:The name used to create the objects needed to interact with the table recordset (default; the name of the table withou prefix)
  • Recordset object handler name: The name used to create the objects needed to interact with the single record (default; the name of the table withou prefix + 'list')

 

6. Select the fields to show and edit.

the program parses the DB and shows the fields in every table

 

use tab navigation to select the table to edit. These options works only on BE (back end)

  • Field name: (read only)
  • Field type: (read only)
  • Show in list:show field when list records (default: primary key, `id`, `name`, `title`, `publish`, `published`, `ordering`, `access`)
  • Search:use field for search records in table (default: all text type fields)
  • Show in edit:show field in edit form (default: all but primary key)
  • Get Field Data:generate method in record list model to get specific field values (see code comments for help)
  • Foreign key: reserved for internal team
  • Render As:use a specific input type for rendering (input, text area, rte, select, boolean radio, calendar). 
  • Required: field is mandatory in editing
  • Validator: generate models/rules php file for validation. JS not yet supported
  • Comment: (read only)

Please pay attention!
'Get Field Data' doesn't check if method name is valid. so if you select the field 'name' will be generated the getName() method overriding the JModel->getName(). In doubt add a suffix to auto-generated method! (fixed in 1.5.2.0+)

 

7. Set parameters.

Not yet implemented. Options (preferences) for component. Does'nt work: press 'Next Step'.

 

7. scaffold the component.

Create the component for Joomla! in a subdirectory in the folder where you ran the progam (com_ [Safe Name])

 

8. Editing the generated code.

At this point you will:

  • correct form of editing data in forms of back-end com_[SafeName]/admin/views/[TableClass]/tmpl/default.php
    • fix javascript control
  • designing the layout of views in the front end in com_[SafeName]/site/views/[TableClass]/tmpl/default.php
  • obviously add the logic of the component in the controller;)

 

 

Supported OSs

The program requires Microsoft. NET 4.0+. Version for Joomla! 2.5 and 3.x will be released only for the Windows environment (Windows: XP, Vista, Windows 7)

May be it can run on Linux or Mac under Mono, but it is not tested nor supported.

Important Note: For more details, or for troubleshooting installation issues, refer to the support of Microsoft, Mysql or Mono for your operating system.

 

 

Trouble Shooting

Here I collected some error messages and the explanation of problem. Please do not ask help about MySql Server or .NET / Mono configuration.

Could not load file or assembly 'MySql.Data'

This error means that MySql connector was not properly installed: usually this is not a marcoComponentMaker issue.

  1. Be sure to have full .NET 2.0 (or greater) and MyQql connector installed; refer to Microsoft and/or MySql documentation/help.
    If you installed the connector properly you should have it listed in Control Panel/Software; if it is not present try again to install it.
  2. Update the reference to library in marcoComponentMaker.exe.config config file
    Should look like:
    <bindingRedirect oldVersion="6.2.3.0" newVersion="6.3.6.0"/>
    6.3.6.0 is the latest version at time of writing. MUST match the installed version of connector!

Unable to connect to any of the specified MySQL hosts

This errors occurs when Mysql server does not accept connections from remote/local clients.

  1. Ensure socket connections are enabled or bind-address is properly set in my.cnf; check also the port used for connection (usually 3306).
    Configuration options may change: refer to MySql server documentation.
  2. Check (personal) firewalls.
  3. If you are trying to connect to a remote server, ask your provider if you can access the sql server from outside the network (and how). Usually this is not possible.

You can use MySql tool to check connections and analyze network problems.

Access denied for user 'aUser'@'aNetwork' (using password: [YES|NO])

Username and / or password are wrong or a grant is needed for user. Refer to MySql documentation.

 

History:

planned for next versions (some time in the future, ...but seriously)

  • J2.5 per table ACL
  • js validation code generation
  • move every 'generated code' template in external resource
  • full xml metadata for menu items
  • full foreign keys support
  • j2.5 per table-> row ACL (low priority)

 

Apr, 4, 2014 - v 2.5.02 Alpha

  • fixed editing when PK is not `id`
  • great work on translations
    • fixed menù translation
    • implemented sys language
    • better translation's keys generation, no more duplicated items
    • used Joomla string for common operation
  • fixed mysql 5.5 missing ';'
  • template improvments
  • fixed models/rules files generation
  • added model/fields generation
  • improved install file: now it supports 'per dir' file inclusion. it's easier to add file to project

Jan 9, 2013 - v 2.5.01 Alpha

  • fixed controller name
  • fixed pagination
  • better translation handler

Jan 7, 2013 - v 2.5.00 Alpha

  • Joomla! 2.5 support
  • Joomla! 3.x support

Jan 13, 2011 - v 1.5.2.0

  • Joomla! 1.6 support
  • generation of multiple translation files
  • no more use of global vars ($mainframe, $option) both J1.5 and J1.6 code
  • minor code improvements

Dec 29, 2010 - v 1.5.1.0

  • support for translation files
  • more input render types (string, text area, rich text editor, calendar, select list, boolean radio button)
  • field by field rendering control
  • minimun support for related tables (foreign keys)
  • selection of fields for list/editing
  • selection of searchable fields

Jun 12, 2010 - v 1.5.0.0

  • no more mandatory fields in table (id, ordering,published)
  • automatic recognition of primary key (no need that there is `id`, but must be numeric)
  • generation of submenu for navigation between controllers, no more need to add navigation manually
  • back end table list with sortable fields list & filter
  • automatic rendering based on DB field type (input/textarea/rte/calendar)
  • input validation, based on DB field type, before saving data
  • configuration file management for generated component
  • more security checks

April 13, 2010

  • maintenance release for mysql connector 6.2.3

April 5, 2010

  • Added checks on the names of objects and on the structure of db
  • Added checks for mandatory fields
  • Improvements in PHP code

February 13, 2010

  • no new release: but Linux and Mac OS X tested!

December 17, 2009

  • See Italian Text (sorry...)

December 10, 2009

  • be: moved textbox first order of sliders
  • be: moved pages are included out of the loop
  • BE: fixed bug which delete the fields and ordering published
  • BE: added indentation in view template
  • be: table, correct the comment with bars \ \
  • BE: model, proper initialization of the new object by retrieving the values from table
  • BE: view.html.php, proper inspection new item instead of $ hello $ data
  • BE: view template, aggiuntoscheletro javascript to check
  • BE: model, input methods to sort the records
  • BE: controllers, embedded controllers in the specification of all the entry point redirects

November 20, 2009

  • initial release

 

Known bugs

  • Poor front end generation
  • 1.5.1+ tab control doen't work: USE only 'next step button'
  • 1.5.1 "Get Field Data" in parse table doesn't check generated method name and can ovverride Joomla! methods.

Bugs report

Please, don't try to submit code by comments or by conctact form, because html/php code is stripped out for security reasons. Mail reports or suggestions to Questo indirizzo email è protetto dagli spambots. E' necessario abilitare JavaScript per vederlo. .

 

DOWLOAD:

Joomla 2.5 & 3.x

 

Joomla 1.5

No more supported nor devoloped

 

Commenti   

0 #68 marco 2014-04-04 07:14
:-) New J2.5 & J3.x Version released for Marco's Component Maker!

Apr, 4, 2014 - v 2.5.02 Alpha
- fixed editing when PK is not `id`
- great work on translations 8)
- . fixed menù translation
- . implemented sys language
- . better translation's keys generation, no more duplicated items
- . used Joomla string for common operation
- fixed mysql 5.5 missing ';'
- template improvments

happy coding,
marco
Citazione
0 #67 Guest 2014-03-25 14:51
Outstanding story there. What occurred after?
Take care!

==== Answer
They married and live happy.
Which part of 'no spam' didn't you understand?
Citazione
0 #66 Guest 2014-01-20 12:10
Hi,

I cannot export the component to 3.x the option to do that is gray, anybody know how to fix that?

Thanks a lot!

====Answer (missing mail no direct msg)
generated code works on both joomla J2.5 and j3.x versions. it needs just a little layout edit for the backend forms in J3.

bye
marco
Citazione
0 #65 Guest 2014-01-20 11:46
Thanks for the new release I waited for it for a long time!
awesome work!
Sorry to hear that is going to be the last version :(
Citazione
+4 #64 Guest 2013-03-12 18:14
It's now March 2013, a year since I last commented to say it's been over a year since an update =) I was just checking to see if anything had happened in a year but it's unfortunate to see it hasn't .. Joomla 3.0 is now the recommended Joomla version and this is still 1.5 with beta 1.6 ( which happens to work in 2.5 ) ..

I've moved onto a web based component builder, it builds much more complete code.. the unfortunate thing is that it doesn't build it around my database design so if I have existing tables of data I can't just point it and it work which is why I would prefer to use your code... Please consider updating or releasing it to some community that will update it.. over two years is a long time.

- Lonnie
Citazione
0 #63 Guest 2012-12-07 16:36
After downloading and running the .exe application. I discovered the available database does not have tables as indicated on the provided screenshots. How do I have the tables populated after selecting the mysql database.

===Answer
hi hassan,
have you changed the connection parameters in config file?
read carefully the instructions, please!

bye,
marco
Citazione
+2 #62 Guest 2012-11-30 08:24
What a great tool! Can you keep update it as the joomla have been update for many times.
Citazione
0 #61 Guest 2012-04-23 11:20
Thanks Marco, Great work!!!
Waiting for next release :lol:
Citazione
+1 #60 Guest 2012-03-21 13:46
Citazione Lonnie:
Last update was January 2011, it's now March 2012 so it's not been updated in over a year now ..

Has this become abandon ware? alpha support for 1.6 was added, we went through the 1.6 cycle, the 1.7 cycle and now we're into 2.5 .. fortunately the code still runs but it's generating 1.5 code ported roughly to 1.6 ..

Marco buddy! I love your work but it's at this rate it's bound to soon fail .. Please pick this back up, or pass the torch on to someone who will :(

I'd gladly even pay a small fee to buy a license if you modernized it and made it a purchased software.. it would be sad to see this die off.


I have found that the 1.6 code generator even in its beta state is still viable for 2.5, yes there is more work to do to bring in the save, save and next, save and close etc but the component still saves many many days / weeks of work.
Citazione
+7 #59 Lonnie 2012-03-02 15:02
Last update was January 2011, it's now March 2012 so it's not been updated in over a year now ..

Has this become abandon ware? alpha support for 1.6 was added, we went through the 1.6 cycle, the 1.7 cycle and now we're into 2.5 .. fortunately the code still runs but it's generating 1.5 code ported roughly to 1.6 ..

Marco buddy! I love your work but it's at this rate it's bound to soon fail .. Please pick this back up, or pass the torch on to someone who will :(

I'd gladly even pay a small fee to buy a license if you modernized it and made it a purchased software.. it would be sad to see this die off.
Citazione

Aggiungi commento

Please note: URL in text are not linked and site address is only for internal use.

Comments are human checked. All spam will be removed, so don't waste your time!

Codice di sicurezza
Aggiorna

L'estate si avvicina hai già trovato l'albergo per le vacanze? cerca un albergo al mare o un hotel in montagna ove trascorrere le tue vacanze.