User Tools

Site Tools


manual:advanced:customization:actions

This is an old revision of the document!


Locus Actions

This page is obsolete and will be reworked soon

Basic information

Below this mysterious name is hidden very simple way, how to provide easy method for downloading data from your own web server to Locus, and probably other features later. Whole concept is based on XML file, that you “give” Locus to process. In XML file is described what to do.

Locus currently support actions: download

How to

Whole file you provide to Locus is XML file with this syntax

<?xml version="1.0" encoding="utf-8"?>
<locusActions>
  <action>...</action>
</locusActions>

Where locusActions may contain one or more action objects, that will do required work.

To make Locus correctly handling this file, you simply construct URL to this file by following syntax (example)

locus-actions://https/dl.dropbox.com/u/12579512/my_directory/test.xml

As you can see, simply change scheme to locus-actions and default scheme change to part of base URL separated only by one slash. Locus will handle this link in simple way:

  1. remove locus-actions tag
  2. change first part into new scheme

Download

Action object that serve to download files into Locus directory

Sample syntax is

<?xml version="1.0" encoding="utf-8"?>
<locusActions>
  <download>
    <source size="22075830" date="2012-06-29_19-11-54">
      <![CDATA[http://.../map.tar]]>
    </source>
    <dest><![CDATA[/maps/map.tar]]></dest>
    <after>...</after>
  </download>
</locusActions>

Where

  • download - is core tag, that identify this action
  • source - URL to source file. If contain size and date parameters, download file be checked and not downloaded if already exists
    • size - (optional) size of file in bytes
    • date - (optional) date of last edit in format yyyy-MM-dd_HH-mm-ss. Some phones have problems with setting correct time to downloaded file. Highly recommended is to set only size for comparing already downloaded files,
  • dest - relative path (to Locus root), where to put new file
  • after - special action that is performed after download. Currently supported is
    • refreshMap - useful if you download new personal or vector maps. This called on last map (in case you download more maps), refresh list of maps without need to restart Locus
    • importData - immediately after file is downloaded, Locus will start normal import process of this file
    • displayData - immediately after download, Locus will load and display downloaded file on map. Data will be displayed only temporarily, so if you want to store them permanently, use importData option
    • extract - extract downloaded file. Directory is the one, used for download.
    • deleteSource - allow to delete downloaded file. This is useful mainly if you download zipped file and after extract, you want to remove this file.

TIPS

  • Download map file (zip archive) - you may use this combination extract|deleteSource|refreshMap, which extract file after download, delete original file and finally refresh maps list.
  • Download file ready for import (zip archive) - you may use this combination extract|importData, which extract file after download and start import. In this case, it is suggested to set dest parameter to special Locus directory cache/temp. This directory is from time to time cleared, so all unneeded files will be removed.
manual/advanced/customization/actions.1432216968.txt.gz · Last modified: 2015/05/21 16:02 by mstupka