Page 1 of 1

Component XML Installation Problem

Posted: Tue Sep 11, 2007 11:53 pm
by uweD
Hi,

Can anyone see from this xml file below, why the joomla installer doesn't execute my SQL file? I can install my little demo component, but the tables are not being created. Have I missed something in the xml?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE install SYSTEM "http://dev.joomla.org/xml/1.5/component-install.dtd">
   <install type="component" version="1.5.0">
   
      <name>Messageboard</name>
      <author>Uwe Duesing</author>
      <creationDate>August 2007</creationDate>
      <copyright>Uwe Duesing</copyright>
      <authorEmail>[email protected]</authorEmail>
      <authorUrl>www.uweduesing.com</authorUrl>
      <version>1.5.0</version>
      <license>GNU/GPL, see LICENSE.php</license>
      <description>Demo component</description>
      
      <files>
            <filename>controller.php</filename>
            <filename>messageboard.php</filename>
            <filename>register_component.sql</filename>
            <filename>models/default.php</filename>
            <filename>models/save.php</filename>
            <filename>models/show.php</filename>
            <filename>tables/messages.php</filename>
            <filename>views/confirmsave/tmpl/default.php</filename>
            <filename>views/confirmsave/view.html.php</filename>
            <filename>views/enterdata/tmpl/default.php</filename>
            <filename>views/enterdata/view.html.php</filename>
            <filename>views/show/tmpl/default.php</filename>
            <filename>views/show/view.html.php</filename>
      </files>
            <install>
               <sql>
                  <file driver="mysql">install.mysql.sql</file>
                  </sql>
                </install>
                
                <uninstall>
                   <sql>
                      <file driver="mysql">uninstall.mysql.sql</file>
               </sql>
            </uninstall>
      <administration>
      <menu>messageboard</menu>
         <files folder="admin">
            <filename>admin.messageboard.php</filename>
            <filename>install.mysql.sql</filename>
            <filename>uninstall.mysql.sql</filename>
         </files>
      </administration>
</install>


Here is the sql

Code: Select all

DROP TABLE IF EXISTS `#__messageBoard`;

CREATE TABLE '#__messageBoard' IF NOT EXISTS (
'name' VARCHAR( 200 ) NOT NULL ,
'surname' VARCHAR( 200 ) NOT NULL ,
'email' VARCHAR( 200 ) NOT NULL ,
'message' TEXT NOT NULL ,
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
) ENGINE = innodb



Thanks a lot for your help,
Uwe

Re: Component XML Installation Problem

Posted: Wed Sep 12, 2007 1:07 am
by tjay
I dont see it, does it error on install?

Re: Component XML Installation Problem

Posted: Wed Sep 12, 2007 1:11 am
by uweD
No - But I have meanwhile rewritten the silly thing  ;) and surprise it works. It told me that everything was fine, but the data bas table was not created. Anyway here is my new xml file and suddenly everything is fine. One of those things I guess...

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install SYSTEM "http://dev.joomla.org/xml/1.5/component-install.dtd">
<install type="component" version="1.5.0">
   <name>Message Board</name>
   <!-- The following elements are optional and free of formatting conttraints -->
   <creationDate>2007 09 12</creationDate>
   <author>Uwe Duesing</author>
   <authorEmail>[email protected]</authorEmail>
   <authorUrl>http://www.uweduesing.com</authorUrl>
   <copyright>Copyright Info</copyright>
   <license>License Info</license>
   <!--  The version string is recorded in the components table -->
   <version>Component Version String</version>
   <!-- The description is optional and defaults to the name -->
   <description>Description of the component ...</description>

   <!-- Site Main File Copy Section -->
      <files>
            <filename>controller.php</filename>
            <filename>messageboard.php</filename>
            <filename>register_component.sql</filename>
            <filename>models/default.php</filename>
            <filename>models/save.php</filename>
            <filename>models/show.php</filename>
            <filename>tables/messages.php</filename>
            <filename>views/confirmsave/tmpl/default.php</filename>
            <filename>views/confirmsave/view.html.php</filename>
            <filename>views/enterdata/tmpl/default.php</filename>
            <filename>views/enterdata/view.html.php</filename>
            <filename>views/show/tmpl/default.php</filename>
            <filename>views/show/view.html.php</filename>
      </files>
   <install>
      <sql>
         <file charset="utf8" driver="mysql">install.sql</file>
      </sql>
   </install>
   <uninstall>
      <sql>
         <file charset="utf8" driver="mysql">uninstall.sql</file>
      </sql>
   </uninstall>  
   <administration>
      <!-- Administration Menu Section -->
      <menu>Message Board</menu>
     
      <!-- Administration Main File Copy Section -->
      <!-- Note the folder attribute: This attribute describes the folder
         to copy FROM in the package to install therefore files copied
         in this section are copied from /admin/ in the package -->
         <files folder="admin">
            <filename>admin.messageboard.php</filename>
            <filename>install.sql</filename>
            <filename>uninstall.sql</filename>
         </files> 
   </administration>
</install>