return array from every_param
[MojoFacets.git] / README
1 Mojo Facets - server side facet browsing using Mojolicious and jQuery UI
2
3
4 Data sources:
5
6 Put JSON file from Simile Exhibit project in data/ with extension .js or .json
7
8 Alternative format is pipe (|) separated text files with extension .txt
9 First column is always header with field names
10 Multi-line values should be wrapped in ^multi-line-text^
11
12 If you save bounch of html files with table in directory with .html extension, they will
13 we all read as single data set, allowing easy analysys of search results, for example.
14
15 CSV files with .csv extension are parsed using , as delimiter. Encoding is utf8
16 and can be specified in filename, before extension like this: data.encoding.csv
17
18 CouchDB data can be imported using files which contain full url to CouchDB database
19 or url to CouchDB view to import. URL's filename should end in *.couchdb
20
21 lsblk .pairs format is basically shell variables in form NAME="value"
22
23
24 Start with:
25
26     LANG=hr_HR.utf8 ./script/mojo_facets daemon --reload
27
28
29 Changing tabular data:
30
31 Just double click on any table cell and click outside or focus out to save change.
32
33
34 Data action and changes:
35
36 There are two kinds of audit log in MojoFacets:
37
38 1. actions stored in /tmp/actions are clicks on user interface with parameters,
39    they will probably be erased on next reboot since they are in /tmp
40
41 2. changes in data/database.changes are more structured, including old value
42    and unique identifiers for that row
43
44 Changes can be applied on any dataset currently in memory.
45
46 Whole idea of changes is to create audit log which is detailed enough to recostruct
47 current state of dataset from source file and list of changes. However, to speed
48 up operations, you can periodically save your in-memory data to /tmp/ in perl
49 storeable format using save link in interface.
50
51
52 Data replication:
53
54 Actions can be replicated to other hosts using MASTER enviroment variable
55 or config menu
56
57     # slave
58     MASTER=http://localhost:4444 ./script/mojo_facets daemon --reload
59
60
61 Code console to modify data using perl snippets:
62
63 Experimental REPL console supports perl snippets which get $row hash which is one
64 element from your dataset.
65
66 If you want to create or update values, you will have to use $update hash to set
67 new values.
68
69 If you want to report something from your dataset (also called reduce in map/reduce
70 terminology) you can use $out hash to store values which will be used to generate
71 new dataset using $key and $value for column names.
72
73 All values are repetable, but if you create just a scalar, magic(tm) inside MojoFacets
74 will try to upgrade it to [ $scalar ] so you don't have to do it explicitly.
75
76 Code examples are stored in public/code
77
78 They use column1,column2.description.pl notatition so only snippets which have applicable
79 column will be shown.
80
81
82 Facet code eval:
83
84 Code snippet will be executed for each facet $value and will report $count and $checked state.
85 You can also update $checked to programatically select part of facet values.
86
87
88 Export data:
89
90 All exported data is stored in public/export/database/
91
92 There you can find saved filters and items generated with export checkbox
93
94     filter.column_name.optional_description
95         items.column1.column2.column3
96
97