[GSoC 2009] JDevTools - Automated scripts for Joomla

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
arnfred
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon May 11, 2009 1:00 pm

[GSoC 2009] JDevTools - Automated scripts for Joomla

Post by arnfred » Mon May 11, 2009 1:50 pm

Hi all, My name is Jonas Arnfred, and I'll be working on making joomla easier to develop components for, by automizing certain tasks and provide libraries for others. If you feel like knowing more, then take a look below.

JDevTools

Abstract

The goal of project JDevlTools is to make Joomla easier to develop for. Currently developers creating components, modules or plugins go through a lot of tedious task setting up files and writing boilerplate that can easily be automated. My aim is to provide tools for developers to automate these task, so they can focus on what's important: Creating quality web sites with Joomla.

Project

JdevTools is a project that spans two areas. First of all I intent to create utilities that automate component creation, module creation and plugin create by creating files and boilerplate code. Secondly it's my aim to create an adminList library to make it easier to for developers to create the administration.



Utilities
(DevScripts)

Most developers doing a lot of joomla developing have a bunch of scripts or files they copy around each time they want to make a new component, module or plugin. Instead of letting developers waste their time creating these tools, I intent to let Joomla save their time by providing this functionality from within joomla. I will do this by creating a common interface for a group of scripts taking care of different parts of the coding process. My aim is not to automate the process completely, or to create a kind of 'component creation in 3 easy steps'. The aim is strictly to provide simple tools for developers who already know how to code.

I imagine that these tools will consist either of different wizards of different forms where some basic information can be entered. The user can then click 'create' and all relevant actions will be taken leaving the developer ready to start coding. If a user for example wanted to create a new component, we would ask for the name of the component and the author name, and create all standard files needed for the component. Each file will be ready to work on, already containing the neccesary code pieces. Alternatively we could make the scripts more atomic and provide functionality for creating e.g. a new view for a specific component. I will take care to consider how these scripts best can be suited to help developers out there.



Library (AdminList)

The library part of the project is quite a different creature. During normal component development, the standard admin table contains a lot of repeated elements that could be benificial to abstract away in a library. To construct an admin table should be a question of specifying the content of each collumn, and then letting joomla take care of the rest. Practically speaking a possible way of doing it could look like this:

Code: Select all

    $table = new Table($items,$pagination)
    $table->col("name")->edit()
    $table->col("area_id")->db("#__areas","name")->label("Area");
    $table->col("description")->truncate(50);
And then in the tmpl:

Code: Select all

    echo $table
This would create a table with 3 collumns (besides id and checkbox),

* One column displaying the name (that is, accessing $item[n]->name) for all n's) and being a link to the edit page (that's what the edit() method does)
* One column showing the area name and sending an sql request to the #__areas table to get the name with that specific area_id, and finally having the heading as "Area" instead of "Area_id"
* One column showing the description truncated down to around 50 characters

Then a __toString method would render the table, filling in the
information.

This way the developer wouldn't have to worry about html, table cells and other nitty gritty details that doesn't change in the administration section anyway. An important part of the design of the library is of course that it fits well with the rest of the joomla code base and is intuitive to use for a developer who is already familiar with the rest of joomla's functionality.


Benefits

With these two additions to Joomla, I think we can increase developer productivity substantially while making the components they create easier to maintain and less error prone from copying code around. Increased productivity will lead to more components, modules and plugins, which leads to more reason for webmasters to choose joomla as their cms, and more reason for developers to choose joomla as their platform.

What now?

Seeing that this project aims to help out component creators, it's important that I know how to best do so. I've developed Joomla components for some time myself, so I'm starting out with a decent comprehension of the problems to be solved, but I'm still very interested in inputs from other people who have been developing with Joomla. If you have ideas or input, feel free to write a comment.

User avatar
Oleg Nesterov
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon May 11, 2009 8:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Oleg Nesterov » Mon May 18, 2009 8:14 am

As a mentor of this project I just wanted to say that we really need your ideas and thoughts about things that may be helpful for you. So feel free to write a comment.
...making developer's life better

User avatar
joomlacorner
Joomla! Explorer
Joomla! Explorer
Posts: 407
Joined: Thu Aug 18, 2005 2:29 am
Contact:

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by joomlacorner » Mon May 18, 2009 9:13 am

do you have a look on EasyCreateor?

http://projects.easy-joomla.org/project ... eator.html
รับพัฒนาระบบด้วย Joomla http://marvelic.co.th | ทีมพัฒนาภาษาไทย http://www.joomlacorner.com

User avatar
darb
Joomla! Ace
Joomla! Ace
Posts: 1429
Joined: Thu Jul 06, 2006 12:57 pm
Location: Stockholm Sweden
Contact:

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by darb » Mon May 18, 2009 5:30 pm

Yes there are some tools where you can pick up some from tools in JED where Easy Creator is not there
http://extensions.joomla.org/extensions ... ment-tools

but here
http://extensions.joomla.org/extension ... evelopment
Success in the long run Its not about the code its about the people and community that's make it!
Its not what you say its what you do that matters!

Darb - aka ssnobben

User avatar
Oleg Nesterov
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon May 11, 2009 8:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Oleg Nesterov » Mon May 18, 2009 8:58 pm

Thanks for your advises. We know about such tools and furthermore we've made up a list of useful ones.
...making developer's life better

User avatar
jiggliemon
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Wed Nov 22, 2006 6:18 am
Contact:

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by jiggliemon » Thu May 21, 2009 12:15 am

My Two Cents:

Joomla Relies on alot of pre-defined default dirs that hold assets. example:

Code: Select all

$this->getModel('some_model');
You can over ride this using various "Include some path" methods. example:

Code: Select all

JTable::addIncludePath('some/path/here/');
If you're building a large scale website, and creating all the components from scratch, you need to direct the include path for every Model, View, Paramater, Javascript file, Css file, anything that one would want to store in a global folder.

Say i wanted to create my own "Mini Library" in the Libraries folder to hold all my site global classes or models or what have you. I think there should be a way to include a Global include.
If i type JHTML::script('somescript.js'); It will look in the 'media.system.js' folder, as well as the 'libraries.myproject.js' folder. This makes it a lot easier for me to keep up on new releases of Joomla (by replacing only certain folders, or moving my files over to a fresh install.)

Also, in the same train of thought, there should be a Global "Over-ride" for the core libraries. Take for example, the 'libraries.joomla.filesystem.file.php' file, I would like to have a 'libraries.myproject.filesystem.file.php', that will be loaded in place of the core one. Mainly so that i can keep up on fresh releases easily, and still maintain my extends. THis would also allow someone like myself the comfortablilty of building a bridge from JDatabase into an abstraction layer like Doctrine. And not have to worry about which files needed to be neglected or over written.

Some sort of Bootstrapping would make large scale sites nice and easy.

And if you want to be really cool lets tackle an abstraction layer!

arnfred
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon May 11, 2009 1:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by arnfred » Thu May 21, 2009 9:21 am

jiggliemon,

It's an interesting idea, but I think it's a little outside the project scope.

What we are focusing on is mostly the creation of tools for creating components, so while I think you are right that file inclusion could be done smarter, it's not something I plan to be focusing on. The reason why is mostly a question of focus. We are adding some elements to joomla that would make it easier to create components, while what you are proposing is more in the avenue of changing how joomla actually works, which would be an entire different process.

Thanks a lot for your thoughts though. Keep them coming :)

User avatar
Tonie
Joomla! Master
Joomla! Master
Posts: 16584
Joined: Thu Aug 18, 2005 7:13 am

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Tonie » Fri May 22, 2009 9:24 am

A few things I could be thinking off:

* create a simple view showing information
* create a two way view with testViewTests and testViewTest for a standard content-like page where there is a list (testViewTests), and each item is editable (testViewTest)
* Support for pagination in backend
* Easy way to add dropdown HTML lists or radio buttons through a helper file.

Are these the things you are thinking of?

User avatar
Oleg Nesterov
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon May 11, 2009 8:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Oleg Nesterov » Fri May 22, 2009 11:22 am

Tonie wrote:A few things I could be thinking off:

* create a simple view showing information
* create a two way view with testViewTests and testViewTest for a standard content-like page where there is a list (testViewTests), and each item is editable (testViewTest)
* Support for pagination in backend
* Easy way to add dropdown HTML lists or radio buttons through a helper file.

Are these the things you are thinking of?
Almost all of this will be covered by the JDevTools, but if you need to handle some specific situations you will be able to do this by adding your package with your own files and tasks to execute.
...making developer's life better

ewel
Joomla! Guru
Joomla! Guru
Posts: 522
Joined: Mon Oct 01, 2007 11:35 am

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by ewel » Sat May 23, 2009 7:10 pm

What we are focusing on is mostly the creation of tools for creating components
If I am not mistaken, the vast majority of extensions are modules and plugins. I would also venture a guess that the developers of smaller extensions, as plugins and modules usually are, would benefit most from what you are trying to do. So, why not cater for modules and plugins?

Edit: I forgot to say well done for this initiative!

User avatar
Oleg Nesterov
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon May 11, 2009 8:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Oleg Nesterov » Sat May 23, 2009 7:20 pm

ewel wrote:
What we are focusing on is mostly the creation of tools for creating components
If I am not mistaken, the vast majority of extensions are modules and plugins. I would also venture a guess that the developers of smaller extensions, as plugins and modules usually are, would benefit most from what you are trying to do. So, why not cater for modules and plugins?

Edit: I forgot to say well done for this initiative!
The reason to focus on components mostly is that they are more difficult to develop, may contain many files and tasks, and therefore need more routine work from developers. We don't see the same with modules and plugins. For them we'll only support installing and packaging. So could you please explain in more details your request?

Check the latest project specifications here: http://community.joomla.org/gsoc2009/jo ... tools.html
...making developer's life better

ewel
Joomla! Guru
Joomla! Guru
Posts: 522
Joined: Mon Oct 01, 2007 11:35 am

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by ewel » Sat May 23, 2009 8:30 pm

Just like you explained about components, modules and plugins have a preferred structure. Modules (can and should preferably) have views, and both modules and plugins can make good use of helpers. A good number of modules and plugins use the database, if not to store then to look up, just like components. Plugins have standard parts of the code in terms of the triggers. Also, they usually follow one of few patterns in terms of adding something to, or before, or using a regex for replacing something in, an article.

Components are often more complex. But, as I said, the relative complexity is probably the same. This is because components tend to be made by capable developers, whereas modules and plugins tend to be made by people with much less experience. So, let's say the need is equal.

Additionally, many components need, or are completed by, modules and plugins. Comment components, for example, work through plugins. Other components would be relatively useless without some modules to show various lists taken from the component. At least from a user perspective, where components are supplemented by modules and plugins, they should be distributed in one installer package. Why stop at helping to make someone make a component when he or she will also need to make and package modules and plugins?

So, rather than a component creator, I would love to see an extension creator.

User avatar
Oleg Nesterov
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon May 11, 2009 8:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Oleg Nesterov » Sat May 23, 2009 9:01 pm

ewel wrote:Just like you explained about components, modules and plugins have a preferred structure. Modules (can and should preferably) have views, and both modules and plugins can make good use of helpers. A good number of modules and plugins use the database, if not to store then to look up, just like components. Plugins have standard parts of the code in terms of the triggers. Also, they usually follow one of few patterns in terms of adding something to, or before, or using a regex for replacing something in, an article.

Components are often more complex. But, as I said, the relative complexity is probably the same. This is because components tend to be made by capable developers, whereas modules and plugins tend to be made by people with much less experience. So, let's say the need is equal.

Additionally, many components need, or are completed by, modules and plugins. Comment components, for example, work through plugins. Other components would be relatively useless without some modules to show various lists taken from the component. At least from a user perspective, where components are supplemented by modules and plugins, they should be distributed in one installer package. Why stop at helping to make someone make a component when he or she will also need to make and package modules and plugins?

So, rather than a component creator, I would love to see an extension creator.
Well, I agree that modules and plugins can be complex and may need some automation, too. We will think what we can do for them. But if we are not able to accomplish this during GSoC it will be scheduled later on. As you may read in project specifications the JDevTools is going to be flexible and extensible.

Thanks for your thoughts we really appreciate them!
...making developer's life better

ewel
Joomla! Guru
Joomla! Guru
Posts: 522
Joined: Mon Oct 01, 2007 11:35 am

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by ewel » Sat May 23, 2009 9:17 pm

Welcome, and thanks for doing this project!

gamupstate
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Tue May 26, 2009 7:55 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by gamupstate » Wed Jun 03, 2009 11:57 am

jiggliemon wrote:
Also, in the same train of thought, there should be a Global "Over-ride" for the core libraries. Take for example, the 'libraries.joomla.filesystem.file.php' file, I would like to have a 'libraries.myproject.filesystem.file.php', that will be loaded in place of the core one. Mainly so that i can keep up on fresh releases easily, and still maintain my extends. THis would also allow someone like myself the comfortablilty of building a bridge from JDatabase into an abstraction layer like Doctrine. And not have to worry about which files needed to be neglected or over written.
Assuming you are running PHP 5.2+, this is with a few exceptions very easily accomplished.

The Joomla library loader checks to see if a class exists before it loads a class, so if you beat the loader and force your class to be loaded first you can override the Joomla core libraries without actually having to touch the core files.

For example, I had someone with a very specific need, she had to make a simple change to a module layout, but between the layout template, the ability to override that template, and such finding the file to make the change to was annoying.

I wrote a simple corehack plugin, http://gothaminformatics.com/our-extens ... ing-plugin

What it does is
checks to make sure the module helper has not already been loaded[too late to run if it has]
locates the module helper library on disk
applies a quick find/replace to modify it to make some html outputting
saves the file to disk in the plugin directory
forces that file to be loaded

This overloads the core file functionality without actually changing the core files[as soon as the plugin is disabled, it goes back to running normally]

This was a quick plugin as proof of concept/to help with a particular function. The same theory could be extended but instead do some extra checking so you don't keep rehacking the file every time and only do so when the version of Joomla changes.

Now, all that said, the inclusion of an override include path, say for example add a folder called "local" to the root, and have the JImport routine check for /local/libraries/joomlafilesystem/Jfile.php and load that if it exists, otherwise load /libraries/joomlafilesystem/Jfile.php - this is how Menalto Gallery manages overriding core function instead of changing the core files. But that requires a true core hack as JImport is loaded before anything else and there is no chance to pseodo-hack it[though if you use the PECL mod that allows you to destroy classes, you can replace the JImport class with your own class]

jimmyneitron
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Sep 08, 2008 8:52 am

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by jimmyneitron » Thu Jun 04, 2009 8:46 am

Hi Guys!
Sorry for my bad english!

Now working on my universal MVC component.
Now its finished, sometimes i add some features.
Its components structure:
com_my
-models
lists.php
edit.php
save.php
-tables
....
table files
....
-views
-lists
-tpl
default.php
...
defaultN.php
view.html.php
-edit
-config
controller.php
admin.my.php
helper.php

big feature in file helper.php
in this file i coded
3 functions
controller_map()
model_map()
view_map()

they analyzy variable $a and maps to the right way

User avatar
Oleg Nesterov
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon May 11, 2009 8:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Oleg Nesterov » Thu Jun 04, 2009 9:04 am

Hi jimmyneitron. I didn't understand what you requested. But if you need such universal component with your specific files, like helper.php, you will be able to substitute the default component files in JDevTools with your own ones and use them painless. Does this answer your question?
...making developer's life better

User avatar
Ronze
Joomla! Explorer
Joomla! Explorer
Posts: 394
Joined: Thu Jan 17, 2008 7:31 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Ronze » Wed Jun 24, 2009 7:54 am

Just a response to your blog today about a special scripting language:

Wouldn't it be best to use XML, as this is the standard that most UML editors use? Then it would be easy to create an UML diagram of your component, and then run it through your application to have it all generated in code?

IBM has some really cool tools that does exactly this in Java and C++ - it would be so cool to have an XMl -> Joomla generator :-)
Read developer tips & and tricks about Joomla on my blog:
http://www.youcanjoomla.com

arnfred
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon May 11, 2009 1:00 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by arnfred » Wed Jun 24, 2009 8:44 am

Ronze,

It's a very interesting point you are bringing up, and I can definitely see where you are coming from. I have personally decided against it for this project to keep it simple. - Both for myself, as well as for developers doing joomla components who aren't familiar with UML.

Too keep scripting in PHP makes it easier for me to custom create something that's made with Joomla in mind. This way I can incorperate the rules and structures that components and the like are restricted by, creating a scripting environment around it. I believe this makes the end product simpler for the user to use, since it's very few developers who will start UML'ing to create a component (except for a few database schemas).

But all said I still think you have a very good point, and while I've chosen against it personally, I agree that it would be pretty awesome : )

User avatar
Ronze
Joomla! Explorer
Joomla! Explorer
Posts: 394
Joined: Thu Jan 17, 2008 7:31 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by Ronze » Wed Jun 24, 2009 8:52 am

Hey... I understand - it would take quite an effort :-) Good luck with your project...
Read developer tips & and tricks about Joomla on my blog:
http://www.youcanjoomla.com

User avatar
ongray217
Joomla! Intern
Joomla! Intern
Posts: 67
Joined: Sat Jun 14, 2008 4:07 pm
Location: Kuala Lumpur, Malaysia
Contact:

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by ongray217 » Fri Jul 31, 2009 3:37 am

I mainly use Joomla to create components for backend. I can give some input for component.
One of the most common features for components are 'search and list' (testViewTests) of its tables or join-tables. It is an easy and similar process, but tedious when you need to do this for every new table created.
I like the approach used in phpBMS (http://www.phpbms.org), an open source project. you can see the demo on their website (need to login as admin). It uses 2 components to handle this.
1st component to allow developer to define 'Table Definitions' : which table, which columns, what searches, which field
2nd component to automate the display for 'search and list' based on the table definitions in the 1st component.

Hence, a standard 'search and list' display page can be created or amended within 1-2 minutes. developer does not need to create any MVC coding at all. Just create the Menu with the correct link and parameter.
All Joomla core-components can use this approach to 'search and list' too.

Tips: How to login as phpBMS admin
1) goto http://www.phpbms.org/trial/index.php, and login as any user listed.
2) after login, goto http://www.phpbms.org/trial/search.php?id=9 (cut and paste the url)
3) create a new 'admin' user. make sure 'administrator' checkbox is checked.
4) logout and login with the new admin user you have just created.
5) Explore SYSTEM > Table Definitions

I also like the approach used for 'Menu', 'Tabs', 'Saved Searches', 'Relationships'.
Raymond Ong (ongray[at]evolucent[dot]net)
Website: http://www.evolucent.net

wik
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sat Oct 07, 2006 11:17 am
Location: Ukraine
Contact:

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by wik » Fri Aug 07, 2009 11:41 pm

Hello,

I am a little lost this initiative, sorry, but how it's going? :)
Edit: I mean Utilities (DevScripts) as it's looks like first priority task, does not it?

Thanks.

p.s.
Great idea, in overall looks like tasks feature in symfony php framework.

User avatar
jjorba
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Apr 03, 2006 2:52 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by jjorba » Sat Aug 22, 2009 6:13 pm

Hello im Joomla spanish developer and i'm very interested with your project

I wonder when you'll have a beta of this project?


Many tnx

Josep

towhidd
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Oct 10, 2009 9:15 pm

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by towhidd » Sat Oct 10, 2009 10:04 pm

JDevTools is a great idea as do this it will be very helpful for us who think writing code is a tedious things and we want it very soon. Best of luck.

lawmaina77
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Dec 15, 2008 5:28 am

Re: [GSoC 2009] JDevTools - Automated scripts for Joomla

Post by lawmaina77 » Sun Jan 31, 2010 9:11 pm

Hi,
i hope by now there is something to download, I mean it's now 2010, is anywhere I can download this great tool


Locked

Return to “Joomla! 1.5 Coding”