Bug 989268

Summary: RFE: Generate a metadata javascript file when building book
Product: [Community] PressGang CCMS Reporter: Matthew Casperson <mcaspers>
Component: CSProcessorAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1CC: cbredesen, lnewson
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: 2013-09-09 00:07:17 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 Matthew Casperson 2013-07-28 22:44:54 UTC
To support integrating topics into websites as callouts, the CSProcessor should generate a javascript file called "pressgang_website.js" in the Publican files directory.

The format of this file is shown below. It follows the JSONP format, calling the pressgang_website_callback function with a dictionary that maps CSS element selectors with information about the topics that relate to them.

The "css_selector" strings are the values assigned to the "PressGang Websites Element ID" extended property (id 37), and will probably look like "#SearchButton". The "fixed url" strings are the values assigned to the "Fixed URL" extended property (id 20).

pressgang_website_callback({
    "css_selector1": {"target":"fixed url", "topicid":"12345"},
    "css_selector2": {"target":"fixed url", "topicid":"12346"},
    "css_selector3": {"target":"fixed url", "topicid":"12347"},
    etc...
});

The callback will then use this information to associate help topics with specific UI elements.

Comment 1 Matthew Casperson 2013-07-29 05:17:10 UTC
On second thought this should just be an array of topic ids, fixed urls and titles.

pressgang_website_callback([
  {"topicId":12345,"target":"Fixed URL","title":"Topic Title 1"},
  {"topicId":12346,"target":"Fixed URL","title":"Topic Title 1"},
  etc...
]);

Comment 3 Matthew Casperson 2013-07-31 07:39:02 UTC
I have incorporated the javascript file into the dev instance of the UI, and it is working great.

I'd like to get the objects in the array to include the value of property tag 37. That has been repurposed to indicate which version of the UI the topic contains new information for. With this information we can indicate new features as they become available.

If property tag 37 is assigned to a topic more than once, just include the largest/latest value (sorted alphabetically).

E.g.

pressgang_website_callback([
  {"topicId":12345,"target":"Fixed URL","title":"Topic Title 1","newSince":""},
  {"topicId":12346,"target":"Fixed URL","title":"Topic Title 1","newSince":"201308031011"},
  etc...
]);