diff options
12 files changed, 95 insertions, 15 deletions
diff --git a/common/res/resources/schemas/MOA-SPSS-1.2.xsd b/common/res/resources/schemas/MOA-SPSS-1.2.xsd index 6937d5dd7..d7a06d6e7 100644 --- a/common/res/resources/schemas/MOA-SPSS-1.2.xsd +++ b/common/res/resources/schemas/MOA-SPSS-1.2.xsd @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Gregor Karlinger (Bundeskanzleramt) -->
<!--
MOA SP/SS 1.2 Schema
-->
@@ -174,6 +173,15 @@ <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
+ <xsd:complexType name="FinalDataMetaInfoType">
+ <xsd:complexContent>
+ <xsd:extension base="MetaInfoType">
+ <xsd:sequence>
+ <xsd:element name="Type" type="xsd:anyURI" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
<xsd:complexType name="DataObjectInfoType">
<xsd:sequence>
<xsd:element name="DataObject">
@@ -203,7 +211,7 @@ <xsd:complexType name="TransformsInfoType">
<xsd:sequence>
<xsd:element ref="dsig:Transforms" minOccurs="0"/>
- <xsd:element name="FinalDataMetaInfo" type="MetaInfoType"/>
+ <xsd:element name="FinalDataMetaInfo" type="FinalDataMetaInfoType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="XMLDataObjectAssociationType">
@@ -258,7 +266,7 @@ <xsd:restriction base="CheckResultType">
<xsd:sequence>
<xsd:element name="Code" type="xsd:nonNegativeInteger"/>
- <xsd:element name="Info" type="ManifestRefsCheckResultInfoType"/>
+ <xsd:element name="Info" type="ManifestRefsCheckResultInfoType"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
diff --git a/spss.server/doc/moa_spss/MOA-SPSS-1.2.xsd b/spss.server/doc/moa_spss/MOA-SPSS-1.2.xsd index 6937d5dd7..d7a06d6e7 100644 --- a/spss.server/doc/moa_spss/MOA-SPSS-1.2.xsd +++ b/spss.server/doc/moa_spss/MOA-SPSS-1.2.xsd @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Gregor Karlinger (Bundeskanzleramt) -->
<!--
MOA SP/SS 1.2 Schema
-->
@@ -174,6 +173,15 @@ <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
+ <xsd:complexType name="FinalDataMetaInfoType">
+ <xsd:complexContent>
+ <xsd:extension base="MetaInfoType">
+ <xsd:sequence>
+ <xsd:element name="Type" type="xsd:anyURI" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
<xsd:complexType name="DataObjectInfoType">
<xsd:sequence>
<xsd:element name="DataObject">
@@ -203,7 +211,7 @@ <xsd:complexType name="TransformsInfoType">
<xsd:sequence>
<xsd:element ref="dsig:Transforms" minOccurs="0"/>
- <xsd:element name="FinalDataMetaInfo" type="MetaInfoType"/>
+ <xsd:element name="FinalDataMetaInfo" type="FinalDataMetaInfoType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="XMLDataObjectAssociationType">
@@ -258,7 +266,7 @@ <xsd:restriction base="CheckResultType">
<xsd:sequence>
<xsd:element name="Code" type="xsd:nonNegativeInteger"/>
- <xsd:element name="Info" type="ManifestRefsCheckResultInfoType"/>
+ <xsd:element name="Info" type="ManifestRefsCheckResultInfoType"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
diff --git a/spss.server/res/resources/wsdl/MOA-SPSS-1.2.xsd b/spss.server/res/resources/wsdl/MOA-SPSS-1.2.xsd index 6937d5dd7..d7a06d6e7 100644 --- a/spss.server/res/resources/wsdl/MOA-SPSS-1.2.xsd +++ b/spss.server/res/resources/wsdl/MOA-SPSS-1.2.xsd @@ -1,5 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Gregor Karlinger (Bundeskanzleramt) -->
<!--
MOA SP/SS 1.2 Schema
-->
@@ -174,6 +173,15 @@ <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
+ <xsd:complexType name="FinalDataMetaInfoType">
+ <xsd:complexContent>
+ <xsd:extension base="MetaInfoType">
+ <xsd:sequence>
+ <xsd:element name="Type" type="xsd:anyURI" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
<xsd:complexType name="DataObjectInfoType">
<xsd:sequence>
<xsd:element name="DataObject">
@@ -203,7 +211,7 @@ <xsd:complexType name="TransformsInfoType">
<xsd:sequence>
<xsd:element ref="dsig:Transforms" minOccurs="0"/>
- <xsd:element name="FinalDataMetaInfo" type="MetaInfoType"/>
+ <xsd:element name="FinalDataMetaInfo" type="FinalDataMetaInfoType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="XMLDataObjectAssociationType">
@@ -258,7 +266,7 @@ <xsd:restriction base="CheckResultType">
<xsd:sequence>
<xsd:element name="Code" type="xsd:nonNegativeInteger"/>
- <xsd:element name="Info" type="ManifestRefsCheckResultInfoType"/>
+ <xsd:element name="Info" type="ManifestRefsCheckResultInfoType"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java b/spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java index dfa8927e1..e306127b3 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/SPSSFactory.java @@ -832,6 +832,7 @@ public abstract class SPSSFactory { * @param mimeType The MIME type part of the meta information. * @param description Descriptive meta information. May be <code>null</code>. * @param otherInfo XML meta information. May be <code>null</code>. + * @param type Type information for XML signature creation. May be <code>null</code>. * @return The <code>MetaInfo</code> object containing the above data. * * @pre mimeType != null && mimeType.length() > 0 @@ -841,7 +842,8 @@ public abstract class SPSSFactory { public abstract MetaInfo createMetaInfo( String mimeType, String description, - NodeList otherInfo); + NodeList otherInfo, + String type); /** * Create a <code>CanonicalizationTransform</code> type of <code>Transform</code>. diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java b/spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java index fea0a1b42..56a1793af 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/common/MetaInfo.java @@ -28,4 +28,10 @@ public interface MetaInfo { * @return The elemental informations. */ public NodeList getAnyElements(); + /** + * Gets the XML signature creation type information of the associated object. + * + * @return the XML signature creation type information of the associated object. + */ + public String getType(); } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java index c435dd8fd..93aceb033 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/MetaInfoImpl.java @@ -16,6 +16,8 @@ public class MetaInfoImpl implements MetaInfo { private String description; /** Descriptive XML content. */ private NodeList anyElements; + /** Type information for XML signature creation */ + private String type; /** * Sets the MIME type. @@ -56,4 +58,18 @@ public class MetaInfoImpl implements MetaInfo { return anyElements; } + /** + * Sets the XML signature creation type information. + * + * @param type the XML signature creation type information to set. + */ + public void setType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + + } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java index a953c2af3..bf15bf37e 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/impl/SPSSFactoryImpl.java @@ -472,11 +472,13 @@ public class SPSSFactoryImpl extends SPSSFactory { public MetaInfo createMetaInfo( String mimeType, String description, - NodeList otherInfo) { + NodeList otherInfo, + String type) { MetaInfoImpl metaInfo = new MetaInfoImpl(); metaInfo.setMimeType(mimeType); metaInfo.setDescription(description); metaInfo.setAnyElements(otherInfo); + metaInfo.setType(type); return metaInfo; } diff --git a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java index a41b14df0..9e8c7d0e2 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/api/xmlbind/RequestParserUtils.java @@ -32,6 +32,7 @@ public class RequestParserUtils { private static final String REFERENCE_ATTR_NAME = "Reference"; private static final String MIME_TYPE_XPATH = MOA + "MimeType"; private static final String DESCRIPTION_XPATH = MOA + "Description"; + private static final String TYPE_XPATH = MOA + "Type"; private static final String XML_ASSOC_CONTENT_XPATH = MOA + "Content"; private static final String CONTENT_XPATH = MOA + "Base64Content | " + MOA + "XMLContent |" + MOA + "LocRefContent"; @@ -71,8 +72,10 @@ public class RequestParserUtils { XPathUtils.getElementValue(metaInfoElem, DESCRIPTION_XPATH, null); NodeList anyOther = XPathUtils.selectNodeList(metaInfoElem, ANY_OTHER_XPATH); + String type = + XPathUtils.getElementValue(metaInfoElem, TYPE_XPATH, null); - return factory.createMetaInfo(mimeType, description, anyOther); + return factory.createMetaInfo(mimeType, description, anyOther, type); } /** 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 <code>DataObject</code> from a <code>Content</code> object. * * @param content The <code>Content</code> object containing the data. + * @param finalDataMetaInfo The meta information corresponding with <code>content</code>. * @param referenceID The reference ID to set in the resulting * <code>DataObject</code>. May be <code>null</code>. * @param allowContentAndReference If <code>true</code>, 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 <code>SingleSignatureInfo</code> object * containing the <code>DataObjectInfo</code> objects. + * @param createTransformsProfiles A list of objects of type {@link CreateTransformsInfoProfileExplicit}, + * each representing the transforms info profile information for the corresponding <code>DataObject</code>. * @param signatureEnvironment The * @param idGen The ID generator for <code>DataObject</code> references. * @return The <code>List</code> of <code>DataObject</code>s 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 <code>Content</code> object containing the data object. * <code>ContentOptionalRefType</code>. + * @param finalDataMetaInfo The meta information corresponding with <code>content</code>. * @param referenceID The reference ID to use in the signature for the * <code>DataObject</code> created. * @return The <code>DataObject</code> 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 <code>DataObject</code> to be used in a detached signature. * * @param content The <code>Content</code> object containing an the data. + * @param finalDataMetaInfo The meta information corresponding with <code>content</code>. * @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(); diff --git a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java index aab2a0cc7..7de2add33 100644 --- a/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java +++ b/spss.server/src/test/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactoryTest.java @@ -150,6 +150,7 @@ public class DataObjectFactoryTest extends SPSSTestCase { factory.createFromContentOptionalRefType( content, null, + null, true, false, true, @@ -165,6 +166,7 @@ public class DataObjectFactoryTest extends SPSSTestCase { DataObject dataObject = factory.createFromContentOptionalRefType( content, + null, null, false, false, |