Tuesday, January 27, 2009

Rivilės duomenys veikia, klaidingas pranešimas

Rivilės padalinių ir gamintojų klausimas sekmingai išspęstas. Pasirodo neteisingai nurodyti prisijungimo duomenys. Viskas veika, klausimų nėra.

Prisijungimas prie Rivilė duomenų bazės

Produktų katalogui reikalingi duomenys iš Rivilė duomenų bazė. Deja negaliu patikrinti "Rivilės padaliniai" ir "Rivilės gamintojai" vartotojo interfeiso. Problema susijusi su prisijungimu prie atitolusios duomenų bazės. Iki vakaro butinai reikia tai išspręsti.

Šalių administravimo dialogas padarytas

Šalies administravimo interfeisas padarytas, pratestuotas ir veikia. Kadangi servisas ir DB operacijos jau buvo padarytos, vartotojo interfeisą sukuriau padarydamas parduotuvės administravimo vartotojo interfeiso kopiją. Užtrukau viso labo 1 - 1.30 h.

Vartotojo interfeiso atnaujinimas

Šiandien radau užmirštą ir vartotojo interfeise nerealizuotą funkciją. Pasirodo administratorius negali įvesti, peržiūrėti, redaguoti arba ištrinti produkto gamybos šalį. Trumpai sakant nėra šalies administravimo. Atrodo kad tai puikus darbas šiai nakčiai.

Monday, September 29, 2008

Step 0.1 - Papildomi reikalavimai

Sveiki, jei turite pastabų ar pageidavimų meskite kaip komentarus.

Dėkui.

Wednesday, September 24, 2008

Step 3 - SVG template fitting with data.

Current status. Now I have a SVG viewer and SVG printer. Both of them are working, one issue  what I left with is a precise size of the printed out SVG document, but almost sure I will be able to fix it.

Now I have to merge product's data from database with SVG template and get an output SVG file suitable for printing. All SVG template files are produced by professional graphic designers, they are designed on Corel Draw and then exported to SVG file format. These template files have to be updated with data what are retrieved from database. To do that job I see two general options, to use any templating language or XSLT. Independently on any chosen option it's preferable to have a clean easy readable and ordered SVG file.

Few days ago, I took a first look at source of exported SVG file. I wasn't been impressed by it's quality. I did expect to have to do some manual editing of produced file, but never thought about so horrible result. Actually I found a few major issues, what I had to solve. The first issue was , text was distributed over separate small text nodes. Some sentences was chunked to separate words, even some words had separate text node for every single letter. Other issue, oder of text information in template file was randomly distributed over all the file. 

As I said in my previous posts I have quite a few options to use: FreeMarker, XSLT, Velocity. After some tests I bet on Velocity. Some samples will follow in following posts. 

The hardest part is how to get exact visual result of the label. In order to achieve that I was forced to start using some SVG tags from SVG version 1.2. Result I got back is good enough, still have to do some little tweaking.


Step 2 - SVG printer - Continued

As I mentioned before in the previous post, I was not able to find a batik print example. It turned out, that information about SVG printing I was able to find in batik-user mailing list. It took some time to collect working solution from little parts. So mailing list helped again.

Printed out SVG document looks as it should, currently haven't noticed any issues. This is definitely a good sign. 

Here is a java code that works for me.


public void actionPerformed(ActionEvent e) {

PrinterJob printerJob = PrinterJob.getPrinterJob();
PageFormat pageFormat = printerJob.defaultPage();

PrintTranscoder transcoder = new PrintTranscoder();
TranscoderInput ti = new TranscoderInput(svgCanvas.getSVGDocument());
transcoder.transcode(ti, null);

if (printerJob.pageDialog(pageFormat) != pageFormat) {
if (printerJob.printDialog()) {
printerJob.setPrintable(transcoder);
try {
printerJob.print();
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
} else {
System.err.println("Print was cancelled");
}
}