Bug 831295

Summary: running "updatebook" fails with a list of Invalid Topic Title errors
Product: [Other] Topic Tool Reporter: Joshua Wulf <jwulf>
Component: FUDCon Docs HackAssignee: Joshua Wulf <jwulf>
Status: CLOSED CURRENTRELEASE QA Contact: Joshua Wulf <jwulf>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: lcarlon, topic-tool-list
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-08 14:38:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joshua Wulf 2012-06-12 17:35:12 UTC
Symptom:

When "updatebook" is run after a book has been edited, it fails with a list of errors like this:

ERROR: Line 53: Invalid Topic! Existing topic title doesn't match.
       -> Specified: "Try before you buy": Live CD and USB [225]
       -> Topic 225: Try Fedora easily with no risk: Live CD and USB
ERROR: Line 56: Invalid Topic! Existing topic title doesn't match.
       -> Specified: Create Live USB [238]
       -> Topic 238: Create Live USB on Microsoft Windows
ERROR: Line 64: Invalid Topic! Existing topic title doesn't match.
       -> Specified: The Red Hat Package Manager - rpm [179]
       -> Topic 179: The RPM Package Manager

Cause: 

The topic titles in the database and the names in the content spec must match, to ensure that reused topics are actually the ones that you mean to use. Imagine a situation where you reuse a topic, but accidentally enter the wrong topic ID. Your book would not come out as expected. A validation check when the spec is pushed ensures that what you want is what you get.

After extensive editing, however, it is common that topic titles are refined, changed, or fixed through editing. In this case you might wish to accept all changes into your content spec automatically.

Fix: 

There is a --permissive mode that rewrites all topic titles in your content spec to match the current titles in the database. Use this with care. 

To activate this option, add the option in the bin/updatebook script, like this:

 java -jar $HOME/csprocessor.jar push -p --config $HOME/csprocessor.ini --host http://127.0.0.1:8180/TopicIndex -u writer

Comment 1 Joshua Wulf 2012-06-12 17:47:22 UTC
Usually you will want to run the updatebook script first, check the error messages, then run in permissive mode.

In that case, add this to the updatebook script:

 java -jar $HOME/csprocessor.jar push $1 --config $HOME/csprocessor.ini --host http://127.0.0.1:8180/TopicIndex -u writer

Now you can call updatebook with -p, like so:

updatebook -p

to get permissive mode (rewrite all topic titles in the content spec with titles from the database)

and:

updatebook

to get an error report about topic titles that have been changed in the database since the content was last pushed.