Need advice for my Server part - sql-server

I'm stuck on my server part.
I thing it would be fine if I make an REST architecture but I'm not sure.
My application is that an identitied user edit his name, age, hobbies...and I want to stock all the informations of all the users on my data server. Then, I could send the information of a user to another in a ListView with an adaptater.
Any idea to help me?
Thanks in advance

I have recently added a series of posts to my blog that may help. It covers creating a RESTful service using Java EE technologies on the GlassFish server. The example produces consumes XML, but could easily be adapted to handle JSON.
Part 1 - The Database Model
Part 2 - Mapping the Database Model to JPA Entities
Part 3 - Mapping JPA Entities to XML using JAXB
Part 4 - The RESTful Service

Related

cakephp 4 - model without database

In a cakephp 4 project in need to read data from a third party api.
I found this doc for cakephp 2, but no equivalent for cakephp 4.
https://book.cakephp.org/2/en/models/datasources.html
Where is it ?
Thanks
Read data from a third part api direct in your controller using HttpClient or other libs.
https://book.cakephp.org/4/en/core-libraries/httpclient.html
In CakePHP 4 the ORM is structured quite differently, data is retrieved via a Datasource, so you essentially need an HTTP-backed Datasource.
While CakePHP doesn't naively supply an HTTP source, there are a few of plugins that do, such as:
https://github.com/imsamurai/cakephp-httpsource-datasource
https://github.com/CakePHP-Copula/Copula
It looks like these may have some drawbacks and limitations - and in general be fairly advanced setups requiring some creative problem solving. So in the end, as the other poster mentioned, it may in the end be easier to just make HTTP requests directly if you don't require any of the ORM features (validation, Entity classes, virtual fields, Event hooks, etc.)
If the API communicate using POST/GET requests and responds using JSON format (which is usually the case), you can use the Request & Response Objects to ask and get data from the API

SharePoint 2013 - Getting SPSite.Url from SharePoint DB

I'm working directly against the SharePoint DB (I know it is highly not recommended but I need to, for several reasons).
I'm trying to get the SPSite.Url property ("http://baseurl/sites/somename") but can't figure out how to do that. I can only find and get the second part ("sites/somename") for each site.
Does any one know which stored procedures I need to use in order to get that?
The way to do that is: Retrieving the Farm Id--> Retrieving the Alternate URL Collection Ids--> Retrieving the Alternate URL Collections--> Alternate URL Matching
You can find in this link: [MS-WSSFO3]: Windows SharePoint Services (WSS): File Operations Database Communications Version 3 Protocol documentation with detailed explanation under this section:
Site Collection Lookup

Mobile application backend

I'm currently developing a mobile application that will fetch data from server by request (page load) or by notification received (e.g. GCM).
Currently I'm starting to think about how to build the backend for that app.
I thought about using PHP to handle the http requests to my database (mySQL) and to return the response as JSON. As I see it there are many ways to implement such server and would like to hear to hear thoughts about my ideas for implementations:
1. create a single php page that will receive an Enum/Query, execute and send the results.
2. create a php page for every query needs to be made.
Which of my implementations should I use? if none please suggest another. Thank you.
P.S, this server will only use as a fetcher for SQL and push notifications. if you have any suggestion past experience about how to perform it (framework, language, anything that comes to mind) I'd be happy to learn.
You can use PHP REST Data services framework https://github.com/chaturadilan/PHP-Data-Services
I am also looking for information about how to power a web and mobile application that has to get and save data on the server.
I've been working with a PHP framework such as Yii Framework, and I know that this framework, and others, have the possibility to create a API/Web service.
APIS can be SOAP or REST, you should read about the differences of both to see wich is best for mobile. I think the main and most important one is that for SOAP, you need a Soap Client library on the device you are trying to connect, but for REST you just make a http request to the url.
I have built a SOAP API with Yii, is quite easy, and I have use it to communicate between two websites, to get and put data in the same database.
As for your question regarding to use one file or multiple files for every request, in the case of SOAP built on Yii, you have to normally define all the functions available to the API on the server side in only one file(controller) and to connect to that webservice you end up doing:
$client=new SoapClient("url/of/webservice);
$result=$client->methodName($param1, $param2, etc..);
So basically what you get is that from your client, you can run any method defined on the server side with the parameters that you wish.
Assuming that you use to work program php in the "classic way" I suggest you should start learning a framework, there are many reasons to do it but in the end, it is because the code will result more clean and stable, for example:
You shouldn't be writing manual queries (sometimes yes), but you can use the framework's models to handle data validation and storage into the database.
Here are some links:
http://www.larryullman.com/series/learning-the-yii-framework/
http://www.yiiframework.com/doc/guide/1.1/en/topics.webservice
http://www.yiiframework.com/wiki/175/how-to-create-a-rest-api/
As I said, I am also looking to learn how to better power a mobile application, I know this can be achieved with a API, but I don't know if that is the only way.
create a single php page that will receive an Enum/Query, execute and send the results.
I created a single PHP file named api.php that does exactly this, the project is named PHP-CRUD-API. It is quite popular.
It should take care of the boring part of the job and provides a sort of a framework to get started.
Talking about frameworks: you can integrate the script in Laravel, Symfony or SlimPHP to name a few.

Multiple data sources: data storage and retrieval approaches

I am building a website (probably in Wordpress) which takes data from a number of different sources for display on various pages.
The sources:
A Twitter feed
A Flickr feed
A database on a remote server
A local database
From each source I will mainly retrieve
A short string, e.g. for Twitter, the Tweet, and from the local database the title of a blog page.
An associated image, if one exists
A link identifying the content at its source
My question is:
What is the best way to a) store the data and b) retrieve the data
My thinking is:
i) Write a script that is run every 2 or so minutes on a cron job
ii) the script retrieves data from all sources and stores it in the local database
iii) application code can then retrieve all data from the one source, the local database
This should make application code easier to manage - we only ever draw data from one source in application code - and that's the main appeal. But is it overkill for a relatively small site?
I would recommend putting the twitter feed and flickr feed in JavaScript. Both flickr and twitter have REST APIs. By putting it on the client you free up resources on your server, create less complexity, your users won't be waiting around for your server to fetch the data, and you can let twitter and flickr cache the data for you.
This assumes you know JavaScript. Once you get past JavaScript quirks, it's not a bad language. Give Jquery a try. JQuery Twitter plugin Flickery JQuery plugin. There are others, that's just the first results from Google.
As for your data on the local server and remote server, that will depend more on the data that is being fetched. I would go with whatever you can develop the fastest and gives acceptable results. If that means making a REST call from server to sever, then go for it. IF the remote server is slow to respond, I would go the AJAX REST API method.
And for the local database, you are going to have to write server side code for that, so I would do that inside the Wordpress "framework".
Hope that helps.

How to create a website which uploads/ download data from/ to Database and Excel files

I am afraid to ask this kind of question as it has many factors to consider and its not easy for others to give suggestions.
But, I have to do this task and couldnt trace out the possible way to do this. One requirement I know is with the help of AJAX controls and Update panel ( I never worked on them) I have to do this.
Please please some ideas and suggstions, of how to start and soem pinpoints to get there.
it will be an internal portal site and users can access the data from this website which I have uploaded to the database and download data using UI I have.
hoping some help on this.
Thank you,
Ramm
You will need 2 components
1. Excel VBA : for retrieving data from web service and sending data to web service
2. Web Service : for providing data to excel vba and receiving data from excel vba for saving to database
I currently working for a project with this kind of mechanism, which involved database as backend and excel as user interface.
Here's a simple example in PHP using MySQL - http://www.w3schools.com/PHP/php_ajax_database.asp
You're right. That's way too much for anyone to try to answer. But here are some links that should help:
Microsoft ASP.NET Ajax: http://www.asp.net/learn/ajax/
Db-driven ASP.NET App Tutorial: http://www.asp.net/learn/3.5-videos/video-363.aspx

Resources