In Ews push notification mode, I am getting unwanted unsaved Appointment. How to get rid of them? - exchangewebservices

I am using Exchange Web Services' push notification mode. I noticed that when I "New an appointment" in Exchange, if I click "attachment" button, it jumps to Attachement page, and push a "Item" notification into the SOAP servlet right away, without me "Save" the appointment. I guess this is probably how it works. But then I need to identify this "Item" as unfinished in my code, such that I can ignore it until I received another notification when the appointment is actually saved. So far, I've tried a number of properties such as isDraft, isDirty, getAppointmentState and etc to identify this "unsaved" appointment, but none of them worked.
So my questions are:
Can I config the exchange server such that it stops pushing notification for "unsaved" appointment?
Failing to do (1), how can I identify the "unsaved" appointment? Which property to check?
Thanks in advance,
Ling

Notifications are basically just telling you that an Item has been created on the server and based on way the UI action is taking place the client is creating an item to cater for the UI interaction so you will get a notification regardless. There is no such concept as a draft appointment and then next notification you get for that appointment should be an update. Multiple notification for an appointment is something that your code you should expect and deal with if you synchronization process is going to work reliably.
One thing you can try is to look at the item that is being created with a MAPI editor like OutlookSpy or MFCMapi as that will tell you if there is a specific extended property that you maybe able to use.

Related

EWS create appointment without getting a streaming notification

I'm working on synchronization from our application to Exchange and back. I've set up a streamingnotification to the calendar of a room/resource defined in Exchange.
When I create an appointment in the calendar of the room I get a notification in my application, which is great. However, I also want to change this appointment from our application and send these changes to the calendar of the room in Exchange. That is no problem, but then I also receive a notification from Exchange. Basically Exchange is telling me that item 'x' has changed, when I'm the one who changed it, so I already know and don't want to process this change.
Is there a way to determine where the change originated from, or tell EWS to not send a streamingnotification when I edit an item?
Whenever you change an Item in EWS with UpdateItem the lasted ChangeKey is returned in the Response https://msdn.microsoft.com/en-us/library/office/dn605828(v=exchg.150).aspx . This property allows you to track when changes occur on the Item or to validate if no changes has occurred since the last modification.
The PidTagLastModifierEntryId property https://msdn.microsoft.com/en-us/library/gg672131(v=exchg.80).aspx will tell you who last modified an appointment.

Are there any hooks for user modification events in google apps?

Currently the bane of my existence is dealing with users email signatures at work, changing names, titles, departments, new users...it's all annoying. Currently I manage it with GAM and a semi templated HTML file to push changes, which works okay, but it's still a manual process. What I'm looking to do is create a small app script or app engine project that can...
detect a new or changed user
pull the fields needed to fill in their signature template
push the changes to their account
2 & 3 are no problem at all, it's #1 that I cannot find a reasonable solution to.
I had thought about using the google apps audit settings to email a specific mailbox when a new user is created, but that will only catch new users, not changes in titles and such. My only apparent option is something that runs periodically checking all the users signatures against what my script would generate and updating if needed, but that's hardly efficient and creates a potential timelapse in the waiting period meaning when people want things 'done now' (which is of course, every request), it will mean I manually trigger the job; effectively bringing me back to my original solution.
Is there any kind of user feed that contains changes available in google apps? Maybe google has a POST hook that hits a predefined URL on changes?
You can probably use push notifications for this https://developers.google.com/drive/web/push using the users.watch method https://developers.google.com/admin-sdk/directory/v1/reference/users/watch

Getting rename event from Box webhook, also are events preferred to webhook in Box?

I'm trying to use webhooks to get notifications for changes in a user's Box account. One thing I don't see is an option to get a webhook notification when an item is renamed. Is it possible to get a notification for rename? I see that RENAME is available via the event API, is it preferable to use the event API? I saw another stackoverflow question asking about webhook vs event (Box webhooks deprecated in favor of long polling?) and the answer said webhooks are still valid, but didn't really comment on webhook vs event.
I'd prefer webhooks since they are a close fit to how I get changes for Dropbox accounts but it appears from the docs that event has more information/options. Also, it seems it's possible to miss a Box webhook notification which could create an inconsistent state between Box the model in my application.
Which to choose?
Many thanks!
I don't believe it's possible to get a WebHook notification when an item is renamed.
The choice between WebHooks and events really depends on what you're building. WebHooks are generally easier to use, but the events stream can give you more power. In your case, you'll probably need to use events so you can be notified of a renames.
It's also worth noting that if your application really depends on staying in sync with the state of Box, you're better off using the events stream. It lets you specify a last known position in the stream so that you can catch up on any missed events if your application goes offline.

Keeping Email Message from Grouping into Conversation View in Gmail

I'm working on a feature for a client to send them email updates whenever a specific event occurs on their site. When the message shows up in Gmail, the messages get grouped together in conversation view even through they aren't the same conversation. It appears that this is due to the fact that Gmail groups based only on the subject. The client is adamant that we not change the subject line (don't get me started).
Does anyone know how I can disable this by sending a special header in the mail or am I out of luck?
There appears to be no way to prevent this, short of turning off conversation view (have you considered that?).
My guess is that Gmail is actually threading based on its own Thread-Topic header field, which it adds (overwriting any value you pass; it just copies the Subject field) - there's no way of telling, though, unless you can change that field after the fact. Which leads to the suggestion of writing an IMAP application to download the message, edit the headers, and re-upload it again. You'd need to investigate the feasibility of this, though.

How does Facebook detect when a user receives a new message & make changes to the html?

I'm new to AJAX and PHP but I know that PHP is a server-side scripting language and so there will not be any changes to the html unless the user refreshes the page or the user submits a form. Therefore I suppose the change of the number in <span id="mercurymessagesCountValue"> when a facebook user receives a message
is AJAX-related.
And this is my guess:
The change of the number is triggered when it is detected that another user [the sender] has inserted a new row into a particular table and each column contains different data: the time, the message, the sender id and the receiver id.
So here's my question... In this case, how is the changes in the database detected and how does it trigger a javscript [or something else] to make changes to the html? Or if I'm wrong... can I know how Facebook does that? Thanks very much!!
If I got the question right, you should check out about pull and push models. Facebook works under the push model: facebook server knows when new message is received and it pushes the notification to the client (website open in the browser).
Let me clear a few things up for you here,
AJAX is simply a type of request being sent by the browser to go grab data from another page dynamically. In facebook's case, they actually have a special type of connection to the client computer to keep the page 'alive'. This way, they can push dynamic updates to the client without the need to constantly poll/refresh a single page on the server (would make large amounts of load).
So, let's just pretend, they are constantly refreshing the page on the server to determine how many notifications are unread -
Client -> Ajax Call -> Server PHP Page -> Ajax Return -> Client
So, in order, the client sends a request for the page to be generated by the server.
The server's php page will then count the number of 'unread' notification rows in the database for that particular user. It will then output the number of unread rows in plain html.
The client then recieves this plain HTML from the Ajax call, and simply updates the DOM with the new number of unread notifications
PLEASE NOTE: This is not how facebook works, but it's a good example of how to set up your own basic notification system if you are new to dynamic coding.
My guess is that requests are sent frequently from the client via Javascript, to the host, asking "has anything new happend since last time i asked?". The answer is responded by the server, with PHP, if it is yes, the new data is delivered in the respond and JavaScript updates the DOM (HTML) with the new data, like showing the red flag or something.
javascript:location.load(t);
(t=time interval)
i guess ,, refreshing a page in every several seconds will pop up the notifications recieved..!!