Dashboard > Community Wiki > ... > Modules > PUR implementation with Spring - Hibernate - HSQLDB
PUR implementation with Spring - Hibernate - HSQLDB Log In View a printable version of the current page.

Added by Vaudano Luca , last edited by Boris Kraft on Jun 23, 2008  (view change)
Labels: 

The original PUR module works as all things Magnolia using the Java Content Repository. You will find it on SVN community modules. The example below shows you how to use it directly with a database instead of JCR.

1 Unzip hsqlbd
2 Run runServer.bat or runServer.sh for starting the HSQL db in server mode

3 Create the tables:
CREATE TABLE "INTERNET_USER" (
    INTERNET_USER_ID integer NOT NULL IDENTITY,
    USERNAME varchar NOT NULL,
    PASSWORD varchar NOT NULL,
    EMAIL varchar NOT NULL,
    FULL_NAME varchar,
    STATE decimal NOT NULL,
    CREATION_DATE date NOT NULL
 );
 CREATE UNIQUE INDEX INTERNET_USER_FK1 ON INTERNET_USER(INTERNET_USER_ID);
 CREATE UNIQUE INDEX INTERNET_USER_FK2 ON INTERNET_USER(USERNAME);
 CREATE UNIQUE INDEX INTERNET_USER_FK3 ON INTERNET_USER(EMAIL);

 CREATE TABLE "INTERNET_USER_ATTRIBUTE" (
   INTERNET_USER_ATTRIBUTE_ID bigint NOT NULL IDENTITY,
   INTERNET_USER_ID decimal NOT NULL,
   ATTRIBUTE_KEY varchar NOT NULL,
   VALUE_KEY varchar NOT NULL
 );
 CREATE UNIQUE INDEX INTERNET_USER_ATTRIBUTE_FK1 ON INTERNET_USER_ATTRIBUTE(INTERNET_USER_ATTRIBUTE_ID);

4 Adds the two projects (magnolia-core-integration and magnolia-module-PUR) in your workspace

5 In your Dynamic Web Application add:
a) in WEB-INF/web.xml this code just before </web-app>:

  <!- SPRING - START ->
  <!- Loads the root application context of this web app at startup (Spring) ->
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
 
  <!- Configuration for Public User Registration module ->
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      classpath:eu/vaudano/pur/springConfig/applicationContext.xml
      classpath:eu/vaudano/pur/springConfig/daosAccessContext.xml
      classpath:eu/vaudano/pur/springConfig/managersAccessContext.xml
    </param-value>
  </context-param>
  <!- SPRING - END ->

b) copy in the WEB-INF directory the file magnolia-module-PUR/src/main/test/hibernate.properties
c) Copy the jar files, zipped in jars.zip, in WEB-INF/lib

may I ask
1) to add some description of what you're trying to achieve
2) what the point is of ripping half of the public-user-registration community module's code off and changing the headers and author attribution, instead of contributing and proposing patches ?

1) Because I made a question in the magnolia-user mailing list and I didn't have a reply, so I start to make this module.
The question is:
if I have one author instance and two public instance, the three JCR repositories after a user registration could become not align, right?
And I made this module that saves the user profile in an external DB.

2) Sorry for the ripping!!!  (I said in the mailing list that " I used the design, the structure and some methods of the PUR module
present in the SVN repository of Magnolia".)
Again sorry but I'm a newbie of contributing in source code...  How I can contribute?

I change the header of incriminate files

Powered by a free Atlassian Confluence Open Source Project License granted to Magnolia International. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators