How to create own database and table in dotCMS 2.5.6

79 views
Skip to first unread message

Dheeraj Dheeru

unread,
Nov 19, 2014, 8:58:23 AM11/19/14
to dot...@googlegroups.com
Hi Guys,
I created a form and the form  data is storing in dotcms3 database in that contentlet table  ,but I have to store data in another table ,so, can anybody tell how it possible?

Jason Tesser

unread,
Nov 19, 2014, 9:01:39 AM11/19/14
to dot...@googlegroups.com
you would need to create your own servlet or jersey class or something serverside to POST to. 

maybe something like this 

or 


You can get more info on plugins in dotCMS here 

On Wed, Nov 19, 2014 at 8:58 AM, Dheeraj Dheeru <dhee...@gmail.com> wrote:
Hi Guys,
I created a form and the form  data is storing in dotcms3 database in that contentlet table  ,but I have to store data in another table ,so, can anybody tell how it possible?

--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms.
For more options, visit https://groups.google.com/d/optout.

Falzone, Chris

unread,
Nov 19, 2014, 9:10:57 AM11/19/14
to dot...@googlegroups.com
So a couple things you could do here:

1) after the content is saved you could write a process to pull it into your external db.  This could be done with the Rest API, or even manually using the UI Export to CSV tooling.  You could also write a PostContentletHook to do this.

2) If you want to save it only to your external db, you would need to write your own handler, this could be a rest service or servlet/struts-action/spring-controller/etc:


If you need to interact with an external db (or even a side-loaded table in the main dotCMS db) you can use the dotConnect class:

For an external db, you'll need to map the connection pool in your servlet container's mapping file (ROOT.xml for tomcat)

Hope that helps!

On Wed, Nov 19, 2014 at 8:58 AM, Dheeraj Dheeru <dhee...@gmail.com> wrote:
Hi Guys,
I created a form and the form  data is storing in dotcms3 database in that contentlet table  ,but I have to store data in another table ,so, can anybody tell how it possible?

--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms.
For more options, visit https://groups.google.com/d/optout.



--

Christopher Falzone

Interactive Developer


A Q U E N T

Digital, Creative, and Marketing Talent


aquent.com

cfal...@aquent.com

Dheeraj Dheeru

unread,
Nov 19, 2014, 9:18:24 AM11/19/14
to dot...@googlegroups.com
guys ,can you elaborate it ,I didn't get it

Nathan Keiter

unread,
Nov 19, 2014, 9:21:48 AM11/19/14
to dot...@googlegroups.com

I don’t think it could be any more elaborate than Chris’ answer.

 

Basically, you will need to write custom code to save it anywhere else.  Preferably in an external database.

 

Maybe another idea would be to do an export of the content and upload it somewhere else.

 

Nathan

 

Nathan I. Keiter

Lead Network Applications Programmer

DataSystems

Gettysburg College

Campus Box 2453

717-337-6993

 

Measure your success by the level of service you provide.

Si hoc legere scis nimium eruditionis habes.

--

Kivi Shapiro

unread,
Nov 19, 2014, 9:57:27 AM11/19/14
to dot...@googlegroups.com
On Wednesday, 19 November 2014 08:58:23 UTC-5, Dheeraj Dheeru wrote:
I have to store data in another table

It's worth confirming that this is a requirement. With dotCMS as an xCMS (https://dotcms.com/videos/dotcms-xcms-solution), you might not need to touch the database at all.

Kivi Shapiro
Qualicom Innovations
Reply all
Reply to author
Forward
0 new messages