author | František Kučera <franta-hg@frantovo.cz> |
Tue Mar 23 15:09:19 2010 +0100 (2010-03-23) | |
changeset 83 | 6767606d6342 |
parent 66 | 048531e09c09 |
child 134 | 4bd1e353c527 |
permissions | -rw-r--r-- |
franta-hg@66 | 1 |
package cz.frantovo.nekurak.web; |
franta-hg@66 | 2 |
|
franta-hg@68 | 3 |
import cz.frantovo.nekurak.dto.Podnik; |
franta-hg@66 | 4 |
import cz.frantovo.nekurak.servlet.Fotky; |
franta-hg@66 | 5 |
|
franta-hg@66 | 6 |
/** |
franta-hg@66 | 7 |
* Knihovna funkcí použitelná v EL |
franta-hg@66 | 8 |
* @author fiki |
franta-hg@66 | 9 |
*/ |
franta-hg@66 | 10 |
public class FunkceEL { |
franta-hg@66 | 11 |
|
franta-hg@66 | 12 |
/** Musí odpovídat cestě, kam je namapovaný servlet. */ |
franta-hg@66 | 13 |
private static final String SERVLET = "fotky"; |
franta-hg@66 | 14 |
|
franta-hg@66 | 15 |
public static String fotka(int id, boolean nahled) { |
franta-hg@66 | 16 |
String prostredek = nahled ? Fotky.PODADRESAR_NAHLED : Fotky.PODADRESAR_ORIGINAL; |
franta-hg@66 | 17 |
return SERVLET + "/" + prostredek + "/" + id + "." + Fotky.PRIPONA; |
franta-hg@66 | 18 |
} |
franta-hg@68 | 19 |
|
franta-hg@68 | 20 |
public static boolean maFotky(Podnik p) { |
franta-hg@68 | 21 |
return !p.getFotky().isEmpty(); |
franta-hg@68 | 22 |
} |
franta-hg@66 | 23 |
} |