bwanders / dokuwiki-strata

Strata - a Semi-Structured Data plugin for Dokuwiki
https://www.dokuwiki.org/plugin:strata
17 stars 8 forks source link

How to get data to refresh? #32

Closed aubreyz closed 2 years ago

aubreyz commented 7 years ago

Have been experimenting with a combination of strata, templatery and stratatemplatery (and enjoying it very much).

What I can't figure out is how to get the data refresh (at the data end not at the output end).

I threw in a few files from fwurg.net - and struggled to get these to show up -- eventually they did but I figured out that running Searchindex Manager plugin did not achieve it.

It was only achieved by manually altering the time-stamp on all txt files and only after that running Searchindex Manager - now all good.

Obviously this would be necessary if ever required to resurrect the database from the txt source files, so what mechanism is there to ensure that data is entered apart from going into every file, making some trivial change, and re-saving?? It may be relevant to note that I installed templatery and stratatemplatery only after copying data files across. May be worth a note in manuals unless there is a simpler way.

bwanders commented 7 years ago

Strata picks up changes in the data in the page through the DokuWiki event system, and data enters the index through the so-called "metadata" renderer. This means that any external edits (i.e., directly adding/removing files in the pages directory) are not picked up all that well.

There is no direct method of restoring the database, except for rerendering all pages. The best way to get DokuWiki to rerender a page in full is to view the page, and add the &purge=1 argument to the URL. So for example, http://my.domain.tld/wiki/url_to_page&purge=1. This will force DokuWiki to rerender the page, including the metadata. This also updates the Strata index with the data from that page.

The way I normally restore a full database is by constructing the necessary URLs with a shell script and simply hitting them locally with curl or wget. But usually, there are nicer ways to get the data into the wiki that do not involve manually transplanting data files into the internal directories of dokuwiki.

I agree that the option to automatically do that would be nice, but I have no idea where to start with such a feature. Pull requests are very welcome for this.