From cd3d7bc859c07dadb47219c1a38af1d3b8981a52 Mon Sep 17 00:00:00 2001 From: gregor Date: Wed, 26 Nov 2003 17:08:12 +0000 Subject: Zwischenstand Implementierung Feature 54. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@63 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../moa/spss/server/invoke/DataObjectFactory.java | 5 +++++ .../server/invoke/XMLSignatureCreationInvoker.java | 24 ++++++++++++++++++++-- .../invoke/XMLSignatureCreationProfileFactory.java | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server') diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java index 6f541ed42..634cf9992 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java @@ -332,6 +332,7 @@ public class DataObjectFactory { * Create a DataObject from a Content object. * * @param content The Content object containing the data. + * @param finalDataMetaInfo The meta information corresponding with content. * @param referenceID The reference ID to set in the resulting * DataObject. May be null. * @param allowContentAndReference If true, then @@ -363,6 +364,7 @@ public class DataObjectFactory { */ public DataObject createFromContentOptionalRefType( Content content, + MetaInfo finalDataMetaInfo, String referenceID, boolean allowContentAndReference, boolean binaryAsXml, @@ -414,6 +416,9 @@ public class DataObjectFactory { dataObject.setURI(reference); dataObject.setReferenceID(referenceID); + // set Type gathered from corresponding meta information + dataObject.setTypeURI(finalDataMetaInfo.getType()); + return dataObject; } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java index c3b788716..7de8ba48f 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationInvoker.java @@ -30,9 +30,11 @@ import at.gv.egovernment.moa.spss.MOAApplicationException; import at.gv.egovernment.moa.spss.MOAException; import at.gv.egovernment.moa.spss.MOASystemException; import at.gv.egovernment.moa.spss.api.common.Content; +import at.gv.egovernment.moa.spss.api.common.MetaInfo; import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureEnvironmentProfileExplicit; import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureInfo; import at.gv.egovernment.moa.spss.api.xmlsign.CreateSignatureLocation; +import at.gv.egovernment.moa.spss.api.xmlsign.CreateTransformsInfoProfileExplicit; import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest; import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse; import at.gv.egovernment.moa.spss.api.xmlsign.DataObjectInfo; @@ -157,9 +159,11 @@ public class XMLSignatureCreationInvoker { } // build the list of DataObjects + List createTransformsProfiles = profileFactory.getCreateTransformsInfoProfiles(singleSignatureInfo); dataObjectList = buildDataObjectList( singleSignatureInfo, + createTransformsProfiles, signatureEnvironment, refIdGen); @@ -288,6 +292,8 @@ public class XMLSignatureCreationInvoker { * * @param singleSignatureInfo The SingleSignatureInfo object * containing the DataObjectInfo objects. + * @param createTransformsProfiles A list of objects of type {@link CreateTransformsInfoProfileExplicit}, + * each representing the transforms info profile information for the corresponding DataObject. * @param signatureEnvironment The * @param idGen The ID generator for DataObject references. * @return The List of DataObjects contained in the @@ -299,28 +305,36 @@ public class XMLSignatureCreationInvoker { */ private List buildDataObjectList( SingleSignatureInfo singleSignatureInfo, + List createTransformsProfiles, XMLDataObject signatureEnvironment, IdGenerator idGen) throws MOASystemException, MOAApplicationException { List dataObjInfos = singleSignatureInfo.getDataObjectInfos(); List dataObjects = new ArrayList(); - //Document requestDoc = singleSignatureInfo.getOwnerDocument(); Iterator dtIter; + Iterator ctpIter = createTransformsProfiles.iterator(); - for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) { + for (dtIter = dataObjInfos.iterator(); dtIter.hasNext();) + { DataObjectInfo dataObjInfo = (DataObjectInfo) dtIter.next(); String structure = dataObjInfo.getStructure(); + + CreateTransformsInfoProfileExplicit transformsProfile = + (CreateTransformsInfoProfileExplicit) ctpIter.next(); + MetaInfo finalDataMetaInfo = transformsProfile.getCreateTransformsInfo().getFinalDataMetaInfo(); if (DataObjectInfo.STRUCTURE_ENVELOPING.equals(structure)) { dataObjects.add( buildEnvelopingDataObject( dataObjInfo.getDataObject(), + finalDataMetaInfo, idGen.nextId())); } else if (DataObjectInfo.STRUCTURE_DETACHED.equals(structure)) { dataObjects.add( buildDetachedDataObject( dataObjInfo.getDataObject(), + finalDataMetaInfo, signatureEnvironment, idGen.nextId())); } else { @@ -338,6 +352,7 @@ public class XMLSignatureCreationInvoker { * * @param content The Content object containing the data object. * ContentOptionalRefType. + * @param finalDataMetaInfo The meta information corresponding with content. * @param referenceID The reference ID to use in the signature for the * DataObject created. * @return The DataObject representing the data contained in @@ -349,6 +364,7 @@ public class XMLSignatureCreationInvoker { */ private DataObject buildEnvelopingDataObject( Content content, + MetaInfo finalDataMetaInfo, String referenceID) throws MOASystemException, MOAApplicationException { @@ -358,6 +374,7 @@ public class XMLSignatureCreationInvoker { dataObject = factory.createFromContentOptionalRefType( content, + finalDataMetaInfo, referenceID, false, false, @@ -371,6 +388,7 @@ public class XMLSignatureCreationInvoker { * Build a DataObject to be used in a detached signature. * * @param content The Content object containing an the data. + * @param finalDataMetaInfo The meta information corresponding with content. * @param signatureEnvironment The signature environment where the signature * will be inserted. * @param referenceID The reference ID to use in the signature for the @@ -384,6 +402,7 @@ public class XMLSignatureCreationInvoker { */ private DataObject buildDetachedDataObject( Content content, + MetaInfo finalDataMetaInfo, XMLDataObject signatureEnvironment, String referenceID) throws MOASystemException, MOAApplicationException { @@ -404,6 +423,7 @@ public class XMLSignatureCreationInvoker { dataObject = factory.createFromContentOptionalRefType( content, + finalDataMetaInfo, referenceID, true, false, diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java index c9bb12f75..6078c7fb0 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/XMLSignatureCreationProfileFactory.java @@ -181,7 +181,7 @@ public class XMLSignatureCreationProfileFactory { * @throws MOAApplicationException An error occurred creating one of the * profiles. */ - private List getCreateTransformsInfoProfiles(SingleSignatureInfo singleSignatureInfo) + List getCreateTransformsInfoProfiles(SingleSignatureInfo singleSignatureInfo) throws MOAApplicationException { TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); -- cgit v1.2.3