Skip to main content
New Participant
Jul 31, 2024 8:22 PM UTC
Question

Knowlede Document getInternalFilename()

I am updating a custom plugin that utilizes the Knowledge Document Type and uses the getInternalFilename() to get the absolute path of the document. That function has been deprecated, what is the preferred replacement, as I still need the absolute path of the document. Would getExternalFilename() return a similar value. 

3 replies

stefanhelzle0001
Brainy
Aug 1, 2024 6:00 AM UTC

Find some alternatives here: https://docs.appian.com/suite/help/24.2/api/com/appiancorp/suiteapi/knowledge/Document.html#getInternalFilename()

You can also check other plugins from the app market for the included source code.

A word of caution here. My experience with developing plugins is quite limited.

Known Participant
Sep 8, 2024 2:38 PM UTC

Preferred way is to use the file stream APIs instead of the deprecated ones. Have listed a few use cases for working with documents.

For reading, use getInputStream of Document object returned by ContentService.download() api by passing the document id.

For updating an existing document, similarly use getOutputStream and write to the DocumentOutputStream returned.

For creating a new document, create a new Document object, call contentService.uploadDocument which returns a ContentUploadOutputStream. Then write data to this output stream. Note that the getContentId method returns the newly created document id.

kumara0180
Participating Frequently
Sep 8, 2024 9:15 PM UTC

Did you try documet(documentID,”URL”) ?