Friday, August 26, 2011

Pure Javascript Bar chart

To show a chart, an existing library for charts creation will be necessary. I have chosen to use The jit Javascript library. In this library u create JSON object in server side then call your javascript function with JSON string parameter in user side. This is pure javascript library.

I choose this library because when  I search library for my genealogy tree I have found this lib more useful. For example I have created one diagram yesterday, which must show purchased ecards count by country.

So my SQL looks like following:

Sunday, August 14, 2011

YUI Date Formatting for MySQL date field

For example we want show report with date column. For this I have used YUI datatable (The DataTable control provides a simple yet powerful API to display screen-reader accessible tabular data on a web page. Notable features include sortable columns, pagination, scrolling, row selection, resizeable columns, and inline cell editing. For more information about YUI datatable read from here). Date field is timestamp type in MySQL DB.

Tuesday, August 2, 2011

JasperReport from XML Datasource with Inline Images

There are many library for creating reports. But personally I use Jasper Report. JasperReports is an open source Java reporting tool that can write to screen, to a printer or into PDF, HTML, Microsoft Excel, RTF, ODT, Comma-separated values and XML files. It can be used in Java-enabled applications, including Java EE or Web applications, to generate dynamic content.

I'm adding XML datasources for reports @ my work place and needed to embed the image signature for every report document.

Read Alfresco node to byte array in Javascript

When I created response document for all appeals I want replace signature in document too. But I must save signature images in repository because I want nobody can see signatures. Then I write small class and read image node from repository to byte array then send it to jasper report as Base64 encoded.
But how can u read image from byte array and show it in your document? If u are interested about this then u must read my other post :)

Friday, July 29, 2011

Update Task variables from Alfresco Javascript API

Hi. Alfresco has it's own javascript API for workflow. U can read abaut this from alfresco wiki:
1. Alfresco Javascript API
2. Workflow Administration

U can read and write task variables in JBPM. The Alfresco JavaScript action lets you embed custom JavaScript into process definitions in much the same way that you can embed BeanShell scripts. To do so, simply add an <action> element with class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript" attribute. Inside the <action> element, include a <script> element that defines the JavaScript to execute. As with the BeanShell script definitions, this <script> element may optionally contain <variable> elements
and an <expression> element if you want to limit access to process and task variables.