Events from Local MS office application to browser - javascript

We have a content management solution and we host files.
Our server side act as a MS WEBDAV server .
Our browser side java script based application shows the files stored in our servers.
Whenever an user click on a document in our browser application , we form the ms office URIs and Local ms office installation opens. Thereafter the DAV communication happens between the local office application and our server side.
Now i want to share some information/state between the local office application and the client side browser which actually helped to open the file.
Is it possible on the browser side to listen to some events generated by office application for e.g. on save ?
Office generates event on save but they remain on the realm of Office products. How to propagate this event to the browser application running ?
I can probably develop a VSTO add in , capture the event, wrap the event to a messsage bus and let my browser application listen to that message bus but this seems pretty complex.
Also i don't have the option to send any notification from my server side to client side .
Best Regards,
Saurav

Your best bet is to create a VSTO add-in that talks directly with a server-side service.
You have a few options on how to implement this. I would try to create a WebSocket bridge, which forwards messages between the VSTO add-in and your web application client-side code. I would start by looking at using something like websockify.
Alternatively, you could create a simple HTTP web service that can be called by both parties and then have the javascript code poll for updates periodically.
Or you could even go for a hybrid of these two options, where the VSTO add-in uses a standard HTTP service call and your javascript uses WebSockets to receive updates from the same service.
This new service could easily sit alongside your main web application. Maybe, the web methods could just be part of your web application.
It is quite straight forward... You just need to figure out how you are going to keep a reference of the document so that both parties can refer to it, unmistakenly. I would consider using a file property or document metadata property.

Related

Need some hint on how to start porting my application

We have two applications, one called flexOS locally on "the server", and one called flexVisu remote on "the client". The first one is doing the job, collection data and such things.
Historically those two applications are able to communicate via TCP/IP sockets and a proprietary binary protocol.
Now we want to replace the client application flexVisu with a web page hosted on the IIS locally on the server. Every web browser on every device should be able to display these web page(s).
Firstly we experimented with an additional application (flexVisuWebServer) on the IIS side that basically hosted a web socket server and translated the json data from the client into binary data for the server and vice versa.
But this always requires a http connection and a wss connection to be open at the same time.
I don't know why, but I don't like the idea of using javascript on the client to handle all the data processing to display the server data.
I think that it would be much easier if I wrote an asp.Net c# application that handles the connection to "the server" via our proprietary TCP/IP protocol. That way no conversion of data between binary and json format must be done, and the web page itself can be also written in C#.
This approach much more resembles the current approach with flexVisu connecting directly to flexOS, the binary data is directly used to fill in Windows Forms controls.
What am I missing here?
Would the asp.Net application be able to connect to a tcp socket and use our own protocol?
[Edit: 2021-02-09 at 16:18 localtime]:
I managed to use our proprietary TCP/IP protocol to connect from the web server to the flexOS in the page_load of the asp.net web page.
So basically it should not be a problem to use the underlying library to read data directly from the flexOS.
OT: Should i post subsequent ASP.Net questions here too, or open some more questions?
We decided to follow this concept:
the webpage is using a websocket connection to our application flexVisuWebServer and this application uses our propietary TCP/IP protocoll to talk with flexOS.

Having a web application listen for data without a server

For my job, I am researching a new means of accessing data from a web application created in either HTML or Javascript. The situation is that we have a proxy that takes data from a computer's serial port and broadcasts it as regular TCP data on the Local Host. We have web application that runs on the local system and we want it receive that data that is being broadcasted, however we want to implement this without creating a server to acquire said data.
So far I have been researching and googling for a solution but my search hasn't been fruitful. If there exists a means for a web application to acquire data being broadcasted from a proxy, I would like to know. Also we are running the web application locally from file:\ in IE11.
This stack overflow question is somewhat similar to our situation, however we cannot use Flash or Adobe Air: AS3 socket class connection with serproxy and sending data 

Is this WebSockets approach correct?

I want to create this routine:
I access the /receiver (Receiver)
Receiver is listening for 'hello' event
I access the /emitter (Emitter) from another tab
Emitter fires the 'hello' event
Receiver says alert("Hello world") when 'hello' event is fired
Is it possible using WebSockets? I want to make the API server with Python, and the client with JavaScript.
webSockets connect client and server. The do not directly connect two web pages in two different tabs.
It is possible that two web pages in two different tabs could each connect to the server and the server could then route messages sent from one web page to the other web page. That's how a typical chat program works (which is a classic demo app for webSockets).
Yes, this is possible to build with a server in Python and client in Javascript web page.
You can certainly find many libraries written for webSockets in Python with your own search. Browser Javascript already has webSocket support built in. Many people choose to use socket.io which is a higher-level library built on top of webSocket and there are implementations for socket.io in many languages (including Javascript for the browser and Python for the server).
WebSocket is used when you need a persistent, web-friendly connection with or without a browser. If you just need to merely communicate among tabs in the same browser instance, you can use localStorage (which fires an StorageEvent event) even if you are offline.
If you potentially need the emitter to be accessed by another browser out on the web, or if the emitter was not a browser web-app (e.g., an IoT use case), then you would need WebSocket. Then one good solution would be a simple publish/subscribe mechanism using WebSocket. Here's a good Angular library that a colleague wrote that might help you:
https://github.com/kaazing/tutorials
Full disclosure: I work for Kaazing

Connect to Secure Socket Server written in C++ with client written in JavaScript

What I want to achieve:
I have a linux server connected to network which runs a database. The database is not reachable from network. There is a software which acts as a middle layer between the server and client(s). The clients would access the database through this layer. This is required because:
There will be multiple users with different permissions.
I want a common API because the client software will be implemented to mobile platform, mostly for Android and as a webpage(this is where I want to use JavaScript) as well.
I don't want to expose the database directly to clients because I would be forced to store the database's login credentials in client's device.
The client software will be used only for data exchange and displaying the result to user. Any processing would be done in server.
The part which is not clear is the webpage. I could use PHP, but I want to make it like the Google Hangouts app in Gmail or the Facebook Messenger. The content which is fetched from database is displayed without reloading the page. Since I have't done anything like this in JavaScript, I don't know where to start, which libraries I should use.
Note that the communication between the client and the server would be done over secure sockets. The middle layer would be implemented in C++ using OpenSSL.
I would suggest to connect to the server using C++ with the system() command.

Android running browser ASP page that sends commands to windows PC

I am wondering how i can send a command (like 1, 2, 3..etc) from my web app (classic asp/asp.net) web page on my android web browser to a windows computer thats on the same LAN network. Kind of like an instant messenger type of thing so that i can design a web page with buttons and each button would send a command back to the computer.
Is that possible? Or do you know any other alternatives to accomplish this same task?
David
If you are looking at using a web server for each system windows system, then the android app simply calls some webpage with the message. The android app would need to keep calling a particular page for 'new' messages using an ajax request. However there are probably other better was of doing this - but it is possible using this method. Another option is each windows system self hosts their own WCF app which receives messages. You still need some central store to make sure all members get the messages unless they constantly poll each other.
Another alternative (and doesn't require polling) is to utilize sockets and simply stream the data back and forth over a port and keep the connection open.

Categories

Resources