[opencms-dev] create table on module import

Paul-Inge Flakstad flakstad at npolar.no
Tue Aug 3 10:29:11 CEST 2010


Hi again Thomas,

Actually, the method description for the mentioned initialize(...) method reads:
(...) if the module requires special DB tables to be created, you should implement a check if theses tables exist in this method, and if they don't exist create them as needed.

So I guess there isn't a better way. ;-)

Best regards,
Paul 

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of 
> Paul-Inge Flakstad
> Sent: 3. august 2010 10:25
> To: The OpenCms mailing list
> Subject: Re: [opencms-dev] create table on module import
> 
> Hi Thomas,
> 
> There may very well be other (and better) ways to achieve 
> what you want, but one thing that comes to mind is the module 
> action class.
> 
> The initialize(...) method of a module's action class is 
> called by the OpenCms system during server startup. From 
> within this method of your own module's action class, you 
> could check if the table exists, and create it if needed.
> 
> If you're unfamiliar with module action classes, the Wiki 
> might be helpful: http://tinyurl.com/2cv45pr
> 
> Best regards,
> Paul
> 
> > -----Original Message-----
> > From: opencms-dev-bounces at opencms.org 
> > [mailto:opencms-dev-bounces at opencms.org] On Behalf Of remschi at gmx.at
> > Sent: 3. august 2010 10:01
> > To: opencms-dev at opencms.org
> > Subject: [opencms-dev] create table on module import
> > 
> > Hi!
> > 
> > I'm creating a module and would like to store data in a (new) 
> > database table (which should be in the same database as all 
> > the opencms-table).
> > 
> > My question is now:
> > Is it possible that the table is created automaticly on 
> > module-import (when someone installs the module)? So that 
> > create script is packed into the module zip or similar...
> > I couldn't find any help in the forums or the wiki...
> > 
> > Thanks!
> > 
> > Thomas
> > -- 
> > Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
> > Jetzt De-Mail-Adresse reservieren: 
> http://portal.gmx.net/de/go/demail
> > 
> > _______________________________________________
> > This mail is sent to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, 
> > please visit
> > http://lists.opencms.org/mailman/listinfo/opencms-dev
> > 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 


More information about the opencms-dev mailing list