11
oryxvet
AjaxModel a xoops ajax sample module
  • 2006/4/28 15:26

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


I have build a sample ajax module witch is based on the famous Ajax Agent. Thank to Steve Hemmady !

This simple module use the XOOPS object model to
- get a user from an id.
- update the attributes "Email", "url" and "default theme" of a profile User

The class "UpdateManager.php" is generic and can be use with other XOOPS object.

You can download it here:


Hope that help

PS : The oryxgen project will integrate soon ajax.



12
oryxvet
Re: Where's the "object orientation"?
  • 2006/4/10 14:05

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


You can use and extend 2 master class in xoops. XoopsObject to describe an object and XoopsObjectHandler to handle the objects. You can see the XOOPS documentation about XoopsObject and XoopsObjectHandler features in :

http://dev.xoops.org/modules/phpwiki/index.php/XoopsObjectAndHandler

You can also download a module call "Oryxgen" witch can generate this 2 classes starting from a database table.
http://www.oryxvet.com/dev/upload/oryxgen_0.6.rar

Hope that helps



13
oryxvet
Re: oryxgen V 0.6
  • 2006/4/6 10:10

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Sorry,

I can't spend time to correct oryxgen for XOOPS 2.2 or 2.3. I keep development on 2.0 for the moment.
I'm waiting for the early stable version of 2.2.4 or 2.3 to adapt oryxgen to this new versions.

The 2.2.3 is not really stable. you'll get better results by using the latest 2.0.x release.

For example in the 2.2.3 in the XoopsMySQLDatabase class the quoteString function is

function quoteString($str)
{
 if (
is_string($str)) {
  
$str "'".str_replace('\"''"'addslashes($str))."'";
 }
 return 
$str;
}


In XOOPS 2.0.13, the code is
function quoteString($str)
{
  
$str "'".str_replace('\"''"'addslashes($str))."'";
  return 
$str;
}


I use this function to format field in the SQL requests. In 2.2.3 if my string is "" the quoteString return blank (becaus e "" isn't a string) witch provide a sql error...
Should i correct this in the oryxgen module or not ?

For me the quoteString will become
function quoteString($str)
{
  if (
is_string($str)) {
      
$str "'".str_replace('\"''"'addslashes($str))."'";
  } else if (!
$str) {
     
$str ="''";
  }
  return 
$str;
}


But i don't know if it is a bug or something of desired.



14
oryxvet
Re: oryxgen V 0.6
  • 2006/4/5 16:42

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Haihaihai !

oryxgen is useful with XOOPS 2.0.13. I suppose you use XOOPS 223. I never test it in such version.

To correct this bug (i'm not sure that it was the last), add in the file c:\appserv\www\x223\class\oryxgen\form\formloader.php

before this line
include_once XOOPS_ROOT_PATH.'/class/xoopsform/formtextdateselect.php';

add this line
include_once XOOPS_ROOT_PATH.'/class/xoopsform/xoopsformcalendar.php';


Best regards



15
oryxvet
Re: XML Integration
  • 2006/4/4 7:43

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


To parse a xml file in XOOPS you have a package xml in the ../class/xml directory in XOOPS 2.0.13.

1 - There is a parser call saxparser. You can use it directly or extend it if you want to save some informations during the file parsing. In this case you add attributes to save informations like parent informations.
2 - You must extend the class XmlTagHandler.
- getName return the name of the tag to perform. in your case it coundt be return 'product' if you want to perform the product tag.
- handleBeginElement : this funciton is execute when the parser begin the tag
- handleBeginElement : this funciton is execute when the parser begin the tag "getName()". You can here code an "echo" .
- handleEndElement : idem handleBeginElement at the end tag.
$parser = new xmlParser($fresource);
$parser->parse();
if (
$parser->getErrors()) echo($parser->getErrors()); 
else echo(
$parser->getLog());


An other better solution is to use a xsl file to transform your xml file in HTML. There is useful function in PHP to do that...

Hope that help



16
oryxvet
Re: oryxgen V 0.6
  • 2006/4/3 16:02

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


I have correct this small bug in this package :

http://www.oryxvet.com/dev/upload/oryxgen_0.6.rar

Is there someone who generate something usable with oryxgen ?
Just curious.



17
oryxvet
oryxgen V 0.6
  • 2006/3/16 18:37

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Here is the new oryxgen version (xoops module generator) witch include

--> a Generation of SQL file
--> New css menu avalable for IE (not perfect but ... )
--> Add a permission system
--> Add automatic managment of cols called : "uid_update", "uid_create", "user_id" ou "uid"
....
have a good time


http://www.oryxvet.com/dev/upload/oryxgen_0.6.rar



18
oryxvet
Re: A xoops module generator to test
  • 2006/2/21 10:10

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Quote:

It looks like this is one of the best module, which I am looking.


Thank

Quote:
But I tried to install this module on XOOPS 2.2.3 and I end up with couple of problems.

I'm sorry ! I currently work on the permission. I don't have new version. The next version will introduce permission : Each class and each attribute will have a permission for each group.

I focus myself on the 2.0.13 XOOPS version.
I'm waiting a stable version of the 2.2.x to looking at these problem. Do you think 2.2.3 is a stable version ? If it is, i can spend a couple of hour to modify oryxgen...

Quote:
Need to include formCalander.php file.

For the calendar :
In 2.0.13 the XoopsFormTextDateSelect don't work well. In the render() function of the class, you can't set the date format as i need. I hope the 2.2.3 can do that...

You must add the file root\class\xoopsform\formcalendar.php in the root\class\oryxgen\form\formloader.php file.

Quote:
setid() method not defined in formelement

For the setId, you must hack the oryxgen formelement : root\class\oryxgen\form\formelement.php .
Adding the code "getId" and "setId" from the
root\class\xoopsform\formelement.php class.

The next version of oryxgen will integrated this code...

Best regard



19
oryxvet
Re: A xoops module generator to test
  • 2006/2/9 11:00

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


Oryxgen is a XOOPS module generator. All generated module have the same ergonomics like the oxyxgen module with is a generated module.
The generated form is based on a database row identified by an id (entity). You can add entity, modify entity, and delete entity. You can also Add children entity to the entity and perform functionnales actions.

But not all code is generated. There is several possibility of personalization. Here are the principals:

1 - You can add php code a the end of the form by adding a php file named /personnalize/MyClass directory/form_end_MyClass.php

2 - For each class, a /personnalize/MyClass/action_myClass.php exist. In this class you can use this folowing function.
- $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

In this class, you can code
- In validate function : the functional constraint code. If a error message is adding, the action is not perform.
- In store_before function : the code to perform before store the entity
- In store_after function the code to perfom after store the entity
- The action defined for a class

3 - For each class you can add states. The advance of these various states can be modelled using UML by the stat chart diagram.
If the status is specified in oryxgen as a "php variable" this variable (a Boolean) must be coded in the /personnalize/MyClass/criteria_myClass.inc.php
In oryxgen, you can define for each status the attribute to show.

4 - For each class and each status.
You can add actions. The code of this action must be coded in the /personnalize/MyClass/action_myClass.php as a function. Once the module generated, this function will perform when the user submit action.

5 - If the attribute type is COMBO_PERSO, a file named as the attribute is generated in /personnalize/MyClass directory. You must code the array [key] [value] of the select combo.

6 - If the attribute type is CALULATED, a file as the attribute is generated in /personnalize/MyClass directory. You must code the value a this attribute.

.....



20
oryxvet
Re: A xoops module generator to test
  • 2006/1/23 8:37

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


In his first version this module was refused in xoops.org modules repository for several reason. I'll submit again this module in the xoops.org modules repository once i would have introduced a permission developpement and people as you will have validated the module.
This permission development will have to manage the authorization on each classes and on each classes attributes. I need it to construct a real intranet module with 3 ou 4 groups like "supplier", "customer", "employee", "manager". Each group witch don't have the same autorisation in reading, writing, deleting in classe or attribute's classe....
This development will be finished in 5 or 6 weeks.




TopTop
« 1 (2) 3 »



Login

Who's Online

185 user(s) are online (135 user(s) are browsing Support Forums)


Members: 0


Guests: 185


more...

Donat-O-Meter

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

Latest GitHub Commits