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



Sep 10, 2011, 10:06 AM
14 Posts

Wrong URLs in download control, Error 500

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: xpages,download Control
  • Replies: 1
Hi,

i have an XPages database containing only design and some configuration documents.
Some of those configuration documents point to other databases on the same server.

I have managed to display views and documents from the other databases in the center of a oneUIv2 layout.

One of my custom controls displays the documents and contains a download control.
The documents are displayed perfectly, but clicking on one of the diplayed attachments yields an Error 500.

The attachment links created are of the form:

http://<server>/<xPagesDbPath>/xsp/.ibmmodres/domino/OpenAttachment/<xPagesDbPath>/<docUNID>/Body/<attachmentFilename>

The second "<xPagesDbPath>" should contain the data-DB path instead of the xPages-DB path!
I have tried to add a databaseName property to this:data, but that is completely ignored, leading to the same result.
Of course, the correct database must be known, otherwise the document could not be displayed at all...

I have seen older posts here concerning a similar bug which should be fixed by now, but those only concerned documents of the current database.

Is this still a bug?
Or could someone please show me a work-around (accessing the attachments and creating the links manually)?


Thanks in advance,
  Bernd
 
Sep 28, 2011, 9:20 AM
14 Posts
Re: Wrong URLs in download control, Error 500 (workaround)
I still consider this a serious bug in the donwload custom control .
 
Meanwhile I have developed a workaround by showing the attachments in a dataTable with correct links, working as expected in the Notes client and in the browser:
 
<!-- Attachments in body field of dominoDoc with correct links... -->
<xp:dataTable id="dataTable1" caption="Attachments" var="attRow">
    <xp:this.value><![CDATA[#{javascript:dominoDoc.getAttachmentList("Body").toArray()}]]></xp:this.value>
    <xp:this.rendered><![CDATA[#{javascript:getComponent("dataTable1").getRowCount() > 0 }]]></xp:this.rendered>
    <xp:column id="column1">
        <xp:link escape="true" id="link2" target="_blank">
            <xp:this.value><![CDATA[#{javascript:
// each attRow is a NotesEmbeddedObject
var attName = attRow.getName();
var domDocServerPath = dominoDoc.getParentDatabase().getServer();
var domDocDbPath = dominoDoc.getParentDatabase().getFilePath();
domDocDbPath = domDocDbPath.replace(/\\/g,"/");
var domDocUnid = dominoDoc.getDocument().getUniversalID();
var res = @Word(context.getUrl(),'.nsf',1) + ".nsf/xsp/.ibmmodres/domino/OpenAttachment/" + domDocServerPath+"!!"+domDocDbPath + "/" + domDocUnid + "/body/" + attName + "?Open";
res}]]></xp:this.value>
            <xp:this.text><![CDATA[#{javascript:attRow.getName()}]]></xp:this.text>
            <xp:image id="image2" url="/intprof.gif"></xp:image>
        </xp:link>
    </xp:column>
</xp:dataTable>

 

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