Jump to content


Photo

How to extend data model?

data model extend

  • Please log in to reply
11 replies to this topic

#1 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 09 November 2011 - 10:31 AM

I would like to extend the data model of Zurmo in order to give him some extra functionalitie.
For example I would like to create a new class called color:
- From which class, controllers, views should I inherit?
- How to define the class and configure it so all tables are created during install (or post-install)
- How to secure it?
- How to add it to the menu? (principal or admin)

#2 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 09 November 2011 - 03:57 PM

Can you describe a bit more about the use-case for the 'color' class? This will help me make a solid recommendation as to how to approach the customization.

Jason Green
Zurmo Team
Need support? Upgrade now


#3 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 10 November 2011 - 09:03 PM

The main purpose is to add colors and sizes to opportunities and generate articles from it (Color-Size). Below I describe the behaviour for Color but Sizes is very similar.

A TechnicalColor is a class with an ID, Name, Description, Image, Red value, Green value, Blue value.
A MarketingColor is a class that references a TechnicalColor and has a an ID, Name, Description, Season (ValueList)
An Oportunity can have 0 or more MarketingColor
An Oportunity can have 0 or more Size
An article (Marketing Color/Size combination) can be generated selecting a size and a Marketing Color.
An article has some extra attributes as Color, Size, Status, SKU, Description, price, etc..


I hope this will explain the use-case.

Regards

#4 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 11 November 2011 - 03:47 PM

I am going to write a wiki today explaining how to approach this.

Jason Green
Zurmo Team
Need support? Upgrade now


#5 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 11 November 2011 - 06:27 PM

http://zurmo.org/wik...stomizing-zurmo

I hope this helps. Please let us know if you have more questions. I will be adding to this as I get time, but at least with the example custom instance, you should be able to get started correctly.

Also - remember to turn on debug in debug.php and also keep in mind that during development things will cache, so you might want to turn off caching during development. I like to personally keep it on, but if i ever need to clear the cache i will add the parameter &clearCache=1 to the url if I am refreshing a page. This will force the cache to clear.

Jason Green
Zurmo Team
Need support? Upgrade now


#6 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 13 November 2011 - 06:29 PM

Thanks it's a very good starting point, but for me is a little bit hard to follow the customization process trough the code.
I used windiff to check the differences between the standard zurmo project and this baseline and there are many of them:
- The whole animals module is new
- Many other files are different due to Unix-Windows commands

I also had problems installing this version....After the settings page the page stays blank.

I hope you will have some time to explain the process step by step.

#7 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 14 November 2011 - 09:57 PM

I will see whats up with the install not working on zurmo zoo. Also i will add more to the wiki to provide additional explanation. i will try to do this today.

Jason Green
Zurmo Team
Need support? Upgrade now


#8 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 15 November 2011 - 06:53 PM

I tried to install from scratch zurmozoo and it installed fine. When you get a blank screen, you should check the php error logs on your machine. It might give a clue as to what is happening.

What i would like to do is a skype IM chat with you to go over the zurmozoo customizations. This will help me understand more of what kind of instruction you are looking for so i can improve the wiki article. I will PM you my info.

Jason Green
Zurmo Team
Need support? Upgrade now


#9 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 15 November 2011 - 08:19 PM

Hi
I found the problems
in DatabaseMaxAllowedPacketSizeServiceHelper.php line 47 I had to replace checkDatabaseMaxAllowedPacketsSize by getDatabaseMaxAllowedPacketsSize
in DatabaseMaxSpRecursionDepthServiceHelper.php line 47 I had to replace checkDatabaseMaxSpRecursionDepth by getDatabaseMaxSpRecursionDepth
But there is also a missing function in DatabaseDefaultCollationServiceHelper.php as the InstallUtil.php file does not have any method related to collation.
Maybe I got the wrong InstallUtil.php ?

#10 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 15 November 2011 - 11:34 PM

Did you do a clone from bitbucket of zurmozoo? Can you attach your installUtil.php file? seems like maybe you have something different for that file.

Jason Green
Zurmo Team
Need support? Upgrade now


#11 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 17 November 2011 - 05:55 PM

Just checked out again and everything is fine, sorry. Just needed to some changes to make it run under IIS

#12 Jason

Jason

    Administrator

  • Administrators
  • 717 posts
  • LocationChicago

Posted 17 November 2011 - 08:23 PM

We chatted on IM about this issue. Turns out we need a few more tests for running on IIS. Thanks for your feedback!

Jason Green
Zurmo Team
Need support? Upgrade now






Also tagged with one or more of these keywords: data, model, extend

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users