We migrated the site to the new version. So some links may not work properly: please be patient. Thank you.

Marco's Component Maker for Joomla! 1.5

marco component's builder for Joomla! 1.5

Creating components for Joomla 1.5! is much more complicated than doing so for version 1.0 because you need to write lot of code for controllers, models, views, tables and templates for the view.

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

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

This extension is also published on http://extensions.joomla.org , if you like, it vote it or write a review, thank you.

Building components for Joomla!1.5

 

New in version 1.5.2.0: Joomla! 1.6 support

 

Note: because of the work, I'm late with new releases of the program :(

So you can ignore the warning "This version has expired, ..."

Sorry, marco

 

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 1.5 and 1.6 code generation

 

REQUIREMENTS

  • runtime. NET 2.0+ or Mono 2.4.3+
  • MySql Connector-Net 6.2.3 from http://dev.mysql.com/downloads/connector/net/
  • 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 ...

releases prior 1.5.0 only:

  • why is created functioning components, the tables must have these three fields (the default Joomla!): id (primary key), published and ordering. If these fields do not exist will also be edited in the source table and controllers.

releases 1.5.0 +:

  • the fields published and ordering are no more mandatory, anyway these fields have a special role/management (as in Joomla! default).

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...

 

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!1.5 generator components (downloads are at the end of the page, before comments) and unzip it in a folder.

 

2.

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: (since v 1.5)

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
  • Generate translation file: create a translation file for each selected language (you have to translate... of course)

 

4.

and then select the database tables for which will be created models, controllers and views

fill in the fields:

  • Select: Select the tables that will be part of the component
  • FE: not yet implemented
  • FE view: not yet implemented
  • Table Class: The name used to create the table
  • Single record object handler name:The name used to create the objects needed to interact with the table recordset
  • Recordset object handler name: The name used to create the objects needed to interact with the single record

 

5.

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:not implemented yet
  • Render As:use a specific input type for rendering (input, text area, rte, select, boolean radio, calendar)
  • 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)

6.

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

 

7.

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

 

8.

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;)

releases prior 1.5.1 only:

  • Remove unnecessary fields from the display format for record set in com_[SafeName]/admin/views/[TableClassList]/tmpl/default.php

 

releases prior 1.5.0 only:

  • add routing to indicate the default view of the back-end (comment out the code and add the name of the controller and view) in com_ [Safe Name] / admin / [Safe Name]. php
  • edit com_ [Safe Name] / admin / views / [Table Class] / tmpl / default.php to create the textarea if required editing HTML, and currently they are created only input of type text that can not handle HTML code, in this case must also be changed according to the 'Store ()' fee in the model to allow this type of content.

compacted the component, or load it in the directory / tmp, and install it.

 

9.

let me know what you think: be good, is still in beta;)

 

Notes on Joomla! 1.6 code generation

Joomla! 1.6 support in still in alpha version. Generated code runs, but is a 1.5 porting, not a real 1.6 code. Not all new features are supported.

OK:

  • it runs!!
  • translation files fully compliant
  • basic ACL support on component

KO:

  • no ACL at table / row level
  • do not use new class for models/controllers/forms/fields in admin

 

Supported OSs

Bad news from the front of Mono.
Because a lack of implementation in System.Windows.Forms.DataGridViewCell.GetValue() function call, versions greater than 1.5 are not compatible with the Mono environment.
I hope this will be fixed soon.

The program requires Microsoft. NET 2.0+ or Mono 2.4.3+; therefore can be used on any operating system that supports one of two frameworks:

* Windows: XP, Vista, Windows 7, Windows 2003
* Linux
* Mac OS X Tiger(10.4), Leopard (10.5), and Snow Leopard (10.6)

The installation package contains the library Mysql.Data.dll 6.1.2.0 for Windows (not included since v1.1); to use the program on another OS, delete the library and install the package 'Connector-Net 6.2.2', version '. Net & Mono (Architecture Independent) ', or later, from mysql.com.

For more details, or for troubleshooting installation issues, refer to the support of Mono Mono and your operating system.

 

How to work on Ubuntu

Quick instructions: To use Joomla Component Builder on Ubuntu (tested with Ubuntu 10.4) install the packages 'MonoDevelop' and 'MonoDevelop-database'. After, you have to download the package 'Connector-Net 6.2.2' version '.Net & Mono (Architecture Independent)' From mysql.com. Unzip the package and install the library in the GAC, as root, with

gacutil-i [pathToLib/]mysql.data.dll

After that, copy mysql.data.dll in /usr/lib/mono/2.0/

Bigham (thanks) also informed me that, sometimes, you must rename the file mysq.data.dll to MySql.Data.dll (http://forums.mysql.com/read.php?47,367529,367529).


Important Note: For more details, or for troubleshooting installation issues, refer to the support of Mono and 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)

  • J1.6 per table ACL
  • move every 'generated code' template in external resource
  • full J1.6 support (support for new J16 admin classes)
  • full xml metadata for menu items
  • full foreign keys support
  • front end editing
  • j1.6 per table-> row ACL (low priority)

 

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.
  • 1.5.1 template beViewList.php: row 43 ($rows[0]->publish) should be ($rows[0]->published) for [un]publish list.

Solved:

  • Prefix problem: fixed in 1.5.0.0
    Driver install.sql contains:
    CREATE TABLE IF NOT EXISTS `jos_mytab`
    should be
    CREATE TABLE IF NOT EXISTS `#__mytab`
    Thanx to ZnakZorro
  • 1.5.0 missing php in opening tag <? when Joomla! calendar is rendered
  • 1.5.0 error in php store() data; in templates/beModel.php replace line 98 with:
    $this->setError( $row->_db->getErrorMsg() );

 

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:

Please, read related articles (see: 'example component' and 'manage the back end #1' &  'manage the back end #2') before start to develop.

 

Security Warning

The "front end" code generated by the program versions prior to 1.5 may suffer attacks "lfi" or "SQL injection". You hardly used the "front end" code as it is, but if these are the changes:

feEntryPoint.php
line #29 (LFI vunerability) replace with
if($controller = JRequest::getWord('controller')) {

feModel.php
line #40 (SQL Injection vunerability) replace with
$id = JRequest::getInt('id', 0);

 

Commenti   

 
+1 #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
 
 
0 #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
 
 
+6 #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
 
 
0 #58 John Wennips 2012-02-17 16:55
Hi Marco.
A error occured in the last step (file generation). He could't find the path:
System.IO.DirectoryNotFoundException: Kan een gedeelte van het pad E:websitesmarco _com_makertempl atesj15feEntryP oint.php niet vinden.
bij System.IO.__Err or.WinIOError(I nt32 errorCode, String maybeFullPath)
bij System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String msgPath, Boolean bFromProxy)
bij System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
bij System.IO.Strea mReader..ctor(S tring path, Encoding encoding, Boolean detectEncodingF romByteOrderMar ks, Int32 bufferSize)
bij System.IO.Strea mReader..ctor(S tring path, Encoding encoding)

===== Answer:
hi john,
strange error: 'DirectoryNotFoundException'.

did you unpack the zip file or are you trying to use it via window's unpacker?
does the directory 'E:websitesmarc o_com_makertemp latesj15' exist?
less important: did you try to run the program as 'administrator'?

bye,
marco
Citazione
 
 
0 #57 Peter 2012-02-09 21:29
Maybe a stupid question?

But how can I find unique/safe name for my component.

for example I could choose com_zoo, but com_zoo already exists. Is there a database somewhere?

===Answer
this is the reason why I put 'marco' in front of the name of my components...
Citazione
 
 
+5 #56 Amresh Kumar 2012-02-04 13:48
please Make a relese for Joomla 2.5.x
Citazione
 
 
+2 #55 John Wennips 2012-02-01 19:44
Thank's Marco it's working !
Under Windows7 you must install the MySQL connector 6.4.4 under Administrator and not via another user.
This generated code gives me the structure and the boost I needed.
Many thanks for this tool.
Citazione
 

Aggiungi commento

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.