Wednesday, January 27, 2010

Alfresco FirstFoundationClient (How to setup and Run)

With this blog you will be able to setup and Run FirstFoundationClient sample of Alfresco.

1. Import FirstFoundationClient Project in eclipse (Assuming you are using eclipse).
2. Specify repository properties with “source/alfresco/extension/custom-repository.properties”.


#
# Sample custom content and index data location
#

dir.root=D:/javatools/alfrescorepo/alf_data
dir.indexes=D:/javatools/alfrescorepo/alf_data/lucene-indexes

#
# Sample database connection properties
#
db.name=alfrescorepodb
db.username=workalfresco
db.password=workalfresco
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfrescorepodb


3. Create New file “custom-hibernate-dialect.properties” under “source/alfresco/extension”.
#
# Sample Hibernate configuration for changing Database dialect
# For a full list: http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-optional-dialects
#


#
# PostgreSQL dialect
#
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.query.substitutions=true TRUE, false FALSE


4. Create new bean definition “hibernateConfigProperties” in “source/alfresco/extension/custom-repository-context.xml”.

<bean id="hibernateConfigProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations">
<list>
<value>classpath:alfresco/domain/hibernate-cfg.properties</value>

<!-- Override hibernate dialect -->
<value>classpath:alfresco/extension/custom-hibernate-dialect.properties</value>
</list>
</property>
</bean>


5. Run FirstFoundationClient.java with main method.

Note:
1. If you are using PostgreSQL or any other database please provide driver classpath or add additional jar to your project.
2. If your alfresco tomcat server is already Running Please try to change avm.jmxrmi.port from 50500 to 50502 and avm.remote.port from 1313 to 1315 in “/source/alfresco/extension/custom-alfresco-shared.properties”.