cancel
Showing results for 
Search instead for 
Did you mean: 

Solution to fulfill OA functions in Alfresco without much coding

andy2_0
Champ in-the-making
Champ in-the-making
The typical scenario is the expense reimbursement application process: application form (based on a template) submission; reimbusement-process follow-up; summarizing and reporting.

Below is the solution I drafted:

(1) create the Excel template, set a specific cell to a JSON string, in which the values (extracted from other cells) are stored in a format;
(2) put the template file to Repository>Data Dictionary>Node Template;
(3) add a property to those kind of templates, the property could be "value-in-json"
(4) user to create files based on the templates
(5) after the file edited and submitted, an additional action will be executed to get the json string from the specific cell and set it to the "value-in-json" property.
(6) get the JSON string for further process, for example, for sum-up.

My questions are as below:
a. in step 5, how to get the cell value from an Excel file in alfresco?
b. how about this solution, are there any better solutions without much coding?

Thanks in advance!
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Alfresco ships with Apache POI, a library that knows how to work with files created by office suites (like Excel). So you could write an Alfresco action that extracts the cell value using POI.

The POI method that looks most promising after a quick glance is:
http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Cell.html#getStringCellValue%28%29

If you need help writing actions, take a look at this:
http://ecmarchitect.com/images/articles/alfresco-actions/actions-article-2ed.pdf

You want the "action executer class" example.

Jeff

andy2_0
Champ in-the-making
Champ in-the-making
Jeff, thanks!