fetching a file from a url for mobile app: How to manage server side running Joomla? - iphone

Im new to website development and design so apologize in advance if the question is redundant.
I have a program where a client, using a URL string fetches a XML file from a webserver. This would be no problem right if it were a simple URL with no security or no CMS (like Joomla) involved: Just put the exact URL string and the client gets the file from the web server, done.
But, how would the process work if the URL is on my site hosted on GoDaddy and using a Joomla CMS?
Im trying to understand how the same process of fetching a file works on a hosted server using a CMS. Since I just made the transition from my site being on my school's servers to having a Joomla website Im hosting on goDaddy.
I mean where would I put the file if I also want the file to be accessible only if the client authenticates itself first. Just to be on the safe side. I mean is this how normally things work in mobile apps? I have a client program thats a iPhone app and within the app I have a XML file which is used as a data source for my UITavleView, but I want to check some URL to see if an updated version of the XML file exists. My app side programming is mostly done, now Im trying to learn the server side things I need to do to make this process happen with Joomla and my own hosted site
I donot understand how would the process work in that case. I mean, what are the things I would need to do on the server side to and the client side to make this possible?
Please help me understand or if you could point me to some links where these steps are illustrated...or if you could give me some Google key words I can search for to learn about this process.
thanks a lot

The fact that you have a CMS does not generally change how you access a file within the file structure of your domain unless the CMS protects certain directories. In this case, Joomla does not so you can directly access any file you wish. Depending on the sensitivity of the information you are trying to retrieve, you can protect the directory through your domain management panel. If it's not particularly sensitive, the authentication can be done by the app since the URL you are accessing can be easily hidden from the user.
It seems like that would be the simplest solution since the app will have access to user information by nature of where it resides.

Related

How do open source/free software applications handle the client_secret in oauth? (Without a web server)

I am making a tiny desktop application for my personal use. (Also for a few of my friends.) As part of this application, I am using OAuth 2 to access some of Google's APIs.
I want to eventually upload this to a server where potentially anyone could download it. So I can't just bundle the client_secret with the application.
So, I would like to know, how do open source applications that share there entire source code deal with this?
I could just require users to get their own client_id from google. But that's a bit of a cumbersome process, and I would ultimately end up writing a scraper to do it automatically, defeating the purpose, also it would be very brittle.
Alternatively, there is this question where the answer is to run your own server to act as a middle agent. However, because this is only a small app I'm doing for me and a few friends, I don't really want to manage a server just for this, and even if I did, it certainly would be fairly unstable.
In short, are there any solutions here that
allow me to put my source code on the internet,
don't require me to run my own server, and
don't require my users to go get there own 'client_id' after they've already downloaded my desktop application, or require me to make a web scraper that does it for them?

Login Logout authentication and uploading views and pics in our applcation

I want to create an application in which i want a login logout authentication from the database file that can be handled by web services. This application should always need to be connected with the internet and after login i need to upload images and also give there views about the image and i am not getting any idea how start work on that can anyone help me.... I want to use this application some sort similar like facebook.
There is also a problem that which type of application i create native or web or else. Please help me to start this application.....
Try setting up a server that can handle the requests from your app. Your app can then request content or upload content to the server using NSURLRequest. For further reading refer http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/Concepts/URLOverview.html
I think you are asking the wrong question. What web development language do you know to help you accomplish this? There are many different ways to go, like open source as opposed to paid, which services best handle your specific needs, like Ruby or PHP, which RDBMS to use, etc. If you don't know any programming, then it is going to be a long road. Your first step should be taking what you already know and branching from there, learning what you need to know. In your case, you'll need to learn server side scripting, connect it with a database, how to set up a server to put it all in, as well as client side development like javascript to go with the html.

How do I sync an offline web app (HTML+JS+CSS) with my server?

Do I need to implement my own sync methods in order to make an offline web app (html+css+js) stay up to date with changes made on the server (and viceversa)? I'm using MySQL on the server side.
I read Two-way sync between iPhone application and web application with some pointers but I think they're talking about native applications when they mention CFUUIDCreate and I wander if this is possible for the Web.
Does someone have some code to share or maybe can point me in the right direction?
Thank you!
P.S.: I hope my english is not that rusty ;)
To store static contents on the client-side, as Jethro Larson said, the Application Cache Manifest is the way to go to cache the static contents of your website (HTML, CSS, JS and images).
To handle dynamically generated contents offline, you can use javascript templates. There are several solutions for this.
To sync the two databases, there is a project called persistence.js (persistencejs.org) which is a javascript library which offers a unique API to work with WebSQL databases, Local Storage, etc. They have a plugin for this library called persistence.sync (persistencejs.org/plugin/sync) which syncs the remote database with the server's one. It consists of POST and GET requests to a specific url that you can configure (for example yourapp.dev/sync). They have an example back-end written in node.js and here is one for Rails. It's simple to understand and persistence.sync is well documented.
Look at the offline cache:
http://www.webreference.com/authoring/languages/html/HTML5-Application-Caching/
http://www.google.com/search?q=offline+cache+html5
http://www.slideshare.net/search/slideshow?q=offline+cache

Is it possible to have a free web-service that would check a page and email its HTML code to me?

I just asked a question about whether it was possible to write a web-page-checking code and run it from free web server, and one supporter answered and said that it was possible and suggested that I used Google App Engine service.
But he also said that there are no files there, so I would have to work with their database.
I wonder, if there is no such feature as creating files on that free web server, then is it possible to run from that free web server a code that would check a web-page every once in a while, record its HTML code, and mail it to my mail box?
It is totally possible on Google AppEngine.
I am not sure by you mean "no files" on GAE: there is definitely access to files but in "READ ONLY" mode.
What you have to do is fetch the remote WEB page (through urlfetch API) and use the email API to send it.

what language combination should I use to permanently modify a webpage?

I'm trying to make a page with 2 fields (email and feedback) and 1 button. When the user clicks on the button, a table on a page else where is filled in with the data, permanently.
Does anyone have recommendations of how I should do this? I'd like to avoid having a script send me an email, or writing to a database. But if I have to, which ever is easier to configure would be prefered.
Thanks,
Matt
So you want a comments system like you find on most blogs? You'll need to store those comments somewhere, probably in a database. As for how to do it, that would depend entirely on what you already know and what the site is currently written in. You could use PHP and MySql if you already have those skills, or ASP.Net/SQL Server, or if you want to be down with the cool kids you can use Ruby on Rails or Python/Django.
If you post what languages you already have experience in, and/or what the site is written in you might get a more specific answer :-)
There're 2 types of scripts: server side and client side. The client side script (JavaScript) stores info only for particular visitor on his computer and this can't be seen by anybody else.
You need a server side script to save feedback on the server. The language or technology depends on the hosting server you use. Not all hosting services allows server side scripts. You need first to find out what scripting languages and technologies are supported by your hosting provider. Then we can help you more.
ADD:
For an unexperienced persons I recommend to search for hosting services which has most needed functionality. Something like blogs, etc. On such services you could create pages that will have comments and feedback and many more.
While it may seem outdated it's not necessarily a bad design. You can use PHP or Perl (due to it's string parsing capabilities) and simply store the main page on the disk.
Here's your sudo code/design...
You'll need need an html page that looks as follows
<tr><td>email</td><td>comment 1</td></tr>
<tr><td>email 2</td><td>comment 2</td></tr>
<tr><td>email 3</td><td>comment 3</td></tr>
Then you'll need a php script page that will read this html file in and display it.
The php page will also contain code for dealing with a user submitted comment. When a user posts a comment you need to open the html page with the rows in it and append to that file.
You need to be careful with this design however because you may run into write concurrency issues if two people attempt to read the file at the same time. Add code to handle this gracefully accordingly.