How to import .xlsx file on my hosting when Tiddlywiki start?

122 views
Skip to first unread message

Siniy-Kit

unread,
Jun 10, 2020, 2:29:22 PM6/10/20
to TiddlyWiki
Hi! I use .xlsx plugin to import Excel tables, and it works very well.  I want to serve my dataBase.xlsx file on my hosting. And when my Tiddlywiki  page opens, it must automatically import all data from this table without clicking buttons and import dialog.
Is it possible to write macros for automatic file import on start? 

TonyM

unread,
Jun 10, 2020, 8:09:21 PM6/10/20
to TiddlyWiki
Sinny,

There are built in startup actions, and a plugin from someone else (for more functional startup actions), that can trigger any process but I think the dialogue will still appear.

What I am curious about is do you plan to load this for every user who loads the wiki, or only you responsible for publishing/saving? THis seems like a performance impact.

A Quick workaround could be to make a virtue of it and have a startup modal as if you want to refresh the data or not. You could also ties this to user ID, so when you load it and you were the last user I will only display the modal then.

I would think there may be occasions on which you would like to load the wiki and not import.

Regards
Tony

Siniy-Kit

unread,
Jun 11, 2020, 6:09:04 AM6/11/20
to TiddlyWiki
Hi, Tony. I am making store now. As a rule I make stores on google spreadsheets (like this)  My empty Tiddlywiki loads  data from google spreadsheet for every user  who loads wiki.  By changing spreadsheet id in url I can have many different online stores on one empty TW

BUT my client dont like google spreadsheets he likes Excel! His shop will  have 20 000 items and he wants update them every day by dropping heeg.xlsx file to his hosting.  So am thinking how to make it work on tiddlywiki.


четверг, 11 июня 2020 г., 3:09:21 UTC+3 пользователь TW Tones написал:

Saq Imtiaz

unread,
Jun 11, 2020, 6:31:36 AM6/11/20
to TiddlyWiki
@Siniy what you want is possible but will require some custom JavaScript coding. I see that you already run custom JS in your TW so hopefully this is something you are able to work on yourself.

What could try to do is something like this:
  • instead of getting data from the google sheet, GET the .xlsx file as binary data and save it as a binary tiddler
  • invoke the deserializer from the XLSX plugin to deserialize the data and create tiddlers, skipping the import dialog.
Alternatively, convert the XLSX to JSON remotely, using the same format as Google Sheets. This would let you use a similar workflow to what you have now, but would require a serverside component.

Either a script that checks for the XLSX file every few minutes, and if it has changed converts to JSON and makes it available at a given URL. Or, acts more like a proxy, doing the conversion on request.

Saq

TW Tones

unread,
Jun 11, 2020, 9:12:09 AM6/11/20
to TiddlyWiki
Sinny,

I am aware of your shops, amazing stuff. Now I have a better idea of your problem, in my view it is your client :) but then they pay the bills.

I have being keen to obtain a similar solution, I am convinced one exists, but it may not have been found yet.

Could it be possible for him to submit a csv version (ie a different save method) to simplify at least one step?

Regards
Tony
Reply all
Reply to author
Forward
0 new messages