Web Blog Pribadi indra Wijaya Kusuma

Information For Us—Kemarin adalah Pelajaran,Hari ini adalah Anugerah,Esok adalah Tantangan—

Marco’s Component Maker for Joomla! 1.5

Posted by ningrate pada Agustus 21, 2010

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

VERSION 1.5.0 RELEASED!!

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!

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!): <strong>id</strong> (primary key), <strong>published</strong> and <strong>ordering.</strong> If these fields do not exist will also be edited in the source table and controllers.
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);

As you understand, this is a machine translation. Not always I have time to translate the text, so I limit myself to some corrections: if you are able to read the Italian … http://www.mmleoni.net/joomla-generatore-di-componenti

INSTRUCTIONS

1.

download the package: Joomla!1.5 generator components 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.

3.

run the program.

Creare componenti per Joomla! - Settings component

fill in the fields:

  • the name of the component (Component Name)
  • the name (without _ or other strange characters, using only lowercase letters) for use in models.Controllers (Safe Name)
  • Table prefix used to install Joomla (Prefix Table) [part of the name to be replaced with’#__’, typical ‘jos_’]
  • Render “text” fields as
    • textarea: default html <textarea>
    • rte editor: Joomla! rte editor
  • Render “datetime” fields as
    • calender: Joomla! js calendar
    • string: default html <input>

4.

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

Creating components for Joomla! - Selection Db and tables

fill in the fields:

  • Select: Select the tables that will be part of the component
  • 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 to create the component for Joomla!

Creating components for Joomla! - Parsing Tables

6.

To create the component for Joomla! in a subdirectory in the folder where you ran the program (com_ [Safe Name])

Creating components for Joomla! - Crittura component

7.

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
  • Remove unnecessary fields from the display format for record set in com_[SafeName]/admin/views/[TableClassList]/tmpl/default.php
  • 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.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.

8.

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

Supported OSs

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.

History:

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

  • no more php4 support (php5 style class constructor and access modifiers)
  • no more use of global vars ($mainframe, $option): start thinking to Joomla! 1.6
  • xml metadata for menu items
  • basic front end editing
  • creating translation ini files


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

  • 1.5.0 missing php in opening tag <? when Joomla! calendar is rendered
  • Poor front end generation

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

DOWLOAD: HERE

Iklan

2 Tanggapan to “Marco’s Component Maker for Joomla! 1.5”

  1. Kangedo said

    Gan…Gimana caranya pasang textarea pada halaman posting di joomla ya???

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: