HowTo enable comments in a postgresql-openCMS

9. Feb. 2009
Opencms-Version 7.0.5

Without compiling the whole project.

I found some days ago, comments and the formgenerator are not working together
with postgresql. The problems are caused by the used database/generic.properties, where
statements like these are defined:

---------------- INDEX WFE_DATE_IDX (DATE_CREATED)\ ) ENGINE=MYISAM DEFAULT CHARSET=UTF8 SELECT MAX(CMS_WEBFORM_ENTRIES.ENTRY_ID) MAXID FROM CMS_WEBFORM_ENTRIES ---------------- This causes an sql-error when com.alkacon.opencms.formgenerator_1.2.0 is used. If you want to use formgenerator and comments in your openCMS you have to do the following: unzip com.alkacon.opencms.formgenerator_1.2.0.zip you will find: /system/modules/com.alkacon.opencms.formgenerator/lib/com.alkacon.opencms.formgenerator.jar in it unzip it also you will find: /com/alkacon/opencms/formgenerator/database/generic.properties correct then syntax-errors in it: (line 30) READ_NEXT_ENTRY_ID=\ SELECT MAX(CMS_WEBFORM_ENTRIES.ENTRY_ID) MAXID FROM CMS_WEBFORM_ENTRIES change it to: READ_NEXT_ENTRY_ID=\ SELECT MAX(CMS_WEBFORM_ENTRIES.ENTRY_ID) as MAXID FROM CMS_WEBFORM_ENTRIES ^^^^ in line 78 change COUNT_FORM_ENTRIES=\ SELECT \ COUNT(DISTINCT CMS_WEBFORM_ENTRIES.ENTRY_ID) COUNT \ FROM CMS_WEBFORM_ENTRIES to COUNT_FORM_ENTRIES=\ SELECT \ COUNT(DISTINCT CMS_WEBFORM_ENTRIES.ENTRY_ID) as COUNT \ FROM CMS_WEBFORM_ENTRIES ^^^^^ you may also change line 1 to 25 to a postgresql-syntax. But another way is also possible: execute these statements in your database: CREATE TABLE cms_webform_data ( ref_id integer NOT NULL, fieldname character varying(256) NOT NULL, fieldvalue character varying(1024) NOT NULL ); CREATE TABLE cms_webform_entries ( entry_id integer NOT NULL, form_id character varying(256) NOT NULL, date_created bigint NOT NULL, resource_id character varying(36) NOT NULL, state integer NOT NULL ); now create a new jar-file "zip -r ../com.alkacon.opencms.formgenerator.jar ." from the root-directory of the jar-file (which holds "/META-INF" and "/com") then change to the root-directory of the zip-file (which holds "/system", "components.properties", and "manifest.xml") and put all together in an new zip-file zip -r ./com.alkacon.opencms.formgenerator_1.2.0.zip . now you have a new webform modul. follow the instructions in the Alkacon_OAMP_Webform.pdf and install in on the server.
now you are able to use webforms ans comments (if com.alkacon.opencms.comments_1.0.0.zip is also installed)


good luck ;-)

wicki[at]erste.de