-
Notifications
You must be signed in to change notification settings - Fork 0
OokTech/TW5-FederationCore
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
title: $:/plugins/Federation/FederationCore/ReadMe caption: ReadMe !! What is this? This is the basic core for adding federation to tiddlywiki. This plugin has only the back-end tools necessary to allow other wikis with this plugin to fetch tiddlers from this wiki, or to use this wiki to fetch tiddlers from other wikis with this plugin. This plugin uses the `$action-tiddlerbundle` widget for part of its function. See the [[readme|$:/plugins/Federation/FederationCore/ActionTiddlerBundleReadMe]] and [[demo|$:/plugins/Federation/FederationCore/BundleDemo]] for more about that. !! Parameters |!Parameter |!Description | |!url |The url of the remote wiki you wish to fetch from. (No Default) | |!filter |The filter used to determine which tiddlers from the remote wiki are returned. (Default: `[is[system]!is[system]]` so nothing is returned) | |!bundleName |The name of the tiddler returned as the bundle. (`Default Bundle` for bundles that use the `Tiddler` packing, `JSON Bundle` for bundles that use `JSONBundle` for the bundle function.) | |!bundleFunction |The function you want used to bundle the returned tiddlers. By default the options are `bundleTiddlers` and `JSONBundle` (Default: `bundleTiddlers`) | |!bundleHandler |The name of the bundle handler to use with the returned bundle. Only `default` is in the FederationCore plugins, other handlers will be in other plugins. (Default: `default`)| |!separator |The string used to separate the tiddler text in the bundle when `bundleTiddlers` is used. This should never have to be changed. (Default: `<!-- TIDDLER SEPARATOR --!>`) | !! How do I do anything with this? The code below is used in [[the fetch demo|$:/plugins/Federation/FederationCore/FetchDemo]] There are two (or more) wikis. The one you are using is the `local wiki` and all the others are `remote wikis`. All the wikis involved must have this plugin. In the `local wiki` you have something like this: ``` This is a url you can use for testing: `https://ooktech.xyz:8443/Public` Remote Wiki: <$edit-text tiddler='$:/state/TWederation/FetchTiddlers' field='url' class='tc-edit-texteditor'/> This filter works for testing: `[!is[system]limit[10]]` Filter: <$edit-text tiddler='$:/state/TWederation/FetchTiddlers' field='filter' class='tc-edit-texteditor'/> Bundle Name: <$edit-text tiddler='$:/state/TWederation/FetchTiddlers' field='bundle_name' class='tc-edit-texteditor'/> Bundle Function: <$radio tiddler='$:/state/TWederation/FetchTiddlers' field='bundle_function' value='bundleTiddlers'> Tiddler Bundle</$radio> <$radio tiddler='$:/state/TWederation/FetchTiddlers' field='bundle_function' value='JSONBundle'> JSON Bundle</$radio> <$button> Fetch Some Tiddlers <$action-sendmessage $message='tm-send-request' request_type='request_bundle' url={{$:/state/TWederation/FetchTiddlers!!url}} filter={{$:/state/TWederation/FetchTiddlers!!filter}} bundleName={{$:/state/TWederation/FetchTiddlers!!bundle_name}} bundleFunction={{$:/state/TWederation/FetchTiddlers!!bundle_function}} /> </$button> This lists the existing bundles that have already been fetched: <$list filter='[tag[Tiddler Bundle]][tag[JSON Bundle]]' > </$list> ``` When you click the button the `local wiki` fetches the tiddlers in the `remote wiki` returned by the filter. These tiddlers are put into a bundle and must be unpacked before they are usable in the local wiki. This is a necessary safety feature. To unbundle the tiddlers you use the `$action-tiddlerbundle` action widget like this: ``` <$select tiddler='$:/state/TWederation/UnbundleName' > <option value='' > No Bundle Selected </option> <$list filter='[tag[Tiddler Bundle]][tag[JSON Bundle]]' > <option> <$view field='title' /> </option> </$list> </$select> <$button> Unbundle Tiddlers <$action-tiddlerbundle $action='unpack' $bundle={{$:/state/TWederation/UnbundleName}} /> </$button> Titles in the bundle: <$list filter='[[$:/TiddlerBundleData/]addsuffix{$:/state/TWederation/UnbundleName}]' > <$list filter='[list<currentTiddler>]' > </$list> </$list> ``` !! Uses for this plugin are: *Add this plugin to a wiki that you want to be able to pull content from (the source wiki) *Add this plugin to a wiki that will use one of the other federation plugins (because it is required by all other federation plugins) *Use this plugin to create your own tool that uses federation
About
The basic federation components for TWederation
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published