I have an internal web based utility that we use to keep track of employee training. Currently, in order to indicate that training has been completed, the employee being trained has to input their employee number and a PIN. Then, the person conducting the training has to do the same. This utility runs on dedicated touch screen computers that run Chrome in kiosk mode.
Everybody in the company already carries a Prox Card. I also have a 5025CL reader. Getting the information about which employee carries which card is an issue I can handle. What I'm having an issue with is being able to access the smart card reader from the web page. I came across the Smart Card Connector from Google, but it appears to only work on ChromeOS.
For reasons that are probably pretty obvious in 2017, I'd like to avoid Java or Flash for interfacing with this hardware. I think my ideal would be an extension for Chrome that can recognize a special tag (probably a <div> with a specific id) and display instructions to scan that card. Once it detects a card scan, it submits the form. Obviously writing a little JavaScript to pull that together is no issue.
I am open to alternatives, but would also like to avoid going back to Internet Explorer. I originally ran IE on these computers, but due to some rendering issues switched them all to Chrome.
Sadly I was unable to solve this issue in my preferred way (with a plugin/extension to Chrome for interacting with a Smart Card reader). But I was able to get it working by using CefSharp in a VB.Net project. The VB.Net code is able to interact with the Smart Card reader (in my case HID 5025 CL) and pass those results to the web page being processed by CefSharp.
More detail (and some code) can be found as the answer to another question.
If I link a phone number with HTML like this:
123456789
The Browser gives me a response if I want to start an application, in my case Skype.
Now my question, is it possible to create a selfmade window and tell something like download and install Skype if none suitable application like Skype to use that functionality is installed.
That's not possible. Which program is used to open a resource is solely at the discretion of the user's browser/computer. There is (and should be) no way to interfere with that. It would cause terrible security problems if a webpage had the ability to direct a browser towards a certain program or register if a specific program is installed.
I am wondering if it is possible to specify a wildcard sharing contract in Windows 8 metro. I would like to create an application that can receive every possible sharing request in Windows 8 (for debugging purposes), including custom streams from third party applications.
Yeah, you pretty easily could. Until it comes to the custom streams/data.
ShareOperation.Data contains a list of strings that the datapackage contains. You could loop through them and do with you wish with the data. You just wouldn't be able to easily do some kind of If/Switch logic, since if you get custom data, it won't come up in the StandardDataFormats.
http://msdn.microsoft.com/en-US/library/windows/apps/windows.applicationmodel.datatransfer.datapackageview.availableformats
What is the best practice in handling multiple windows and/or tabs in a web application? What are the pros and cons of a given approach?
I'm not looking for an answer that specifies a particular framework solution. The best practice should apply to all HTTP/HTML based web applications whether they are ASP, .NET, Java Servlets, Struts, JSF, etc
Assumptions:
the application cannot prevent a user from opening a new window and/or tab
HTTP / HTML (how or if it is generated by some framework should not matter). Not Flex, Flash, etc
Should the app try to detect (possibly via a nonce or other technique) that a new window and/or tab has been opened and display some error message?
If the app allows a new window and/or tab, what are the pitfalls (form submissions for one) to watch for and how should they be handled?
I'd say the biggest thing is avoid using "long-persisting" mutable session data (Data that will be hanging around longer than just the instance needed to transfer the data to the next page). This is the biggest challenge I've seen with multiple tabs. What I like to do is store data in the session and then "serialize" that data into the page. When I need that data again I grab it from the page and then store it in the session. That prevents the users other open pages from changing the data.
Your application shouldn't care about multiple tabs being opened. The tab paradigm was developed with the assumption that a page is a page. The biggest thing to do is to understand the technology you are implementing the page in(where there is a potential for data being shared at a global level) and building your pages to be thread-safe(because technically speaking every page request is a thread).
Consider the following scanning procedure in a typical document handling webapp:
The user scans a document using a scanner connected to his/her computer
The scanned image is saved locally on the user's computer as a BMP/JPG/TIF/PNG file
The user hits a file upload "Browse.." button in the web application
The user is presented with a file dialog which he/she uses to locate the scanned image
The user hits "Upload image" and the scanned image is uploaded to the server where it is stored
This process is quite complicated and I'd like to reduce the number of steps in order to make the process more user friendly/fool proof. Under ideal circumstances the above steps would be replaced with only one step in which the procedure initiate document scanning, complete document scanning and upload resulting image is automatically triggered from the webapp when clicking say "Scan and upload". Unfortunely it seems like the state of "web/scanner integration" is quite poor so this might be utopia.
How would you tackle this problem? More specifically, how would you go about reducing the number steps involve in the use-case described?
Well, two years have passed, so here's an update on the state of the art for those just joining us.
Both Dynamsoft and Atalasoft have multi-browser web-scanning toolkits which are compatible with any server-side stack. Both require the user to install an ActiveX (in IE) or an NPAPI plugin (Chrome, Firefox, etc.) to get access to the scanner via the TWAIN API.
Obviously if you have the time or a limited budget, you can create your own plugin. I heartily recommend the FireBreath plugin framework, and any TWAIN library rather than writing your own TWAIN code.
Once the ActiveX or plugin is installed, the rest of the work is a combination of javascript & HTML on the client, and some kind of handler on the server to accept and process the incoming image, which can be made to look just like a multipart form submit with an attached file.
I recommend doing the image upload in javascript using AJAX, because it is then part of the same browser 'session' as the web page, and it inherits the browser's proxy settings, session cookies and server-side authentication. I don't know about Dynamsoft's control, the Atalasoft toolkit includes such AJAX uploading. The image(s) are handed from the plugin to the javascript as a base64-encoded string, so no local file is actually created.
Disclaimer: I work on Atalasoft's WingScan web-scanning toolkit.
If your target audience is running Windows and IE, and you don't mind spending a few $$, Atalasoft has some components that will do just what you're looking for.
I actually saw someone at the bank do this while setting up my account and I was totally amazed. Bank in question was using Windows and IE, I assume your in an equally controlled environment. I think the bank used a combination of a custom/ predictable scanner driver and an ActiveX control.
A page loaded which said "Open the scanner" the staff member popped the document in and hit Scan on the webpage, then the page changed to say Scanning, then it showed the scanned document on the web page for the staff member to Approve. I can only assume that the scanner driver send the image to a certain location and the active X control was polling for it to appear, once it appeared it showed the image on screen, once the staff member had approved it the active x uploaded it in the background. She opened the next page and carried on with the rest of the process.
God knows how they made all that tech work but it can be done.
Silverlight 4 is coming out soon. It is supposed to have the ability to interact with COM objects on the user's computer (provided they are running Windows). In theory you call WIA methods from your Silverlight web page.
We implemented a solution to implement Remote Deposit for a bank. It works only in IE. A winforms dll was created that interfaces with LeadTools TWAIN dll. Leadtools TWAIN dll abstracts all the TWAIN minutae. This approach is slighly better than using an ActiveX control. .NET Framework would be needed on client. The scanned images are posted back to a hidden variable on the page and are processed on the server.
Hmm, I've always wanted to look at a scanned file before I did anything with it, but I suppose that depends on your scanner and how much quality you need.
If the goal is to "automate the scanning and uploading process" as opposed to "write a web app", I'd write an AutoIt script to control the existing scanner software and a simple ftp program.
The option most likely to remove the most steps, would probably be writing a customized scan utility that the user would download and run on their local machine.
SANE or TWAIN would handle getting the scanned image. cURL could than handle uploading the image to your web app. To make things even easier for the end user, I would use something like a Comet connection to update the web page when the file was available.
If that isn't an option, you might look into seeing what options your users will likely have using their scanners software. I believe many programs now support scanning to email or ftp.
The solution I have used for an intranet app, using multifunction scanner/copiers was to scan to an SMB share that the web server had access to. The user just goes to the copier scans to the share and when they get back to their desk, they go to the new scans page which shows a list of all the new unprocessed files.
Since your audience is controlled environment, You can write your own browser extension/program based on WIA/TWAIN that does the scanning. If you choose browser extensions such as BHO/ActiveX/XPCOM, etc, you need get the user's permission to install your extension. If you choose to write a program you may need web deployment technologies like ClickOnce or Java Web Start to be launched from web.
Interfacing TWAIN is a pain on Windows. Complexity aside, you have to display some GUI written by different scanner driver developers. It may be the only way to support old scanners or features not exposed via other interfaces like full-speed multipage scans from a document feeder.
Microsoft's WIA makes interfacing with scanner much easier with a scripting object model, however scanner-specific features are not available and some old scanners do not support the interface.
After scanning you can call a web service to notify the server and the web page can refresh periodically to check new images.
We have done something similar. we used a command-line TWAIN program (http://www.burrotech.com/quickscan.php). $$ $49
1) We developed a small .Net application to run the QuickScan program as a shell command.
2) The command was assigned to the Scan button.
3) Once the user presses on the scan button, a prompt will appear to enter the file name. The user saves the transaction Id as the file name.
4) Another .Net application (or maybe the same mentioned before) will read this file and upload it into database considering that the filename is the transaction ID.
Worked like a warm knife in butter!
You can try displaying the transaction ID into IE, user to select the ID then presses Scan. Your application will read the SELECTED text and save the file using the SELECTED text as the file name. We havne't tried it but it should work.
It is only utopia if you think that web applications are limited to web browsers, in fact, web applications can include a lot of different technologies, besides HTML and Javascript.
The cool way of solving that problem -- in fact, I already used that for some usbserial devices -- is to implement your application using SOAP+XMPP. You can do that in Perl by using XML::CompileX::Transport::SOAPXMPP, Catalyst::Engine::XMPP2, Catalyst::Controller::SOAP and Catalyst::Model::SOAP.
The interesting thing about using XMPP is that it simplifies the management of addressing, since you use the JID (Jabber ID) to look for the software agent, not some host+port addressing schema. The second interesting part of using XMPP is to more easily support the server pushing information to the client.
But if you don't want to handle XMPP you still can do the same thing with a lightweight embedded http server -- HTTP::Server::Simple, in Perl -- and somehow register the current scanner address in the server so it can call back.
And a last option, which is not so cute, is to have the software agent polling the server to see when there is a "scan document and upload" order for that specific machine and realize that operation when that is present.
In summary, having a local software agent to interact with the local hardware doesn't make your webapp less "web", as long as you use web standards -- like XML, SOAP and others -- to perform that communication.
You can put a Java applet in your website. This can access the scanner and send the data via REST to your web server.