4 Replies Latest reply on Apr 9, 2010 1:37 PM by Benjamin Seyinbour

    GateIn Portal on PostgreSql

    wilson javier Newbie

      Hi all.

       

      I need integrate GateIn Portal with PostgreSQL. I'm new at this and do not know what I must modify configuration files.

       

      Thank you very much for any response.

       

      I work to GateIn on JBoss.

        • 1. Re: GateIn Portal on PostgreSql
          wilson javier Newbie

          hi all.

           

          I read and I could connect GateIn with PostreSQL.


          to follow the steps below:


          1. name of my database: jdbcjcr
          2. Username: test
          3. password: test


          The following files were modified:


          -> configuration.properties (server / default / conf / gatein)

           

          # Data
          gatein.data.dir=${jboss.server.data.dir}/gatein

          # DB
          gatein.db.data.dir=${gatein.data.dir}/db

          # JCR
          gatein.jcr.config.type=local
          gatein.jcr.datasource.name=java:jdbcjcr
          gatein.jcr.datasource.dialect=auto

          gatein.jcr.datasource.driver=org.postgresql.Driver
          gatein.jcr.datasource.url=jdbc:postgresql://localhost:5432/jdbcjcr
          gatein.jcr.datasource.username=prueba
          gatein.jcr.datasource.password=prueba

          gatein.jcr.data.dir=${gatein.data.dir}/jcr
          gatein.jcr.storage.data.dir=${gatein.jcr.data.dir}/values
          gatein.jcr.index.data.dir=${gatein.jcr.data.dir}/lucene
          gatein.jcr.index.changefilterclass=org.exoplatform.services.jcr.impl.core.query.DefaultChangesFilter


          # IDM
          gatein.idm.datasource.name=java:jdbcidm

           

           

          ->jcr-configuration.properties (server/default/deploy/gatein.ear/02portal.war/web-inf/conf/jcr)

           

           

          <external-component-plugins>
              <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
          ...........   

          ...........

                  <properties-param>
                    <name>ref-addresses</name>
                    <description>ref-addresses</description>
                    <property name="driverClassName" value="org.postgresql.Driver"/>
                    <property name="url" value="jdbc:postgresql://localhost:5432/jdbcjcr"/>
                    <property name="username" value="prueba"/>
                    <property name="password" value="prueba"/>
             
              </properties-param>
                </init-params>
              </component-plugin>
            </external-component-plugins>

           


          -> idm-configuration.properties (server/default/deploy/gatein.ear/02portal.war/web-inf/conf/organization)

           

          this has the same configuration as the previous file (jcr-configuration.properties)

           

           

          I hope this is helpful to someone. If you encounter any problems post them.


          I hope this is helpful to someone. If you encounter any problems post them.

          Thanks to all

          • 2. Re: GateIn Portal on PostgreSql
            Benjamin Seyinbour Expert

            Hi wilson javier,

             

            I don't think it is a good idea to hard-code the 'ref-addresses' values in the 'jcr-configuration.xml' (found in server/default/deploy/gatein.ear/02portal.war/web-inf/conf/jcr).

             

            It will pick up these values from the 'configuration.properties' (found in server/default/conf/gatein).

             

            Also note the following:

             

            1. In the configuration.properties, you might want to set:

             

            gatein.idm.datasource.dialect=pgsql

             

            2. In the repository-configuration.xml (found in server/default/deploy/gatein.ear/02portal.war/web-inf/conf/jcr), add to each '<lock-manager class>' the following line:

            <property name="jbosscache-cl-cache.jdbc.node.type" value="bytea" />

             

            PostgreSQL uses 'bytea' and not 'blob', which is the GateIn default, otherwise, you will have:


            Database exception. org.postgresql.util.PSQLException: ERROR: type "blob" does not exist.

             

            Cheers



             

             

            'configuration-configuration.xml'  changed to 'repository-configuration.xml'

            • 3. Re: GateIn Portal on PostgreSql
              wilson javier Newbie

              hi benjamin.

               

              Thanks for your response.

               

              I work with Gatein on Jboss.

               

              can not do this step 2 because I can not find the  file configuration.xml in the path that you show:

               

              2. In the configuration-configuration.xml (found in  server/default/deploy/gatein.ear/02portal.war/web-inf/conf/jcr), add to  each '<lock-manager class>' the following line:

               

              I do not know if this doing something wrong

               

               

              another question.

               

              assuming that I properly connected the GateIn with  PostgreSQL,
              which is the number of tables that  should show my database?

               

              thank for all

              • 4. Re: GateIn Portal on PostgreSql
                Benjamin Seyinbour Expert

                Hi Wilson,

                 

                There is no 'configuration-configuration.xml'  -- my mistake. You want 'repository-configuration.xml' (found in  server/default/deploy/gatein.ear/02portal.war/web-inf/conf/jcr). Inside, you will find something like:

                 


                <lock-manager class=...>
                <properties>
                <property name=... />
                <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
                <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
                <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="pk" />
                <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
                <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
                <property name="jbosscache-cl-cache.jdbc.node.type" value="bytea" /> < ------NOTICE THE value=bytea
                <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
                <property name="jbosscache-cl-cache.jdbc.datasource" value="${gatein.jcr.datasource.name}${container.name.suffix}" />
                </properties>

                 

                There are five of them to update. Just add to each one of them the entry:

                 

                <property name="jbosscache-cl-cache.jdbc.node.type" value="bytea" />

                 

                 

                >>assuming that I properly connected the GateIn with  PostgreSQL,
                >>which is the number of tables that  should show my database?

                 

                1. Well since you have 'jdbcjcr' in your 'configuration.properties' you should have that database, but my advice is that you create it in PostgreSQL yourself. And when you restart GateIn, you should see 17 tables in the jdbcjcr database.

                 

                2, Also don't forget that you need to do:


                <property name="url" value="jdbc:postgresql://localhost:5432/jdbcjcr_${name}/> <------ NOTICE THE '_${name}' at the end.

                 

                (i) In mine, I am using '_portal' instead of '_${name}' because of errors thrown when I use '_${name}'.   See the GateIn Reference Guide @ 2.1.2. "Configuring the database for JCR", it will explain to you why you need the suffix.

                 

                (ii) You also need to create a database for your  IDM. If your have in 'configuration.properties' something like:

                 

                gatein.idm.datasource.url=jdbc:postgresql://localhost:5432/jdbcidm_${name}

                 

                Then when you restart GateIn, you will have 17 tables in this database also.

                 

                Cheers