A view template that appears on field:plugin-type[import] can be used to work with the standard import, which contains a json of the import tiddlers
incomingTiddlers.push(title);
importData.tiddlers[title] = tiddlerFields;
tiddlerFields.myimport = "imported" ;
Lovely work like usual. I knew the json mangler plugin would start to pay off with particular applications like this.
I would be keen to apply filters and actions to the json tiddlers during import to add or remove title prefix/suffix or field value pairs.
This would allow importing tiddlers that would overwrite existing ones under a different namespace and keeping them there or allowing a difference check and commit process. This could help with multiple contributors submissions such as via the comments plugin.
I expect even just a subset of json mangler features to handle import and json files would go a long way.
Thanks
Tony
<$button>
<$action-sendmessage $message="tm-perform-import" $param="anyname"/>
Import from Plugin
</$button><$button actions=<<tag-import-actions>>>Import and TagHere
<$action-sendmessage $message="tm-perform-import" $param="$:/Import"/>
</$button>\define tag-import-actions()
<$set name="titleprefix" value="[[">
<$set name="titlesuffix" value="]]">
<$list filter="[[$:/Import]get[text]split[# ]removeprefix<titleprefix>removesuffix<titlesuffix>]" variable=imported>
<$fieldmangler tiddler=<<imported>>>
<$action-sendmessage $message="tm-add-tag" $param=<<currentTiddler>>/>
</$fieldmangler>
</$list>
</$set>
</$set>
\endI am still wondering about proper use of the "tv-auto-open-on-import" variable. What Tony wrote about "tv-enable-drag-and-drop" makes me think there is a tiddler that I should be globally poking that value into rather than it being a locally controlled thing.
\define tv-auto-open-on-import()
{{$:/config/tv-auto-open-on-import}}
\end<$list filter="[enlist{$:/Import}butfirst[6]]" variable="imported">
<!--actions go here-->
</$list>So the issue is that when you set tv-enable-drag-and-drop, it is only set in that widget and its children.The import message is handled by the navigator widget which is an ancestor of your widget.I use something like this:A tiddler called $:/sq/macros/tv-auto-open-on-import with the tag $:/tagsMacro and the content:\define tv-auto-open-on-import()
{{$:/config/tv-auto-open-on-import}}
\end
<$list filter="[enlist{$:/Import}each[]]" variable=imported>
...
</$list>I tried doing this without success. Not sure what I am doing wrong but it seemed to ignore the transcluded "no" setting and opened $:/Import anyways. I trying something similar by not using the transclusion and adding and removing the $:/tags/Macro. But it seems that macros are a bit sticky and once enabled, it stays that way until reload.
<$action-listops $tiddler=<<imported>> $tags="mytag" />[[$:/Import]links[]]I must try and publish something on import tools I am developing as well for a little more colaboration.
I wish we had a more robust but uncomplicated way to collaborate on things inside a wiki.
I am sure a check in out process for serial editing a single wiki would be enough. Perhaps with a user aware streams.
Regards
Tony
Setting the macro tag worked better for me in that it did suppress the $/:Import but the problem is when the tag is removed, the macro stays active for some time ... The only reliable way of resetting things seems to be to save and reload. There must be some caching happening. It doesn't seem browser dependent since it does the same thing in Chrome and Firefox (at least in Linux).