1 files renamed
11 files modified
| | |
| | | /* |
| | | Nutzerverwaltung - A Generic User Manager |
| | | Copyright (c) 2016 Ulrich Hilger |
| | | |
| | | This program is free software: you can redistribute it and/or modify |
| | | it under the terms of the GNU Affero General Public License as published by |
| | | the Free Software Foundation, either version 3 of the License, or |
| | | (at your option) any later version. |
| | | |
| | | This program is distributed in the hope that it will be useful, |
| | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | GNU Affero General Public License for more details. |
| | | |
| | | You should have received a copy of the GNU Affero General Public License |
| | | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | | * the Free Software Foundation, either version 3 of the License, or |
| | | * (at your option) any later version. |
| | | * |
| | | * This program is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | * GNU General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU General Public License |
| | | * along with this program. If not, see http://www.gnu.org/licenses/ |
| | | */ |
| | | |
| | | package de.uhilger.um; |
| | | |
| | | /** |
| | |
| | | /* |
| | | Nutzerverwaltung - A Generic User Manager |
| | | Copyright (c) 2016 Ulrich Hilger |
| | | |
| | | This program is free software: you can redistribute it and/or modify |
| | | it under the terms of the GNU Affero General Public License as published by |
| | | the Free Software Foundation, either version 3 of the License, or |
| | | (at your option) any later version. |
| | | |
| | | This program is distributed in the hope that it will be useful, |
| | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | GNU Affero General Public License for more details. |
| | | |
| | | You should have received a copy of the GNU Affero General Public License |
| | | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | | * the Free Software Foundation, either version 3 of the License, or |
| | | * (at your option) any later version. |
| | | * |
| | | * This program is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | * GNU General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU General Public License |
| | | * along with this program. If not, see http://www.gnu.org/licenses/ |
| | | */ |
| | | |
| | | package de.uhilger.um; |
| | | |
| | | import org.apache.catalina.realm.RealmBase; |
| | |
| | | /* |
| | | Nutzerverwaltung - A Generic User Manager |
| | | Copyright (c) 2016 Ulrich Hilger |
| | | |
| | | This program is free software: you can redistribute it and/or modify |
| | | it under the terms of the GNU Affero General Public License as published by |
| | | the Free Software Foundation, either version 3 of the License, or |
| | | (at your option) any later version. |
| | | |
| | | This program is distributed in the hope that it will be useful, |
| | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | GNU Affero General Public License for more details. |
| | | |
| | | You should have received a copy of the GNU Affero General Public License |
| | | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | | * the Free Software Foundation, either version 3 of the License, or |
| | | * (at your option) any later version. |
| | | * |
| | | * This program is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | * GNU General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU General Public License |
| | | * along with this program. If not, see http://www.gnu.org/licenses/ |
| | | */ |
| | | |
| | | package de.uhilger.um.api; |
| | | |
| | | import de.uhilger.baselink.GenericRecord; |
| | |
| | | /* |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011, 2012 Ulrich Hilger, http://uhilger.de |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | |
| | | /* |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011, 2012 Ulrich Hilger, http://uhilger.de |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | |
| | | /* |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011, 2012 Ulrich Hilger, http://uhilger.de |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | |
| | | /* |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011, 2012 Ulrich Hilger, http://uhilger.de |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | |
| | | /* |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011, 2012 Ulrich Hilger, http://uhilger.de |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | |
| | | /* |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011, 2012 Ulrich Hilger, http://uhilger.de |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
File was renamed from src/java/de/uhilger/um/App.java |
| | |
| | | package de.uhilger.um; |
| | | /* |
| | | * Nutzerverwaltung - User and role management in your browser |
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de |
| | | * |
| | | * This program is free software: you can redistribute it and/or modify |
| | | * it under the terms of the GNU General Public License as published by |
| | | * the Free Software Foundation, either version 3 of the License, or |
| | | * (at your option) any later version. |
| | | * |
| | | * This program is distributed in the hope that it will be useful, |
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | * GNU General Public License for more details. |
| | | * |
| | | * You should have received a copy of the GNU General Public License |
| | | * along with this program. If not, see http://www.gnu.org/licenses/ |
| | | */ |
| | | |
| | | package de.uhilger.um.web; |
| | | |
| | | import de.uhilger.baselink.PersistenceManager; |
| | | import de.uhilger.baselink.Record; |
| | |
| | | import javax.servlet.ServletContextListener; |
| | | |
| | | /** |
| | | * Hauptklasse der Anwendung Nutzerverwaltung |
| | | * Initialisierungsklasse der Anwendung Nutzerverwaltung |
| | | * |
| | | * Hier wird u.a. geprüft, ob die Datenbank vorhanden ist und diese |
| | | * angelegt, falls nicht. Das SQL zur Anlage der Datenbank findet |
| | | * angelegt, falls nicht. Das SQL-Skript zur Anlage der Datenbank findet |
| | | * sich in WEB-INF/create_database.sql |
| | | * |
| | | * @author Ulrich Hilger |
| | | */ |
| | | public class App implements ServletContextListener { |
| | | public class Initialiser implements ServletContextListener { |
| | | |
| | | private static final Logger logger = Logger.getLogger(App.class.getName()); |
| | | private static final Logger logger = Logger.getLogger(Initialiser.class.getName()); |
| | | |
| | | /** Name der Datei mit dem SQL-Skript zum Erzeugen der Datenbank */ |
| | | private static final String SCRIPT_NAME = "create_database.sql"; |
| | |
| | | /** Name des SQL-Befehls zum Pruefen, ob die Datenbank vorhanden ist */ |
| | | public static final String SQL_DB_VORHANDEN = "dbVorhanden"; |
| | | |
| | | /** Anwendungsweite Referenz zur Datenbank */ |
| | | //private static PersistenceManager db; |
| | | |
| | | /** Anwendungsweite Referenz zu den SQL-Befehlen */ |
| | | //private static Properties sql; |
| | | |
| | | /** die Klasse, die von der Nutzerverwaltung zum Verschlüsseln verwendet wird */ |
| | | //private static Digester digester; |
| | | |
| | | /** |
| | | * Diese Webanwendung initialisieren, also z.B. Elemente instantiieren, die |
| | | * über den Deployment Descritpor veränderlich gehalten sind. |
| | |
| | | try { |
| | | initSql(servletContext); |
| | | initDb(servletContext); |
| | | //String digesterClassName = servletContext.getInitParameter(P_DIGESTER); |
| | | //digester = (Digester) Class.forName(digesterClassName).newInstance(); |
| | | } catch (Exception ex) { |
| | | logger.log(Level.SEVERE, null, ex); |
| | | } |
| | |
| | | logger.log(Level.SEVERE, ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | /* ----------------- statische Getter --------------------- */ |
| | | |
| | | /** |
| | | * Das Zugriffsobjekt fuer die Datenbank dieser Webanwendung |
| | | * ermitteln |
| | | * |
| | | * @return das Zugriffsobjekt zur Datenbank dieser Webanwendung |
| | | */ |
| | | /* |
| | | public static PersistenceManager getDatabase() { |
| | | if(db == null) { |
| | | db = new PersistenceManager(); |
| | | } |
| | | return db; |
| | | } |
| | | */ |
| | | |
| | | /* |
| | | public static Digester getDigester() { |
| | | return digester; |
| | | } |
| | | */ |
| | | |
| | | /* ----------------- Logik zur Datenbank-Erzeugung ------------ */ |
| | | |
| | |
| | | /*
|
| | | * To change this license header, choose License Headers in Project Properties.
|
| | | * To change this template file, choose Tools | Templates
|
| | | * and open the template in the editor.
|
| | | * Nutzerverwaltung - User and role management in your browser
|
| | | * Copyright (C) 2011-2016 Ulrich Hilger, http://uhilger.de
|
| | | *
|
| | | * This program is free software: you can redistribute it and/or modify
|
| | | * it under the terms of the GNU General Public License as published by
|
| | | * the Free Software Foundation, either version 3 of the License, or
|
| | | * (at your option) any later version.
|
| | | *
|
| | | * This program is distributed in the hope that it will be useful,
|
| | | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| | | * GNU General Public License for more details.
|
| | | *
|
| | | * You should have received a copy of the GNU General Public License
|
| | | * along with this program. If not, see http://www.gnu.org/licenses/
|
| | | */
|
| | |
|
| | | package de.uhilger.um.web;
|
| | |
|
| | | import java.io.IOException;
|
| | |
| | | hier wird ein URL wie z.B.
|
| | | http]://example.com/um/svc/testmethode
|
| | | umgesetzt auf
|
| | | http]://example,com/um/api?c=de.uhilger.um.api.UserMgr&m=testmethode
|
| | | http]://example.com/um/api?c=de.uhilger.um.api.UserMgr&m=testmethode
|
| | |
|
| | | der Teil 'svc' ist im Filter Mapping des Deployment Descriptor
|
| | | deklariert. Der Teil 'api' zeigt mit Hilfe eines Servlet
|
| | |
| | | <url-pattern>/svc/*</url-pattern> |
| | | </filter-mapping> |
| | | <listener> |
| | | <listener-class>de.uhilger.um.App</listener-class> |
| | | <listener-class>de.uhilger.um.web.Initialiser</listener-class> |
| | | </listener> |
| | | <servlet> |
| | | <servlet-name>TransitServlet</servlet-name> |