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 2 
Send Topic Print
attribute= list of a particular prototype? (Read 10904 times)
Steve Scott
Full Member
*
Offline



Posts: 169

attribute= list of a particular prototype?
May 29th, 2014, 12:16pm
 
I'm not sure if I am using the correct vocabulary, but here is what I'm thinking about doing:

I have created a prototype called themes and have created a list which includes peace, hope, justice, love, etc.  

I have another list of people and one of the key attributes for these people is "themes"

When adding the the themes to a person, is it possible to have those themes pop up?  I want to do this to create consistency.

For example, when editing Martin Luther King Jr. I would have a list of all available themes pop up and I would select "peace" and "justice"

I would then create an agent for the theme of peace which would show all of the people related. . . Gandhi, MLK, etc.

Thanks,
Steve



Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: attribute= list of a particular prototype?
Reply #1 - May 29th, 2014, 1:16pm
 
When you say a prototype with a list, my hunch is you've maybe put the words in the note's $Text.

Let's assume $Themes is a list - as a topic might relate to more than one theme. Next, we want a Set-type attribute rather than a List-type, as a Set de-duplicates values. That is, in any given note we will only see a given theme listed once even if added twice.

Now we have our $Themes but want to pre-populate the list so when adding a value it will already be in the value pop-up list.

Simply add a note, best in a back of house area of the doc with a self-explanatory name. In that note, add $Themes as a key attribute. Now you'll add all the names in the list. The quickest way is to write out the list in the note's text, one value per line. Then use a rule to populate the note's $Themes:

$Themes=$Text.replace("\n+",";")

To save lots more typing, see a fleshed out  demo file of the process.
Back to top
 
 

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



Posts: 169

Re: attribute= list of a particular prototype?
Reply #2 - May 29th, 2014, 2:38pm
 
Hi Mark,

Thanks for the demo file.  That looks great.  I was thinking of having the themes as a part of the main outline— they were not in a note field.  However, you got me thinking, the themes could be agents finding things that had the attribute of the particular theme.

Method #1

1. People

1.1. Gandhi
1.2 MLK

2. Themes
2.1 Peace
   2.1.1 Gandhi (alias)
   2.1.2 MLK (alias)

2.2 Justice

Method #2

I suppose the other approach is

1. People

   1.1. Gandhi
   1.2 MLK

2. Themes
   2.1 Peace (agent)
      2.1.1 Gandhi
      2.1.2 MLK

Is method #2 better than #1 or does this just show how flexible TBX is?  Thanks for the demo file.  I'll start trying to figure that out.

Thanks,
Steve
Back to top
 
« Last Edit: May 29th, 2014, 2:39pm by Steve Scott »  
  IP Logged
Steve Scott
Full Member
*
Offline



Posts: 169

Re: attribute= list of a particular prototype?
Reply #3 - May 29th, 2014, 3:15pm
 
Hi Mark,

I tried to follow the directions on the demo file.

After adding more items to the list of themes, the list becomes flat.

instead of

peace
love
compassion
justice

the pop up list reads:

peace love compassion justice

Thanks for any help.

Steve
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: attribute= list of a particular prototype?
Reply #4 - May 29th, 2014, 5:19pm
 
Odd. Best guess is you made a String-type attribute and not a Set-type. The demo has everything you need.
Back to top
 
 

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

User - not staff!

Posts: 5689
Southsea, UK
Re: attribute= list of a particular prototype?
Reply #5 - May 29th, 2014, 5:22pm
 
Looking at your first reply above, I'm confused as it seems to be doing something completely different to the original concept. What are you trying to do, if not seed the value choices in a list?

List are lists - they don't have hierarchy/  If you're wanting a single list with sub-lists within it, then I don't think TB can do that.
Back to top
 
 

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



Posts: 169

Re: attribute= list of a particular prototype?
Reply #6 - May 29th, 2014, 11:46pm
 
Hi Mark,

Demo file:  I recorded a movie showing what I am doing and how everything ends up on one line.  The movie is here:   https://dl.dropboxusercontent.com/u/916107/web_forum/tinderbox_list.mp4

I guess I'm making things too complicated again.  This thread is drilling down pretty deep.  I think I'll back up and explain in a new thread what I am trying to accomplish.

Thanks,
Steve
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: attribute= list of a particular prototype?
Reply #7 - May 30th, 2014, 3:22am
 
Ah, I think I incorrectly the state of the RuleDisabled tick box in my explanatory note, having it ticked when it should be ticked and vice versa. I've corrected the instructions and re-uploaded the file (same name) - get it here.

Basically a rule is looking at the current note's $Text and using that to populate the key attribute $Themes. Whilst you're editing $Text you don't really want the rule running.  Making $RuleDisabled a key attribute makes this easier to do in this context. The opening and closing of the note (not pertinent in TB6) is the only way in v5 to 'refresh' the text window view on demand - otherwise you have to wait and TB may/may not update it.

Sorry about that confusion.

As to the wider sorry, $Themes is a set. So any note can be 'tagged' with one or more theme values.  note TB doesn't have 'closed' lists - you can add any new value you like and TB has no means to stop that. However, if you 'seed' the value list via the above method and only then apply values to your content via the pop-up list you simulate a closed list as you can only pick from displayed values.

Can agents find notes using a given theme? Yes, this query will find all notes with the $Themes value of "peace":

$Themes & $Themes.contains("peace")

N.B. for Set and List attributes you can't use the '==' operator to test for a particular value (read why). As .contains() is a slower test than == it makes sense to first find only those notes with any value for $Themes and only then test that group for the desired value.

Be aware that the above query will find your value set-up note so you may want some extra query term to exclude that note from the matches.
Back to top
 
 

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



Posts: 169

Re: attribute= list of a particular prototype?
Reply #8 - May 30th, 2014, 11:13am
 
Hi Mark,

Thanks for hanging in there with me. . . I'm trying to follow the directions, but I am getting the same results.  The list ends up on one line.  Am I missing something as I follow the directions?

Here is a video of me trying to follow along:  https://dl.dropboxusercontent.com/u/916107/web_forum/tinderbox_list2.m4v

BTW, I really like this method to have a consistent set of themes.

Steve


UPDATE

I got it working by putting this in the note:  justice; love; hope; unity;

instead of

justice
love
hope
unity
Back to top
 
« Last Edit: May 30th, 2014, 11:39am by Steve Scott »  
  IP Logged
Steve Scott
Full Member
*
Offline



Posts: 169

Re: attribute= list of a particular prototype?
Reply #9 - May 30th, 2014, 1:14pm
 
I have created a TBX file that has three lists:

1) Religion (it works)
2) Unit (it doesn't work)
3) Tags (it doesn't work)

I've gone through every setting and don't see a difference between the three notes.  I am having trouble getting consistency.  

The rules compared:
$religion=$Text.replace("\n+",";")
$unit=$Text.replace("\n+",";")
$tags=$Text.replace("\n+",";")

The demonstration file I have created is here: https://dl.dropboxusercontent.com/u/916107/web_forum/list_test.zip

Thanks for any thoughts!
Steve
Back to top
 
« Last Edit: May 30th, 2014, 1:16pm by Steve Scott »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: attribute= list of a particular prototype?
Reply #10 - May 30th, 2014, 1:14pm
 
Aha, works in v5 but in v6 it's broken. I'll let Eastgate know.  For now, leave the rule off and just add all the entries into the KA box one by one (N.B. separate each item with a semi-colon). Or open the TBX in v5, let the process run, turn off the rule and then close and re-open in v6. Sorry about that!
Back to top
 
 

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



Posts: 169

Re: attribute= list of a particular prototype?
Reply #11 - May 30th, 2014, 1:19pm
 
Mark, thanks for helping me figure that out.  I couldn't figure out what was happening!  I'll try to open it in TB5.  What is the KA Box?  Is that the attribute field?

Thanks,
Steve
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: attribute= list of a particular prototype?
Reply #12 - May 30th, 2014, 1:20pm
 
Sorry, KA = 'Key Attribute', i.e. showing an attribute in the (optional) table at the top of a text window/pane.
Back to top
 
 

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



Posts: 169

Re: attribute= list of a particular prototype?
Reply #13 - May 30th, 2014, 5:31pm
 
Thanks, Mark.  Is there any way to delete all past entries?  I only want to use the pop up list of pre-defined religions or themes.  Everytime I record a new combination that becomes a new option.  Over time this is going to get out of control.



Thanks,
Steve
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: attribute= list of a particular prototype?
Reply #14 - May 30th, 2014, 5:39pm
 
I'll wager all those bad terms only exist in the note you used to created them.  Delete the note (and by all means make a new one) but you should find the bad stuff is gone.

Meanwhile, a little bird tells me this issue should be fixed for the next release of v6 (which I suspect is likely days rather than months away).
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1 2 
Send Topic Print