*Research Planner Technical Nuts & Bolts

Writing and using plugins for Version 5 and above.
User avatar
tatewise
Megastar
Posts: 16051
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Research Planner Technical Nuts & Bolts

Postby tatewise » 19 Nov 2018 14:18

Another approach to planning and tracking research (16402) is interesting but I have some technical issues.
Since it is all about managing Tasks might Task Planner or even Task Manager be a better overall name?
That would make it more generically applicable to any Tasks and not just Research.

Typos in Knowledge Base > Status and Priority:
1st paragraph ends with an unmatched parenthesis ).
Last paragraph Source and/or Priority should say Status and/or Priority.

Throughout, instead of Fact tab, it should refer to Facts tab.

All the links to #Customisation are broken as the section headline is now Customising the Approach.
(That is a snag of those forms of hyperlink ~ they must keep in step with changes to section headlines.
Whereas hyperlinks to pages automatically adapt to new page headlines as long as the underlying page name is retained.)

I found the single page of advice and the long left-hand Table of Contents awkward to navigate back and forth.
Does it need sub-pages such as Research Concepts, Using the Tools, Installation & Download, Customising the Approach?

I have not had time to experiment with any of the tools yet.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Research Planner Tehnical Nuts & Bolts

Postby ColeValleyGirl » 19 Nov 2018 15:13

Mike, thanks.

Typos and links (I hope) all fixed.

Re name, I'm pretty focussed on planning Research (I wrote a whole app for it -- GenQuiry). Not sure Task Manager is right as it doesn't manage Tasks; Task Planner might be OK until we get to More Complex Planning ... I shall think.

I wish it was possible to keep the Table of Contents in line with the main content, so that it was always in view -- I agree, it's a large chunk of text (cut and pasted from a more structured Help File). Sub-pages would be easier but of course it may not be of the least interest to anyone anyway.

User avatar
tatewise
Megastar
Posts: 16051
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Research Planner Tehnical Nuts & Bolts

Postby tatewise » 19 Nov 2018 18:21

That is why I prefer my Plugin Help & Advice structured pages integrated with the FHUG Knowledge Base .
They are the one stop shop either for FHUG users, or from the Plugin itself.
Some of my Plugins have a separate IUP window, but others simply invoke the FHUG Knowledge Base URL.
I am sure you are familiar with the former, and Clean Living Persons is an example of the latter with the URL in the Plugin Store page and via the Plugin Help & Advice button.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 19 Nov 2018 19:05

As you know I prefer a help file structure -- ideally delivered as html but the knowledge base can't host that. Heyho...

User avatar
Jane
Site Admin
Posts: 7630
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Another approach to planning and tracking research

Postby Jane » 20 Nov 2018 08:07

Personally I like the single page view as it makes it easier to get a good overview. The helpfile works well with the plugin and has the advantage that it works "offline", so perhaps have the guide in the KB as a single page and use the helpfile with the plugin.

I like the design of the Plugin nice and simple and clean to look at.

I'll look at locking the TOC but I suspect it will only be practical for the "desktop" view.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 08:34

Thanks, Jane. Re ToC, don't put too much effort into it -- as you say, once people have decided to use the plugin, the Help file will get the most use.

User avatar
Valkrider
Megastar
Posts: 1015
Joined: 04 Jun 2012 19:03
Family Historian: V6.2
Location: Spain
Contact:

Re: Another approach to planning and tracking research

Postby Valkrider » 20 Nov 2018 09:32

Helen

I tried to install the plugin. On first run it wanted to install and additional module, I OK'd that and then get this popup error message.
error-task.JPG
error-task.JPG (18.91 KiB) Viewed 1728 times

If I try and re-run the plugin this error pops up immediately.

Any thoughts?

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 10:26

Colin,

It looks to me as if:

    either the required module (pl) isn't being downloaded
    or the Help file isn't being downloaded

Can you check ProgramData > CalicoPie > FamilyHistorian > Plugins and let me know if there's a directory in there called pl please? That will help me know which it is.


I'm assuming you have Internet connectivity?

User avatar
Valkrider
Megastar
Posts: 1015
Joined: 04 Jun 2012 19:03
Family Historian: V6.2
Location: Spain
Contact:

Re: Another approach to planning and tracking research

Postby Valkrider » 20 Nov 2018 10:31

Internet fine.

Yes I do have the pl directory with 38 files in it.

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 10:34

OK, the it's the help file. Can you try opeing this url in a browser (should download the help file):

https://www.fhug.org.uk/wiki/lib/exe/fe ... lanner.chm

You don't have to save it -- I just want to know if you can access it.

User avatar
Valkrider
Megastar
Posts: 1015
Joined: 04 Jun 2012 19:03
Family Historian: V6.2
Location: Spain
Contact:

Re: Another approach to planning and tracking research

Postby Valkrider » 20 Nov 2018 10:39

Yes my browser can see it and offers to download it.

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 10:45

OK, let me think...

User avatar
tatewise
Megastar
Posts: 16051
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Another approach to planning and tracking research

Postby tatewise » 20 Nov 2018 11:43

That COM exception can arise for all manner of Internet difficulties, including the FHUG site being down or slow.

So my Plugins trap that sort or error using pcall( ) as used in Knowledge Base > Check Version In Store (code snippet).

Code: Select all

local function httpRequest(strRequest)                     -- Luacom http request protected by pcall() below
   local http = luacom.CreateObject("winhttp.winhttprequest.5.1")
   http:Open("GET",strRequest,false)
   http:Send()
   return http.Responsebody
end -- local function httpRequest

      local strRequest ="http://www.family-historian.co.uk/........"
      local isOK, strReturn = pcall(httpRequest,strRequest)
      if not isOK then                              -- Problem with Internet access
         fhMessageBox(strReturn.."\n The Internet appears to be inaccessible. ")
         return nil
      end

Then depending how that is organised it is possible to identify exactly which download is failing.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 11:52

Thanks, Mike, but trapping the error is the easy bit -- the plugin will still fail (with an error message that says, effectively "Duh -- can't download a file so I'm going to exit") if the file(s) it needs can't be downloaded. I need to rework some logic...

User avatar
Valkrider
Megastar
Posts: 1015
Joined: 04 Jun 2012 19:03
Family Historian: V6.2
Location: Spain
Contact:

Re: Another approach to planning and tracking research

Postby Valkrider » 20 Nov 2018 11:55

Maybe as a work around if the help file downloads from the url just tell users where to copy it to?

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 11:56

Colin, there's a config file to create as well. Let me look at the logic....

User avatar
tatewise
Megastar
Posts: 16051
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Another approach to planning and tracking research

Postby tatewise » 20 Nov 2018 12:52

Helen, I found this type of Internet connection problem very difficult to resolve satisfactorily.
The snag is it can be transient and can depend on the domain involved.
Sometimes I get the problem with the FHUG website or Family Historian website even though the Internet connection is good.
So testing the Plugin by perhaps simply unplugging the Internet does not necessarily proved the script is correct.
What trapping with pcall() does allow is a meaningful message to the user and a repeat attempt after a delay, rather than crashing with the generic COM Exception error.
It can also identify exactly which URL domain & file caused the problem, which may not help the user, but gives you useful feedback.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 12:56

Mike, I shall try again: the work I need to do is on the startup logic so that it fails safe. Trapping the error is the least of my worries.

User avatar
tatewise
Megastar
Posts: 16051
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Another approach to planning and tracking research

Postby tatewise » 20 Nov 2018 13:37

I noticed one minor startup glitch.
Running the Plugin twice without closing and reopening FH to install the Fact Set resulted in a second .fhf file being downloaded with a similar name suffixed with (2). So presumably the Plugin is only checking the Task fact exists rather than the .fhf file exists.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 13:58

Yes, it's checking that the Task fact exists -- there's no way of testing for the .fhf file other than ferreting around in ProgramData\Calico Pie\Family Historian\Fact Types\Custom (and so relying on undocumented data structures...) 42 years of programming tells me what a good idea that is not.

Should I remove the option for the user to download the .fhf file manually? I don't think so.

I'll have a look at the logic while I'm working on the other problem, as I seemingly can't rely on the user following the instruction that they ought to close FH before running the plugin again.

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 16:38

Colin, Mke -- try the version now available for download from the Knowledge Base.

Colin, it fails safe(r) if the downloads fail -- at least you have the option of doing all of them manually.

Mike, it tests for the existence of the Research Planner Fact Set in the Program Data directory structure (much as I hate to make assumptions about the structure of that Directory) , but it will still have problems if somebody is using a different Fact Set and hasn't completed the installation. (It will not be a problem if and when Calico Pie fixes the problem I reported about new fact sets not being recognised without a restart unless they're Imported).

User avatar
tatewise
Megastar
Posts: 16051
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Another approach to planning and tracking research

Postby tatewise » 20 Nov 2018 16:46

I use fhGetContextInfo("CI_APP_DATA_FOLDER") and then drill down to the Family Historian\Fact Types\Custom folder in several Plugins. As far as I can recall none of the existing folders have ever changed since the inception of FH, and it would be difficult to do so, and maintain backward compatibility with earlier versions, and with my Backup and Restore FH Settings Plugin. So I think that folder hierarchy will never change.

Anyway your Plugin downloads files to Family Historian\Plugin Data\Research Planner.dat, so you could check there for the Research Planner.fhf file.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 16:48

MIke, yes I could but that wouldn't cater for the users that download manually, unfortunately.

User avatar
tatewise
Megastar
Posts: 16051
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Another approach to planning and tracking research

Postby tatewise » 20 Nov 2018 17:19

Well it is working better now, and the Plugin can't cater for everything users might do.

BTW: Line 926 has a typo for /n/n that should be \n\n
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 1139
Joined: 28 Dec 2005 22:02
Family Historian: V6.2
Location: Cirencester, Gloucestershire
Contact:

Re: Another approach to planning and tracking research

Postby ColeValleyGirl » 20 Nov 2018 17:45

Thanks, Mike.


Return to “Plugin Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests