Accessing SCORM sitting in ec2 instance from a Application server - php

I need to access a SCORM content through my application (LMS). Now, this content is stored in the filesystem in a different AWS ec2 instance (ubuntu machine).
My server has different application instances installed for serving different clients. Each client instance has a separate filesystem repo sitting on a same ec2 server.
How do I maintain that the SCORM opened by a specific user interacts only with the specific client application instance so that SCORM interaction parameter values get saved in the correct database?
Note : My application does not have a multitenant architecture.
Sorry for a such a generic question, actually I am a little confused hence a little direction would be appreciated so that further I can find my way out.

SCORM and Cross Domain would require some work. If you can get the content and the Platform on the same domain that would go easier. Another option would be to just get all the content files to point to their CSS/JS/IMG assets on the other server. Then your playing in the right sandbox.
Short of that there are some IFRAME hacks out there to do the same but it pretty much requires you to touch things that would lend it self to just pointing to all the Assets anyway without the go-between.
SCORM is a JavaScript<->JavaScript communication. The LMS will send the data stored in a session to the backend commonly on a commit call.

Related

Google Cloud Platform files location

I wanted to move a website from a shared server to Google Cloud but I cannot wrap my head around it. Before giving up completely, I decided to make this question:
I already completed the Hello World tutorial (https://cloud.google.com/php/getting-started/hello-world). But what if I want to update the index.html file? Where would I find it?
I was expecting to see it in one of the storage Buckets, but that's not the case... even when installing a Kubernetes Engine.
If you decide to use Google App Engine Flexible (as the hello world sample app that you linked to) you need to understand the idea of this additional layer of abstraction over your server(s). App Engine Flexible is designed to make things easier for you - you focus on your code in your local machine where you modify it, update it and then with one command (gcloud app deploy) you instruct the App Engine to do one of the following:
start a VM (your server) and a Docker container with your app in it
if it's not already running
in case you are updating an existing app, it will update the code in the VM which is your server. If your app receives a lot of traffic, you may have more than one container and VM running and all of them will get updated.
Both things are presented schematically in the image in this section.
This way you can develop your app locally and not worry about actually getting inside the server with for e.g. ssh. Your code is there in those VM(s) and App Engine manages it for you (however, if you really need to, it is still possible to ssh into the VM in App Engine Flex environment).
If you have a static website, it can be hosted in the Storage buckets, which is a different scenario. However, as you're using PHP I assume it's more likely that your website is dynamic.

Architecture for syncing data with remote server

Current scenario :
There is a webservice (build in php/mysql). User filled data is stored on a remote server.
Issue is user has extremely bad internet connection, webservice is down most of the time. Is there a way to store data locally and sync it when internet is available?
Please note, user might not have database installed on his machine also there is no localserver to work with.
Even if user had some type of RDBMS installed on the box, you probably wouldn't have any way to communicate with it. You can use the HTML 5 Storage API, but it will not solve the connection issues.
And since localStorage (which you probably would use) is available directly only from JavaScript, you would have to make a complicated and fully functional JS application to utilize it.
Note: based on your profile, I would estimate that your JavaScript skills would not be adequate for such task.
If your target audience is mobile users, then you have another alternative: create a native application.
You would still be able to use HTML for the interface (using built in web browser components). But it also would let you have SQLite DB and file storage available on the mobile device, where you can cache the necessary data.
look at the features in HTML 5 for local storage
Typically I would go with IndexDB and then push the local data to the server once the connection is back
http://diveintohtml5.info/storage.html - Should give you a brief about the features and implementation.

Should I separate the web-service interface from the other parts of the system?

I'm developing a system (o rly?!), a regular system. This system maybe considered normal: CRUD's are all over the place. BUT, I also need to access his data as a web service. I'm developing both: the system and the web service, using Laravel 4.
I have controllers, of course, for all the CRUDs on the system so an user can be able to put information on the database. Pretty simply stuff...so far!
As I said: I need to consume data on a web-service format. I need to make request and record data to the server throught a JSON string and REST verbs. That being said, here comes the question:
Should I create a whole new project to access the data as a web service and separate it from the original project (cruds) or this is just a stupid idea of mine?
I think this might help on the security and on the cohesion on both projects.
Any answer is welcome ans thanks in advance! =D
If you are a coder who can easily organise an additional layer into your current app, to create the web-service layer, then do it.
If (like me, and probably most others) you'll just get swamped in a mess of files and folders, and end up changing code which impacts your already existing app - stay well clear! Write a new web-service app!
Separate the concerns, and sleep happy at night that both animals are caged up separately so they can't kill each other.
Although...you are using laravel. So you can actually create separation quite nicely in one app by using packages (were called bundles in L3). You still might run into the risk that you mess up some code of your current app, but if you are strict with yourself, you should be ok.
One question I'd ask yourself is why not just have the app ONLY be a web service, and create clients that meet any needs you want? It does seem odd to have an app being used as a web server and also as a web service. You may run into all sorts of performance problems if you try to do both in the same app.
UPDATE:
For a definitive answer on if you are doing this the right way: I say no, you aren't doing it the right way. Create a web service from your app, and ONLY allow it to be a web service. Then create client apps (web service consumers) to meet any needs you have for displaying the data.

Dummy CardDav server

I'm looking to build a dummy CardDav server that allows me to do the following:
- add a CardDav source on an iOS device
- the source will show up as a group on the native Contacts app
- no syncing actually takes takes place with the server (no contacts should be stored on the server or deleted from the device)
The purpose for all of this is that I'm looking to manage the source from an iOS app.
I deployed a Baikal CardDav server successfully and I tried to sniff out the requests that take place when registering a new source, unfortunately I'm quite stuck.
At the moment I have a php file that responds to a PROPFIND request and allow for the source to be validated, but it doesn't show up in the Contacts application.
Any tips would be appreciated in either writing a dummy CardDav server or crippling a functioning one in order to only provide the auth functionalities?
Not sure if i understood your question.
You may try Calendarserver at http://trac.calendarserver.org/wiki/docs-trunk . It is simple to install and setup and works without any quirks.
If you need the server to behave a certain way might be best to use a Carddav framework like SabreDav (for PHP) or milton.io (for java, my project). Then you can do all sorts of weird backend stuff
Milton actually comes with really simple example projects with in-memory data thats perfect for mucking about with

Access mysql db and server side scripts from local file

This is more general design kind of question. My major project is to create native app for Firefox OS. Which therefor means JavaScript, jQuery, HTML5 and css. This application should have several functions. But as a general design goes I need local html,css,js application running under firefox OS with ability to access server php scripts and mysql db, but because application is running on client side, I have a major problem with communication between application and server. Which technology, language, API or JS functions could I use for Login check, registration, messaging. How can I access server from local (on PC or Mobile Device) files. There is possibility that I'm missing some point or that my whole understanding of the problem is wrong, but is this possible and how?
Apps are built using standard Web technologies with additional metadata that allows the User Agent to discover, install, launch, and grant them additional privileges.
So says MDN.
The usual way to interact with remote, shared databases is to place a RESTful HTTP front end in front of them and access that with JavaScript/XMLHttpRequest.
XHR, WebSocket or TCPSocket.
FYR:
https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest
https://developer.mozilla.org/en/docs/WebSockets
There is no TCPSocket document on MDN, but you can study gaia email app.
https://raw.github.com/mozilla-b2g/gaia/master/apps/email/js/ext/gaia-email-opt.js

Categories