# HG changeset patch # User František Kučera # Date 1267082806 -3600 # Node ID 67d332d4856250ada586cca40bea8636910c4b1c # Parent ea342cf8c15a61fcc3c59b072116ff0db3082060 Zakládání podniků + HTTP autentizace. diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-ejb/src/conf/Podnik.hbm.xml --- a/java/nekurak.net-ejb/src/conf/Podnik.hbm.xml Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-ejb/src/conf/Podnik.hbm.xml Thu Feb 25 08:26:46 2010 +0100 @@ -3,7 +3,11 @@ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> - + + + podnik_seq + + diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.java --- a/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.java Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.java Thu Feb 25 08:26:46 2010 +0100 @@ -26,6 +26,10 @@ return dotaz.getResultList(); } + public void uloz(Podnik p) { + em.persist(p); + } + private static String t(Class trida) { return trida.getSimpleName(); } diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java --- a/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java Thu Feb 25 08:26:46 2010 +0100 @@ -3,6 +3,7 @@ import cz.frantovo.nekurak.dao.PodnikDAO; import cz.frantovo.nekurak.dto.Podnik; import java.util.Collection; +import javax.annotation.security.RolesAllowed; import javax.ejb.EJB; import javax.ejb.Stateless; @@ -20,4 +21,14 @@ Collection vysledek = podnikDAO.getPodniky(); return vysledek; } + + @RolesAllowed("opravneny") + public void zalozPodnik(Podnik p) { + podnikDAO.uloz(p); + } + + @RolesAllowed("opravneny") + public void upravPodnik(Podnik p) { + podnikDAO.uloz(p); + } } diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-lib/src/cz/frantovo/nekurak/ejb/PodnikRemote.java --- a/java/nekurak.net-lib/src/cz/frantovo/nekurak/ejb/PodnikRemote.java Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-lib/src/cz/frantovo/nekurak/ejb/PodnikRemote.java Thu Feb 25 08:26:46 2010 +0100 @@ -12,5 +12,9 @@ public interface PodnikRemote { public Collection getPodniky(); + + public void zalozPodnik(cz.frantovo.nekurak.dto.Podnik p); + + public void upravPodnik(cz.frantovo.nekurak.dto.Podnik p); } diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/PridatPodnik.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/PridatPodnik.java Thu Feb 25 08:26:46 2010 +0100 @@ -0,0 +1,23 @@ +package cz.frantovo.nekurak.web; + +import cz.frantovo.nekurak.dto.Podnik; + +public class PridatPodnik { + + private HledacSluzby hledac = new HledacSluzby(); + + private Podnik podnik = new Podnik(); + + public Podnik getPodnik() { + return podnik; + } + + public void setPodnik(Podnik podnik) { + this.podnik = podnik; + } + + public boolean getPridano() { + hledac.getPodnikEJB().zalozPodnik(podnik); + return true; + } +} diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/WEB-INF/casti/detail.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-web/web/WEB-INF/casti/detail.jsp Thu Feb 25 08:26:46 2010 +0100 @@ -0,0 +1,12 @@ + + + + + +

TODO: Detail podniku ().

+ +
diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/WEB-INF/casti/pridatPodnik.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-web/web/WEB-INF/casti/pridatPodnik.jsp Thu Feb 25 08:26:46 2010 +0100 @@ -0,0 +1,48 @@ + + + + + + +

Přidání nového podniku

+ + + + + + +

Název: ${pridatPodnik.podnik.nazev} / ${param.nazev}

+

Popis: ${pridatPodnik.podnik.popis}

+

URL: ${pridatPodnik.podnik.url}

+

Ulice: ${pridatPodnik.podnik.ulice}

+

č.p.: ${pridatPodnik.podnik.cisloPopisne}

+

Město: ${pridatPodnik.podnik.mesto}

+ + + +

Podnik byl přidán.

+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ + + + +
diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/WEB-INF/casti/uvod.jsp --- a/java/nekurak.net-web/web/WEB-INF/casti/uvod.jsp Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-web/web/WEB-INF/casti/uvod.jsp Thu Feb 25 08:26:46 2010 +0100 @@ -10,17 +10,19 @@

Naposledy přidané podniky:

-

-

-

+

+

+

+

Adresa:
-   -
- -

- -

www stránka

-
+   +
+ +

+ +

www stránka

+
+
diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/WEB-INF/sun-web.xml --- a/java/nekurak.net-web/web/WEB-INF/sun-web.xml Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-web/web/WEB-INF/sun-web.xml Thu Feb 25 08:26:46 2010 +0100 @@ -1,12 +1,16 @@ - /nekurak.net-web - - - - - Keep a copy of the generated servlet class' java code. - - + /nekurak.net-web + + + + + Keep a copy of the generated servlet class' java code. + + + + opravneny + spravce + diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/WEB-INF/web.xml --- a/java/nekurak.net-web/web/WEB-INF/web.xml Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-web/web/WEB-INF/web.xml Thu Feb 25 08:26:46 2010 +0100 @@ -1,24 +1,44 @@ - 30 + + 30 + - index.jsp + index.jsp - - 404 - /WEB-INF/chyby/404.jsp + + 404 + /WEB-INF/chyby/404.jsp - - 500 - /WEB-INF/chyby/500.jsp + + 500 + /WEB-INF/chyby/500.jsp - - javax.servlet.jsp.jstl.fmt.fallbackLocale - cs + + javax.servlet.jsp.jstl.fmt.fallbackLocale + cs + + + opravneny + + + + Správa Nekuřák.net + /sprava/* + + + opravneny + + + + BASIC + nekurakNET + + diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/index.jsp --- a/java/nekurak.net-web/web/index.jsp Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-web/web/index.jsp Thu Feb 25 08:26:46 2010 +0100 @@ -30,19 +30,26 @@
- + + + + - + @@ -51,8 +58,8 @@

© 2010 nekurak.net. Licence: Affero GPL. - nekurak.net-src.zip - . + nekurak.net-src.zip + .

diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/sprava/grafika --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-web/web/sprava/grafika Thu Feb 25 08:26:46 2010 +0100 @@ -0,0 +1,1 @@ +../grafika/ \ No newline at end of file diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/sprava/index.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-web/web/sprava/index.jsp Thu Feb 25 08:26:46 2010 +0100 @@ -0,0 +1,1 @@ +../index.jsp \ No newline at end of file diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/sprava/styl.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/nekurak.net-web/web/sprava/styl.css Thu Feb 25 08:26:46 2010 +0100 @@ -0,0 +1,1 @@ +../styl.css \ No newline at end of file diff -r ea342cf8c15a -r 67d332d48562 java/nekurak.net-web/web/styl.css --- a/java/nekurak.net-web/web/styl.css Thu Feb 25 02:41:57 2010 +0100 +++ b/java/nekurak.net-web/web/styl.css Thu Feb 25 08:26:46 2010 +0100 @@ -5,6 +5,10 @@ text-align: center; } +a { + text-decoration: none; +} + .body { width: 1000px; text-align: left; @@ -37,7 +41,7 @@ #nabidka li { display: inline; font-size: 14px; - margin-left: 8px; + margin-left: 12px; } #nabidka li a { @@ -48,6 +52,10 @@ color: orange; } +#prihlasenyUzivatel { + color: gray; +} + #obsah { width: 980px; border: 1px solid silver; @@ -81,3 +89,19 @@ font-weight: bold; } +.podnik a h2 { + color: black; +} + +fieldset { + border: none; +} + +form { + text-align: right; + max-width: 400px; +} + +input { + width:200px; +}