Merge branch 'master' into eval-code
[MojoFacets.git] / README
diff --git a/README b/README
index f676698..750c6f8 100644 (file)
--- a/README
+++ b/README
@@ -1,9 +1,60 @@
 Mojo Facets - server side facet browsing using Mojolicious and jQuery UI
 
 
-Put JSON file from Simile Exhibit project in data/
+Data sources:
+
+Put JSON file from Simile Exhibit project in data/ with extension .js or .json
+
+Alternative format is pipe (|) separated text files with extension .txt
+First column is always header with field names
+Multi-line values should be wrapped in ^multi-line-text^
+
+If you save bounch of html files with table in directory with .html extension, they will
+we all read as single data set, allowing easy analysys of search results, for example.
+
 
 Start with:
 
-LANG=hr_HR.utf8 ./script/mojo_facets daemon --reload
+  LANG=hr_HR.utf8 ./script/mojo_facets daemon --reload
+
+
+Data replication:
+
+  # master
+  ./script/mojo_facets daemon --listen 'http://*:4444' --reload
+
+  # slave
+  MASTER=http://localhost:4444 ./script/mojo_facets daemon --reload
+
+
+Turning actions into changes:
+
+There are two kinds of audit log in MojoFacets:
+
+1. actions stored in /tmp/actions are clicks on user interface with parameters
+
+2. changes are more structured, including old value and unique values from
+   edit of one value in dataset
+
+If you want to create changes which can be applied again on original dataset or
+any other dataset which has same unique values you can use helper script:
+
+  $ ./script/actions-to-changes /data/mojo_facets/*
+
+
+Modify your data using perl snippets
+
+Experimental REPL console supports perl snippets which get $rec hash which is one
+element from your dataset. All values are repetable, so you always have to create
+array of values if you are creating new columns, even for single value.
+
+* generate new columns with number of elements in some other column
+
+  $rec->{count} = [ $#{ $rec->{original} } + 1 ];
+
+* generate century column from year
+
+  foreach my $year ( @{ $rec->{Year} } ) {
+    push @{ $rec->{century} }, int($year/100)+1;
+  }