mfrench
I'm new here

Best method for writing to the FirstSpirit database from a generated webpage?

Hello,

We have several forms on our site, some of which need to store information into a database.  The database already resides in FirstSpirit, as we filter this information through workflows, and in some cases, back out to the website. 

A good example is our Product Dealers.  We have a page that allows users to enter an address, then shows them a map & list of registered dealers in their area.  (Like a store locator)  These dealer can apply on our site using a form, which saves their information and sends a notification to the business owner so they can 'approve' or 'reject' the application.  Once approved, this dealer needs to be added to the database which is fed to the Dealer Locator page. I'd like this to be automatic- it should write the entry to the FirstSpirit database (but not release it), then the editor can review the content and make changes if necessary before releasing it for use on the generated site.

So far, I see two options:

Develop a plugin/module for FirstSpirit which accepts an incoming form post (is this even possible?)

Create a JSP page that manually connects to the SQL database via JDBC to store the data

I'm hoping someone in the community might have some experience doing this, or some insight as to how I can get started on this.

-Mike

0 Kudos
3 Replies
bohm
I'm new here

Hi Mike,

If you want to enter records into a FirstSpirit-driven database we strongly recommend using the official API. Accessing the database directly via SQL is discouraged for data integrity reasons. So your first option is the right way to go.

How the information travels from the form to the module which transforms it and enters it into FirstSpirit's database should be discussed in a solution design. There are numerous ways to achieve this each with different levels of complexity and there is no single best solution. I have also sent you an email regarding your particular usecase, so let's get together and discuss options to find the best solution for you.

Hope this helps

Christoph

Hello Mike,

do you need further help or did Christoph's reply already help you? In this case it would be great if you mark his reply as "correct answer".

If you have found a solution by yourself it would be very kind of you if you describe it here.

Best regards

Michaela

0 Kudos

Christoph,

Thank you for your reply.  As you know, we are investigating ways to acheive some of our goals by using the WebForms module for FirstSpirit.

For deeper levels of data customization (information that is not presented in WebForms), we will need a (internal-only) central interface that allows reporting, viewing, and editing of data such as products, projects, dealers, etc.  Since this data may not live in FirstSpirit, my instinct is to write this all in a self-contained FirstSpirit project using HTML and JSP's to connect to a SQL database.  If you have any further insights to this approach, I welcome your suggestions.

Thanks!

Mike

0 Kudos