RESTful api for getting course listing and opening course in studio.

Pattern for how to do refactoring from locations to locators and from
old style urls to restful ones.
This commit is contained in:
Don Mitchell
2013-10-03 12:06:26 -04:00
parent fd49f09284
commit 010905eb99
12 changed files with 310 additions and 113 deletions

View File

@@ -1,6 +1,6 @@
[
{
"_id":"head12345_12",
"_id": { "$oid" : "ad00000000000000dddd0000"},
"category":"course",
"fields":{
"textbooks":[
@@ -46,12 +46,12 @@
"edit_info": {
"edited_by":"testassist@edx.org",
"edited_on":{"$date" : 1364481713238},
"previous_version":"head12345_11",
"original_version":"head12345_10"
"previous_version":{ "$oid" : "ad00000000000000dddd0001"},
"original_version":{ "$oid" : "ad00000000000000dddd0010"}
}
},
{
"_id":"head12345_11",
"_id":{ "$oid" : "ad00000000000000dddd0001"},
"category":"course",
"fields":{
"textbooks":[
@@ -97,12 +97,12 @@
"edit_info": {
"edited_by":"testassist@edx.org",
"edited_on":{"$date" : 1364481713238},
"previous_version":"head12345_10",
"original_version":"head12345_10"
"previous_version":{ "$oid" : "ad00000000000000dddd0010"},
"original_version":{ "$oid" : "ad00000000000000dddd0010"}
}
},
{
"_id":"head12345_10",
"_id":{ "$oid" : "ad00000000000000dddd0010"},
"category":"course",
"fields":{
"textbooks":[
@@ -149,11 +149,11 @@
"edited_by":"test@edx.org",
"edited_on":{"$date": 1364473713238},
"previous_version":null,
"original_version":"head12345_10"
"original_version":{ "$oid" : "ad00000000000000dddd0010"}
}
},
{
"_id":"head23456_1",
"_id":{ "$oid" : "ad00000000000000dddd0020"},
"category":"course",
"fields":{
"textbooks":[
@@ -199,12 +199,12 @@
"edit_info": {
"edited_by":"test@edx.org",
"edited_on":{"$date": 1364481313238},
"previous_version":"head23456_0",
"original_version":"head23456_0"
"previous_version":{ "$oid" : "2d00000000000000dddd0020"},
"original_version":{ "$oid" : "2d00000000000000dddd0020"}
}
},
{
"_id":"head23456_0",
"_id":{ "$oid" : "2d00000000000000dddd0020"},
"category":"course",
"fields":{
"textbooks":[
@@ -251,11 +251,11 @@
"edited_by":"test@edx.org",
"edited_on":{"$date" : 1364481313238},
"previous_version":null,
"original_version":"head23456_0"
"original_version":{ "$oid" : "2d00000000000000dddd0020"}
}
},
{
"_id":"head345679_1",
"_id":{ "$oid" : "3d00000000000000dddd0020"},
"category":"course",
"fields":{
"textbooks":[
@@ -295,62 +295,62 @@
"edited_by":"test@edx.org",
"edited_on":{"$date" : 1364481313238},
"previous_version":null,
"original_version":"head23456_0"
"original_version":{ "$oid" : "2d00000000000000dddd0020"}
}
},
{
"_id":"chapter12345_1",
"_id":{ "$oid" : "cd00000000000000dddd0020"},
"category":"chapter",
"fields":{},
"edit_info": {
"edited_by":"testassist@edx.org",
"edited_on":{"$date" : 1364483713238},
"previous_version":null,
"original_version":"chapter12345_1"
"original_version":{ "$oid" : "cd00000000000000dddd0020"}
}
},
{
"_id":"chapter12345_2",
"_id":{ "$oid" : "cd00000000000000dddd0022"},
"category":"chapter",
"fields":{},
"edit_info": {
"edited_by":"testassist@edx.org",
"edited_on":{"$date" : 1364483713238},
"previous_version":null,
"original_version":"chapter12345_2"
"original_version":{ "$oid" : "cd00000000000000dddd0022"}
}
},
{
"_id":"chapter12345_3",
"_id":{ "$oid" : "cd00000000000000dddd0032"},
"category":"chapter",
"fields":{},
"edit_info": {
"edited_by":"testassist@edx.org",
"edited_on":{"$date" : 1364483713238},
"previous_version":null,
"original_version":"chapter12345_3"
"original_version":{ "$oid" : "cd00000000000000dddd0032"}
}
},
{
"_id":"problem12345_3_1",
"_id":{ "$oid" : "0d00000040000000dddd0031"},
"category":"problem",
"fields": {"data": ""},
"edit_info": {
"edited_by":"testassist@edx.org",
"edited_on":{"$date" : 1364483713238},
"previous_version":null,
"original_version":"problem12345_3_1"
"original_version":{ "$oid" : "0d00000040000000dddd0031"}
}
},
{
"_id":"problem12345_3_2",
"_id":{ "$oid" : "0d00000040000000dddd0032"},
"category":"problem",
"fields": {"data": ""},
"edit_info": {
"edited_by":"testassist@edx.org",
"edited_on":{"$date" : 1364483713238},
"previous_version":null,
"original_version":"problem12345_3_2"
"original_version":{ "$oid" : "0d00000040000000dddd0032"}
}
}
]

View File

@@ -11,7 +11,7 @@
"blocks":{
"head12345":{
"category":"course",
"definition":"head12345_12",
"definition":{ "$oid" : "ad00000000000000dddd0000"},
"fields":{
"children":[
"chapter1",
@@ -65,7 +65,7 @@
},
"chapter1":{
"category":"chapter",
"definition":"chapter12345_1",
"definition":{ "$oid" : "cd00000000000000dddd0020"},
"fields":{
"children":[
@@ -83,7 +83,7 @@
},
"chapter2":{
"category":"chapter",
"definition":"chapter12345_2",
"definition":{ "$oid" : "cd00000000000000dddd0022"},
"fields":{
"children":[
@@ -101,7 +101,7 @@
},
"chapter3":{
"category":"chapter",
"definition":"chapter12345_3",
"definition":{ "$oid" : "cd00000000000000dddd0032"},
"fields":{
"children":[
"problem1",
@@ -120,7 +120,7 @@
},
"problem1":{
"category":"problem",
"definition":"problem12345_3_1",
"definition":{ "$oid" : "0d00000040000000dddd0031"},
"fields":{
"children":[
@@ -139,7 +139,7 @@
},
"problem3_2":{
"category":"problem",
"definition":"problem12345_3_2",
"definition":{ "$oid" : "0d00000040000000dddd0032"},
"fields":{
"children":[
@@ -169,7 +169,7 @@
"blocks":{
"head12345":{
"category":"course",
"definition":"head12345_11",
"definition":{ "$oid" : "ad00000000000000dddd0001"},
"fields":{
"children":[
@@ -233,7 +233,7 @@
"blocks":{
"head12345":{
"category":"course",
"definition":"head12345_10",
"definition":{ "$oid" : "ad00000000000000dddd0010"},
"fields":{
"children":[
@@ -287,7 +287,7 @@
"blocks":{
"head23456":{
"category":"course",
"definition":"head23456_1",
"definition":{ "$oid" : "ad00000000000000dddd0020"},
"fields":{
"children":[
@@ -342,7 +342,7 @@
"blocks":{
"head23456":{
"category":"course",
"definition":"head23456_0",
"definition":{ "$oid" : "2d00000000000000dddd0020"},
"fields":{
"children":[
@@ -396,7 +396,7 @@
"blocks":{
"head23456":{
"category":"course",
"definition":"head23456_1",
"definition":{ "$oid" : "ad00000000000000dddd0020"},
"fields":{
"children":[
@@ -450,7 +450,7 @@
"blocks":{
"head345679":{
"category":"course",
"definition":"head345679_1",
"definition":{ "$oid" : "3d00000000000000dddd0020"},
"fields":{
"children":[