Bug 744661

Summary: RFE: Add priority option to set different list order for books
Product: [Community] Publican Reporter: Deon Ballard <dlackey>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.8CC: dmacpher, jfearn, mhideo, mmcallis, rlandman+disabled, rlandman
Target Milestone: 3.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-31 03:11:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 820023    

Description Deon Ballard 2011-10-10 03:31:08 UTC
Mike Hideo-Smith had a nifty idea when we were talking last week about adding a priority or weight that would allow books to be listed on the site index an another order, other than alphabetical.

For example, if I have these three guides, they're always going to be listed in this order:

Admin guide
Developers SDK
Install Guide
Release notes
Tuning guide

But maybe I want them listed in this order:

Release Notes
Install guide
Admin guide
Tuning guide
Developers SDK

It would be nice to have something that can indicate the priority or order number of a guide.

Comment 1 Jeff Fearn 🐞 2011-10-10 04:38:01 UTC
My concern is that the user has no idea what your intentions are so for them the list is unordered. This would be a pretty horrible user experience. How would that be addressed?

Comment 2 Deon Ballard 2011-10-26 16:48:07 UTC
*** Bug 747455 has been marked as a duplicate of this bug. ***

Comment 3 Deon Ballard 2012-02-13 14:46:02 UTC
Jeff, 

Actually, the experience is just the opposite (cf. the recent comments about the comments on topic organization).

Back when the docs site was completely user-defined and I could order books however I wanted on an index, a couple of projects requested two things:

1. That I reorder docs so (at the least) things like install, release notes, and FAQ were at the top so they were the first things people saw

2. That there were labels to show "categories" like installation, administration, and development

Having the install docs at the top makes sense because it is the first thing people do. Grouping admin-related docs and development-related docs also makes sense (although labels help there).

Straight alphabetical lists don't make sense unless you're already familiar with the doc set and know to scan.

Comment 4 Jeff Fearn 🐞 2012-03-14 07:28:17 UTC
Added sort_order parameter which overrides book name when values differ. Defaults to 50.

QA-NOTE: this breaks backwards compatibility with Publican 2 database structure. Need to document migrate_site action.

Pushed To ssh://git.fedorahosted.org/git/publican.git
   403d79f..ec0e254  master -> master

Comment 5 Michael Hideo 2012-06-08 01:41:39 UTC
setup publican website, install two books from the same product and version, then update book which is lower down in alpha order, use the new sort order parameter to sort it higher in alphabetical order.

Comment 6 Dan Macpherson 2012-06-16 04:08:30 UTC
Sort order remains unchanged.

Reproduction steps:
1. Installed and configured publican website
2. Created two books: Install and Admin
3. Set Install sort_order:1, Admin sort_order:2 in publican.cfg for each
4. Built and installed books to website
5. Sort order is Admin then Install

Have also tried Install sort_order:2 and Admin sort_order:1 and still have same results.

Checked site db using sqliteman and saw that sort_order for each book is set to 50 for both.

Bug fix failed. Setting this back to ASSIGNED.

Comment 7 Dan Macpherson 2012-06-16 04:53:26 UTC
^^ Checked publican-3.0-0.fc17.t180.noarch on Fedora 17

Comment 8 Jeff Fearn 🐞 2012-06-24 07:31:21 UTC
sort_order wasn't being set when a book was installed, fixed it.

To ssh://git.fedorahosted.org/git/publican.git
   4a5866f..a8b827b  master -> master

Comment 9 Ruediger Landmann 2012-07-04 06:23:43 UTC
Still not working for me on Build t197; I've tried with both old- and new-style sites.

Comment 10 Ruediger Landmann 2012-07-04 07:23:25 UTC
More info: I uninstalled, rebuilt, and reinstalled the books.

Comment 11 Jeff Fearn 🐞 2012-07-05 06:02:05 UTC
I fixed the manual install but not the RPM install ... oops.

Fixed RPM install.

To ssh://git.fedorahosted.org/git/publican.git
   612a8db..c434b2c  master -> master

Comment 12 Ruediger Landmann 2012-07-10 02:28:57 UTC
Now, with 

sort_order: 10

set in one book and

sort_order: 5

set in another

I get an error during %post when I install the second book:


Transaction Summary
=========================================================================================================================================================
Install  1 Package

Total size: 1.4 M
Installed size: 1.4 M
Downloading Packages:
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : Red_Hat_Enterprise_Linux-Power_Management_Guide-6-web-en-US-1.0-2.fc17.noarch                                                         1/1 
Use of uninitialized value in numeric comparison (<=>) at /usr/share/perl5/vendor_perl/Publican/WebSite.pm line 1670, <FH> line 10.
Use of uninitialized value in numeric comparison (<=>) at /usr/share/perl5/vendor_perl/Publican/WebSite.pm line 1670.
Use of uninitialized value in numeric comparison (<=>) at /usr/share/perl5/vendor_perl/Publican/WebSite.pm line 1670.
Use of uninitialized value in numeric comparison (<=>) at /usr/share/perl5/vendor_perl/Publican/WebSite.pm line 1670.
  Verifying  : Red_Hat_Enterprise_Linux-Power_Management_Guide-6-web-en-US-1.0-2.fc17.noarch                                                         1/1 

Installed:
  Red_Hat_Enterprise_Linux-Power_Management_Guide-6-web-en-US.noarch 0:1.0-2.fc17

Comment 13 Jeff Fearn 🐞 2012-07-11 06:11:48 UTC
Fixed comparison code.

To ssh://git.fedorahosted.org/git/publican.git
   4078254..11fd56c  master -> master

Comment 14 Ruediger Landmann 2012-07-11 06:21:33 UTC
Verified in build t207 -- working as advertised! :)