cancel
Showing results for 
Search instead for 
Did you mean: 

How to extend Alfresco?

agey
Champ in-the-making
Champ in-the-making
Hi all,

I need some help please as I have some doubts on how I can extend Alfresco :shock: :

I need to develop an application to manage dossiers composed by a set of documents and information as metadata related to these dossier. I have thought about creating each dossier as  an Alfresco's space where I can save the scanned documents belonging to each dossier. For the information, instead of using the metadata of the dossier (Alfresco's space) I have thought of extending Alfresco's database with new tables because we would have many and  different types of information to store. When a dossier is created, first a space would be created in Alfresco to contain the documents of the dossier and on the other hand, the information should be written in the new tables of the database (as I said we would need to store too much to keep it as metadata). A workflow process would be defined to approve dossiers for different departments based on a set of conditions. These conditions should be configurable since they can change at any time. My doubts are:

- Which is the best way to perform this? Must I use the WebService and / or WebScripts to integrate Alfresco with a new web application that we would need to develop? Or shall we  create Alfresco's new modules with the new functionalities and  integrate them in the jsp code of the Alfresco pages we can develop and adapt?

- How does Alfresco connect to the database? Is there any documentation I can check to see how I can expand Alfresco's db adding new tables and accessing them from the Alfresco Application?

I would be grateful for any help or indicate of how I should do it. I got quite lostnow as this is stoping our development now

Thank you very much in advance.
5 REPLIES 5

zaizi
Champ in-the-making
Champ in-the-making
Which is the best way to perform this? Must I use the WebService and / or WebScripts to integrate Alfresco with a new web application that we would need to develop? Or shall we create Alfresco's new modules with the new functionalities and integrate them in the jsp code of the Alfresco pages we can develop and adapt?

This depends. It really depends on various factors. Without knowing the more about your web application's requirements, skill set of developers, strategic plans, etc. we can't give a definite answer. However, the quickest and easiest way to get an initial solution up and running would be to create an Alfresco module.

How does Alfresco connect to the database? Is there any documentation I can check to see how I can expand Alfresco's db adding new tables and accessing them from the Alfresco Application?

Would strongly suggest you stay away from extending the Alfresco database. If you have to use a database to store information use a different database. What kind of information do you have to store that you can't store in Alfresco?

If you want to discuss your options and pros / cons of each approach please contact us directly. We'd be more than happy to provide you with Alfresco consulting.

agey
Champ in-the-making
Champ in-the-making
Hello Zaizi,

Thank you very much for your reply.

I have extended Alfresco to develop a dossiers management application. I have used a different database to store other information outside Alfresco.

Now I have a doubt about the transaction manage. The services of the new application uses services of Alfresco.

This new services are configured to connect new database and use a different SessionFactory and TransactionManager than Alfresco services. The problem is when an error occurs in the new database, the rollback is done in the new database but not in Alfresco.

This is the new configuration:

The TransactionManager bean

<bean id="transactionManagerNew" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="transactionSynchronizationName">
            <value>SYNCHRONIZATION_ALWAYS</value>
        </property>
        <property name="sessionFactory">
            <ref bean="sessionFactoryNew" />
        </property>
    </bean>

The SessionFactory bean

<bean id="sessionFactoryNew" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource"><ref local="myDataSource" /></property>
      <!– Must references all OR mapping files. –>
      <property name="mappingResources">
         <list>
            <value>org/new/hibernate/mapping/Dossier.hbm.xml</value>
            …
         </list>
      </property>
      <property name="schemaUpdate"><value>false</value></property>      
      
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
            <prop key="hibernate.connection.pool_size">1</prop>
            <prop key="hibernate.hbm2ddl.auto">false</prop>
            <prop key="hibernate.show_sql">false</prop>
         </props>
      </property>
   </bean>

The new services are configured with:

<property name="transactionManager"><ref local="transactionManagerNew"/></property>

How can I configure the transactionManager to use one transaction to connect two databases? Is it posible?
How can I configure to do rollback in two databases when an error occurs?

Thank you very much in advance,

zaccret
Champ in-the-making
Champ in-the-making
Did you find a solution ?

prateekgoyal
Champ in-the-making
Champ in-the-making
Hi,

Did you managed to integrate alfresco with your web application.Actually i'm also working on the web application in i want to use alfresco as DMS and using jBPM as workflow engine.
Can you guide through the approach to start my work.

Please Reply

Thanks.

yaziderman
Champ in-the-making
Champ in-the-making
Hello,

Zaizi said:
the quickest and easiest way to get an initial solution up and running would be to create an Alfresco module.

How is that? is there any related documentation?