cancel
Showing results for 
Search instead for 
Did you mean: 

How to Creat Custom Table and accessing it

koteswar
Champ in-the-making
Champ in-the-making
Hi ,
  I need to create new table and i have to store some custom data into table , How we can Create and how we can access it ?
DB is HSQL only
Please let me know ASAP
19 REPLIES 19

asurjit
Champ in-the-making
Champ in-the-making
Thanks for your reply.

Web Services or Web Scripts

I am not very clear how you are going to use your web scripts or web services to populate this content. Where will you invoke any of this service? How will you tie your file system deployment with web services to populate the content in transactional mode?

Will be good if we have any documented steps to use Web Services or Web Scripts to populate Alfresco content in portal database.

This is integral feature of a content deployment module for a content management system and detailed steps on wiki will be appreciated.

Thanks
-Amar

mabayona
Champ on-the-rise
Champ on-the-rise
You can trigger the update either from inside Alfresco or from outside. My recommendation is to use Javascript/web scripts and to activate the triggers (e.g. custom behavior or custom actions) to do the update.

The Development guide is full of info about how to do it.

Anyway, you should provide a little bit more background of your use case for us to be able to give you better advice (we are not mind readers! Smiley Happy)

asurjit
Champ in-the-making
Champ in-the-making
Okay here comes the use case details

We have news articles in our web site and no of news articles are huge in number and appearing on different places on the site. For eg latest three news article on home page, latest 3 articles from each news category on news hub page and then list of news articles on news article page itself.

There are two ways to achieve this, One is to generate all the pages on addition of new news article in WCM or you capture the article details in the CMS and then populate article details on the portal database so that portal can fetch the information at run time.

In this scenario, we want to publish Article Title, id, date, body, summary fields in the database so that portal can display them at run time by fetching the values from news_article table.

Every article has pdf document also attached which we can deploy using File system deployment but to update the database is not working.

You mentioned lots of places in development guide this information is given but we tried to find this information and we are unable to find it anywhere.

I hope you do not need to read my mind any further and should have more detailed reply on this.

Thanks,
-Amar

mabayona
Champ on-the-rise
Champ on-the-rise
"I hope you do not need to read my mind any further and should have more detailed reply on this."

Amar, please do not forget that this is a public forum and  that we are not obliged to answer your questions. I would recommend you to be nicer if you want an answer.

Short. If the number of news articles is HUGE and the refresh frequency is BIG then you should go directly to a WCM-based solution.

asurjit
Champ in-the-making
Champ in-the-making
I did not write this with hard words..it was just a funny reply..probably I forgot to put smily in rush Smiley Happy

I do appreciate your help for sure mate..

"Short. If the number of news articles is HUGE and the refresh frequency is BIG then you should go directly to a WCM-based solution."

When you say WCM based solution..will be great if you can detail it out a bit. Do you mean to access the WCM content repository using web scripts here?

This can have definitely performance issues and apart from this our key concern is, we are definitely missing an important piece of functionality in Alfresco which put me in doubt while suggesting to use Alfresco for their implementations.

Would like to confirm if this is definitely not possible using Alfresco in the current state?

cheers,
-Amar

mabayona
Champ on-the-rise
Champ on-the-rise
Basically, if you got mostly web content (e.g. stored as  XML) then WCM. There you can use either java or javascript depending of your skill and performance requirements. Also you can define custom workflows to fine tune the content lifecycle.

asurjit
Champ in-the-making
Champ in-the-making
I am not sure how do I perform this using JavaScript but only option can be to write a custom workflow using jbpm and one of the task in that will be to get the content from xml files and write them to the custom tables. This can be a workable option but this would require lots of custom coding and apart from this it will not provide transactional behaviour for the content deployment.

This is definitely a hard way to go with Alfresco!

mabayona
Champ on-the-rise
Champ on-the-rise
If all you need is to extract data to a table/database, the easiest most scalable solution is to write webscripts inside Alfresco that extract the data and to call them from your external application that populates the table/database.

Look for web scripts info in the Development Guide.

anupnepal
Champ in-the-making
Champ in-the-making
Hello

I have created a new workflow regarding payment in alfresco community edition using SDK

But in that work flow I need to display the Currency data and Department data in dropdown box

I have created a new page for currency and have also made an webscript api for it.

My problem is that I need a place to store the information, i read your discussion and found that creating new table is bad approach so can you please point me towards right direction

Thankyou

anupnepal
Champ in-the-making
Champ in-the-making
Hello,

Well i managed to save the data in the Node. I created a custom model, with files currencyModel.xml and currency-model-context.xml. And managed to save the data in the Node by creating and new Interface CurrencyService.java and its implemented class CurrencyServiceImpl.java and saved the data in the format of the currencyModel.xml, i called the service from the API i created for Currency.

Thank You