I'm building a chat system based on ejabberd using an iOS client (and XMPPFramework).
My current chat system supports only one-on-one conversations between users saving a chat history on a MySQL database.
In order to recreate the same chat system, i'd need ejabberd to retrieve chat history from my database so the users don't lose previous conversations when switching to the new chat system.
I'd like not to save the conversation client-side since the iOS app can be deleted and reinstalled (or the user could switch device).
Is it possible to make ejabberd read chat history from my MySQL db?
This should be possible with mod_archive_odbc.
It's an additional ejabberd module that you can find by checking out http://svn.process-one.net/ejabberd-modules/ with SVN.
An example on how to build and install a module on Debian can be found here.
The question is a bit old, but if anyone is still interested.
This could be achieved by Message Archive Management (http://xmpp.org/extensions/xep-0313.html).
Most complete implementation of this XEP is in MongooseIM (fork of ejabberd).
https://github.com/esl/MongooseIM/blob/master/apps/ejabberd/src/mod_mam.erl
ProcessOne page claims to have support for archiving on this page: http://www.process-one.net/en/ejabberd/#getejabberd, but there is no mention on this page: http://www.process-one.net/en/ejabberd/protocols/. Looks like they are using their custom specification.
Please note, that you won't be able to use mod_mam from MongooseIM directly with processone ejabberd, because of small differences in function arguments that module is calling.
Related
We have a service broker dashboard that monitors queues on our database.
Its a simple interface that shows the queues, whats still processing/unprocessed (quantity) and the jobs that the queues are linked to.
The issue here is that different people in the company have different levels of access in SQL, hence when lower level users need to view this app, it crashes citing Authentication issues.
I am thinking of creating a Web Interface to display the queues and quantities processing/unprocessed and status of jobs and the queues with buttons to restart them and view the log.
What would be the best way to do this?
First I'll answer the question you did not ask, namely how to address the problem of an application that performs a certain task requiring privileges (eg. VIEW SERVER STATE required to query the sys.dm_broker_activated_tasks) but without giving the privilege to the user using the application. The best solution is module signing: your application is querying the privileged DMV via a stored procedure and you sign the procedure and grant the required privilege to the signature. Read a full example at Signing an activated procedure (the example is pertinent to activation, but it applies just as well to your monitoring app). Of course, you would have to modify the application to interact with the database using stored procedures so you have something to sign.
Now your actual question, which is basically 'how to do a web app'. Is really too broad. Start by following an ASP.Net MVC tutorial for example to get you started. http://www.asp.net/mvc is a great starting point.
I have a client who wants a control panel for the app I am developing them. The control panel is a Mac OSX application that allows the user to submit files (excel docs and such) to my MySQL database. Those files are then checked by the iOS app I have created for them.
I have no idea how to do this. I have the MySQL database all set up, and I have looked everywhere for a solution. Any help is appreciated.
I wouldn't try to connect to your MySQL database directly from your cell phone. It's a bad design for several reasons. Instead build a API on the same server as the MySQL database. It doesn't matter if you do it in java, php, c# or anything else. You might even find some product or open source project that can do this automatically. I've listed some benefits of doing it this way
It makes testing easier. You can write a test framework against your API that doesn't rely on or is using a phone.
It makes development faster. You don't need to emulate or use a phone to develop and test your table design and queries.
It gives you compatibility. When you need to change your database (and you do) you can create new APIs that the new version of the app uses while and old version still out there can continue to use the old API (that you might have to modify to still provide the same functionallity)
It gives you flexibility. If your user base grows and you might need to have replication for reads or sharded databases you build that into the API instead of into the app which is just a better way to do it.
One option would be to use PHP to handle all the database interaction.
Host the scripts on the server and just have the apps call them and get the scripts to return some sort of parseable response (I'd go for JSON).
I have never found a suitable Object-C based connector for MySQL. At this point I would suggest using a C/C++ connector. There's lots of examples of how to configure the connector for both C and C++. The hard part will be all of the data passed from the MySQL code and the Object-C code will that it will have to be in C types.
EDIT: An Example
any ideas on what I need to create a touchscreen restaurant ordering system?
I've got the touch UI understood and implemented 100%.
What I can't figure out is how to implement the "Send order to
kitchen" and "Call waiter" functions.
Each table will have a "client" computer running an air app. Calling the "Send order to kitchen" and "Call waiter" functions from the "client" computer should make the "client" communicate with a different "kitchen" computer over wifi.
I'm sure this can be done, I just don't know what I need.
I've read about UDP but I'm not sure that's it.
Any ideas?
With real time data delivery, a streaming server is useful, like you mentioned. Adobe offers a free service for that:
http://labs.adobe.com/technologies/cirrus/
If you think dealing with that might be somewhat over your head, you can always use a standard, locally accessible web server like PHP/MySQL. It would even allow you to archive closed orders with say, an "order_status" database field in MySQL.
The host AIR application could periodically ping the server for "open" records and push an alert if it sees any new records. When an order goes out, you'd obviously send a separate request back to the web server to update a particular record as closed.
Additionally, clients would send their order requests to the web server for inserting new records into the database... with each new record receiving a unique id (primary key).
I personally would go for option 2 for the sake of a database implementation.
For an easy Windows PHP/MySQL installation: http://www.wampserver.com/
Don't over complicate it.
An AIR application can run a ServerSocket that other AIR apps can push and pull messages from. You only need to write and read Sockets.
We even have cross-platform implementations of this, where either server or client is a native Android or iPhone app.
It works well as long as you can read / write servers and you are on the same network.
Good luck!
Juan
We have a product developed in C#.Net. It is not a web application but a desktop version. It connects to various databases like MSSQL, MySQL etc.
We keep on upgrading the versions of the software for bug fixes as well as new functionality.
These updates changes the exe as well as dll used and the database also.
We would like to know what are the different methods using which we can provide updates to our customer.
Consider deploying your app with ClickOnce . Lets your users easily install the application from a web server, and it has automatic support for updates. It's integrated with visual studio, and will generate the stuff you need with the push of a button.
Well, there are several different paths to take.
Simple: Just provide a new installer that overwrites the previous installation. Send the clients an email when it's ready or simply put it up on your site.
Mid level: Provide a "check for new version" function in your app that compares it's version number to one retrieved from a web service on your side. Fire up a browser to download it and run the installer if necessary...
Best (IMHO):
Create a wrapper application for yours. This wrapper is what would actually be started when they click your icon. It would check for new versions (again once every couple of weeks), then fire off the main program if everything is good. If an update exists give the user the option to download it. Download the file and replace the real app. Then launch it. BTW, This is pretty close to the Firefox model.
I've been asked to see if we can monitor the "health" of mysql server in some way. The proposal was that there might be snmp support (this is for version 5.0.x). I was not able to find definitive information on it - A link to a reference would be great.
The real issue is to get periodic information on the "health" or status of mysql. We could write our own process that sites and actively talks to it, then publish that to our GUI (the GUI does not talk to mysql right now).
Is there a simple mechanism that can be used, or other best practice when one has no interest in the content of mysql, but just want to know what its status is? (up, down, available, other, etc)
The gui app is java, the rest of our stuff is a mix of java and c++
I'm not looking for a third party solution - just want to know if mysql "publishes" snmp data for others to consume.
This might help: MySQL Activity Report
Didn't see that you wanted it posted to your GUI app. Though, if your app can display images, you could just load the images that MySQL AR outputs...
I think there is a SNMP agent available in MySQL Enterprise Monitor, but that is of course for the commercial version. There are also several other commercial snmp agents available.
There is a C API for MYSQL that can be used for many of the monitoring tasks that you may be interested in: mysql_ping, mysql_sqlstate, etc. Since you were mentioning that you were using C++ that may be an option.
Take a look at MySQL C API for complete documentation.
That said, there is also some status information available that you can fetch with SQL statements: 'SHOW PROCESSLIST', 'SHOW SLAVE STATUS', etc.
Documentation about this you can find at SHOW Syntax