loic01 Absent Member.
Absent Member.
2861 views

Document Mime Type Using JAVA

Hi,

I'm having difficulties to create a document with the proper file extension, it always has the ".tmp" extension. I saw that this can be achieved using the GroupWise DocumentRef object but I can't find a way to link the DocumentRef object with the new Document previously created. Can someone assist me in achieving this task.

Thanks.
Labels (1)
0 Likes
6 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Document Mime Type Using JAVA

The file name extension "<filename>" on a DocumentRef is
read-only. The only place you can set the file name extension
is on a Version object.

Preston

>>> On Wednesday, April 08, 2009 at 7:56 AM,

loic01<loic01@no-mx.forums.novell.com>
wrote:

> Hi,
>
> I'm having difficulties to create a document with the proper file
> extension, it always has the ".tmp" extension. I saw that this can be
> achieved using the GroupWise DocumentRef object but I can't find a way
> to link the DocumentRef object with the new Document previously created.
> Can someone assist me in achieving this task.
>
> Thanks.

0 Likes
loic01 Absent Member.
Absent Member.

Re: Document Mime Type Using JAVA

Hi,

Thanks for your response.
I've tried using the version filename but I'm still struggling to get it right. Here is the approach that I follow:
1-create a new document
2-retrieve the new created document
3-Instantiate a new version object and set its properties to be the same as the created document
4-Then call the modifyItemRequest to modify the document version object.

There might be something that I'm doing wrong can you please assist me in solving this issue of the document extension.

Thanks
0 Likes
Highlighted
Anonymous_User Absent Member.
Absent Member.

Re: Document Mime Type Using JAVA

You'll have to look at the SOAP traces to see if you can figure
out what you are doing wrong. Here a some modified SOAP traces
of creating a document, modifying the version and get the version
again.

create doc request:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope>
<env:Body>
<ns0:createItemRequest>
<ns0:item xsi:type="ans1:Document">
<ans1:subject>TestDoc</ans1:subject>
<ans1:library>
<ans1:email>domain.PO1.PO1 Library@67</ans1:email>
</ans1:library>
</ns0:item>
</ns0:createItemRequest>
</env:Body>
</env:Envelope>

create doc response:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope>
<env:Body>
<gwm:createItemResponse>
<gwm:id>domain.PO1.PO1 Library:44@68</gwm:id>
<gwm:status>
<gwt:code>0</gwt:code>
</gwm:status>
</gwm:createItemResponse>
</env:Body>
</env:Envelope>

getItems request:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope>
<env:Body>
<ns0:getItemsRequest>
<ns0:container>domain.PO1.PO1 Library:44@68</ns0:container>
<ns0:count>0</ns0:count>
</ns0:getItemsRequest>
</env:Body>
</env:Envelope>

getItems response:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope>
<env:Body>
<gwm:getItemsResponse>
<gwm:items>
<gwt:item xsi:type="gwt:Version">
<gwt:id>domain.PO1.PO1 Library:44:1@69</gwt:id>
<gwt:version>1</gwt:version>
<gwt:container>domain.PO1.PO1 Library:44@67</gwt:container>
<gwt:created>2009-04-09T07:54:34Z</gwt:created>
<gwt:library>
<gwt:displayName>PO1 Library</gwt:displayName>
<gwt:email>PO1 Library@prestons.provo.novell.com</gwt:email>
</gwt:library>
<gwt:documentNumber>44</gwt:documentNumber>
<gwt:versionCreator>
<gwt:displayName>Preston stephenson</gwt:displayName>
<gwt:email>pstephenson@prestons.provo.novell.com</gwt:email>
<gwt:uuid>2D16B180-0922-0000-846C-82BD300F9E1C</gwt:uuid>
</gwt:versionCreator>
<gwt:versionNumber>1</gwt:versionNumber>
<gwt:versionStatus>available</gwt:versionStatus>
<gwt:life>0</gwt:life>
<gwt:ageAction>archive</gwt:ageAction>
</gwt:item>
</gwm:items>
<gwm:status>
<gwt:code>0</gwt:code>
</gwm:status>
</gwm:getItemsResponse>
</env:Body>
</env:Envelope>

modify version request:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope>
<env:Body>
<ns0:modifyItemRequest>
<ns0:id>domain.PO1.PO1 Library:44:1@69</ns0:id>
<ns0:updates>
<ans1:update xsi:type="ans1:Version">
<ans1:versionDescription>This is a test
description</ans1:versionDescription>
<ans1:life>66</ans1:life>
<ans1:ageAction>delete</ans1:ageAction>
<ans1:fileSize>0</ans1:fileSize>
<ans1:filename>cpp</ans1:filename>
</ans1:update>
</ns0:updates>
<ns0:recurrenceAllInstances>0</ns0:recurrenceAllInstances>
</ns0:modifyItemRequest>
</env:Body>
</env:Envelope>

getItems request 2nd time:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope>
<env:Body>
<ns0:getItemsRequest>
<ns0:container>domain.PO1.PO1 Library:44@68</ns0:container>
<ns0:count>0</ns0:count>
</ns0:getItemsRequest>
</env:Body>
</env:Envelope>

getItems requeset 2nd time:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope>
<env:Body>
<gwm:getItemsResponse>
<gwm:items>
<gwt:item xsi:type="gwt:Version">
<gwt:id>domain.PO1.PO1 Library:44:1@69</gwt:id>
<gwt:version>2</gwt:version>
<gwt:container>domain.PO1.PO1 Library:44@67</gwt:container>
<gwt:created>2009-04-09T07:54:34Z</gwt:created>
<gwt:library>
<gwt:displayName>PO1 Library</gwt:displayName>
<gwt:email>PO1 Library@prestons.provo.novell.com</gwt:email>
</gwt:library>
<gwt:documentNumber>44</gwt:documentNumber>
<gwt:versionCreator>
<gwt:displayName>Preston stephenson</gwt:displayName>
<gwt:email>pstephenson@prestons.provo.novell.com</gwt:email>
<gwt:uuid>2D16B180-0922-0000-846C-82BD300F9E1C</gwt:uuid>
</gwt:versionCreator>
<gwt:versionNumber>1</gwt:versionNumber>
<gwt:versionDescription>This is a test
description</gwt:versionDescription>
<gwt:versionStatus>available</gwt:versionStatus>
<gwt:life>66</gwt:life>
<gwt:ageAction>delete</gwt:ageAction>
<gwt:filename>cpp</gwt:filename>
</gwt:item>
</gwm:items>
<gwm:status>
<gwt:code>0</gwt:code>
</gwm:status>
</gwm:getItemsResponse>
</env:Body>
</env:Envelope>


If you still have problems, send me the same SOAP
requests on your document and version.
If you have problems creating a new version, let me
know and I can show you that.

Preston

>>> On Thursday, April 09, 2009 at 6:26 AM,

loic01<loic01@no-mx.forums.novell.com>
wrote:

> Hi,
>
> Thanks for your response.
> I've tried using the version filename but I'm still struggling to get
> it right. Here is the approach that I follow:
> 1-create a new document
> 2-retrieve the new created document
> 3-Instantiate a new version object and set its properties to be the
> same as the created document
> 4-Then call the modifyItemRequest to modify the document version
> object.
>
> There might be something that I'm doing wrong can you please assist me
> in solving this issue of the document extension.
>
> Thanks

0 Likes
loic01 Absent Member.
Absent Member.

Re: Document Mime Type Using JAVA

Hi Preston,

Thanks for the soap trace files that you've provided they helped me to locate where was my error. My mistake was the container ID, I was using the library ID instead of the document ID to create or modify the document version object.

I've got another issue though: each time that I create a document it appears in the user's mailbox as well as in the user's document folder. Is there a way to specify that the document should only appear in the user's document folder?


Thanks...
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Document Mime Type Using JAVA

There is an outstanding bug on this issue.
There is not a workaround.
The bug has not been assigned to a release yet.
(It is not scheduled to be fixed yet).

Preston

>>> On Tuesday, April 14, 2009 at 8:26 AM,

loic01<loic01@no-mx.forums.novell.com>
wrote:

> Hi Preston,
>
> Thanks for the soap trace files that you've provided they helped me to
> locate where was my error. My mistake was the container ID, I was using
> the library ID instead of the document ID to create or modify the
> document version object.
>
> I've got another issue though: each time that I create a document it
> appears in the user's mailbox as well as in the user's document folder.
> Is there a way to specify that the document should only appear in the
> user's document folder?
>
>
> Thanks...

0 Likes
loic01 Absent Member.
Absent Member.

Re: Document Mime Type Using JAVA

Thanks Preston...
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.