How to show files attached to Document with xp:fileDownload - xpages

In an application I have files attached directly to the Notes document and not to the document via a Rich text field.
I would like to make those files available in the xp:fileDownload control but that allows only file binding to a Rich text object.
Binds the file control to a data element or other value which must be
of type rich text.
http://www-01.ibm.com/support/knowledgecenter/SSVRGU_9.0.0/com.ibm.designer.domino.ui.doc/wpd_controls_cref_filedownload.html
Is it possible to use the control somehow for making the files attached to the document available for download via this control?

try to download the file using domino url api
download
Domino URL

Related

Display Document Library from Hub Site

Other than using the "embed" webpart, is there a way to display a document library from a Hub site on an associated site?
Or a way to change the look of the embedded library so that the header commands are not visible or the view defaults to its own view?
I want to get rid of the "new", "upload", "edit" headers but still allow filtering.
There is no option to display a document library from a hub site on an associated site except for the Embed web part.
If you only need to display files from an associated site, you could consider to use the "Highlighted Content" web part on a modern page.
It allows you to pick up contents, then filter by content type, file type, and managed properties. You can use the "path" managed property to only get documents from a specific library (Path Begins with {library url}).

Can I add sign here filed to custom pdf and use it for embedded sign later

I have a PDF document. Can I modify it to include SignHere/InitialHere anchor text fields using DocuSign Account through UI and download the PDF in my server and use it later for embedded singing.
Well, I think there are two options here:
You are asking about modifying your PDF. You can do that, but you would have to use some other software/API for this. This would allow you to use AnchorTags with the modified text that you chose.
You could add the SignHere/InitialHere tags via the API when you create the envelope. Here is some code example that can get you started:
https://developers.docusign.com/esign-rest-api/code-examples/code-example-embedded-signing

Create PDF file with pre-defined template

I am trying to create a PDF with the pre-defined template with this particular library called PDFKIT. The server is written in Nodejs, may I know is there any good example I could refer to? What I want to achieve is to have a User Interface as an entry form, and then there is a pre-defined PDF file in-place on the server.When the user hits the submit button, the pdf rendering engine will pick-up the data and embedded into the pdf template file.
Take a look at the PSPDFKit for Web / PSPDFKit Server API docs for handling forms which let you retrieve and update all form fields. You can then use the document APIs for downloading a PDF with the form fields set to whatever values your user submitted.
So to recap, the steps are:
Upload the template PDF to the server storing the document id in your database or in the user's session.
Fill in the form fields using the data your user submitted.
Download the PDF with the updated form fields and e.g. email it or store it somewhere.
Alternatively you can create a signed URL so that you can directly redirect your user to the generated PDF.
Have you heard about PhantomJS? There is a package which name is phantom-html-to-pdf. You may give it a try.

xpages: how do attachments work in a web page

The context here is that, in a CMS type of app, the users that create content like to reproduce Notes' way of having attachments anywhere in the text, not just a list of attachments at the bottom of the page. When creating a page, they want to be able to create links to the attachments right away, using a link and an img tag, not saving the document first and then edit it again.
I have found the YouAtNotes HTML5 Multi File Upload control, which enables the users to upload the attachments before the document is actually saved. The URL for attachment uploaded befor ethe doc is saved is then:
http://myserver/myDB.nsf/xsp/.ibmmodres/persistence/DominoDoc-NEW_569-Body/indifference.jpg
I use this URL in the CKEditor to create an image and it looks OK: the image shows up in the editor and has this URL:
/myDB.nsf/xsp/.ibmmodres/persistence/DominoDoc-NEW_569-Body/insanity.jpg
I then save the document, and it still looks good. The image is showing up and the URL is still:
http://myserver/mydb.nsf/xsp/.ibmmodres/persistence/DominoDoc-NEW_569-Body/indifference.jpg
I close my browser, and open up the page again, and now I see that my image is not showing up, but the URL is still:
/Belair/xBiblio.nsf/xsp/.ibmmodres/persistence/DominoDoc-NEW_569-Body/indifference.jpg
But if I look at the URL that is used by the download control, this is what is has:
http://myserver/mydb.nsf/xsp/.ibmmodres/domino/OpenAttachment/belair/xbiblio.nsf/E4E384094564EE9E85257F33005953AE/Body/indifference.jpg
Why did it change?
Is there documentation on how that whole attachmentprocess works, so I can understand it and give proper indications to the users so they can create valid links.
We also have a particularity in our publishing code: we need to keep the UNID of the published document so links that were made using UNIDs are still working. It is an app with a lot of content and many external apps link to it. So when we publish, we actually copy all the content of the draft into the already published document, so the UNID is different from the draft document, and we have issues with attachment links because of that. But that is something else...
The URL "/Belair/xBiblio.nsf/xsp/.ibmmodres/persistence/DominoDoc-NEW_569-Body/indifference.jpg" relates to a temporary location before the docment has been saved. This is standard functionality because
For SSJS / Java to save an file into an NSF, it's got to have been uploaded to the server prior to the commit.
The user has not chosen to save the file yet, so it shouldn't be added to the NSF.
The document hasn't been saved yet, so even if it should be saved to the NSF, no document yet exists to save it to.
The components of the URL are:
"/Belair/xBiblio.nsf", the URL of the database it will finally need to be committed to.
"xsp/.ibmmodres/persistence", a URL that corresponds to a physical folder location where temporary files for this NSF are stored, based on xsp.properties of the NSF; if nothing is defined in xsp.properties of the NSF, xsp.properties of the server is used; if nothing is defined there, a default location is used.
"DominoDoc-NEW_569", a temporary reference to the new, unsaved dominoDocument datasource. If you close the browser and re-open it, you'll be getting a different temporary dominoDocument datasource reference, so I wouldn't expect the image to show up. Otherwise, different users could get one another's attachments.
"-Body", the field the file needs saving into.
"/indifference.jpg" the file name.
Once the document is saved, the file is stored into the Body field of the relevant document, and the file system cleaned up. The URL has to change, because otherwise the attachment would not be available on other replicas, because only the database gets replicated, and it could not be managed by DAOS.
The new URL "http://myserver/mydb.nsf/xsp/.ibmmodres/domino/OpenAttachment/belair/xbiblio.nsf/E4E384094564EE9E85257F33005953AE/Body/indifference.jpg" corresponds to:
"myserver/mydb.nsf/xsp/.ibmmodres/domino/OpenAttachment", shorthand URL to open the relevant attachment.
"/belair/xbiblio.nsf/E4E384094564EE9E85257F33005953AE", the location of the document the attachment is stored in.
"/Body", the field name.
"/indifference.jpg", the attachment name (the field could have multiple attachments, of course).
The information above is based on what has been documented in XPages Portable Command Guide (for xsp.properties settings for changing the default temporary locations) and Mastering XPages 2nd Edition.
I'm not sure what the YouAtNotes uploader does, so I can't say whether it should be changing the URL or not on save. But in more recent versions of Domino, attachments can be uploaded without a full refresh, which may be of use as an alternative.
When you're copying documents, if you're storing HTML that references images by their URLs, including UNIDs, you'll need to modify those references.
If you want to keep UNIDs, remember that they are read-write - you can set them as well as get them. However, bear in mind that you'll have problems if you change the URL to the same URL of an existing document. Bear in mind this is also XPages, so the data accessed via the XPages applications don't have to be in the same database.

Preview InfoPath Attachment

I have a form that Legal will use to track trademark claims. They want to be able to attach logos to this for for easy reference. It's easy enough to create a file attachment, but is there any way to show a preview of the attached image?
The solution has to be usable in a browser enabled form.
Attachments are stored in base64 format. You'd need to somehow post that data to the server, encode it correctly, and send it back to the client as a jpg. It's a bit of work, but i'm sure it's doable.
You could add a link column (named preview) to your form library that leads to an .aspx page in the layouts directory, where you read the form xml and generate a preview of the document including the attachment previews.
This way you are able to handle the different attachment formats (e.g using C# code) and bypass the limited functions of the form service.
You could add a "edit this form" button to that page that redirects to the original formservice url.
Most browsers support base64 decoding, so you could very easily just point to the base64 data directly.
You might want to checkout base64 in internet explorer: http://dean.edwards.name/weblog/2005/06/base64-sexy/

Resources