Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Splitting and Merging Documents (Read 5119 times)
Ted Goranson
Full Member
*
Offline



Posts: 141
Virginia Beach VA
Splitting and Merging Documents
Nov 20th, 2010, 2:52am
 
Mark Andersen has a thorough list of what happens when various things are pasted and dragged to various places. But it does not address this, I think.

I am starting an ambitious tbx file. It has roughly two parts which over time will be deeply interconnected but for several months I expect no links between these halves. But I do expect sharing of prototypes.

One half will initially focus on export programming while the other on map-centric actions.

Can I set the document up, then copy just the export section for experimenting, then paste it back? I suppose this is the same as asking:

Suppose I define prototypes in a single document, then copy them to two separate docs and enrich the documents independently without changing the prototypes. Can I paste them together (minus one set of prototypes) and have the note-prototype relationships anneal?
Back to top
 
 
WWW TedGoranson   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Splitting and Merging Documents
Reply #1 - Nov 20th, 2010, 9:00am
 
How large will the document be in 6 months?

Since the two portions share prototypes, I think it may be simpler to keep them together. But if the document will grow very large, very quickly, the time spent reassembling the parts might be less than the time spent loading & saving things you don't need at the moment.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Splitting and Merging Documents
Reply #2 - Nov 20th, 2010, 12:02pm
 
Ted the bit to watch - as alluded to in aTbRef - is that although notes in file A and file B might use same named prototypes (those in B might even have originated in A), when merging notes from B into A, they do not maintain their prototype even to the necessary prototype is still there. I assume this is because the prototype 'link' for B's notes are actually to a note ID that doesn't exist in A - even though a prototype of the same screen name does exist. he result is the imported noes have prototype set to none.

So on re-merging your file you'll need to manually re-set the prototypes. Given the last point above, if prototype allocation is not self-evident, I'd make a custom string attribute $OldPrototype. Add this to both. Now we'll assume B's notes are merging to A. In B make and agent to find all notes where $Prototype has a value. Use the agent action to store this value in $OldPrototype. Now when B's notes are added to A, do the reverse in A: find all notes with a value in $OldPrototype (i.e. newly imported notes) and apply each note's value for that attribute to its $Prototype.

A bit of a bore but it's the simplest workaround I can see, unless/until TB supports auto-mapping of prototypes for imported notes. I think the latter's a more complex task than it sounds as, for prototype allocation can occur through complex chains of inheritance - something a trivial test can easily overlook.

One other angle on this. If you know you'll be doing such split/merge operations, it will pay to design your prototype inheritances such that they are as simple as possible and thus easier to rebuild if necessary.
Back to top
 
« Last Edit: Nov 20th, 2010, 12:04pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ted Goranson
Full Member
*
Offline



Posts: 141
Virginia Beach VA
Re: Splitting and Merging Documents
Reply #3 - Nov 20th, 2010, 12:05pm
 
All this reflects my thinking. But I am looking for some information to calculate with.

Is it the case that if I paste one outline (minus its prototypes) into another, and there are common prototypes in both files, then the pasted outline’s notes will connect with the identically named prototypes in the parent doc?

If this is the case, then repasting will trivial, no?
Back to top
 
 
WWW TedGoranson   IP Logged
Ted Goranson
Full Member
*
Offline



Posts: 141
Virginia Beach VA
Re: Splitting and Merging Documents
Reply #4 - Nov 20th, 2010, 12:07pm
 
Sorry Mark A.

I replied to Mark B without seeing your information. That answers the question.

Thank you.
Back to top
 
 
WWW TedGoranson   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Splitting and Merging Documents
Reply #5 - Nov 20th, 2010, 12:40pm
 
BTW - and just in case you try - you can drag or paste B's prototype(s) with it's notes. A drag (not sure about paste) is limited to 250 notes. After the past you may end up with 2 prototypes of the same name (TB supports name dupes) with A's notes linking to A prototype and the ex-B notes linking to the prototype they brought with them. Thus the method I outlined above is probably the easiest/safest for merging data using common prototypes.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Stephane
Full Member
*
Offline



Posts: 71
@istib
Re: Splitting and Merging Documents
Reply #6 - Nov 20th, 2010, 12:56pm
 
thanks for pointing out the 250 notes limit, that answers some of my puzzlement recently. why, though?

regarding the above issue, if the Prototypes in both files have the same note ID (in the TBX file) - for instance, because both files originate from the same custom template file -, surely preserving the prototype links to the same note ID when dragging notes from one file to another shouldn't be too hard to implement?

This addition would heavily relieve my dependence on single file use (>22mb as we speak, hence loading and agent refreshing taking a considerable time)
Back to top
 
« Last Edit: Nov 20th, 2010, 12:56pm by Stephane »  
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Splitting and Merging Documents
Reply #7 - Nov 20th, 2010, 3:41pm
 
Why 250?  Don't know. It used to be 50. Having no limit will end up with someone dragging more date than their system can cope with and baliming TB for subsequent weirdness - so limits make sense.  If you think it should be higher, I'd suggest contacting Eastgate with a case for a larger limit.

Quote:
regarding the above issue, if the Prototypes in both files have the same note ID (in the TBX file) - for instance, because both files originate from the same custom template file -, surely preserving the prototype links to the same note ID when dragging notes from one file to another shouldn't be too hard to implement?


I'd assume that note B's notes when dragged to A get allotted a new ID, un-allocated in A; otherwise, a naming collision could occur. I, as the user may be certain the notes/prototypes, but TB doesn't and must act with prudence. People might be pretty upset if they dragged in notes that then overwrote data in A just because they had the same ID the original one in B. In other words, the scenario is more complex than one might assume. The are lots of potentially nasty edge cases once you move past anything but the simplest scenario.  Prototype X might seem the same in A and B but B's copy might inherit from prototype Y and... well, you get the picture. Though it would be nice if TB could magically merge prototypes, as a beta-tester I'm regularly reminded how things I thought were simply strictly aren't - this is just such.

TBX size. There's no fixed limit but if sheer size causes a slow down then I think it's a gentle hint suggesting either upgrading your hardware or splitting the TBX. The method outlined above is not complex, can be applied to a split as well as a merge and needs to be done only once.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Stephane
Full Member
*
Offline



Posts: 71
@istib
Re: Splitting and Merging Documents
Reply #8 - Nov 20th, 2010, 4:04pm
 
Point well taken.
Your method of assigning prototype names to a temporary attribute is very clever. It'll do for now. Thanks
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print