Bug 1065609 - RFE: Need a way to specify the location of common content
Summary: RFE: Need a way to specify the location of common content
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CSProcessor
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.7
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On: 1016354
Blocks: 1107905
TreeView+ depends on / blocked
 
Reported: 2014-02-15 06:19 UTC by Matthew Casperson
Modified: 2014-08-04 22:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-06-22 21:32:42 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1112027 1 None None None 2023-02-21 23:19:46 UTC

Internal Links: 1112027

Comment 1 Lee Newson 2014-02-16 23:23:05 UTC
If you take a look at <LINK REMOVED>, you can see that this book has a preface that pulls in the Common_Content/Conventions.xml file through a xinclude. So you have 

Introduction
1. Document Conventions (this is the xinclude in the preface)
2. Feedback (this is a section under the preface)

We can't replicate this structure in a content spec. To import these old books while preserving their structure we'll need something like the following:

Preface: Introduction
  Initial Text:
    Introduction [28778]
    XInclude: Common_Content/Conventions.xml
  Feedback [28779]

XInclude: Common_Content/Conventions.xml is the implied conventions xml that is put into the book before the preface. If it is specifically defined in the spec it should be placed in that location instead.

Comment 2 Lee Newson 2014-02-16 23:26:20 UTC
Firstly we'll need a way to disable the default preface inclusion (see BZ#1016354). Secondly I'm not so sure XInclude is the best reference for this as the only content you will be able to include is the Common Content included in the brand. As such this might be a better alternative:

Preface: Introduction
  Initial Text:
    Introduction [28778]
  Common Content: Conventions.xml
  Feedback [28779]

Comment 3 Lee Newson 2014-05-27 00:53:44 UTC
Another possible option would be to do something like:

Preface: Introduction
  Initial Text:
    Introduction [28778]
  Conventions.xml [Common Content]
  Feedback [28779]

Comment 4 Lee Newson 2014-06-04 08:43:38 UTC
Added in 1.7-SNAPSHOT build 201406041757

The format is the same as my last comment. The file name used is pulled from the title, so in "Conventions.xml [Common Content]", "Common_Content/Conventions.xml"  would be the href of the XInclude.

Some things to note:

- Since the common content is on a per user basis we can't validate the content accurately and as such it may break builds if used incorrectly.

- Due to the above report a bug links will also not be included in any "Initial Text" contains that contain Common Content.

- Again due to the first point we cannot know the id of the content so relationships and targets cannot be used with Common Content.

Comment 5 Lee Newson 2014-06-04 08:51:17 UTC
Two additional points I forgot is:

- The name will attempt to be "fixed" so that spaces are replaced by underscores and the name doesn't have to include ".xml". So the following would all be valid: "Legal Notice [Common Content]", "Legal_Notice.xml [Common Content]", "Legal Notice.xml [Common Content]"

- The validator will warn if the file being used isn't a common publican Common Content file.

Comment 7 Matthew Casperson 2014-06-12 05:15:37 UTC
The default preface is just:

Preface: Preface [T1]
  Conventions.xml [Common Content]
  Feedback.xml [Common Content]

The import tool will now import content with this structure, but this results in the error:

ERROR: Line 28: Invalid Preface! No topics or levels in this Preface.
       -> Preface: Preface [T1]

Comment 8 Lee Newson 2014-06-12 05:43:47 UTC
For the above the default preface should be used, however this is still a bug as you may want to include or reorder the default structure.

Comment 10 Matthew Casperson 2014-06-16 20:41:37 UTC
Confirmed that the following Custom Content inclusions will reference a file called Test_Content.xml

Test Content [Common Content]
Test_Content [Common Content]
Test Content.xml [Common Content]
Test_Content.xml [Common Content]

Comment 11 Matthew Casperson 2014-06-16 20:45:49 UTC
When a Common Content reference is added as the sole child under a part, like:

Part: Title
  Test Content [Common Content]

An error is generated:

ERROR: Line 278: Invalid Part! No levels in this Part.
       -> Part: Test

This should be a warning, as it is possible that the common content has the required content to be included under a part.

Comment 12 Lee Newson 2014-06-17 01:57:12 UTC
Fixed in 1.7-SNAPSHOT build 201406171137

Updated the validation rules so that no error or warning will be produced for parts so that it is consistent with the way Common Content elsewhere.

Note: This is currently live on the test/development server.

Comment 14 Matthew Casperson 2014-06-17 03:08:27 UTC
Verified that a part can be saved with only a common content child.

Comment 15 Matthew Casperson 2014-06-17 03:28:26 UTC
The following will not add the Part to the final build

Part: hi
  Chapter: test
    Conventions [Common Content]

But if you add a topic, the part will build

Part: hi
  Chapter: test
    A test topic [1234]
    Conventions [Common Content]

Comment 16 Lee Newson 2014-06-17 04:17:43 UTC
Fixed the build issue in 1.7-SNAPSHOT build 201406171403

There was a check being performed to make sure the level had topics. I've updated this check so it will now look for topics and common content.

Comment 18 Matthew Casperson 2014-06-17 05:44:24 UTC
The following structure

Chapter: test
  Section: test2
    Initial Text:
      Conventions [Common Content]
      a [3737]

produces the following error

ERROR: Line 25: Invalid Section! No levels in this Section and only one Initial Text topic. Sections with only an Initial Text topic are just ordinary topics, so please use the regular topic syntax.
       -> Section: test2

In this case the Section has two "topics" in the initial text, one just happens to be an external link.

Comment 19 Lee Newson 2014-06-17 06:26:45 UTC
Fixed in 1.7-SNAPSHOT build 201406171614

The validation check for initial content has been updated to check for topics and common content.

Note: This is currently live on the test/development server.

Comment 21 Matthew Casperson 2014-06-17 20:08:13 UTC
All combinations of common content and existing containers that i tried could be saved and built.

Comment 22 Matthew Casperson 2014-06-17 21:14:16 UTC
Successfully pushed, translated and synced a book with common content with Zanata.


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