Register
Submit a solution
The challenge is finished.

Challenge Overview

Our last challenge, POSTGRESQL TO CONTENTFUL.COM IMPORTER UTILITY  generated a great script to import data into Contentful from Postgres. Be sure to check out that challenge if you need more details.   Now let’s make some addtions to the winning submision!   Check out the Fourms for that code.

Contentful API documentation:  https://www.contentful.com/developers/docs/references/content-management-api/������

Currently the script does the following:
A.  Connects to Postgres and Contentful to create a base JSON mapping file
B.  After the user edits the JSON mapping file, uses this information to transfer the data from Postgres to Contentful
C.  Upon successful insert into Contentful, gets the Contentful generated ID and updates the record in Postgres.  

Using this same script (attached), please enhance it to do the following:
1.  Ability to update Contentful record 
a.  Should be a command line switch which takes the records with a Contentful ID (as defined in the config file) and attempts to update the Contentful record.  
      You may have to adjust the insert function to bring back the content version.  You may call this column ‘contentversion’)
2.  Ability to delete Contentful record
a.  Should be a command line switch which takes the records with a Contentful ID and attempts to delete the Contentful record.  
5.  Ability to set status (published, draft, etc) 
a.  Would prefer to set a field in the DB table that determines the status so that each record could have a different status.  
     You can call this column ‘contentstatus’.  The possible statuses are “Draft,Publish,Unpublish”
7.  Ability to specify different config files. Should be a runtime parameter so a user could specify a config and mapping file for each Contentful content type.

Please use the following to help you setup your Postgres DB:
Base table DML:

CREATE TABLE item_tab
(
contenttitle character varying NULL,
contentbody character varying NULL,
externalId character varying NULL,
contentfulId character varying NULL,
contentversion character varying NULL,
contentstatus character varying NULL,
contentlang character varying NULL
);



Sample data:

"My Page","This is my page","123abc","","","Publish","us-EN"
"My Other Page","This is <b>my other</b> page","124abc","","","Publish","us-EN"
"My Foo","This is my foo","125abc","","","Draft","us-EN"
"My Other Foo","This is other foo","126abc","","","Publish","us-EN"

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

ID: 30055600