Welcome, Guest
Username: Password: Remember me

TOPIC: Multiple Components - Same Database?

Multiple Components - Same Database? 06 Apr 2012 05:28 #1921

  • edwardcox
  • edwardcox's Avatar
  • Offline
  • Premium Member
  • Here to help.
  • Posts: 131
  • Thank you received: 26
  • Karma: 12
So, I had this thought as once suggested by Jocelyn, but wondered how it might work.

I know this is not a natural function of J-Cook.

To break down a large project into smaller manageable chunks it might be good to create several Projects (Components) and have each handle different functions - However; that would require that they all shared the same Database and Tables for consistency.

If I create 2 Projects (2 Components) and give them each the same Table name and Field Names I assume that I would have to change the actual Database names to match (after Downloading Projects).

Where in the project should I look to identify the Database? And in theory would this work as described?

Food for thought.

Edward.
Passionate Joomla! Developer and J-Cook pro evangelist.
www.jcombuilder.com - we build great Joomla!® Components so you don't have to.
The administrator has disabled public write access.

Re: Multiple Components - Same Database? 06 Apr 2012 05:39 #1922

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Hi edward,

Cook does not support this for the moment.

TODO :
Once your component is created,
1. Delete the lines that creates the database tables in your installation file.
2. Rename the table name in the table files (PHP) of your component.(constructor)
3. Make a search and rename tables names in SQL queries
4. That's all ;-)

(I am quite sure you should rename the tables because of the alias prfix of your project)
Coding is now a piece of cake
Last Edit: 06 Apr 2012 05:40 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: VeCrea, edwardcox

Re: Multiple Components - Same Database? 12 Apr 2012 19:08 #1981

  • coopdb
  • coopdb's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
I have do it the same way and it works.
But I had problems with case sensitiv fields in the table.
The fields were not shown in my component. So I have renamed all table fields.
J-Cook doesn't use case senstivite tabel fields. Is that correct? Will this be possible in the future?
The administrator has disabled public write access.

Re: Multiple Components - Same Database? 12 Apr 2012 19:53 #1982

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
That's a good question.

Thank's for asking.
Not thinked about yet.

TODO : search and replace on ALL your component.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: edwardcox
Time to create page: 0.121 seconds

Get Started