Not logged in. · Lost password · Register

All posts by rkaa (6)

topic: Anyone "reverse engineered" a struct schema, complete with values, from a MySQL database?  in the forum: General Help and Support Plugins
Avatar
rkaa #1
Member since Jun 2019 · 6 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
Built a CSV for a lookup schema with ~800 servers, locations and racks:
Took 2-3 seconds to import.

Replicating what I used data's "datarelated" for also worked like charm.
No caching issues. Nice.

Still pondering maintenance.


Related enhancement issue #42: support import from data
https://github.com/cosmocode/dokuwiki-plugin-struct/issues…

A user-contributed approach is linked to in one of the comments there (zip, PHP).
Not tested.


Kind regards;
Kristin
topic: Typo on struct filter page at dokuwiki.org  in the forum: General Help and Support Plugins
Avatar
rkaa #2
Member since Jun 2019 · 6 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
In reply to post ID 66739
Done. Aller Anfang ist schwer ;)
topic: Typo on struct filter page at dokuwiki.org  in the forum: General Help and Support Plugins
Avatar
rkaa #3
Member since Jun 2019 · 6 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
Subject: Typo on struct filter page at dokuwiki.org
"schemas" in the examples here should likely be "schema":

https://www.dokuwiki.org/plugin:struct:filters


Kind regards;
Kristin
topic: Anyone "reverse engineered" a struct schema, complete with values, from a MySQL database?  in the forum: General Help and Support Plugins
Avatar
rkaa #4
Member since Jun 2019 · 6 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
In reply to post ID 66626
Thank you pop and andi, for swift replies and good pointers. Does sound like time-savers.
I missed the saveData() method earlier - that would be it.

Haven't quite dropped the (admittedly heretic) idea of toggling a struct.sqlite3 file more directly, though.
I remember some Tcl from way back, and it seems to have a decent SQLite interface.

What still swirls around in my mind is something like..:

- Convert a MySQL db to sqlite format. Tools for this are plentyful, good HOWTO's, culprits and fixes listed
- Script some Tcl to have sqlite3 read from the converted db, then write desired values to struct.sqlite3.

The basic schema would already be in place and assigned, but populating field values for the various pages needs boosting.

Then again.. maybe "the wheel" I need is aleady invented. Reading up on XML-RPC now (and considering learning curves..)


Thanks again.

Kind regards;
Kristin
This post was edited on 2019-06-26, 01:19 by rkaa.
topic: Anyone "reverse engineered" a struct schema, complete with values, from a MySQL database?  in the forum: General Help and Support Plugins
Avatar
rkaa #5
Member since Jun 2019 · 6 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
Subject: Anyone "reverse engineered" a struct schema, complete with values, from a MySQL database?
Hi

I have the pleasure of administrating a Dokuwiki instance in an IT department, containing our "24/7" documentation.
To keep track of our physical servers, some scripts import info from openDCIM, writes a Dokuwiki-page for each server, complete with dataentry, keywords and values for server-rooms, rack-ID etc.

Some wget and "datarelated" magic later, the main documentation pages, where only server names are initially known through the dataentry, nicely list rows with servers, location and rack.

Management now wants to see if the wiki can be re-vamped into a CMS-alike thing, doubling as a-kind of Service Catalogue,  with jobs, products, data flows and customers.. and then some. *And* documentation.

The relevant information is currently spread all over, accessible via APIs, MySQL, or at worst by scp/rsync for some serious post processing.

I guess implementing some/all their wishes would quickly increase the wiki page number by 5-15k.

I'm considering moving from "data" to "struct" because of better aggregations and layout possibilities.
But I don't have the resources to populate the required struct fields by hand.
That job need to be scripted for - somehow. I'm used to modify data entries with bash scripts, sed, awk or whatever it takes to knead a few thousand pages in a matter of seconds. But "database injection" is a new cup of tea.

So thus the question: Is "reverse engineering" a struct schema a viable idea?
(Or am I in it way over my head here, since I at all have to ask..)

If it wasn't clear already, the Goal is to utilise existing values from for instance a MySQL database, to avoid months of manual edits.

Thankful for any ideas or comments!


Kind regards;
Kristin
Oslo, Norway
topic: Struct: How to filter for empty values  in the forum: General Help and Support Plugins
Avatar
rkaa #6
Member since Jun 2019 · 6 posts · Location: Norway
Group memberships: Members
Show profile · Link to this post
In reply to post ID 59722
Brand new to struct here, but I think it's the comparator. Something like this should work:

---- struct table ----
schema: metainfo
cols: %pageid%
filter: Status <=0
csv: 0

If the field name is actually lowercase, and only the Title label is uppercase,
Not sure if aggregations are case sensitive. They ought to be..
Meaning if your field is actually called "status" (and only the Title/label is "Status"):

filter: status  <=0

Tested in struct, seems to work.


Malapropos:

This approach didn't work when looking for empty mail fields in "structured data plugin".
The solution was a work-around:

filter: something_mails !~ *@*


Kind regards;
Kristin
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-10-16, 06:51:38 (UTC +02:00)