/******************************************************************************* * 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. ******************************************************************************/ /* * Copyright 2003 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.data; import java.io.Serializable; import org.w3c.dom.Element; import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate; import at.gv.egiz.eaaf.core.impl.utils.DOMUtils; import at.gv.egovernment.moa.id.commons.api.data.IMISMandate; import at.gv.egovernment.moa.id.util.MandateBuilder; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; public class MISMandate implements Serializable, IMISMandate{ private static final long serialVersionUID = 1L; final static private String OID_NOTAR = "1.2.40.0.10.3.1"; final static private String TEXT_NOTAR = "berufsmäßige(r) Parteienvertreter(in) mit Notariatseigenschaft"; final static private String OID_RECHTSANWALT = "1.2.40.0.10.3.2"; final static private String TEXT_RECHTSANWALT = "berufsmäßige(r) Parteienvertreter(in) mit Rechtsanwaltseigenschaft"; final static private String OID_ZIVILTECHNIKER = "1.2.40.0.10.3.3"; final static private String TEXT_ZIVILTECHNIKER = "berufsmäßige(r) Parteienvertreter(in) mit Ziviltechnikerinneneigenschaft"; final static public String OID_ORGANWALTER = "1.2.40.0.10.3.4"; final static private String TEXT_ORGANWALTER = "Organwalter"; final static public String OID_ELGA_OMBUTSSTELLE = "1.2.40.0.34.3.1.3"; final static public String OID_ELGA_OMBUTSSTELLE_TEST = "1.2.40.0.34.3.1.2.99.9"; final static private String TEXT_ELGA_OMBUTSSTELLE = "ELGA-Ombudsstelle"; private String oid = null; private byte[] mandate = null; private String owBPK = null; // private boolean isFullMandateIncluded = false; /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#getProfRep() */ @Override public String getProfRep() { return oid; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#setProfRep(java.lang.String) */ @Override public void setProfRep(String oid) { this.oid = oid; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#setOWbPK(java.lang.String) */ @Override public void setOWbPK(String oWbPK) { this.owBPK = oWbPK; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#getOWbPK() */ @Override public String getOWbPK() { return owBPK; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#getMandate() */ @Override public byte[] getMandate() { return mandate; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#getMandateDOM() */ @Override public Element getMandateDOM() { try { byte[] byteMandate = mandate; String stringMandate = new String(byteMandate); return DOMUtils.parseDocument(stringMandate, false, null, null).getDocumentElement(); } catch (Throwable e) { Logger.warn("Mandate content could not be generated from MISMandate."); return null; } } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#getMandateJaxB() */ @Override public Mandate getMandateJaxB() { Element domMandate = getMandateDOM(); if (domMandate != null) return MandateBuilder.buildMandate(domMandate); return null; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#setMandate(byte[]) */ @Override public void setMandate(byte[] mandate) { this.mandate = mandate; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.IMISMandate#getTextualDescriptionOfOID() */ @Override public String getTextualDescriptionOfOID() { if (MiscUtil.isNotEmpty(this.oid)) { if (this.oid.equalsIgnoreCase(OID_NOTAR)) return TEXT_NOTAR; if (this.oid.equalsIgnoreCase(OID_RECHTSANWALT)) return TEXT_RECHTSANWALT; if (this.oid.equalsIgnoreCase(OID_ZIVILTECHNIKER)) return TEXT_ZIVILTECHNIKER; if (this.oid.equalsIgnoreCase(OID_ORGANWALTER)) return TEXT_ORGANWALTER; if (this.oid.equalsIgnoreCase(OID_ELGA_OMBUTSSTELLE) || this.oid.equalsIgnoreCase(OID_ELGA_OMBUTSSTELLE_TEST)) return TEXT_ELGA_OMBUTSSTELLE; return "Keine textuelle Beschreibung für OID " + oid; } else { return null; } } // /** // * @return the isFullMandateIncluded // */ // public boolean isFullMandateIncluded() { // return isFullMandateIncluded; // } // /** // * @param isFullMandateIncluded the isFullMandateIncluded to set // */ // public void setFullMandateIncluded(boolean isFullMandateIncluded) { // this.isFullMandateIncluded = isFullMandateIncluded; // } }