Locations

This sample service allows user save his location locally, sync it with locify server and browse saved positions - local and stored on server. Service supports authentification to Locify server. Browsing locally and synchronization is done just by calling internal URLs.

Function of this service is built in Locify client since version 0.9.

Welcome message

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>Locations</title>
</head>
<body class="serviceInfo">
	<div>
		<p class="description">This is basic service for every Locify user. It enables you to save your current location locally, synchronize your locations with our server and browse saved locations on our server.</p>
		<img src="http://www.locify.com/images/icons/savelocation-icon.png" class="icon" alt="" />
		<a href="http://client.locify.com/savemylocation/start" class="firstScreen">firstScreen</a>
	</div>
</body>
</html>

First screen

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>Locations</title>
</head>
<body class="list">
<ul>
	<li><a href="http://client.locify.com/savemylocation/form?target=fs" class="listItem">Save locally</a></li>
	<li><a href="locify://filesystem" class="listItem">Browse saved locally</a></li>
	<li><a href="http://client.locify.com/savemylocation/list" class="listItem">Browse saved on server</a></li>
	<li><a href="locify://synchronize" class="listItem">Synchronize</a></li>
</ul>
</body>
</html>

Save Locally

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>Locations - save</title>
</head>
<body class="form">
	<form action="locify://filesystem/waypoint" method="post">
	<locify:variables>
		<locify:element name="latitude" value="$lat" />
		<locify:element name="longitude" value="$lon" />
	</locify:variables>
		<fieldset>
		<label>Title:<input type="text" name="name" value="" /></label><br />
		<label>Description:<input type="text" name="description" value="" /></label><br />
		<locify:where />
		<input type="hidden" name="latitude" value="" />
		<input type="hidden" name="longitude" value="" />
		<input type="submit" value="Save" />
		</fieldset>
	</form>
</body>
</html>

Browse saved on server

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
	<title>My saved locations</title>
</head>
<body class="list">
<ul>
	<li><a class="listItem" href="http://client.locify.com/savemylocation/show?fileid=Andel.kml">Anděl</a></li>
	<li><a class="listItem" href="http://client.locify.com/savemylocation/show?fileid=Copacabana.kml">Copacabana</a></li>
	<li><a class="listItem" href="http://client.locify.com/savemylocation/show?fileid=LondonOffice.kml">London Office</a></li>
	<li><a class="listItem" href="http://client.locify.com/savemylocation/show?fileid=PragueCastle.kml">Prague Castle</a></li>
	<li><a class="listItem" href="http://client.locify.com/savemylocation/show?fileid=PragueHome.kml">Prague Home</a></li>
	<li><a class="listItem" href="http://client.locify.com/savemylocation/show?fileid=SanFranciscoHotel.kml">San Francisco Hotel</a></li>
	<li><a class="listItem" href="http://client.locify.com/savemylocation/show?fileid=ThePubPlzenIi.kml">The Pub Plzen II</a></li>
</ul>
</body>
</html>

Authentication

Before browse saved on server, cookies are checked and in case user is not logged a 401 HTTP status is returned. Login screen is presented to user. If everything is OK, this alert is returned (same principle is used for error states like bad password):

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:locify="http://client.locify.com/locify_ns/1.0" xml:lang="en" lang="en">
<head>
 	<title>Info</title>
 </head>
 <body class="alert">
 	<div>
 		<p class="text">Authorization successful.</p>
 		<a href="locify://back" class="next">next</a>
		<locify:timeout value="3000" />
 	</div>
  </body>
</html>

How does it look like

You need Flash Player and JavaScript to see video content.