D HCL Domino Daily
All Posts Search Class Map About
A 文
  • Java
    Reading MIME in Java: Without setConvertMIME(false), You're Not Reading MIME

    Modern Domino mail stores the Body as MIME (multipart, with headers), not the classic composite rich text. Read it in Java with getFirstItem("Body") and Domino, by default, converts the MIME to rich text before handing it over — so what you get is the converted thing, with the original MIME structure, headers, and per-part encodings flattened away. To get the real MIME, you first call session.setConvertMIME(false) to turn that conversion off, then getMIMEEntity. This covers the correct order for reading MIME, walking a multipart tree part by part, reading headers, and a biting invalidation rule: a MIMEEntity goes invalid once you apply save / computeWithForm / sign to the Document.

    2026.11.13 →
  • XPages SSJS
    Stream in XPages: Build a Download with getContents, and Set the Charset Yourself

    In XPages you want the user to click a button and download a report file you generate on the spot, or read a file they just uploaded and parse it. The back-end NotesStream (session.createStream) is the tool for that. It has one method that's especially handy in XPages: getContents pours the stream's contents straight into a java.io.OutputStream — which is exactly what the HTTP response's output stream is — so you can stream the generated file to the browser without landing a temp file on disk first. This covers building a download with Stream, reading an uploaded file via fileUpload, writeText's no-line-ending default, and the charset-defaults-to-System trap (the deep dive on that lives in the Java Stream piece; here it's just the fix).

    2026.11.12 →
  • Java
    Files in Java with Stream: the Default Charset Is System, Not Unicode

    In Java you want to write a document's text out to a file, or read a file in. Domino's Stream (session.createStream) is the path that's integrated with Domino's own encoding, and it's what MIMEEntity and attachments use underneath. But it has a trap that quietly mojibakes non-ASCII text: a freshly created Stream reports its Charset as Unicode, yet open(path) with no charset argument defaults to System — the server's platform encoding — not Unicode. This covers getting a Stream, the open charset trap, writeText defaulting to no line ending (EOL_NONE), binary mode and bridging to java.io with getContents/setContents, and the two edges that bite: thread confinement and recycle.

    2026.11.11 →
  • Java
    Attachments in Java: Stream with getInputStream, and Two Traps That Bite

    In Java you want an attachment's bytes — to stream to a browser, hash it, push it to object storage. The reflex is to extractFile to a temp file and read that back; but EmbeddedObject in Java has getInputStream, which reads the attachment's content straight as a stream, no temp file at all. This covers the streaming approach and two traps the docs state plainly but people still hit: extractFile throws on anything that isn't a file attachment (embedded objects / object links), and Document.getEmbeddedObjects doesn't return file attachments at all — you get those off the RichTextItem. Plus a platform reality: UNIX/Mac Domino only supports file attachments, not embedded objects.

    2026.11.10 →
  • XPages SSJS
    DocumentCollection in SSJS: stampAll Updates Them All, removeAll Deletes Them All

    In SSJS a search, an FTSearch, or a view lookup by key hands you a NotesDocumentCollection. To do something to that pile of documents, the reflex is a getFirstDocument / getNextDocument loop; but the collection has batch operations of its own: stampAll sets one field to the same value across every document, and removeAll permanently deletes the whole batch — one line, no loop. Powerful, and removeAll especially will do exactly what you tell it, permanently. This covers getting and walking a collection in SSJS (including the Count-is-a-property-not-getCount gotcha), the stampAll / removeAll batch moves and their risks, combining collections with FTSearch and intersect/merge/subtract, and whose rights these run under.

    2026.11.09 →
  • Java
    Reading Rich Text in Java: Cast First, Then Mind the MIME and the Dropped Attachments

    To touch a rich text field like Body in Java, getFirstItem hands you an Item, and you have to cast it to RichTextItem before you can do anything — and that cast hides two surprises: a modern Body is often MIME, not classic rich text (so you go through getMIMEEntity); and when you read the content to plain text with getFormattedText, it quietly drops the attachments and images. This covers getting at it in Java (the cast and the MIME case), reading rich text to plain text (getFormattedText's three parameters and what it throws away), and building one with createRichTextItem.

    2026.11.08 →
  • Java
    Reading a View in Java: Don't Open a Whole Document Just to Read One Column

    To list a few columns per row out of a view for a report, the reflex is to walk getNextDocument and getItemValue each one — in Java that's thousands of NotesDocuments pulled from the back end and recycled one by one. But those column values already sit in each row: a ViewEntry's getColumnValues() reads the whole row without opening a single document. This covers getting a view in Java (the view/folder and name/alias traps in getView), why you read columns off a ViewEntry instead of a Document, looking up by key with getAllEntriesByKey, and why you call setAutoUpdate(false) before iterating.

    2026.11.07 →
  • XPages SSJS
    In XPages the Database Is Free — the Question Is Whose Rights Opened It

    LotusScript and Java both make you write a few lines to get a Database; in XPages SSJS, database is just there, pointing at the current NSF — you don't even call getDatabase. So the hard part of the Database in SSJS isn't how to get it, it's a question LS and Java rarely force on you: whose rights is this code running with? The user's? Or the XPage's signer's? This covers the database global, how to open other databases (session.getDatabase / getCurrentDatabase), and the session vs sessionAsSigner vs sessionAsSignerWithFullAccess rights model — when you have no choice but to run as the signer.

    2026.11.06 →
  • Notes Client Security +2
    eMudhra Certificates on the Notes Client: The Hard Part Isn't Which Cert — It's Thousands of Desktops

    On the server you pull the affected eMudhra / emSign / Comodo roots out of the trust store one box at a time, as the admin, by hand. On the Notes client the same certificates sit on every desktop in your company — and you can't SSH into five thousand workstations. This follows the Domino Server piece and focuses on the client side: where the certificates hide in a different set of trust stores (the local names.nsf under Advanced > Certificates, the bundled Java cacerts in the program directory, the per-workstation cacert.pem, the macOS keychain), why there's no built-in way to clean them all at once, how to push a fix to every machine with MarvelClient or your own software-deployment tool, and one corner the official bulletin doesn't list but you'd better check yourself: the EOL 9.x.

    2026.11.05 →
‹ Previous123…25Next ›
Powered by Astro and GitHub Actions