Bug 748165 - Autogenerate Author information
Summary: Autogenerate Author information
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CSProcessor
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-22 17:09 UTC by Joshua Wulf
Modified: 2014-10-19 22:59 UTC (History)
2 users (show)

Fixed In Version: 0.14.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-28 22:40:14 UTC


Attachments (Terms of Use)
SQL for the new tables (5.59 KB, text/x-sql)
2011-11-04 07:19 UTC, Joshua Wulf
no flags Details

Description Joshua Wulf 2011-10-22 17:09:01 UTC
Create a table Author_Information with the following fields:

AuthorID  WriterID  First_Name Surname OrgName  OrgDiv  Email 
PRIMARY
AUTOINC


Now, we will populate the WriterID field with the tagID of Authors. So if we have an Assigned Writer jwulf whose TagID is 43, then we'll create a record in here for jwulf and make the WriterID 43.

When assembling a build, we need to do the following:

Run a query that returns all the Author_Information records where the WriterID matches the TagID of any topic-to-tag mapping for any of the topics in the build.

This will return to us a list of the authors who were assigned writers for the topics included in the build.

Now write these guys into the Author_Group.xml file of the output in the following way:

<authorgroup>
       [FOR EACH AUTHOR_INFORMATION]
        <author>
                <firstname>[AUTHOR_INFORMATION.First_Name]</firstname>
                <surname>[AUTHOR_INFORMATION.Surname]</surname>
                [IF EXISTS AUTHOR_INFORMATION.OrgName or AUTHOR_INFORMATION.OrgDiv]
                <affiliation>
                        <orgname>[AUTHOR_INFORMATION.OrgName]</orgname>
                        <orgdiv>[AUTHOR_INFORMATION.OrgDiv]</orgdiv>
                </affiliation> 
                [END: IF]
                [IF EXISTS AUTHOR_INFORMATION.Email]
                <email>jwulf</email>
                [END:IF]
        </author>
        [END: FOR]
</authorgroup>

Boom, automated author attribution.

Comment 1 Lee Newson 2011-10-24 06:04:28 UTC
We would need a way to pull/insert the rest of the data for each Author as Skynet doesn't keep any of this information. All it keeps is the username of the writer.

Comment 2 Joshua Wulf 2011-10-29 01:30:10 UTC
Yes, we will manually populate the table. All we need from Skynet is the user ID.

Hopefully once we demonstrate it as a Proof-of-Concept Skynet will pull the functionality in.

Comment 3 Lee Newson 2011-11-04 00:26:05 UTC
This has now been implemented. However to ensure better database design there are three tables; AuthorInformation, Organization & OrganizationDivision.

In the AuthorInformation table the AuthorID is the TagID in the tag table. This was done since not all users are assigned writers.

If no assigned writers are found then it will go back to the default:

<authorgroup>
        <author>
                <firstname>Staff</firstname>
                <surname>Writer</surname>
                <affiliation>
                        <orgname>Red Hat</orgname>
                        <orgdiv>Engineering Content Services</orgdiv>
                </affiliation>
                <!-- <email></email> -->
        </author>
</authorgroup>

Comment 4 Joshua Wulf 2011-11-04 07:19:40 UTC
Created attachment 531713 [details]
SQL for the new tables

Comment 5 Joshua Wulf 2012-03-28 10:23:56 UTC
Did we lose this functionality when we merged into the borg?

(Documenting it, but it doesn't seem to be working)

At the moment my book [1] has only my name, but topics from different authors (jwulf and sgordon). Is it inheriting the book author from the Content Spec author?

[1] Spec ID: 7272

Comment 6 Lee Newson 2012-03-28 22:40:14 UTC
No see: Bug #791075

The author information is now populated using the property tags on an author. and it gets all the authors for for every topic in the book.

Comment 7 Joshua Wulf 2012-03-29 01:07:10 UTC
Got it, thanks.

The cause of this for me was that one of the assigned writer tags did not have its Person (First Name, Last Name, Email) metadata set up.


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