Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/45932/#msg_45932
I have a very basic question - at least I hope it is basic ;) - that is
bothering me for days now!
I have metadata - received by an ITI-15 request - in form of an
ProvideAndRegisterDocumentSetType. Now I am changing and adding some
specific attributes. As an example - just for testing - I am trying to
add a XDSDocumentEntry.size to every DocumentEntryType with a simple loop
like:
for (DocumentEntryType documentEntry :
(EList<DocumentEntryType>)xdsMetadata.getDocumentEntry()) {
documentEntry.setSize("123456");
}
Now my problem is, that I want to send this "modified" metadata to an IHE
Registry using ITI-14.
Therefore I have to convert this metadata
-ProvideAndRegisterDocumentSetType - to an OMElement.
But I am really stuck on how to solve this problem.
I hope someone can help me!
Thanks in Advance for both your time and your knowledge!
Greetings
Stefan]]>Stefan S.2008-08-19T13:00:05-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/586885/#msg_586885
Indeed this is --- kinda simple. So, one thing to start with is - when
sending the payload to the registry from a repository, you will need to
convert from the ProvideAndRegisterDocumentSetType back to an ebXML
SubmitObjectsRequestType. Once you're back into that type, then you can
submit to the repository.
The way we handle this in the XDS Source and XDS Consumer is
straightforward. In general, it requires three things:
1. Convert the ProvideAndRegisterDocumentSetType (XDS) object to
SubmitObjectsRequestType (ebXML) object
2. Convert the EMF-created SubmitObjectsRequestType object to a DOM object
3. Convert the DOM object to OM for use with Axis2.
Converting from ProvideAndRegisterDocumentSetType (XDS) object to
SubmitObjectsRequestType (ebXML) object
---
For XDS.a:
EbXML_2_1ProvideAndRegisterDocumentSetTransformer setTransformer = new
EbXML_2_1ProvideAndRegisterDocumentSetTransformer();
setTransformer.transform(prDocumentSetTypeObject);
SubmitObjectsRequestType submitObjectsRequest =
setTransformer.getSubmitReq()
For XDS.b:
EbXML_3_0ProvideAndRegisterDocumentSetTransformer setTransformer = new
EbXML_3_0ProvideAndRegisterDocumentSetTransformer();
setTransformer.transform(prDocumentSetTypeObject);
SubmitObjectsRequestType submitObjectsRequest =
setTransformer.getSubmitReq()
Converting from EMF to DOM
---
This conversion requires the creation of an empty DOM Document and then
using the EMF XMLResource's "save" method to save EMF to DOM. Code
snippet looks something like this:
The P&R element should now be "sendable" over the wire.
I put this together pretty fast, so I'm sure I missed something, but
might give it a try!
-Matt
Stefan S. wrote:
> Hi Everybody!
>
> I have a very basic question - at least I hope it is basic ;) - that is
> bothering me for days now!
>
> I have metadata - received by an ITI-15 request - in form of an
> ProvideAndRegisterDocumentSetType. Now I am changing and adding some
> specific attributes. As an example - just for testing - I am trying to
> add a XDSDocumentEntry.size to every DocumentEntryType with a simple
> loop like:
>
> for (DocumentEntryType documentEntry :
> (EList<DocumentEntryType>)xdsMetadata.getDocumentEntry()) {
> documentEntry.setSize("123456");
> }
>
> Now my problem is, that I want to send this "modified" metadata to an
> IHE Registry using ITI-14.
> Therefore I have to convert this metadata
> -ProvideAndRegisterDocumentSetType - to an OMElement.
>
> But I am really stuck on how to solve this problem.
> I hope someone can help me!
>
> Thanks in Advance for both your time and your knowledge!
>
> Greetings
> Stefan
>]]>Matthew Davis2008-08-19T19:44:09-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/46040/#msg_46040
Indeed this is --- kinda simple. So, one thing to start with is - when
sending the payload to the registry from a repository, you will need to
convert from the ProvideAndRegisterDocumentSetType back to an ebXML
SubmitObjectsRequestType. Once you're back into that type, then you can
submit to the repository.
The way we handle this in the XDS Source and XDS Consumer is
straightforward. In general, it requires three things:
1. Convert the ProvideAndRegisterDocumentSetType (XDS) object to
SubmitObjectsRequestType (ebXML) object
2. Convert the EMF-created SubmitObjectsRequestType object to a DOM object
3. Convert the DOM object to OM for use with Axis2.
Converting from ProvideAndRegisterDocumentSetType (XDS) object to
SubmitObjectsRequestType (ebXML) object
---
For XDS.a:
EbXML_2_1ProvideAndRegisterDocumentSetTransformer setTransformer = new
EbXML_2_1ProvideAndRegisterDocumentSetTransformer();
setTransformer.transform(prDocumentSetTypeObject);
SubmitObjectsRequestType submitObjectsRequest =
setTransformer.getSubmitReq()
For XDS.b:
EbXML_3_0ProvideAndRegisterDocumentSetTransformer setTransformer = new
EbXML_3_0ProvideAndRegisterDocumentSetTransformer();
setTransformer.transform(prDocumentSetTypeObject);
SubmitObjectsRequestType submitObjectsRequest =
setTransformer.getSubmitReq()
Converting from EMF to DOM
---
This conversion requires the creation of an empty DOM Document and then
using the EMF XMLResource's "save" method to save EMF to DOM. Code
snippet looks something like this:
The P&R element should now be "sendable" over the wire.
I put this together pretty fast, so I'm sure I missed something, but
might give it a try!
-Matt
Stefan S. wrote:
> Hi Everybody!
>
> I have a very basic question - at least I hope it is basic ;) - that is
> bothering me for days now!
>
> I have metadata - received by an ITI-15 request - in form of an
> ProvideAndRegisterDocumentSetType. Now I am changing and adding some
> specific attributes. As an example - just for testing - I am trying to
> add a XDSDocumentEntry.size to every DocumentEntryType with a simple
> loop like:
>
> for (DocumentEntryType documentEntry :
> (EList<DocumentEntryType>)xdsMetadata.getDocumentEntry()) {
> documentEntry.setSize("123456");
> }
>
> Now my problem is, that I want to send this "modified" metadata to an
> IHE Registry using ITI-14.
> Therefore I have to convert this metadata
> -ProvideAndRegisterDocumentSetType - to an OMElement.
>
> But I am really stuck on how to solve this problem.
> I hope someone can help me!
>
> Thanks in Advance for both your time and your knowledge!
>
> Greetings
> Stefan
>]]>Matthew Davis2008-08-19T19:44:09-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/46101/#msg_46101
Thanks for your answer.
Indeed it is very simple, if you know how to do it! ;)
Greetings
Stefan]]>Stefan S.2008-08-20T05:43:38-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/586911/#msg_586911
Thanks for your answer.
Indeed it is very simple, if you know how to do it! ;)
Greetings
Stefan]]>Stefan S.2008-08-20T05:43:38-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/46131/#msg_46131
After examining your code fragment in detail I stumbled across the
following "problem" and would like to present my solution, just in case
someone experiences the same problem.
The presented example contains the following:
// Convert / "save" EMF to DOM
RegistryPackage packageInstance = RegistryPackage.eINSTANCE;
DocumentRoot root = RegistryFactory.eINSTANCE.createDocumentRoot();
root.setSubmitObjectsRequest(submitObjectsRequest);
The "problem" is, that the class/interface DocumentRoot -
org.eclipse.ohf.ihe.common.ebxml._3._0.rs.DocumentRoot - as returned by
RegistryFactory.eINSTANCE.createDocumentRoot() does not contain a method
"setSubmitObjectsRequest".
My "solution" - or approach - is to use the method "setRegisterRequest()",
as shown in the lines below:
It seems to work, so I think the "problem" is saved. Thanks again for your
help!
Greetings
Stefan]]>Stefan S.2008-08-20T07:12:59-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/586921/#msg_586921
After examining your code fragment in detail I stumbled across the
following "problem" and would like to present my solution, just in case
someone experiences the same problem.
The presented example contains the following:
// Convert / "save" EMF to DOM
RegistryPackage packageInstance = RegistryPackage.eINSTANCE;
DocumentRoot root = RegistryFactory.eINSTANCE.createDocumentRoot();
root.setSubmitObjectsRequest(submitObjectsRequest);
The "problem" is, that the class/interface DocumentRoot -
org.eclipse.ohf.ihe.common.ebxml._3._0.rs.DocumentRoot - as returned by
RegistryFactory.eINSTANCE.createDocumentRoot() does not contain a method
"setSubmitObjectsRequest".
My "solution" - or approach - is to use the method "setRegisterRequest()",
as shown in the lines below:
It seems to work, so I think the "problem" is saved. Thanks again for your
help!
Greetings
Stefan]]>Stefan S.2008-08-20T07:12:59-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/46342/#msg_46342
package names. Thanks for the clarification!
-Matt
Stefan S. wrote:
> Hi Matt!
>
> After examining your code fragment in detail I stumbled across the
> following "problem" and would like to present my solution, just in case
> someone experiences the same problem.
>
> The presented example contains the following:
>
> // Convert / "save" EMF to DOM
> RegistryPackage packageInstance = RegistryPackage.eINSTANCE;
> DocumentRoot root = RegistryFactory.eINSTANCE.createDocumentRoot();
> root.setSubmitObjectsRequest(submitObjectsRequest);
>
> The "problem" is, that the class/interface DocumentRoot -
> org.eclipse.ohf.ihe.common.ebxml._3._0.rs.DocumentRoot - as returned by
> RegistryFactory.eINSTANCE.createDocumentRoot() does not contain a method
> "setSubmitObjectsRequest".
>
> My "solution" - or approach - is to use the method
> "setRegisterRequest()", as shown in the lines below:
>
> org.eclipse.ohf.ihe.common.ebxml._3._0.rs.DocumentRoot root =
> RegistryFactory.eINSTANCE.createDocumentRoot();
> root.setRegistryRequest(submitObjectsRequest);
>
> It seems to work, so I think the "problem" is saved. Thanks again for
> your help!
>
> Greetings
> Stefan
>]]>Matthew Davis2008-08-21T01:24:27-00:00Re: ProvideAndRegisterDocumentSetType --> OMElement
https://www.eclipse.org/forums/index.php/mv/msg/14454/587006/#msg_587006
package names. Thanks for the clarification!
-Matt
Stefan S. wrote:
> Hi Matt!
>
> After examining your code fragment in detail I stumbled across the
> following "problem" and would like to present my solution, just in case
> someone experiences the same problem.
>
> The presented example contains the following:
>
> // Convert / "save" EMF to DOM
> RegistryPackage packageInstance = RegistryPackage.eINSTANCE;
> DocumentRoot root = RegistryFactory.eINSTANCE.createDocumentRoot();
> root.setSubmitObjectsRequest(submitObjectsRequest);
>
> The "problem" is, that the class/interface DocumentRoot -
> org.eclipse.ohf.ihe.common.ebxml._3._0.rs.DocumentRoot - as returned by
> RegistryFactory.eINSTANCE.createDocumentRoot() does not contain a method
> "setSubmitObjectsRequest".
>
> My "solution" - or approach - is to use the method
> "setRegisterRequest()", as shown in the lines below:
>
> org.eclipse.ohf.ihe.common.ebxml._3._0.rs.DocumentRoot root =
> RegistryFactory.eINSTANCE.createDocumentRoot();
> root.setRegistryRequest(submitObjectsRequest);
>
> It seems to work, so I think the "problem" is saved. Thanks again for
> your help!
>
> Greetings
> Stefan
>]]>Matthew Davis2008-08-21T01:24:27-00:00