This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 12, 2013, 5:42 PM
67 Posts

Embedded file with substitution name

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 2
Hi,
 
to use an attachment in a special field of a document at another place, i need to calculate the complete URL to that i.e.:
 
...DBPath.../x/A7D0AFC10F1A8C58C12579D10052E5A2/$file/ATT3UVJN.png
 
I'm able to extract the attachment name in a Field with SSJS: 
 
var alist = document1.getAttachmentList("Field");
var alisti = alist.iterator();
while (alisti.hasNext()) 
{
result =alisti.next().getName();
}
return "...documentID.../$FILE/" + result
  
The problem is, that the real attachment name somtimes is  substituted (as seen in the example above).
My question is: 
 
How can i get the substitute name of a specific attachment ?? 
 
Thanks 
Uwe 

Apr 15, 2013, 2:14 PM
54 Posts
Re: Embedded file with substitution name
try this:

doc = document1.getDocument();
rtitem = doc.getFirstItem("Body");
v = rtitem.getEmbeddedObjects();
for (var i = 0; i < v.length; i++) {
    print(v[i]);

Apr 18, 2013, 7:16 PM
67 Posts
Re: Embedded file with substitution name
 Helmut, that seems to be not a good idea.

When i try your code on a field with substituted attachment names, after execution the http server gets ill:

Exception

java.io.NotSerializableException: lotus.domino.local.EmbeddedObject
lotus.domino.local.EmbeddedObject


 This occurs after that on ALL xpages, regardless if they are involved or not. I have to do a restart of the http-task.
On a field with original  attachment names, there is no problem.

 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal