Report of "Find Referrers" for all topics

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Bob MacLeod
Posts: 16
Joined: Thu Dec 14, 2006 9:53 pm

Report of "Find Referrers" for all topics

Unread post by Bob MacLeod »

In several reports (such as the Full Report with Image References), I can view all of the links inside that topic. But I cannot see any topics that the selected topic is referenced by.

I know I can select the "Find Referrers" button and see both *Referenced by* and *Links to*. That's very helpful. But ideally I need a report that does that for *ALL* topics at once.

We are overhauling our entire help manual from top to bottom to start using translation. We have over 400 topics in our manual. I need a report that tells me not what links there are going out from each topic, but what topics are linked. For example, we have more than 150 snippets, and I have no way to know which of those snippets are actually inserted in another topic. They could actually be orphans. I know that I can select the Find Referrers button, but that is painstaking when doing it for hundreds of

Is there a report that will list all of my topics, and then tell me for each topic, which others topics have incoming links to them?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Report of "Find Referrers" for all topics

Unread post by Tim Green »

Hi Bob,

At the moment the reports do not generate this, probably because of the time it would take. I have asked our developers if it would be possible to add this feature. I'll get back to you here when I have details. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: Report of "Find Referrers" for all topics

Unread post by Simon Dismore »

Bob MacLeod wrote:In several reports (such as the Full Report with Image References), I can view all of the links inside that topic. But I cannot see any topics that the selected topic is referenced by.
If you have regex skills in-house you could probably extract the "refers to" data from the long report and invert it. As far as I can see in the HTML output the refer's topic ID is matched by (name="\w*") then some stuff, then zero or more targets match (href="#\w*"). If you have a regex environment that supports "lookbehind" you can exclude the attributes using (?<=name=")\w*(?=") and (?<=href="#)\w*(?="). I'm no good at this stuff but in theory you could capture the referer id and use it to output pairs of referers and targets, e.g. referer_1→target_1, referer_1→target_2, referer_1→target_3, referer_2→target_1, referer_3→target_1, referer_3→target_2, referer_4→undefined etc. Armed with that you could do anything.
Tim Green wrote:I have asked our developers if it would be possible to add this feature
Tim, if it's not practicable to add more reporting features I wonder whether the long report generator assembles an intermediate data store en route to the HTML output. Perhaps that data could be useful in its raw form?
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Report of "Find Referrers" for all topics

Unread post by Martin Wynne »

Hi Simon,

I'm writing a utility to search the XML files and compile a list of all outgoing and incoming links for all topics*. Mainly for my own use, but Bob may find it answers what he is looking for. I started it some time ago, but this topic has prompted me to get on with it. May have it finished later today.

I prefer the terms "outgoing" and "incoming" to references and referrers, which can get confusing to me -- I found Bob's post difficult to follow. :?

*topic links only, not internet links or file links.

regards,

Martin.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Report of "Find Referrers" for all topics

Unread post by Tim Green »

Hi Martin and Simon,

I discussed this with Alex and his feeling was that it would make the report generation too long for larger projects. With the basic brute force method it would mean scanning all the topic files in the project to get the incoming references to every topic. This is done when you click on Find Referrers in the context menu, but only for the current topic. In the report it would need to be repeated for all topics.

And yes, I know, the faster alternative would be to scan everything once and build a reference list, and then scan that... But given Martin's solution it may be possible sooner rather than later anyway. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Bob MacLeod
Posts: 16
Joined: Thu Dec 14, 2006 9:53 pm

Re: Report of "Find Referrers" for all topics

Unread post by Bob MacLeod »

Thanks for the quick feedback. The biggest help was in learning that I was not missing something (e.g., maybe what I wanted was available and I just did not know it).

Martin--I feel your pain. I had to write that post four or five times to avoid my own confusion... "outgoing" and "incoming" only depends on the point you are standing in. So I muddled through the best I could in writing it.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Report of "Find Referrers" for all topics

Unread post by Tim Green »

Bob MacLeod wrote:"outgoing" and "incoming" only depends on the point you are standing in.
Interesting. I would refer it to the topic in question and if you do that it's quite clear. But it really does depend on your personal perspective. I read a fascinating anthropology article recently explaining that there are cultures that do not have words for "left" and "right", because they don't relate position to the individual. Instead, they always use the equivalents of north, south, east and west -- i.e. they are always referring to relative position with its coordinates as they relate to the environment, not to the individual. Even more interestingly, people in these cultures tend to have much better orientation skills than those in cultures with the left/right concept. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Report of "Find Referrers" for all topics

Unread post by Martin Wynne »

Hi Bob, Tim,

Here's something you might like to try -- download this little utility from: http://85a.uk/hm7_links_finder.exe

I tested it on Tim's HM7 Manual. It was faster than I expected. Tim has some long topic IDs, which are forcing the left column wider:
hm7_links1.png
hm7_links2.png
Sorry it's a bit scruffy. Instructions on the opening page. I'm happy to fix any problems if I can -- I'm not entirely convinced that it finds all the links, but it's a major task to cross-check them all. Can you see any obviously missing Tim?

What's quite handy is that if you copy the text and paste it into a scratch topic in HM7, you get working links to all the topics (Ctrl+click).

I think maybe it needs another column to show all the linked snippets in a topic. The list shows outgoing links from the snippet files, but not which containing topics are creating outgoing links from a snippet. Is it possible to have incoming links to a snippet?

I will do a bit more later today, so that where a topic contains a linked snippet, any outgoing links from the snippet file are added to the topic's outgoing links.

regards,

Martin.
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Report of "Find Referrers" for all topics

Unread post by Tim Green »

Hi Martin,

Very nice -- I measured under 4 seconds for the main Help+Manual help. Are you scanning all the topics once and building a reference list and then searching that?

Grüsse,
Tim
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Report of "Find Referrers" for all topics

Unread post by Martin Wynne »

Tim Green wrote:Very nice -- I measured under 4 seconds for the main Help+Manual help. Are you scanning all the topics once and building a reference list and then searching that?
Thanks Tim,

I have fixed a few bugs and tweaked things a bit. There is a new version at: http://85a.uk/hm7_links_finder.exe

Yes, it's just brute force. Compile a list of outgoing links for each topic, and then search through all the lists to find the incoming links to each topic.

Actually the compilation is very quick. What takes time is the HTML Viewer formatting the list -- which you can see if you watch in the window title bar after clicking Go. This is also why zooming the text size is so slow.

The topic numbers are now shown in both columns. These are simply a list reference, they have no meaning in H&M.

The links in the list are now working to jump to the relevant topic in the list. This is handy for cross-checking the links.

Also, all the links now work when pasted into H&M to access the topics.

I have added some info at the bottom of the list, link counts, unmatched and broken links, etc. :
hm7_links3.png
p.s. things will go wrong if two topics have the same file name, for example in both the Snippets and Invisible folders.

Now I need to do something about the snippets, which ones are used where and which outgoing links are from the snippets and which from the main topic. I'm not too sure yet how best to do that. :)

At present outgoing links from snippets are shown only against the snippet.

regards,

Martin.
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Report of "Find Referrers" for all topics

Unread post by Tim Green »

Hi Martin,
p.s. things will go wrong if two topics have the same file name, for example in both the Snippets and Invisible folders.
That can only happen if the files are added manually in Windows Explorer; HM won't let you create a topic file like that from within the program. (In C# you can create a FileWatcher thread to check for users doing things like that, it would report any changes to files in the project folders immediately. Is that possible in Delphi?)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Report of "Find Referrers" for all topics

Unread post by Martin Wynne »

Tim Green wrote:(In C# you can create a FileWatcher thread to check for users doing things like that, it would report any changes to files in the project folders immediately. Is that possible in Delphi?)
Hi Tim,

All things are possible, but I haven't had any need of such myself. There is Windows API function SHChangeNotify which would help: https://msdn.microsoft.com/en-us/librar ... 62118.aspx

I found a Delphi shareware component based on that which looks very useful: http://delphi.about.com/od/kbwinshell/l/aa030403b.htm

I'm sure Alex knows more about all this than me. :)

regards,

Martin.
DeWayne Rosene
Posts: 45
Joined: Wed Feb 08, 2012 6:34 pm

Re: Report of "Find Referrers" for all topics

Unread post by DeWayne Rosene »

I know this thread is old but it is the only one I found on the subject.

I have a master project containing 35 projects with a total of 2262 topics of which only 96 are snippets. I'm trying to clean up and was looking for a way to xfref the snippets to topics so I can find any snippets that are unused as well as possibly consolidate some that are similar in content.

The standard reports don't accommodate even master projects as far as I can tell and the user written xref program no longer has a working link.

Anyone either have something newer or a copy of the user written xref report?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Report of "Find Referrers" for all topics

Unread post by Tim Green »

Hi Dewayne,

Sorry, but reports and all references still only refer to the current project. There isn't yet any extended reporting that goes through modular project, although that may be added in the future.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply