203 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Domino Server Administration – All Your FAQ’s Are Answered
Wed, Nov 22nd 2017 224
Why requirements gathering is the most important part in a Notes Domino Project – A Project Lead’s Viewpoint
Wed, Oct 25th 2017 1
5 Ways To Get Better ROI From Your Domino Infrastructure
Sat, Sep 30th 2017 3
Lotus Notes Developer Tools: Six Handy Apps To Make Development Easy
Fri, Sep 22nd 2017 1
Migrate Lotus Notes Application Series : Part 1-Defining Domino-Migration Objective
Mon, Sep 4th 2017 1
Lotus Notes Migration-Your FAQs Answered
Mon, Aug 28th 2017 0
[Webinar Recording] Build Mobile Workflows Using SharePoint Framework
Sat, Aug 26th 2017 1
Top 10
Domino Server Administration – All Your FAQ’s Are Answered
Wed, Nov 22nd 2017 224
How To Handle Attachments From Domino To Node Or Mongodb
Mon, Jun 26th 2017 6
Lotus Notes Migration Tool Kit
Mon, Jul 10th 2017 6
How to use Google Maps API‎ for Geocoding in Domino?
Mon, Jun 26th 2017 5
[Free Webinar]Workflows On SharePoint Online: Deep Dive In 60 Minutes
Mon, Jul 10th 2017 5
Quickr to Office 365 Migration: Data Quality
Tue, Mar 28th 2017 4
IBM SmartCloud:The Smarter Alternative To Domino Infrastructure
Mon, Mar 20th 2017 4
[Webinar] Ten Challenges To Migration From IBM Notes To Office 365
Tue, Jun 20th 2017 4
SharePoint List View Threshold: Your FAQs Answered
Thu, Jun 29th 2017 4
[Free Webinar] Notes Apps Strategy With Mail Migrating To Office 365
Tue, Aug 1st 2017 4


How To Handle Attachments From Domino To Node Or Mongodb
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
Allen Boyce    

In order to extract attachments or files from domino we can use the following methods,

  • Using Agents and transfer file data as base64 to Node or Mongodb.
  • Using http connection between node and domino and accessing the file through its URL

The authentication part can be handled either by user authentication or Domino Web Server Application Programming Interface (DSAPI).

Why to handle the attachments in Node or Mongodb?

 This is because, each service call that we make to domino is very costly comparing to a service call in Mongodb or within node itself. So we prefer saving or handling attachments from Node or Mongodb for future use of the file or attachment.

How to handle the attachments in Node or Mongodb?

There are two methods to handle attachments,

  • Using File System(node)
  • GridFS (Mongodb)
  1. File Systems:

 In this method we will use the nodejs API file-system using which we will save the attachments from Domino to the file systems of our node server.

To do so we need to install the following API into our server using npm.

  • File-system
  • Http
  • Express

var app = require(‘express’)();

var http = require(‘http’);

var fs = require(‘file-system’);

app.get(‘/attachment’,function(request,response){

var file = fs.createWriteStream(path to save the file in your file system);

var options = {

Host: servername (domino),

path: path of the attachment in domino,

method: ‘GET’,

headers: {

‘Host’: servername (domino),

}

};

var request = http.request(options, function (res) {

res.pipe(file);

res.on(‘end’, function () {

response.send(true);

});

});

}

  1. GridFS:

GridFS is a specification for storing and retrieving files that exceed the BSON -document size limit of 16 MB.

Instead of storing a file in a single document, GridFS divides the file into parts, or chunks, and stores each chunk as a separate document. By default, GridFS uses a chunk size of 255 kB; that is, GridFS divides a file into chunks of 255 kB with the exception of the last chunk. The last chunk is only as large as necessary. Similarly, files that are no larger than the chunk size only have a final chunk, using only as much space as needed plus some additional metadata.

Reference: https://docs.mongodb.com/manual/core/gridfs/

As soon as you get the file or attachments data from Domino, just push the data as file into to grid fs of mongodb.

To store file in Mongodb GridFS we are going to use the following API’s

  • Mongodb
  • gridFs
var mongo = require(‘mongodb’);

var Grid = require(‘gridfs’);

 

mongo.MongoClient.connect(mongourl , function (err, db) {

if (err) {

console.log(err);

return false;

}

var gfs = Grid(db, mongo);

gfs.writeFile({

filename: file.name,

content_type: ‘image/png’

}, file.data, function (err, fileDetail) {

if (err) {

console.log(err);

return false;

}

console.log(‘File save to GridFs’);

db.close();

});

});

Maarga is a boutique consultancy with deep expertise in Lotus Notes migration, digital transformation and enterprise collaboration. Reach out to Maarga with your needs at Sales@maargasystems.com

The post How To Handle Attachments From Domino To Node Or Mongodb appeared first on Maarga Systems.



---------------------
http://www.maargasystems.com/handle-attachments-domino-node-mongodb/
Jun 26, 2017
7 hits



Recent Blog Posts
224
Domino Server Administration – All Your FAQ’s Are Answered
Wed, Nov 22nd 2017 5:58a   Allen Boyce
Hang is a situation where the Domino server is still running and can see domino console, but one or more tasks on the server are not responding to requests. Most of the time, a hang occurs due to a low-level loop or a permanent unavailability of a resource, causing serious performance issues. The post Domino Server Administration – All Your FAQ’s Are Answered appeared first on Maarga Systems.
1
Why requirements gathering is the most important part in a Notes Domino Project – A Project Lead’s Viewpoint
Wed, Oct 25th 2017 7:20a   Allen Boyce
Requirements are almost always the single largest reason for the success (or the lack thereof) of Notes Domino projects. The post Why requirements gathering is the most important part in a Notes Domino Project – A Project Lead’s Viewpoint appeared first on Maarga Systems.
3
5 Ways To Get Better ROI From Your Domino Infrastructure
Sat, Sep 30th 2017 9:54a   Allen Boyce
Is the world migrating out of the Lotus Notes platform? Lotus Notes born in 1989, is now a 28 year old mature youth powering productivity and collaboration across several large enterprises. The platform has been criticised as out dated in the cloud, social and mobile first world. And that has  spun off lots of tools and […] The post 5 Ways To Get Better ROI From Your Domino Infrastructure appeared first on Maarga Systems.
1
Lotus Notes Developer Tools: Six Handy Apps To Make Development Easy
Fri, Sep 22nd 2017 5:20a   Allen Boyce
The need for speed in fixing bugs, checking the performance of applications, comparing different versions of code, customizing result displays, bringing out well aligned design elements are all part and parcel of a developers daily grind. Here, I have given six tools which can help the Lotus Notes Developer do his job with finesse. The post Lotus Notes Developer Tools: Six Handy Apps To Make Development Easy appeared first on Maarga Systems.
1
Migrate Lotus Notes Application Series : Part 1-Defining Domino-Migration Objective
Mon, Sep 4th 2017 5:39a   Allen Boyce
From today we are starting a new series along with our Tweak Thursdays, on the different aspects on how to Migrate Lotus Notes Application. The post Migrate Lotus Notes Application Series : Part 1-Defining Domino-Migration Objective appeared first on Maarga Systems.
0
Lotus Notes Migration-Your FAQs Answered
Mon, Aug 28th 2017 2:13p   Allen Boyce
IBM Lotus Notes migration projects take anywhere from 4 months to 2 years typically. There are several factors that influence schedule. The post Lotus Notes Migration-Your FAQs Answered appeared first on Maarga Systems.
1
[Webinar Recording] Build Mobile Workflows Using SharePoint Framework
Sat, Aug 26th 2017 9:17a   Allen Boyce
With Microsoft focussing on a cloud-first, mobile-first strategy, ‘SharePoint Framework’ (SPFx) is rapidly gaining ground with developers creating Apps on SharePoint Online. If you are getting started with SPO, the SPFx framework can help you create rich user experiences on mobile devices. This webinar will be a hands on learning session. Topics covered are: How […] The post [Webinar Recording] Build Mobile Workflows Using SharePoint Framework appeared first on Maarga Systems.
2
[Free] Lotus Notes To Office 365 Migration Tool Kit
Tue, Aug 22nd 2017 1:49p   Allen Boyce
With Lotus notes deeply embedded in the enterprise for over two decades, migration out of Lotus notes has a a wide spread impact. Whether it is mail migration to Office 365 or application migration to share point online, every enterprise context is unique.   The post [Free] Lotus Notes To Office 365 Migration Tool Kit appeared first on Maarga Systems.
4
[Webinar] Build Mobile Workflows Using SharePoint Framework
Wed, Aug 16th 2017 10:45a   Allen Boyce
With Microsoft focussing on a cloud-first, mobile-first strategy, ‘SharePoint Framework’ (SPFx) is rapidly gaining ground with developers creating Apps on SharePoint Online. If you are getting started with SPO, the SPFx framework can help you create rich user experiences on mobile devices. This webinar will be a hands on learning session. Topics covered are: How to setup the environment for SPFx Generate a starter template Develop a simple mobile workflow Deploy and celebrate
1
[Webinar] Build Mobile Workflows Using SharePoint Framework
Wed, Aug 16th 2017 10:45a   Allen Boyce
With Microsoft focussing on a cloud-first, mobile-first strategy, ‘SharePoint Framework’ (SPFx) is rapidly gaining ground with developers creating Apps on SharePoint Online. If you are getting started with SPO, the SPFx framework can help you create rich user experiences on mobile devices. This webinar will be a hands on learning session. Topics covered are: How […] The post [Webinar] Build Mobile Workflows Using SharePoint Framework appeared first on Maarga Systems.




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition