/******************************************************************************* * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. *******************************************************************************/ package at.gv.egovernment.moa.id.commons.validation; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import at.gv.egovernment.moa.util.MiscUtil; public class TargetValidator { private static Map targetList = null; static { targetList = new HashMap(); targetList.put("AR", "Arbeit"); targetList.put("AS", "Amtliche Statistik"); targetList.put("BF", "Bildung und Forschung"); targetList.put("BW", "Bauen und Wohnen"); targetList.put("EA", "EU und Auswärtige Angelegenheiten"); targetList.put("EF", "Ein- und Ausfuhr"); targetList.put("GH", "Gesundheit"); targetList.put("GS", "Gesellschaft und Soziales"); // targetList.put("GS-RE", "Restitution"); targetList.put("JR", "Justiz/Zivilrechtswesen"); targetList.put("KL", "Kultus"); targetList.put("KU", "Kunst und Kultur"); targetList.put("LF", "Land- und Forstwirtschaft"); targetList.put("LV", "Landesverteidigung"); targetList.put("RT", "Rundfunk und sonstige Medien sowie Telekommunikation"); targetList.put("SA", "Steuern und Abgaben"); targetList.put("SA", "Sport und Freizeit"); targetList.put("SO", "Sicherheit und Ordnung"); // targetList.put("SO-VR", "Vereinsregister"); // targetList.put("SR-RG", "Strafregister"); targetList.put("SV", "Sozialversicherung"); targetList.put("UW", "Umwelt"); targetList.put("VT", "Verkehr und Technik"); targetList.put("VV", "Vermögensverwaltung"); targetList.put("WT", "Wirtschaft"); targetList.put("ZP", "Personenidentität und Bürgerrechte(zur Person)"); targetList.put("BR", "Bereichsübergreifender Rechtsschutz"); targetList.put("HR", "Zentrales Rechnungswesen"); targetList.put("KI", "Auftraggeberinterne allgemeine Kanzleiindizes"); targetList.put("OI", "Öffentlichkeitsarbeit"); targetList.put("PV", "Personalverwaltung"); targetList.put("RD", "Zentraler Rechtsdienst"); targetList.put("VS", "Zentrale Durchführung von Verwaltungsstrafverfahren"); // targetList.put("VS-RG", "Zentrales Verwaltungsstrafregister"); targetList.put("ZU", "Zustellungen"); } public static List getListOfTargets() { Map list = new HashMap(); list.put("", ""); list.putAll(targetList); List sortedList = new ArrayList(); sortedList.addAll(list.keySet()); Collections.sort(sortedList); return sortedList; } public static String getTargetFriendlyName(String target) { if (MiscUtil.isEmpty(target)) return null; String name = targetList.get(target.toUpperCase()); if (MiscUtil.isNotEmpty(name)) return name; else return null; } public static boolean isValidTarget(String target) { if (MiscUtil.isEmpty(target)) return false; return targetList.containsKey(target.toUpperCase()); } }