Demo email functionality in xpages for multiple servers - xpages

We are planning to create cluster server for our primary server and confused how can we create dynamic document links for workflow users. following is our proposed architecture.
1 - MailServer01
2 - AppServer01 - User where email server is mentioned MailServer01 will use app server01 for apps and this server will use SMTP services of MailServer01 and for another location we are having following two servers
1 - MailServer02
2 - AppServer02 - Same as above
I have an application deployed in primary server(AppServer01) is serving for location X and replica of that application is available on AppServer02 and in use of location Y. Both server are replicating after 5 minutes interval. Now I am having 2 issues and your help is required.
1 - How can I create dynamic link for Rich / Notes Client and Web Client for xpages that person having email on MailServer01 access these links on AppServer01 and person having email on MailServer02 access these links on AppServer02 ? I don't want to hard code anything e.g. previously we were using appendDocLink and if primary is not available user were redirected to replica /cluster.
2 - If I achieve above functionality than if person is initiating workflow from AppServer02 and approval is required from the guy on AppServer01 system generate email instantly but record is updated when replication occurs. How can I make that record immediately available to person on other server. There is no time difference at both locations.
Kindly let me know if you require any further details. Thanks for your time and support.
Thanks,
Qaiser

1.) If you have http(s) enabled on you mail server, I suggest that you create an "intermediary application" on the mail server itself. This application can be called with a parameter to identify the document you want to open. While calling this app you can determine the user's home server and document url and redirect the user to the document on the corresponding app server.
With this approach you do not need any "hard-coded" links, you can compute the link based on the recipient's home server or using the approach Richard suggested in his comment using #UrlOpen.
2.) To ensure that documents within the app will be replicated instantly I recommend to setup both application servers as a cluster. Cluster replication will ensure that both databases are in sync on both servers in "real time" (if there is such a thing like real time...).

Related

How to track last login date for IBM Domino web user?

Does IBM Domino track the last login date for web users(UserName/Password and internet certificate)? I know the access logs contains this information but wanted to know if there may be something built into Domino (maybe in Address Book). Trying to come up with a method to disable web accounts that have not accessed a domino server in a specified time period.
Thanks,
Kev
The User Activity area in the Database Properties picks up from the log.nsf, which is where this information is stored. But, typically, the log.nsf will only have a few days' worth of information. When I've had this requirement before, I've manually captured it via a custom login page or an initUser function I've had in applications.
One of the easiest solutions is to trigger an action from a live web page that generates a database.nsf?openagent event.
like:
or
Ideally you've use the openagent to print a content type and a response, but if you don't browsers do pretty well with invalid responses from servers.
inside your "myagent" you will have the users name available to you to write it to a document.
Your next challenge will be in getting the agent to trigger, but, not too often, ideally only on login.
When a user uses a custom login form it submits the username/password and redirection url in POST method. You could change that to ...?openagent&nexturl=/blablabla.nsf
Your tiny little agent would run one and only one time upon login and update a document in a your custom logging database.
That's a developer's solution.
There are also admin solutions. The server does keep track of active web sessions, but, it does not drop them into the log.nsf like it does upon session ending for a notes session. I don't think it would be too much work from an admin standpoint to get that information there are a lot of event triggers available to you. It's just been way too long since I worked on any server that anyone cared about statistics.

How to show and replicate documents for certain users and roles only?

I'm building a collaboration app with couchdb and pouchdb.
I want to implement a calendar feature.
Let's say there is an event like "secret meeting" that involves the users Jessica and James, so the event should have read, update and replicate capabilities only for Jessica and James.
Or, let's say, I have an event like "general meeting" that should have read, edit and replicate capabilities only for all current (and FUTURE!) users having the role "office".
I know that there is no per-document-access control in couchdb.
I also read about using "proxy servers" but I don't understand how they work.
I read a lot about using "one document per user".
How do I keep the documents in-sync in each database, then?
I could make a DATABASE for each event, but how do I query for views showing all my events? Do I also have to keep a database-per-role?
This is the most normal use case every web app nowadays has!
Think Facebook, think Whatsapp, every chat app.
How should you use CouchDB if you can't limit the access to certain documents?
Yes, you should have a database per user, you will use filtered replication to place into each database all the event documents related to that user or the roles that user belongs to, then you will replicate that entire DB down to the user's PouchDB.
I ended up developing a PROXY server for my databases which sits in front of my main databases and filters the data. It has its own port and queries Couchdb on port 5984 for permissions. I used nodejs and the Nano couchDB adapter for that.

How to Track Connections On a Server Accurately

I have a dedicated server hosting a website of mine and I have about 10% of my traffic unaccounted for.
The path of the clicks is as follows
Ads on Facebok ==> My Website
I have Google Analytics script on My Website (on the bottom) and it should fire off whenever a person lands on the page.
The problems is that if I have 4000 clicks on the Ad (tracked by Facebook), Google Analytics tells me I have about 3600 people landing on My Website.
I also invested in real-time tracking software like Clicky and it gives me similar results to Google Analytics. (just in case GA is not accurate)
So I have narrowed it down to 3 scenarios:
1) The Ad clicks aren't being tracked properly by Facebook (I have made sure this is not the problem)
2) The page is taking too long for some people to load and they are hitting the back button before Google Analytics can be triggered.
3) Some connection are dropping from the Ad to My Website.
Can anyone recommend a way I can make sure 2 and 3 aren't happening? and if they are
how would I fix them.
I'm going to make an assumption that you're using Apache. It should be possible to parse the Apache logs to extract connections from unique IP addresses. Hopefully the URL requested by the client will contain some sort of path indicating that it was directed from Facebook.
Link:
Get unique visitors from apache log file

automation of tasks - email using web application

I have a web application that monitors farms in certain areas. Right now I am having a problem of performing automation with some of the tasks.
Users of the web application can send reports or checkins using keywords. If the reports or checkins correspond to certain keywords, for example "alert", I need the web application to send an alert to the user via email using that web application. But that alert must be sent two weeks after the date of the report received, and to that particular user only.
Would it be possible to use cron to perform this? If not, can anyone suggest me a workaround?
A possible approach you might consider is to store an entry in a database for each of these reminder emails you need to send, at the time your user does whatever action in your application that determines the need to send that email exists. Include the recipient, the date to be sent, and the email content as content you store for each entry. Schedule a single cron job to run periodically to process these database records by due date, and populate an email template to be sent out. You can then either delete the database records, or a better option, include a column that indicates they were sent and mark them as sent.
It would help to provide which technology stack you're operating on and what the application is developed in. Others might be able to point you to technology specific approaches or pre-built plugins/extensions that already do this for the situation you're in, to help you avoid the need to write your own code for the solution.

Best Way To Receive Email Website

I am developing a website -- in the prototype stage, soon to be alpha. I will provide an email address to each account that allows the user to deposit stuff -- not a real email account, just an endpoint for sending things to the site. Many sites provide this kind of service nowadays. I think the first one I saw was Photobucket, which let's you send photos as email attachments.
My question is, what is the best way to implement this kind of service?
In my prototype, I have written a POP3 client which fetches all newly delivered mail (currently from a test Gmail account). My service processes each new mail and attachments, and immediately removes it from the email server.
I could certainly outsource to an email service with POP3 and be done with it. The problem is cost. Most services I have seen provide much more than I need, and they charge per account. I expect to have many accounts and low traffic volume.
So I'm leaning towards hosting email receipt myself. I am open to Windows or Linux. The code that processes incoming emails runs on Windows, but I have other services running on Linux. I have seen a number of open source and free email servers, such as hMailServer and MailEnable (Windows) and qmail, Postfix and exim (Linux).
I guess I have a slight preference towards Linux because of lower hosting costs, but if a Windows service can provide cleaner integration, that might be worth it. As far as features, I would like to have some spam filtering, but it's is not a huge priority. POP3 is adequate for retrieval, but a more direct API would be nice. I will need some kind of API for programmatically provisioning new accounts.
All suggestions are appreciated. Do you know how others implement this kind of service?
UPDATE: I ended up using hMailServer, which is a free mail server that runs on Windows. It seems to be quite mature and robust. It has a COM interop library which makes accessing emails, accounts, etc. from my .NET server app very easy indeed.
If you're going the host-your-own-email-server route, I would probably just use POSTFIX and pipe all your email to a PHP script, which processes the email.
Here's a quick'n dirty tutorial on setting up the email pipe if you're using cPanel:
http://kb.siteground.com/article/How_to_pipe_an_email_to_a_PHP_script.html
If not, here's how to do it:
http://answers.google.com/answers/threadview?id=562518
The bottom line is, you need to have an open SMTP connection to accept email. If you have your own server, then you can install a SMTP server on the machine. Usually, you have filesystem access to the location the email files are placed. Be sure to select a SMTP server that allows this, and that the email are in a format that you can parse.
Then, you can just monitor the file location for incoming emails.
If you can't pipe your emails (using the Postfix suggestion), and you don't have your own server (for example, on a shared hosting plan), then you will need to query a POP3 or IMAP mailbox server for your emails, and parse them accordingly.
I wanted to get emails in real time so I worked out my own solution with google app engine. I basically made a small dedicated google app engine app to receive and POST emails to my main site. That way I could avoid having to set up an email server.
You can check out Emailization (a little weekend project I did to do it for you), or you this small GAE app that should do the trick.
I kinda explained it more on another question.
Hope that helps!

Resources