CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Creating new tables for civipetition
Pages: [1]

Author Topic: Creating new tables for civipetition  (Read 1062 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Creating new tables for civipetition
February 26, 2010, 10:54:57 pm
Hi,

want to try using GenCode and the xml schemas to create DBs. Is the syntax described somewhere ? Couldn't find it in the wiki.

On a practical note, what editor do you use for xml ? doing it in vim is no fun (or I'm missing a magic plugin) ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Creating new tables for civipetition
February 27, 2010, 07:41:26 am

not documented as yet. would be great if you can start off the documentation on that

I use a lot of copy and paste for that and dont use an xml editor. On the other hand we dont do a lot of table creation so dont modify / create a lot of those files

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Creating new tables for civipetition
March 05, 2010, 10:59:51 pm
I've tried to extract a DTD. Am I right to understand that the xml is "flat". eg the tag to express a foreign key or add an index is at the same level as the tag to create the field ?

It is mostly clear, but for the headerPattern. Where is it used ?

Is there a way to have a crud on the top of the BAO easily ? How do you generate the default basic interface ? By hand ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Creating new tables for civipetition
March 06, 2010, 06:58:52 am

1. yes the xml is flat. the FK and index are at the same level as the tag. check Contact.xml for a good example

2. the headerPattern is for import purposes, to match the header to the csv file

3. Currently no, since we never needed it. We've used base classes for this a fair amount to minimize work done.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Creating new tables for civipetition
March 06, 2010, 08:29:14 am
Do you have a suggestion for an exemple of minimum amount of customisation on the top of the base classes I could follow ?

Eg. do you have to list of the fields on the QF or can it be done automatically ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Creating new tables for civipetition
March 06, 2010, 02:23:07 pm

All the information u need is present in the DAO object ($_fields)

u'll need to write a loop to iterate thru those fields and then create a QF element. Creating a text element is the easiest :) You can potentially also write a generic tpl file to display all these form elements

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Creating new tables for civipetition

This forum was archived on 2017-11-26.