documentation: first version of document generation
authorJanos Kovacs <jankovac503@gmail.com>
Mon, 23 Apr 2012 02:57:02 +0000 (05:57 +0300)
committerJanos Kovacs <jankovac503@gmail.com>
Mon, 23 Apr 2012 02:57:02 +0000 (05:57 +0300)
* pdf generation
* no doxygen support yet

configure.ac
doc/Makefile.am
doc/Makefile.rules [new file with mode: 0644]
doc/common/figures/db-layers.svg [new file with mode: 0644]
doc/plugin-developer-guide/db/Makefile.am [new file with mode: 0644]
doc/plugin-developer-guide/lyx/murphy-db.lyx [new file with mode: 0644]
doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx [new file with mode: 0644]
doc/scripts/dblyxfix.py [new file with mode: 0755]

index e07a328..ffdf562 100644 (file)
@@ -124,6 +124,7 @@ AC_MSG_CHECKING([libdir])
 AC_MSG_RESULT([$libdir])
 AC_SUBST(LIBDIR, [$libdir])
 
+
 # Check which plugins should be built in.
 AC_ARG_WITH(builtin-plugins,
             [  --with-builtin-plugins=<plugin-list>  specify which plugins to link in],
@@ -192,6 +193,56 @@ if test "x$has_check" = "xno"; then
     AC_MSG_WARN([Check framework not found, unit tests are DISABLED.])
 fi
 
+# Check for documentation tools
+AC_ARG_WITH([documentation],
+            [AS_HELP_STRING([--with-documentation],
+                            [generate pdf, html and other doc files])],
+            [],
+            [with_documentation=auto]
+)
+
+AS_IF( [ test x$with_documentation = xno ],
+       [ has_doc_tools="no" ],
+       [ AC_PATH_TOOL([MRP_DOXYGEN], doxygen)
+         AC_PATH_TOOL([MRP_LYX], lyx)
+         AC_PATH_TOOL([MRP_INKSCAPE], inkscape)
+         AC_PATH_TOOL([MRP_PYTHON], python)
+         AC_PATH_TOOL([MRP_DBLATEX], dblatex)
+         AC_PATH_TOOL([MRP_XMLTO], xmlto)
+
+         AS_IF( [ test x$MRP_DOXYGEN = x -o x$MRP_LYX = x -o \
+                       x$MRP_INKSCAPE = x -o x$MRP_PYTHON = x ],
+                [ has_doc_tools="no";
+                  AC_MSG_WARN([Some essential doc-tool is missing]) ],
+                [ has_doc_tools="yes" ]
+         ) ]
+)
+
+AS_IF([ test x$has_doc_tools == "xno" -o x$MRP_DBLATEX = x ],
+      [ can_make_pdfs="no";
+        AC_WARN([No PDF documentation will be generated]) ],
+      [ can_make_pdfs="yes"]
+)
+
+AS_IF([ test x$has_doc_tools == "xno" -o x$MRP_XMLTO = x ],
+      [ can_make_html="no";
+        AC_WARN([No HTML documentation will be generated]) ],
+      [ can_make_html="yes" ]
+)
+
+
+AM_CONDITIONAL(BUILD_DOCUMENTATION,  [ test x$has_doc_tools = "xyes" ])
+AM_CONDITIONAL(BUILD_PDF_DOCUMENTS,  [ test x$can_make_pdfs = "xyes" ])
+AM_CONDITIONAL(BUILD_HTML_DOCUMENTS, [ test x$can_make_html = "xyes" ])
+
+AC_SUBST(MRP_DOCDIR, [`pwd`/doc])
+AC_SUBST(MRP_FIGDIR, [$MRP_DOCDIR/common/figures])
+AC_SUBST(MRP_MAKE_DOCRULES, [$MRP_DOCDIR/Makefile.rules])
+AC_SUBST(MRP_DOCSCRIPT_DIR, [$MRP_DOCDIR/scripts])
+AC_SUBST(MRP_ABNF, [$MRP_DOCSCRIPT_DIR/abnf.py])
+AC_SUBST(MRP_DBLYXFIX, [$MRP_DOCSCRIPT_DIR/dblyxfix.py])
+
+
 # Shave by default.
 SHAVE_INIT([build-aux], [enable])
 
@@ -218,9 +269,11 @@ AC_CONFIG_FILES([build-aux/shave
                  src/murphy-db/include/Makefile
                  src/murphy-db/tests/Makefile
                 doc/Makefile
+                 doc/plugin-developer-guide/db/Makefile
                 ])
 AC_OUTPUT
 
+
 # Display the configuration.
 echo "----- configuration -----"
 echo "Extra C warnings flags: $WARNING_CFLAGS"
index 7b32ccc..2582da2 100644 (file)
@@ -1 +1,31 @@
-doc_DATA = CODING-STYLE
+MANDEFS  = plugin-developer-guide.x
+MANUALS  = $(MANDEFS:.x=)
+TARGETS  =
+DOCFILES =
+
+if BUILD_DOCUMENTATION
+DOCDIRS = plugin-developer-guide/db
+endif
+
+if BUILD_PDF_DOCUMENTS
+TARGETS += pdf_targets
+DOCFILES += $(MANDEFS:.x=.pdf)
+endif
+
+SUBDIRS = $(DOCDIRS)
+
+doc_DATA = CODING-STYLE $(DOCFILES)
+
+
+all-am: $(TARGETS)
+
+pdf_targets:
+       for name in $(MANUALS) ; do \
+               xml=$${name}/db/$${name}.xml ; \
+               pdf=$${name}.pdf ; \
+               $(MRP_DBLATEX) --pdf --style=db2latex -P figure.title.top=0 \
+                       -o $${pdf} $${xml} ; \
+       done
+
+clean-local:
+       rm -f *.pdf
diff --git a/doc/Makefile.rules b/doc/Makefile.rules
new file mode 100644 (file)
index 0000000..07ab189
--- /dev/null
@@ -0,0 +1,12 @@
+.SUFFIXES: .svg .pdf .png .lyx
+
+vpath %.svg  $(MRP_FIGDIR)
+
+.svg.pdf:
+       $(MRP_INKSCAPE) --export-area-drawing --export-pdf=$@ $<
+
+
+.svg.png:
+       $(MRP_INKSCAPE) --export-area-drawing --export-png=$@ $<
+
+
diff --git a/doc/common/figures/db-layers.svg b/doc/common/figures/db-layers.svg
new file mode 100644 (file)
index 0000000..b3f48b4
--- /dev/null
@@ -0,0 +1,608 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="297mm"
+   height="210mm"
+   id="svg2985"
+   version="1.1"
+   inkscape:version="0.48.1 r9760"
+   sodipodi:docname="db-layers.svg">
+  <defs
+     id="defs2987">
+    <linearGradient
+       id="linearGradient3783"
+       osb:paint="solid">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop3785" />
+    </linearGradient>
+    <filter
+       id="filter3857"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur3859"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix3861"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset3863"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge3865">
+        <feMergeNode
+           id="feMergeNode3867"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode3869"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter3871"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur3873"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix3875"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset3877"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge3879">
+        <feMergeNode
+           id="feMergeNode3881"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode3883"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter3885"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur3887"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix3889"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset3891"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge3893">
+        <feMergeNode
+           id="feMergeNode3895"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode3897"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter3899"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur3901"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix3903"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset3905"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge3907">
+        <feMergeNode
+           id="feMergeNode3909"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode3911"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter3913"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur3915"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix3917"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset3919"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge3921">
+        <feMergeNode
+           id="feMergeNode3923"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode3925"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter3985"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur3987"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix3989"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset3991"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge3993">
+        <feMergeNode
+           id="feMergeNode3995"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode3997"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter4081"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur4083"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix4085"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset4087"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge4089">
+        <feMergeNode
+           id="feMergeNode4091"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode4093"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       color-interpolation-filters="sRGB"
+       id="filter4081-7"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-0.25"
+       y="-0.25">
+      <feGaussianBlur
+         id="feGaussianBlur4083-6"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix4085-9"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset4087-4"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge4089-0">
+        <feMergeNode
+           id="feMergeNode4091-9"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode4093-5"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter4253"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur4255"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix4257"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset4259"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge4261">
+        <feMergeNode
+           id="feMergeNode4263"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode4265"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+    <filter
+       id="filter4267"
+       inkscape:label="Drop shadow"
+       width="1.5"
+       height="1.5"
+       x="-.25"
+       y="-.25">
+      <feGaussianBlur
+         id="feGaussianBlur4269"
+         in="SourceAlpha"
+         stdDeviation="5.7"
+         result="blur" />
+      <feColorMatrix
+         id="feColorMatrix4271"
+         result="bluralpha"
+         type="matrix"
+         values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.493 0 " />
+      <feOffset
+         id="feOffset4273"
+         in="bluralpha"
+         dx="11.6"
+         dy="10.5"
+         result="offsetBlur" />
+      <feMerge
+         id="feMerge4275">
+        <feMergeNode
+           id="feMergeNode4277"
+           in="offsetBlur" />
+        <feMergeNode
+           id="feMergeNode4279"
+           in="SourceGraphic" />
+      </feMerge>
+    </filter>
+  </defs>
+  <sodipodi:namedview
+     inkscape:document-units="mm"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="676.99722"
+     inkscape:cy="373.08197"
+     inkscape:current-layer="layer1"
+     id="namedview2989"
+     showgrid="false"
+     inkscape:snap-grids="true"
+     inkscape:window-width="1511"
+     inkscape:window-height="1051"
+     inkscape:window-x="249"
+     inkscape:window-y="49"
+     inkscape:window-maximized="0"
+     showguides="true"
+     inkscape:guide-bbox="true">
+    <inkscape:grid
+       type="xygrid"
+       id="grid3999" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata2991">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="fill:#a18689;fill-opacity:1;stroke:none;filter:url(#filter3985)"
+       d="m 193,698.09448 1,-371 310,0 0,-128 344,0 -2,500 z"
+       id="path3983"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ccccccc"
+       inkscape:label="#mdb-path" />
+    <rect
+       style="fill:#a02c2c;fill-opacity:1;stroke:none;filter:url(#filter3913)"
+       id="rect3001"
+       width="602.41913"
+       height="116"
+       x="220.72061"
+       y="356.09448"
+       ry="0.5"
+       inkscape:label="#mql-rect" />
+    <rect
+       style="fill:#a05a2c;fill-opacity:1;stroke:none;filter:url(#filter3899)"
+       id="rect3797"
+       width="286.07703"
+       height="110"
+       x="220"
+       y="499.09448"
+       ry="0.5" />
+    <rect
+       style="fill:#a05a2c;fill-opacity:1;stroke:none;filter:url(#filter3885)"
+       id="rect3797-5"
+       width="290.4006"
+       height="110"
+       x="533.09937"
+       y="500.09448"
+       ry="0.5" />
+    <rect
+       style="fill:#c8ab37;fill-opacity:1;stroke:none;filter:url(#filter3871)"
+       id="rect3797-5-8"
+       width="290.4006"
+       height="110"
+       x="531.6582"
+       y="222.09448"
+       ry="0.5" />
+    <path
+       style="fill:#d0b69d;fill-opacity:1;stroke:none;filter:url(#filter3857)"
+       d="m 172.78059,290.09448 282.57583,-1 -0.7206,-129 390.50156,0 -1.3394,-134 -671.01739,0 z"
+       id="path3835"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ccccccc"
+       transform="matrix(0.97088079,0,0,1,26.971249,10)" />
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter4081);font-family:Sans"
+       x="429"
+       y="665.09448"
+       id="text4077"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan4079"
+         x="429"
+         y="665.09448"
+         style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans Bold">Murphy-DB</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter4081-7);font-family:Sans"
+       x="399.42969"
+       y="117.92261"
+       id="text4077-2"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan4079-4"
+         x="399.42969"
+         y="117.92261"
+         style="font-size:32px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans Bold">Murphy Plugin</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
+       x="676.5293"
+       y="266.09448"
+       id="text4137"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan4139"
+         x="676.5293"
+         y="266.09448"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'">MQL</tspan><tspan
+         sodipodi:role="line"
+         x="676.5293"
+         y="296.09448"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4141">Murphy Query Language</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
+       x="529.13477"
+       y="403.63159"
+       id="text4137-2"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan4139-2"
+         x="529.13477"
+         y="403.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'">MQI</tspan><tspan
+         sodipodi:role="line"
+         x="529.13477"
+         y="433.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4141-2">Murphy Query Interface</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
+       x="365.13477"
+       y="500.63159"
+       id="text4137-2-8"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan4139-2-7"
+         x="365.13477"
+         y="500.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'" /><tspan
+         sodipodi:role="line"
+         x="365.13477"
+         y="530.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4195">Temporary Data Backend</tspan><tspan
+         sodipodi:role="line"
+         x="365.13477"
+         y="560.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4201">MDE</tspan><tspan
+         sodipodi:role="line"
+         x="365.13477"
+         y="590.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4141-2-4">Memory Database Engine</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
+       x="678.13477"
+       y="502.83667"
+       id="text4137-2-8-7"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan4139-2-7-1"
+         x="678.13477"
+         y="502.83667"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'" /><tspan
+         sodipodi:role="line"
+         x="678.13477"
+         y="532.83667"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4195-5">Persistent Data Backend</tspan><tspan
+         sodipodi:role="line"
+         x="678.13477"
+         y="562.83667"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4201-0" /><tspan
+         sodipodi:role="line"
+         x="678.13477"
+         y="592.83667"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4141-2-4-8">SQLite</tspan></text>
+    <path
+       style="fill:#c8ab37;fill-opacity:1;stroke:none;filter:url(#filter4267)"
+       d="m 867,184.09448 30,-49 -1,20 141,-1 0,61 -141,0 0,19 z"
+       id="path4233"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccccccc" />
+    <path
+       style="fill:#a02c2c;fill-opacity:1;stroke:#7b5555;stroke-opacity:1;filter:url(#filter4253)"
+       d="m 177,314.09448 -30,-49 1,20 -141,-1 0,61 141,0 0,19 z"
+       id="path4233-0"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccccccc" />
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
+       x="965.13477"
+       y="177.63159"
+       id="text4137-8"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         x="965.13477"
+         y="177.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4141-24">High level</tspan><tspan
+         sodipodi:role="line"
+         x="965.13477"
+         y="207.63159"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4307">API</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans"
+       x="80.035217"
+       y="307.42651"
+       id="text4137-8-0"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         x="80.035217"
+         y="307.42651"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4141-24-3">Low level</tspan><tspan
+         sodipodi:role="line"
+         x="80.035217"
+         y="337.42651"
+         style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Times New Roman;-inkscape-font-specification:'Times New Roman,'"
+         id="tspan4307-8">API</tspan></text>
+  </g>
+</svg>
diff --git a/doc/plugin-developer-guide/db/Makefile.am b/doc/plugin-developer-guide/db/Makefile.am
new file mode 100644 (file)
index 0000000..4b1ff86
--- /dev/null
@@ -0,0 +1,52 @@
+TOP_SRCDIR = $(abs_top_srcdir)/src
+
+vpath %.lyx ../lyx
+
+include $(MRP_MAKE_DOCRULES)
+
+
+
+FIGURES_SVG = db-layers.svg
+FIGURES_PNG = $(FIGURES_SVG:.svg=.png)
+FIGURES_PDF = $(FIGURES_SVG:.svg=.pdf)
+
+FIGURES = copy_svgs $(FIGURES_PNG) $(FIGURES_PDF)
+FIGURE_FILES = $(FIGURES_SVG) $(FIGURES_PNG) $(FIGURES_PDF)
+
+LYX_DOCS = murphy-db.lyx
+XML_DOCS = $(LYX_DOCS:.lyx=.xml)
+
+MQL_GRAMMAR = mql-grammar.xml
+GENERATED_GRAMMARS = $(MQL_GRAMMAR)
+
+TARGETS = $(FIGURES) plugin-developer-guide.xml
+
+all-am: $(TARGETS)
+
+copy_svgs: $(FIGURES_SVG)
+       for file in $^ ; do cp $(MRP_FIGDIR)/$$file . ; done
+
+$(MQL_GRAMMAR): $(TOP_SRCDIR)/murphy-db/mql/mql-scanner.l \
+                $(TOP_SRCDIR)/murphy-db/mql/mql-parser.y
+       $(MRP_ABNF) $+ > $@
+
+xml_docs: $(LYX_DOCS)
+       for lyx_file in $^ ; do \
+               lyxml_file=$${lyx_file/.lyx/.xml} ; \
+               xml_file=`basename $$lyxml_file` ; \
+               rm -f $$lyxml_file ; \
+               $(MRP_LYX) --export docbook-xml $$lyx_file && \
+               $(MRP_DBLYXFIX)  $$lyxml_file $$xml_file && \
+               rm -f $$lyxml_file ; \
+       done
+
+
+plugin-developer-guide.xml: plugin-developer-guide.lyx \
+                            $(GENERATED_GRAMMARS) xml_docs
+       rm -f ../lyx/plugin-devloper-guide.xml ; \
+       $(MRP_LYX) --export docbook-xml ../lyx/plugin-developer-guide.lyx && \
+       $(MRP_DBLYXFIX) ../lyx/plugin-developer-guide.xml $@ && \
+       rm -f ../lyx/plugin-devloper-guide.xml
+
+clean-local:
+       rm -f $(TARGETS) $(GENERATED_GRAMMARS) $(XML_DOCS) ../lyx/*.xml
diff --git a/doc/plugin-developer-guide/lyx/murphy-db.lyx b/doc/plugin-developer-guide/lyx/murphy-db.lyx
new file mode 100644 (file)
index 0000000..adb7ba4
--- /dev/null
@@ -0,0 +1,146 @@
+#LyX 2.0 created this file. For more info see http://www.lyx.org/
+\lyxformat 413
+\begin_document
+\begin_header
+\textclass docbook-chapter
+\use_default_options true
+\maintain_unincluded_children false
+\language english
+\language_package default
+\inputencoding auto
+\fontencoding global
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref true
+\pdf_bookmarks true
+\pdf_bookmarksnumbered false
+\pdf_bookmarksopen false
+\pdf_bookmarksopenlevel 1
+\pdf_breaklinks false
+\pdf_pdfborder false
+\pdf_colorlinks true
+\pdf_backref section
+\pdf_pdfusetitle true
+\papersize default
+\use_geometry false
+\use_amsmath 1
+\use_esint 1
+\use_mhchem 1
+\use_mathdots 1
+\cite_engine basic
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\use_refstyle 1
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 2
+\tocdepth 3
+\paragraph_separation skip
+\defskip smallskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\bullet 1 0 9 -1
+\bullet 2 0 15 -1
+\bullet 3 0 7 -1
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Murphy Database
+\end_layout
+
+\begin_layout Section
+Overview
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float figure
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Caption
+
+\begin_layout Plain Layout
+Murphy DB components
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+       filename ../../common/figures/db-layers.svg
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Low level API
+\end_layout
+
+\begin_layout Section
+High Level API
+\end_layout
+
+\begin_layout Section
+Murphy Query Language
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand input
+filename "mql-grammar.xml"
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx b/doc/plugin-developer-guide/lyx/plugin-developer-guide.lyx
new file mode 100644 (file)
index 0000000..32f69de
--- /dev/null
@@ -0,0 +1,106 @@
+#LyX 2.0 created this file. For more info see http://www.lyx.org/
+\lyxformat 413
+\begin_document
+\begin_header
+\textclass docbook-book
+\use_default_options true
+\maintain_unincluded_children false
+\language english
+\language_package default
+\inputencoding auto
+\fontencoding global
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_default_family default
+\use_non_tex_fonts false
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+
+\graphics default
+\default_output_format default
+\output_sync 0
+\bibtex_command default
+\index_command default
+\paperfontsize default
+\spacing single
+\use_hyperref true
+\pdf_bookmarks true
+\pdf_bookmarksnumbered false
+\pdf_bookmarksopen false
+\pdf_bookmarksopenlevel 1
+\pdf_breaklinks false
+\pdf_pdfborder false
+\pdf_colorlinks true
+\pdf_backref section
+\pdf_pdfusetitle true
+\papersize default
+\use_geometry false
+\use_amsmath 1
+\use_esint 1
+\use_mhchem 1
+\use_mathdots 1
+\cite_engine basic
+\use_bibtopic false
+\use_indices false
+\paperorientation portrait
+\suppress_date false
+\use_refstyle 1
+\index Index
+\shortcut idx
+\color #008000
+\end_index
+\secnumdepth 2
+\tocdepth 3
+\paragraph_separation skip
+\defskip smallskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\bullet 1 0 9 -1
+\bullet 2 0 15 -1
+\bullet 3 0 7 -1
+\tracking_changes false
+\output_changes false
+\html_math_output 0
+\html_css_as_file 0
+\html_be_strict false
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Plugin Developer Guide
+\end_layout
+
+\begin_layout Part
+Introduction
+\end_layout
+
+\begin_layout Chapter
+Murphy in Brief
+\end_layout
+
+\begin_layout Standard
+jhkjhkjh
+\end_layout
+
+\begin_layout Part
+Basic Infrastructure
+\end_layout
+
+\begin_layout Standard
+\begin_inset CommandInset include
+LatexCommand include
+filename "murphy-db.xml"
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
diff --git a/doc/scripts/dblyxfix.py b/doc/scripts/dblyxfix.py
new file mode 100755 (executable)
index 0000000..07f1039
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+# -*- coding: latin-1 -*-
+
+
+import os, sys, re
+from lxml import etree
+
+def fix_graphs(broken_xml):
+    start = 0
+    end = len(broken_xml)
+    fixed_xml = ""
+
+    for match in re.finditer(graph_pattern, broken_xml):
+        fixed_xml += broken_xml[start:match.start()]
+        fixed_xml += "<!ENTITY graph%s \"%s\">" % \
+            (match.group(1), os.path.basename(match.group(2)))
+        start = match.end()
+
+    if start < end:
+        fixed_xml += broken_xml[start:end]
+    return fixed_xml
+
+def fix_files(broken_xml):
+    start = 0
+    end = len(broken_xml)
+    fixed_xml = ""
+
+    for match in re.finditer(file_pattern, broken_xml):
+        fixed_xml += fix_graphs(broken_xml[start:match.start()])
+        fixed_xml += "<!ENTITY file%s SYSTEM \"%s\">" % \
+            (match.group(1), match.group(2))
+        start = match.end()
+
+    if start < end:
+        fixed_xml += fix_graphs(broken_xml[start:end])
+    return fixed_xml
+
+
+if len(sys.argv) >= 2:
+    path = sys.argv[1]
+    fnam = os.path.basename(path)
+else:
+    fnam = "<unknown>"
+
+try:
+    input  = open(path, "r")
+    input_xml = input.read()
+    input.close()
+except IOError as (errno, strerror):
+    print "Input error %d - %s" % (errno, strerror)
+    exit(errno)
+
+file_pattern = re.compile("<!ENTITY file([0-9]*) \"([^\"]*)\">")
+graph_pattern = re.compile("<!ENTITY graph([0-9]*) \"([^\"]*)\">")
+
+modified_xml = fix_files(input_xml)
+
+parser  = etree.XMLParser(strip_cdata=False)
+xmltree = etree.XML(modified_xml, parser)
+
+output_xml = etree.tostring(xmltree, pretty_print=True)
+
+if len(sys.argv) == 3:
+    try:
+        output = open(sys.argv[2], "w")
+        output.write(output_xml)
+        output.close()
+    except IOError as (errno, strerror):
+        print "Output error %d - %s" % (errno, strerror)
+else:
+    print output_xml