Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Our contentful script is growing up and going global!  
Over the last two months we've asked you to create a script that pulls data from Postgres and insert into Contentful.  We've been pleased with the results, but need to add some additional functionality. 

Currently, our script does the following:
* Connects to Postgres and Contentful to create a base JSON mapping file
* After the user edits the JSON mapping file, uses this information to transfer the data from Postgres to Contentful
* Upon successful insert into Contentful, gets the Contentful generated ID and updates the record in Postgres.
* Allows user to update/delete records in Contentful
* Allows user to set status of records in Contentful
* Allows user to set map and config files for different content types

For this next challenge, we are going to give our script the ability to upload translated content into Contentful.  To do so, your script will need to do the following:

* During insert, read all content with the same “common ID” field
* This field name should be configurable via the config file
* For all records with the same “common ID”, insert these into the same contentful record
* You will need to ensure you are sending the language code.  
* You can read about Contentful’s localization feature here:  https://www.contentful.com/r/knowledgebase/localization/
* For all records with the same “common ID” field,  they should all have the same contentful ID stored in the Postgres DB (As they would be the same record)
* If a record does not have a language, default to the locale set in the config file (Already present).
  
You can find the source script for this challenge in the forum.

Contentful API documentation:  https://www.contentful.com/developers/docs/

Contentful and PostgreSQL schemas
Below you will find the schema for the both Contentful and Postgres. Feel free to customize this schema as needed this is only a suggestive representation of the most simple object possible.  You will have to load data yourself.

Base table DML:
CREATE TABLE content_item
(
contenttitle character varying NULL,
contentbody character varying NULL,
externalId character varying NULL,
commonId character varying NULL,
contentfulId character varying NULL,
contentversion character varying NULL,
contentstatus character varying NULL,
contentlang character varying NULL
);

Sample data:
Please check the forum for the sample data file.  

 

Contentful Model (You will have to build this manually in Contentful.)
Section Title (Short Text) (Localization Enabled)
Section Text (Long Text) (Localization Enabled)
External Id (Short Text) (Localization Enabled)
Common Id (Short Text) 


 

 



Final Submission Guidelines

Submission Deliverables?, Environment Setup Instructions?, Final Submission Guidelines? 
 

1.  Please submit your solution as a single zip file.   
2. Provide a detailed document of your solution including  installation, dependencies and operation
3.  Provide a quick video of you solution in action,   if you are not comfortable with spoken english feel free to annotate your video with text.

ELIGIBLE EVENTS:

2017 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30055862