Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> OPML (was: Tinderbox for iPad)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1264760463

Message started by Paul Walters on Jan 29th, 2010, 5:21am

Title: OPML (was: Tinderbox for iPad)
Post by Paul Walters on Jan 29th, 2010, 5:21am

FWIW, There's an interesting little app for iPhone (I presume also compatible with iPad) called CarbonFin that reads/writes/exports OPML outlines.  Tinderbox can ingest OPML and, with not much effort (a simple export template) export to OPML and back to CarbonFin.  A couple years ago Mark Bernstein in his blog published a link to this review of CarbonFin on Jon Leavitt's blog.

I put a little Tinderbox file here that demonstrates exporting/importing to CarbonFin using OPML:  http://drop.io/TBX2CarbonFin

Title: Re: Tinderbox for iPad
Post by Alex Strick van Linschoten on Jan 9th, 2011, 8:04am

This file seems to have vanished, since the service no longer functions. Any chance someone could repost this file?  Thanks.

Title: Re: Tinderbox for iPad
Post by Christopher Menice on Jan 9th, 2011, 8:31am

I agree! I'd like to see the file as well.  Thanks!

Title: Re: Tinderbox for iPad
Post by Paul Walters on Jan 9th, 2011, 11:21am

I moved the TBX to OPML file over here on Dropbox.   A demo of how to work with Tinderbox and CarbonFin.   In Safari: right click the link and select "Save Linked File As...".  The file will be saved as TBX to OMPL.tbx.xml - just remove the .xml suffix.

Title: Re: Tinderbox for iPad
Post by Alex Strick van Linschoten on Jan 9th, 2011, 11:22am

Thanks Paul.

Title: Re: Tinderbox for iPad
Post by Jean Goodwin on Jan 9th, 2011, 12:25pm

Like Paul, I've found CarbonFin Outliner for iPhone/iPad works well in a loop with Tinderbox on the desktop.  After months of use, however, I've started to get annoyed at the lack of a full screen interface, plus having to keep track of yet another syncing service is hard on my brain.

Another option is the mindmapping app iThoughts.  It can import/export "Tinderbox compliant" opml via Dropbox--for me, that's a plus.  Its maps aren't too fussy, and its use of touch-screen gestures is nice.  It won't work for long-ish hierarchical writing, but for brainstorming and meeting notes, I've come to like it.

Of course, this is all pending Tinderbox for the iPad! (Hint, hint.)

Title: Re: Tinderbox for iPad
Post by Mark Anderson on Jan 9th, 2011, 12:37pm

Thanks, Paul. Might I propose updated versions of the templates?  The proposals are functionally the same, one-for-one replacements, as the demo's templates but differ in using some newer TB syntax and codes which may avoid some encoding edge cases and other issues:

New OPML-Wrapper:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>^title^</title>
<expansionState></expansionState>
</head>
<body>
^children(/TEMPLATES/OPML-item)^
</body>
</opml>


New OPML-Item:

Code:
^if(ChildCount)^^if(Text)^<outline text="^opmlEncode(^value($Name)^)^" _note="^opmlEncode(^value($Text)^)^">^else^<outline text="^opmlEncode(^value($Name)^)^">^endIf^
^children(/TEMPLATES/OPML-item)^
</outline>^else^
<outline text="^opmlEncode(^value($Name)^)^"/>^endIf^


I notice Carbon Fin's own OPML output uses single quotes for attribute values. Whilst XML allows either single or double quotes, double seems the more normal convention and TB's ^opmlEncode()^ makes it safe to use attribute values with quotes in as these are changed to XML/OPML-safe entities.

If you wanted to share ToDo list ticks, Carbon Fin uses an OPML attribute "status". I'd suggest having a TB user Boolean attribute, like $IsComplete and a string attribute $status (N.B. lowercase initial to match CF export). I'd envisage $IsComplete being a key attribute for notes and $status being not shown in TB. Carbon Fin's exported 'status' value is either 'checked' or nothing. Importing CF OPML to TB will set the status field; use Rules or agents to cross-map the $status and $IsComplete attributes:

TB to imported CF state:    if($status){$IsComplete=true}else{$IsComplete=false}
Export TB state to CF:   if($IsComplete){$status="checked"}else($status=""}

An OPML-Item template including the status:

Code:
^if(ChildCount)^^if(Text)^<outline text="^opmlEncode(^value($Name)^)^" _note="^opmlEncode(^value($Text)^)^" _status="^value($status)^">^else^<outline text="^opmlEncode(^value($Name)^)^" _status="^value($status)^">^endIf^
^children(/TEMPLATES/OPML-item)^
</outline>^else^
<outline text="^opmlEncode(^value($Name)^)^" _status="^value($status)^"/>^endIf^

We don't need to opmpEncode the value of $status as it is only ever checked (or no value).

Title: Re: Tinderbox for iPad
Post by Alex Strick van Linschoten on Mar 27th, 2011, 3:51am

I think I may be being fairly dense as usual but I can't seem to get this to work even on the very basic sample outline provided in the demo.  I've tried it in the original version, as well as on the version with updated template text (as provided by Mark Anderson).

So I open the file, I CMD-Click and select all the parts of my outline (the note 'Sample Outline' and all of its children). I then click File-Export as Text. I then choose the Templates/OPML Doc file as the Text Export Template and choose the 'Selected Notes' radial button on the left. I then click export and choose to save the file as Sample.opml.  And then I try to open the file in OmniOutliner (which also handles outlines) as a test. It says the file is corrupted.

Title: Re: Tinderbox for iPad
Post by Alex Strick van Linschoten on Mar 27th, 2011, 3:57am

Ok one of my export attempts work. It was using the original template files (as posted by Paul Walters). Instead of individually selecting all the notes I wanted to export, I only chose the top-level note entitled 'Sample Outline'.  This opens in OmniOutliner, and also exports through CarbonFin's online service, but it uses the note text as the title of the note. I would have thought it would take each note's Name as the title and then insert the main body text as the text associated with each note? Or is this a false assumption on my part?

Title: Re: OPML (was: Tinderbox for iPad)
Post by Mark Anderson on Mar 27th, 2011, 5:18am

The OPML templates cited were only designed to export note and all its descendants, using the envelope/letter metaphor; the root note (envelope) uses a recursing template (letter) to include any descendants (each a sheet of the resulting letter).

If you select all items in a branch of the outline, or in different branches, you'll get envelopes nested in envelopes thus likely 'corrupt' OPML.

If you want to export several discrete hierarchies in one OMPL file you'll need to write a slightly more complex template. Exactly what that is will depend on any (unstated) logic in you export plan (e.g. are the top ('root') notes of each exported branch at the same level, do all descendants of an export root export, etc.?)

The reason the export via Paul's original note flips title/text is that is the way the templates were written.  Looking at his TBX, I'm guessing the note titles ($Name) weren't intended for export.

Noting first that OPML is a loosely defined standard, i.e. apps may do their own thing (e.g. Omni's non-standard '_note' attribute for note text), if you want templates that give 'standard' output I'd suggest trying the ones I posted up-thread. With my template bear in mind that their intended to export a note and all it's descendants.

I've a quick workaround for the latter constraint where you want to export several branches. First export each as a separate OPML file, them open all in TextWrangler (or decent text editor - not word processor). Now for the second and subsequent files, delete all the lines from the first up to and including the <body> tag, plus the line from the </body> tag to the end of the file. Now, take what's left of the contents of file #2 and paste it in file number #1 immediately before the </body> tag. Repeat for file #3, etc. Now #1 is a single OPML with all the data.

Title: Re: OPML (was: Tinderbox for iPad)
Post by Jean Goodwin on Mar 27th, 2011, 4:22pm

Uh, although this thread is no longer about iPad to TBX using OPML (i.e. OPML importing), now that it's active again I want to add another endorsement:  Outliner Pro.  The interface of this app doesn't have a polished look (no animations!!!), but it exports an OPML that puts notes into Tinderbox notes, plus it's entirely gesture-based.  That's cool!

Title: Re: OPML (was: Tinderbox for iPad)
Post by Derek Van Ittersum on Mar 28th, 2011, 11:06am

Hi Jean,

I can't find the app you mentioned in the previous post.  Can you link to it?

Thanks!

Title: Re: OPML (was: Tinderbox for iPad)
Post by Jean Goodwin on Mar 28th, 2011, 6:05pm

Sorry about that--got the name wrong:

http://itunes.apple.com/us/app/simple-outliner/id331093728?mt=8

There's a free version, so it's easy to try.

Title: Re: OPML (was: Tinderbox for iPad)
Post by Paul Walters on Apr 3rd, 2011, 7:09am

I noticed today I had neglected to subscribe to this topic and didn't respond timely to Mark A's skillful revision to the code in my sample file, Jean's excellent suggestions, and Alex's concerns.  I'll undertake to upgrade my example file and repost it here.

Title: Re: OPML (was: Tinderbox for iPad)
Post by Mark Anderson on Apr 3rd, 2011, 9:53am

Re the '_status' (non-standard) OPML attribute used by OO and other OMPL outliners to store tick-box states, I think the plan is to map that to existing system attribute $Checked. NOt so as at v5.8.1 but probably soon. Anyway, if you use the built-in $Checked rather than my earlier suggestion of a user $IsComplete you'll be well set up for an improvement in due course.

Apologies about this threads's titling. It started in Feature Suggestions re iPad but then clearly became an OPML export topic. So I split the thread and moved it (in my forum admin' hat'). An unexpected side effect is that the forum eat the first half of the thread which should have remained in the original sub-forum & with the original thread name. Anyway, this thread is now about OPML.  :)

[edit for typo]

Title: Re: OPML (was: Tinderbox for iPad)
Post by Matt Cawood on Apr 25th, 2011, 7:10am

I can't get this to work after copying the TBX to OPML "template" container to a working outline. At first it wasn't calling the OPML Item template, because I'd put the Template container in a different place in my outline. I figured that out, but now I'm getting an export that produces a folder named for the top-level container, with nothing in it.

The HTML window contains something like this:


Code:
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Agroecology</title>
<expansionState></expansionState>
</head>
<body>
<outline text="Bradley: intregrated ag">

<outline text="Robert Bradley"/>


</outline>


<outline text="Fertiliser trees, Africa"/>


<outline text="McCains potatoes, Washington State"/>


<outline text="Joel Salatin"/>


</body>
</opml>


A couple of the notes listed have body text that doesn't appear in the HTML output.

Advice?

Sometimes I wish Tinderbox was something kickable, so I could kick it. I know I'd be immediately ashamed of my petulance, but there are times when its conventions drive this non-geek to the outer edge of frustration.

Yes, I know that Tinderbox's complexity gives it its power. I still want to kick it.


Title: Re: OPML (was: Tinderbox for iPad)
Post by Mark Anderson on Apr 25th, 2011, 8:02am

sorry you're out of sorts with tinderbox right now. Let's see if we can help. Without your TBX and/or a version of the OPML output you expect to see, it's rather hard to give the exact answer. My best guess is the container meets one or more of:
  • No children
  • Container set not to export children
  • Child notes themselves are set not to export
  • The template reference in the container's export template's ^children^ include is in correct.
Given the mistake you reported with the template path for the container's template, I suspect the last bullet above as the most likely cause of failure for your current export.

~~~~~

I believe that when specifying an internal template you don't have to give the full path (Mark B may correct me on this). My recollection is that in the early days of internal templates you needed to cite a full path but now - as long at the template name is unique - you should be able to use just the template note's name. I suspect confusion creeps in at the HTML view template picker shows the full path for any template. In fairness, the latter's listing of paths is actually useful if you've forgotten where a template is!

Title: Re: OPML (was: Tinderbox for iPad)
Post by Matt Cawood on Apr 26th, 2011, 8:37am

Thanks for the help, Mark. Testiness gone, but the problem remains.

HTML export settings are all true.

Both OPML Doc and OPML Item templates contain the same ^children^ template reference, thus:


Code:
^children(/Utilities/Templates/OPMLtemplates/OPML-Item)^


...which corresponds to the container names I'm using.

I tried just using the template name. Nothing appeared in HTML view other than the name of the top-level container.

It's not so much that the templates (with the path specified) don't pick up the child notes - they list all the relevant the note titles - but that they don't pick up the note text. Or export anything, titles or text.

Title: Re: OPML (was: Tinderbox for iPad)
Post by Paul Walters on Apr 26th, 2011, 9:37am

What's the content of the template?

Over here, I know I would invariably mistype "OPMLTemplates" when I intended "OPMLtemplates", and then spend 45 minutes wondering what's wrong.  Just saying...  :-[

Title: Re: OPML (was: Tinderbox for iPad)
Post by Mark Anderson on Apr 26th, 2011, 11:37am

Ah, if you're picking up titles and not text (i.e. $Name data but not $Text data) it's likely because that's what you asked TB to do via the 'OMPL-Item" template. Can you post the code for that template (i.e. not its output)?

In its very original form, OPML knows nothing about 'text'. An outline item has a title (equating to TB's $Name data). It seems custom has since embraced Omnigroup's OPML addition of a non-standard [sic] attribute called '_note' to hold descriptive data ($Text) about that item. Tb will read and map OPML '_note' attribute data to $Text.

FWIW, the non-standard attribute "_status" doesn't map (inbound) to $Checked as it might logically do. That's as at v5.8.1, but it will do soon, in which case on export you set '_status" value to ^value($Checked)^. Oh, and don't forget to turn on checkboxes in oultine view so you get to see/use the checkbox data. Map view user? Write an agent to set a tick/cross $Badge (or colour, or whatever) depending on the value of $Checked, including code so if you change the Map display attribute for 'checked' stated, it in turn writes to $Checked so when your OPML exports the check marks are correct in whatever your next OPML tool is.

Title: Re: OPML (was: Tinderbox for iPad)
Post by Matt Cawood on Apr 28th, 2011, 3:04am

Sorry about the slow reply - wireless broadband has gone screwy, a penalty of remote living.

Code for OPML-Item:


Code:
^if(ChildCount)^^if(Text)^<outline text="^opmlEncode(^value($Name)^)^" _note="^opmlEncode(^value($Text)^)^">^else^<outline text="^opmlEncode(^value($Name)^)^">^endIf^
^children(/Utilities/Templates/OPMLtemplates/OPML-Item)^
</outline>^else^
<outline text="^opmlEncode(^value($Name)^)^"/>^endIf^

Title: Re: OPML (was: Tinderbox for iPad)
Post by Mark Anderson on Apr 28th, 2011, 3:48am

The answers there in the template.  As it stands, $Text is only exported to the '_note' attribute if there are children. I think you need this instead:


Code:
^if(ChildCount)^<outline text="^opmlEncode(^value($Name)^)^"^if($Text)^ _note="^opmlEncode(^value($Text)^)^"^endIf^>
^children(/Utilities/Templates/OPMLtemplates/OPML-Item)^
</outline>^else^
<outline text="^opmlEncode(^value($Name)^)^"^if($Text)^ _note="^opmlEncode(^value($Text)^)^"^endIf^/>^endIf^

Which, laid out in more readable form is this:

^if(ChildCount)^
  <outline text="^opmlEncode(^value($Name)^)^"^if($Text)^ _note="^opmlEncode(^value($Text)^)^"^endIf^>
     ^children(/Utilities/Templates/OPMLtemplates/OPML-Item)^
  </outline>
^else^
  <outline text="^opmlEncode(^value($Name)^)^"^if($Text)^ _note="^opmlEncode(^value($Text)^)^"^endIf^/>
^endIf^


For your template copy the code in the 'code' section above - including the trailing line return as it will give better layout in your OPML.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.