Bug 702206 - Add TopicID to each output page
Summary: Add TopicID to each output page
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: PressGang CCMS
Classification: Community
Component: Web-UI
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Matthew Casperson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-05 04:05 UTC by Joshua Wulf
Modified: 2014-10-19 22:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-11 05:46:57 UTC


Attachments (Terms of Use)

Description Joshua Wulf 2011-05-05 04:05:54 UTC
Can we please get 

TopicID: [TopicID] 

appended to each output html page, so that we can map the output html to the topics in the database.

Comment 1 Matthew Casperson 2011-05-05 22:47:14 UTC
Done.

Comment 2 Joshua Wulf 2011-05-06 07:10:07 UTC
Sorry, to clarify:

This should not be in the title of the section.

Try this:

inject the following line immediately following the topic <section><title/>:

<para><literal>ID: [[Topic.ID]]</literal></para>

So the output will look like this:

====================================

Add a new Path in Standalone Mode

ID: 3875

Prerequisites
You must meet the following conditions before continuing with this task:

    *
      You must be able to login to the JBoss AS7 Console with an administrator account. 
...etc...
====================================

Ideally we should inject the TopicID at the end of the topic. To do this, you'd need to go the last </section> tag, then check the tag before that, if it is a </section> tag, then go back to that, repeat until you reach a tag before a </section> that is not </section>, this means it is safe to insert the text without breaking the build by following a section with a non-section, then insert:

<para><literal>ID: [[Topic.ID]]</literal></para>

This will put the Topic ID at the end.

The Topic ID there is an internal thing, and might be removed in production. Certainly we do not want it to be an obtrusive feature either internally or in production. It is for reference, so that we can know which topic we are looking at in the output. It doesn't need to call attention to itself, it just needs to be there.

Comment 3 Joshua Wulf 2011-05-06 15:57:50 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=700669#c9

Comment 4 Matthew Casperson 2011-05-10 00:15:35 UTC
Done

Comment 5 Joshua Wulf 2011-05-10 06:43:03 UTC
Too loud. 

Subtle, like this: 

<para>
Report a bug:
<ulink url="https://bugzilla.redhat.com/enter_bug.cgi?product=Topic+Tool&component=web-Topic_Index&comment=Leave%20this%20line%20in%20the%20report.%20Topic%20ID:4092">4092</ulink>
</para>

Comment 6 Matthew Casperson 2011-05-10 20:29:39 UTC
"Report a bug" has to be a section if it is going to appear at the end of the topic. Adding a para to a topic that is a section with child sections (like the overview topics) will break docbook validation.

A section with an empty title is the best workaround for this.

Comment 7 Joshua Wulf 2011-05-10 23:33:15 UTC
A section plays a particular role in formatting the information visually, one that is incompatible with the role of the topic id/bug reporting link.

I'm not sure what tools you have at your disposal while you're building this, but here's some BASIC-style pseudocode that could do it:

LOOP:
Is this tag </section>?
  YES: walk backwards. GOTO LOOP
  NO: Is it </somethingelse>?
    YES: immediately after it write <para>[bugzilla_link]</para>. END

Is that possible?

We really can't have the bugzilla link in a section.

Comment 8 Joshua Wulf 2011-05-10 23:35:21 UTC
LOOP:
Is this tag </section>?
 YES: walk backwards. GOTO LOOP
 NO: Is it </somethingelse>?
   YES: immediately after it write <para>[bugzilla_link]</para>. END
   NO: did I reach the beginning of the document yet?
    YES: this topic has only one section. Write it before the </section> tag. END
    NO: GOTO LOOP

Comment 9 Matthew Casperson 2011-05-11 05:46:57 UTC
This is getting too complicated. If a section is not to be used for displaying links at the end of a topic, then topics need to be redesigned not to used child sections.


Note You need to log in before you can comment on or make changes to this bug.