Using the JS SBT Librarys without running the SBTSDK on a Server - ibm-sbt

can the JavaScript librarys from the SBTSDK used standalone without running the SBTSDK on a server?
So that i can just include local js files from the sbt and use the APIs.
Is this possible?
Thanks.

because of cross origin domain restriction on a browser you won't be able to do that
there are two minimal Ajax proxies included in the toolkit, which doesn't require to deploy the full SBTSDK to a server.
this is the java based proxy https://github.com/OpenNTF/SocialSDK/tree/master/sdk/com.ibm.sbt.proxy.web
this is the php based proxy https://github.com/OpenNTF/SocialSDK/tree/master/php/php-core
relevant documentation for PHP deployment https://github.com/OpenNTF/SocialSDK/wiki/Introducing-the-SBT-PHP-Core - the java proxy is configured as other part of the SDK using managed-beans.xml and the sbt.properties files.

#Paul Bastide: I thought the SBT can be used as a simple JavaScript Wrapper in my JS Web Application by including e.g. sbt-standalone.js (similar to e.g. jquery)? I could write the whole logic to consume the IBM Connections API on my own in jquery. For sure I need to enbale CORS on serverside that this works. Is it really true that the SBT can't be used for this usecase?

Related

Polymer CLI Build | Cache Busting Techniques

A little background:
My app is built on Polymer 2.x and is being hosted on a server that does not support HTTP/2 and does not have a certificate for HTTPS. We must support IE11, Chrome, Firefox, and Safari.
Problem:
I'm running into an issue with browser caching. I was hoping to use the service worker that the Polymer CLI generates to handle the cache busting. However, since our client's server doesn't have HTTPS enabled, we are unable to utilize it. Regardless, we have to support IE 11 on a single build, so service workers aren't an option.
I cannot figure out a way to bust the cache on new deployments. On the Polymer CLI github page, there is an open issue regarding this topic, but there hasn't been any traction since 2016. From watching the YouTube videos on Polymer, it looks like there is (or used to be) a way to intercept the build using Gulp, but I can't seem to figure it out.
Any help is greatly appreciated!
You can use the polymer-build library if you want to build a Polymer project using gulp. You can read about it here:
https://github.com/Polymer/polymer-build
Briefly mentioned in the docs here:
https://www.polymer-project.org/2.0/toolbox/build-for-production#use-polymer-build
Then you can cache bust using something like gulp-rev, but you have to make sure that you're not rewriting the custom element names, just the filenames and import paths. (I tried this once with gulp-rev-all, and by default it was replacing <app-header> with <app-header-a9fe00> or something like that.)
While creating the build run polymer build sw-precache-config.js
I've created gulp-polymer-build to help with this very issue. It borrows from polymer-cli build code, and supports your build configs in polymer.json. It allows you to modify your source stream before building, and then modify the forked streams for all builds you've configured in polymer.json. This makes it easy to use gulp-rev and gulp-rev-replace to do asset versioning.

Use Protractor framework to invoke SOAP webservice and call database

ForUI automation testing, I need to be able to use SOAP interfaces to write and read from an external server - SOAP is the only exposure the server has. I searched on the internet and so far I found out that REST can be used from Protractor but have not seen any examples of using SOAP in Protractor (see Bare HTTP Calls from Protractor Tests
(for Bomi/Yogesh and Stiggler answers) and Direct Server Http Calls in Protractor...can SOAP be directly called from Protractor?
Also, for some other tasks, need to be able to run SQL statements / procedures on an Oracle server. node-oracledb npm was recommended but it seems to be such a big hassle to install. What is the best library to use when it comes to Oracle / Protractor interactions?
That is not the problem that you should try to solve with protractor. Protractor is cool tool for manipulating with browsers, but for all other things it is better to use tools that was designed for them.
You can put any nodejs libraries to your project and use them. Just be sure that you execute them in correct place in your tests.
For example - here is library for soap - https://www.npmjs.com/package/easysoap
And for oracle:
https://www.npmjs.com/package/oracle
BTW: In this example - http://squirrel.pl/blog/2014/01/15/direct-server-http-calls-in-protractor/
additional node js module used - 'requests', that is not protractor feature.

websockets and PHP basics and initiatives

I have to built a multilayer game using web-sockets. For this I have a a shared web server with Apache. Browser is not an issue I am building for modern browsers only.
I tried few example PHP and web-socket source code but no luck.
What do I need to do?
And also how to enable the PHP socket_create function? Already enables php_sockets extension in the php.ini and also the php_sockets.dll exists in the extension directory.
When I call socket_create function php says that this function is undefined.
Any kind of help is appreciated.
Thanks
It seems that the command prompt was using a different configuration file for PHP.
Apache (or from the WAMP's interface) uses a php.ini that is located at:
[WAMP_DIRECTORY]\bin\apache\Apache2.2.21\bin\php.ini
If you will open this file, you may notice that the line extension=php_sockets.dll is already commented out.
Unfortunately, the CLI or command line interface is using a different configuration file which is located at:
[WAMP_DIRECTORY]\bin\php\php5.3.8\php.ini
In order to resolve it, you should comment out the line extension=php_sockets.dll and save it. Run the program after to see if the websockets again are already up and working.
If you can guarantee WebSocket support in the browser then use Ratchet. It won't run within Apache, but as a separate process.
There are other options available too - see the realtime web tech guide.
Questions related to WebSocket + PHP have been asked a number of times on SO. I'd recommend doing a search for best solutions and known gotchas when using Apache, PHP + WebSocket. Here's are a couple of good starting question with some additional links in the answers:
Is native PHP support for Web Sockets available?
Efficient reloading data / pushing data from server to client

Interact with local methods from a Chrome Extension

I'm not sure which technology I should be using, or even what exactly I'm trying to do is called, so I was hoping to just get some guidance on the issue.
We have a client/server architecture, and from the client side you should be able to send a command to the server side either by going from Browser -> Client -> Server, or just directly from Browser -> Server
My question is, what should I be looking in to to help me accomplish this task? I believe if I were to use a Chrome Extension, it would have to use NPAPI to interact locally with my PC, which is less than recommended ;)
The solution only needs to work on Windows, and will not be accessing any of the local users files.
Thanks for your help!
Within Chrome Extensions, you are allowed to access external resources if and only if you explicitly define the permissions (url pattern) in the manifest file.
Depending on the need of your application, you could use RESTful server approach or WebSockets server approach. Once you finish developing your server, your extension can communicate through it using existing web technologies (XmlHTTPRequest, WebSocket).
Assuming your going to use RESTful, what I would do is create a JavaScript service class/library that communicates to your backend (Server) using XHR, and include that in your background page within the extension. Then you can use Extension Message Passing to communicate to your service class.
Think of it as this, the scripts defined in the background context within your extension lives in between your extension and your server, acting like a facade. Search on GitHub/StackOverflow if you need questions regarding how, there are many useful posts/projects.

How Meteor works, Client vs Server?

I am really confused at to how Meteor works.
I know there's a server side where you just install it using the terminal.
But what about the client?
Does the client need to install anything?
For example, clients need to install Adobe Flash to run Flash. Are we talking about the same thing here? Or can the client just access it through a regular page without installing anything.
Thanks for the clarification.
<3 StackOverflow
Meteor is a pure javascript web-application framework.
All you need to run meteor is a JavaScript environment.
Server-side, NodeJS is the gold standard javascript environment.
Client-side, all you need is a browser that supports javascript.
There are no plugins required or other magic at work. It's just javascript.
I am assuming you mean the Meteor Http Server? In this case, you can think of it as being very similar to SignalR or node.js. Basically javascript on the client handles receiving events that come back from the server, so you will generally need to include a script on the client side.
You may want to read the following links for more information.
http://meteorserver.org/browser-techniques/
http://www.hanselman.com/blog/AsynchronousScalableWebApplicationsWithRealtimePersistentLongrunningConnectionsWithSignalR.aspx
I think the question refers to http://meteor.com, and if that is the case the client does not need to install anything.
Meteor is a framework for writing Javascript applications, and as such all modern browsers support it "out of the box". The initial request for a web site will download the HTML, CSS and Javascript and it will run just as any other web application like GMail, etc.
You can check out a series of example applications at http://madewith.meteor.com and you should be able to run them without adding any plugins, etc.

Resources