1
oryxvet
Oryxgen 0.7
  • 2006/6/11 13:36

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Here is the 0.7 version of OryxGen the module XOOPS generation.
Oryxgen is a module generator based on database tables structure. It settles like any other module. It is used in the user part of XOOPS but accessible only for an administrator profile.
The Oryxgen module is generated by itself. It is thus an example of ergonomics and possibilities offered by a generated module. All generated module have the same ergonomics.
The generated forms are on a database row identified by an id (entity). You can add entity, modify entity, and delete entity. You can also Add children and add foreign key. For each entity (and each state of entity) you can define actions to performed :

Once you have defined your meta data you must
- generate structure
- generate language
- generate xoopsversion
- generateblock
- generate program
and install your module in the XOOPS admin part .

Oryxgen is distribuate with GNU GPL licence.

This new version 0.7 integate AJAX request managment and a new user paradisme.
By default, the form is lock, you must click on the padlock to unlock the form.
Once you have submit action (store or something else) the form will lock again.

It's a working version but if someone can send me a return i will be happy.

You can download here :

http://www.oryxvet.com/dev/modules/mydownloads/singlefile.php?cid=4&lid=9



oryxvet http://www.oryxvet.com/dev

2
davidl2
Re: Oryxgen 0.7
  • 2006/6/12 1:15

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Excellent work!

3
kiang
Re: Oryxgen 0.7
  • 2006/6/12 15:36

  • kiang

  • Not too shy to talk

  • Posts: 126

  • Since: 2002/9/2 1


Two big problems...

1. Interface

I have no idea what 'xg_st_xg_statut_criteria' and others exactly mean. There need some more description showed between operaction, or ...

2. Documentation

It's hard to realize your logic if you don't tell us more. I've read the the document you provided for earlier version. But I havn't built any module following it. Maybe I'm stupid enough and need more help. :)
Resized Image

4
oryxvet
Re: Oryxgen 0.7
  • 2006/6/14 9:49

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Oryxgen is a RAD (Rapid Application Development) for XOOPS module. It uses a database as input and creates a XOOPS Module application that maps the data in database within to a Web interface.

There is 5 concepts (class/DB table) in this generator :
Module, classes, attributes, states and actions. This meta model (store in database by the web interface) is used to generate software applications (module). Some meta data corresponds to data about tables and table colonnes, another data models the behavior of the future generated module.

It there also a logic based on the states of the objects. States can be used to modelling our application behaviour and build our software applications

Each class (corrresponding to a table) have can have
- static attributes (correspoding to a collone)
- static actions (the classes actions)
In addition you can (but it's not obligatory) define
- states witch can have it's owns attributes and it's owns actions.

For example in the oryxgen interface
- when you edit an "module" object, there is a "IS_REP_OK" state (is the modules repository generated ?). If true you have the capabilitie to generate programs, if not the actions aren't show on the end user interface .
- when you edit an "attributes" object, there is several states depend on the attributes type. If you change the state by changing the attribute type (for example _TEXT to _FOREIGN_KEY), the list of updating attributes are changing.

Module :
--------
A module is the base of the system. You can generate all file starting from this entity.
Module have this folowing attribute :
Short name : used to prefix the "module" constant present in the /language repersitory.
Version : The version of the module -> see xoops_version
Default starting class : The index with is show for first time to the end user. You can change it on the preference module.
Modules have 1-n classes. Without class you can only generated a default structure.

Classe :
--------
Each class start from a database table. You must have create a database table before define this entity. In the web interface you must choose a table present in a combo with is display all table present in database. Once you have create your class the "refresh" action is automatically execute to import the attributes class (rows of the database table). The default value are defined and you must persolalize it.
You must define
Short name : used to prefix the "class" constant present in the /language repersitory.
primary key : the selected table must have a single primary key defined in auto increment.
For administrator only : true if you want to limit access to admin profile.
In The generated bloc : true if you want to see access to this class stating from the generated block,
Classes have Attributes, actions to do and state.

You can generate class file or language file starting from this entity.

Attributes :
---------
Each row of the database table must have a oryxgen attribute. You can synchronize database by using the "refresh" action.

For each attributs you can define the folowing properties :
Type : condition generated type HTML. For the "_FOREIGN_KEY" type you must define a foreign class (define in the current modules) and his foreign key used by the joint
Weight : Give the position attribute in the form. More the weight is the great more attributee will be high in the form
Size : the html size
Default value : the default value stored in database if the value of attributes is not informed by the end user.
Obligatory : if true, a javascript control is perform to control its presence.
In the create object form : the attribute will be in the created formular. Among all the attributes of a class, there must be at least a boolean with truth.
In the update object form : the attribute will be in the updated fomular. Among all the attributes of a class, there must be at least a boolean with truth.
Possibility of updating in the list : if the classe is owned by an other. You can update it in a list. If true, this attribute will in this list and will be updating. Among all the attributes of a class, there must be at least a boolean with truth.
Take part in the object description : if true, the value of this attribute will be to add to the list of the attributes describing the object. Among all the attributes of a class, there must be at least a boolean with truth.
Take part in the unicity controle : You can controle the unicity of a entity regards to the composition of several attributes. If true, the value of this attribute will be to add to the list of the attributes making it possible to check the unicity of the object. Among all the attributes of a class, there must be at least a boolean with truth.
Help : You can have a contextual "help" on each attributes to help end user. If true, a help icone appear near the libelle and you must override the global named "MyATTIBUT_HELP" in the corresponding language file.
Is a search attribute : For each class you have a search tools. If true, this attribut will be a seach criteria.
Tray name attribute : To group attributes
Html extra adding : Html extra code to add in the tag.



States :
-------
States indicate the state of an object at the present moment.
A oryxgen state is :
Criterias : it is described by a condition that would need to be in the state. You can be described it directly with classe attributes criteria or you can speficied a php variable name. If you choose a php variable name, you must code your state as a boolean in the file /personalize/myClass/criteria_MyClass.inc.php and add on the $states variable. A steleton is generated.
For example in the \modules\oryxgen\personalize\xg_class\criteria_xg_class.inc.php i have code 2 states : "IS_REP_OK" to indicate if there is a repository and "WITH_ATTRIBUTES" to indicate if there is attributes attached to the classe.
For the end user, the states are show on the formular head.
Attributes : This attributes are usable for the end user only if an object is curently in the state (i.e. check the condition that would need to be in the state).
Actions : idem states attributes.


Actions :
-------
Actions can be defines for a class (classe action) and a state (state action). If you add a action you must code it in a special class : \modules\MyModule\personalize\MyClass\action_MyClass.php in the function of the same name :
In this classe, you can use the following variable
- $this->getobject() to manipulate the current object
- $this->getobjectId() to manipulate the current id, needed when the object is new
- $this->setforward_url($forward_url) to set the next url called
- $this->setMsg(MyMsg) to set the message print after action
- $this->addError(MyMsg) to add message error
You can also code a before
For a "MyAction" you can code a "MyAction_before" witch is executed before executing the MyAction and a "MyAction_after".




Once you have defined your meta data, you can generate files by using starting from the your module object :
- generate structure
- generate language
- generate xoopsversion
- generateblock
- generate program

You can personalize
- The language file generated in /language repersitory.
- The criteria used (if you have defined state) in the file \modules\MyModule\personalize\MyClass\criteria_MyClass.php
- The code action (if you have defined action) in the file \modules\MyModule\personalize\MyClass\action_MyClass.php

- you can add information in xoops_version.inc.php witch is include in xoops_version.php

Hope this informations can help us to generate simple module.

Kiang, a new version corrects the faults of language. There no more "xg_st_xg_statut_criteria"

http://www.oryxvet.com/dev/modules/mydownloads/singlefile.php?cid=4&lid=9

5
kiang
Re: Oryxgen 0.7
  • 2006/6/15 18:12

  • kiang

  • Not too shy to talk

  • Posts: 126

  • Since: 2002/9/2 1


With the help from oryxvet, I could generate a module through this tool. I have some suggestions:

1. Store the table structure in database.

When using this module, I must create the tables through phpMyAdmin first. Once generate the module, I must delete the tables which were created manually. Because I want to install the new module through XOOPS system. There are lots of benefits if storing the table structure.

2. Credits

I know it's your right to left credit in the result. But a good code generation tool offen assists others to get more credits.

*The 2 above are brought from XBS ModGen ( http://dev.xoops.org/modules/xfmod/project/?xbs_modgen )

3. Clean the code

I could find lots of unnecessary code snippets in Oryxgen. And the English interface is hard to encourge people trying it. Compare to the new functions, I think it would be better to clean the code from now on. :)

4. Merge the works from other code generation tools

A code generation tool encourge people not to re-build the wheels or waste time on repeatable jobs. I think it would be better to merge some other excellent works like...

symfony - http://www.symfony-project.com/
Qcodo - http://www.qcodo.com/
CakePHP - http://cakephp.org/
Resized Image

6
kiang
Re: Oryxgen 0.7
  • 2006/6/15 18:20

  • kiang

  • Not too shy to talk

  • Posts: 126

  • Since: 2002/9/2 1


Resized Image

7
chippyash
Re: Oryxgen 0.7
  • 2006/6/16 6:26

  • chippyash

  • Friend of XOOPS

  • Posts: 501

  • Since: 2004/1/29


Can you please provide a .tar.gz or a .zip version of your download as .rar is not recognised on many systems

A

8
oryxvet
Re: Oryxgen 0.7
  • 2006/6/16 10:00

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Thank for your work kiang. I'm develop this module first to minimize the time to construct a module and second as a prototype to verify my state object theory. The modifiable, displayable attributes and the possible actions depends of the state of the object (the current context) in which the user is.

You right i must have a refactoring session, there is a lot of unecessary code since i have develop a ajax architecture. I do it every time i'm can but currently i spend my hobby time to developpe a view managment and a workflow validation.

A new version is available (thank to you kiang) :
- Comment the security managment based on $GLOBALS['xoopsSecurity']. I recode this in the next version.
- english language
- debug the sql generation

The package is now in a zip format...

http://www.oryxvet.com/dev/upload/oryxgen_0.7.zip

9
kiang
Re: Oryxgen 0.7
  • 2006/6/16 15:41

  • kiang

  • Not too shy to talk

  • Posts: 126

  • Since: 2002/9/2 1


I commited them into SVN repository of an old project in sf.net. (It's a long story...^^||)

http://sourceforge.net/svn/?group_id=116932

If you like, you could sign up there for some practices about the benefits brought from version control system like SVN. Later you could register your own project. :)

I'll keep commit your releases there and may modify some of them to fit my needs. You could always find the version I'm working on.
Resized Image

10
chippyash
Re: Oryxgen 0.7
  • 2006/6/16 16:13

  • chippyash

  • Friend of XOOPS

  • Posts: 501

  • Since: 2004/1/29


Thanks for the zip version. On installing to XOOPS 2.0.13.2 I get the following noticess

ArrayThis page cannot be displayed due to an internal error.

If you are the administrator of this site, please visit the XOOPS Troubleshooting Page for assistance.

Notice [PHP]: Use of undefined constant _PM_XG_XG_ACTION - assumed '_PM_XG_XG_ACTION' in file modules/oryxgen/xoops_version.php line 105
Notice [PHP]: Use of undefined constant _PM_XG_XG_STATUT_FIELD - assumed '_PM_XG_XG_STATUT_FIELD' in file modules/oryxgen/xoops_version.php line 106
Notice [PHP]: Use of undefined constant _PM_XG_XG_STATUT_CRITERIA - assumed '_PM_XG_XG_STATUT_CRITERIA' in file modules/oryxgen/xoops_version.php line 107
Notice [PHP]: Use of undefined constant _PM_XG_XG_STATUT - assumed '_PM_XG_XG_STATUT' in file modules/oryxgen/xoops_version.php line 108
Notice [PHP]: Use of undefined constant _PM_XG_XG_FIELD_DEF - assumed '_PM_XG_XG_FIELD_DEF' in file modules/oryxgen/xoops_version.php line 109
Notice [PHP]: Use of undefined constant _PM_XG_XG_MODULE - assumed '_PM_XG_XG_MODULE' in file modules/oryxgen/xoops_version.php line 110
Notice [PHP]: Use of undefined constant _PM_XG_XG_CLASS - assumed '_PM_XG_XG_CLASS' in file modules/oryxgen/xoops_version.php line 111
Notice [PHP]: Use of undefined constant XG_SC_STATUT_ID - assumed 'XG_SC_STATUT_ID' in file modules/oryxgen/xoops_version.php line 156
Notice [PHP]: Undefined variable: content in file modules/system/admin/modulesadmin/modulesadmin.php line 285
Notice [PHP]: Undefined variable: content in file modules/system/admin/modulesadmin/modulesadmin.php line 285
Notice [PHP]: Undefined variable: content in file modules/system/admin/modulesadmin/modulesadmin.php line 285
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392
Notice [PHP]: Undefined index: description in file modules/system/admin/modulesadmin/modulesadmin.php line 390
Notice [PHP]: Undefined index: valuetype in file modules/system/admin/modulesadmin/modulesadmin.php line 392

and the following warnings

Warning [PHP]: xoops_module_install_oryxgen(/web/akitson/modules/oryxgen/class/newblocks.php) [function.xoops-module-install-oryxgen]: failed to open stream: No such file or directory in file modules/oryxgen/install/installscript.php line 687
Warning [PHP]: xoops_module_install_oryxgen() [function.include]: Failed opening '/web/akitson/class/oryxgen/class/newblocks.php' for inclusion (include_path='.:/usr/share/pear') in file modules/oryxgen/install/installscript.php line 687
Warning [PHP]: xoops_module_install_oryxgen(/web/akitson/class/oryxgen/class/block_module_link.php) [function.xoops-module-install-oryxgen]: failed to open stream: No such file or directory in file modules/oryxgen/install/installscript.php line 688
Warning [PHP]: xoops_module_install_oryxgen() [function.include]: Failed opening '/web/akitson/class/oryxgen/class/block_module_link.php' for inclusion (include_path='.:/usr/share/pear') in file modules/oryxgen/install/installscript.php line 688
Error [Xoops]: Class XoopsNewblocksHandler does not exist
Handler Name: newblocks in file include/functions.php line 489

Clearly lines 687 and 688 are wrong as they point to an oryxgen directory under the core class directory.

In any event it's not installing.

A

Login

Who's Online

448 user(s) are online (329 user(s) are browsing Support Forums)


Members: 0


Guests: 448


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits