Package Development


(Gasosasedamdjepova) #1

Hi,

 

I want to create custom Squiz package to show in assets list to add aditional payment modules... for example...

 

Is there a documentation somwhere to be found how to create custom package?

 

Thanks


(Nic Hubbard) #2

I don't think the documentation is up anymore, but I have developed many packages and assets for Matrix. We have a custom package and custom asset called Remote Audio that I wrote for Pacific Union College, if you are interested, I zipped them up for you:

 

http://www.puc.edu/__data/assets/file/0004/149152/puc.zip

 

That should show you a pretty good example of how to create a custom package, and to even create a custom asset.

 

To install them you need to run step_03.php.


(Gasosasedamdjepova) #3

Hi Nic,

 

That is great thank you.

Sorry for late reply, but was bussy with other important things in life... as we all are.

 

I'll give it a try and hopefuly I can finaly do some customisation.

 

Thanks


(Benjamin Pearson) #4

Sorry for the late reply, I haven't much Matrix dev in a while, but as a general overview...

 

Package contains:

  • package.xml - XML description of the package
  • package_manager_PACKAGENAME.inc - Methods to install pieces of the packages during step3 like cron jobs, system assets etc.
  • queries.xml - XML file containing the package queries.
  • requirements.xml - XML file containing the requirements of this package (for the requirements script).
  • locale - a directory to contain files containing the strings of different languages (including english).

Then you create the directories to store your assets (Note I think this part is optional, and you can store assets at the package level, but this just provides consistency).

  • content_types - stores any custom content_types
  • cron_jobs - stores any cron jobs.
  • form - stores form actions, questions etc.
  • hipo_jobs - stores any custom hipo jobs.
  • page_templates - stores any custom pages.
  • triggers - stores any custom triggers.
  • ... and heaps more.

 

The *best* way to learn about the packages is to delve into something you are developing (so from your example you would look at the CMS packages for the listing and EComm for the payment stuff) and look to how it is structured.

 

BTW if you don't already know an asset consists a base 3 files: ASSET_edit_fns.inc (backend screen processing code), ASSET.inc (the core asset code) and ASSET_management.inc (the attributes and upgrade steps). There are other files as well (like XML screen definitions, locale stuff, images etc) but the 3 core asset files are the most important bits to get your asset working.

 

From memory, I don't this stuff was ever written down officially but I could be wrong.

 

Hope that helps,

Ben