Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | 4f9f0e9f03675490b2371e4011b40911b72bd387 |
|---|---|
| Date: | 2011-10-14 15:52:13 |
| User: | zach |
| Comment: | working on json wiki command |
Tags And Properties
- branch=json inherited from [7f108075ad]
- closed added by [fba2b503e1] on 2012-07-16 14:42:00
- sym-json inherited from [7f108075ad]
- sym-json-multitag-test inherited from [a893fff3ca]
Changes
Changes to src/json_artifact.c
202 /* 202 /* 203 ** Internal mapping of /json/artifact/FOO commands/callbacks. 203 ** Internal mapping of /json/artifact/FOO commands/callbacks. 204 */ 204 */ 205 static ArtifactDispatchEntry ArtifactDispatchList[] = { 205 static ArtifactDispatchEntry ArtifactDispatchList[] = { 206 {"checkin", json_artifact_ci}, 206 {"checkin", json_artifact_ci}, 207 {"tag", NULL}, 207 {"tag", NULL}, 208 {"ticket", json_artifact_ticket}, 208 {"ticket", json_artifact_ticket}, 209 {"wiki", NULL}, | 209 {"wiki", json_artifact_wiki}, 210 /* Final entry MUST have a NULL name. */ 210 /* Final entry MUST have a NULL name. */ 211 {NULL,NULL} 211 {NULL,NULL} 212 }; 212 }; > 213 > 214 cson_value * json_artifact_wiki(int rid){ > 215 Manifest *pWiki = 0; > 216 char *zBody = NULL; > 217 char *zPageName = NULL; > 218 cson_value * payV = NULL; > 219 cson_object * pay = NULL; > 220 > 221 payV = cson_value_new_object(); > 222 pay = cson_value_get_object(payV); > 223 > 224 zPageName = db_text("SELECT tagname FROM tag" > 225 " WHERE tagid=(SELECT tagid FROM tagxref WHERE rid=%Q)", r > 226 > 227 pWiki = manifest_get(rid, CFTYPE_WIKI); > 228 if( pWiki ){ > 229 zBody = pWiki->zWiki; > 230 } > 231 > 232 cson_object_set(pay, "user", json_new_string("zach")); > 233 cson_object_set(pay, "name", json_new_string(zPageName)); > 234 cson_object_set(pay, "body", json_new_string(zBody)); > 235 return payV; > 236 } 213 237 214 /* 238 /* 215 ** Impl of /json/artifact. This basically just determines the type of 239 ** Impl of /json/artifact. This basically just determines the type of 216 ** an artifact and forwards the real work to another function. 240 ** an artifact and forwards the real work to another function. 217 */ 241 */ 218 cson_value * json_page_artifact(){ 242 cson_value * json_page_artifact(){ > 243 sleep(15); 219 cson_value * payV = NULL; 244 cson_value * payV = NULL; 220 cson_object * pay = NULL; 245 cson_object * pay = NULL; 221 char const * zName = NULL; 246 char const * zName = NULL; 222 char const * zType = NULL; 247 char const * zType = NULL; 223 char const * zUuid = NULL; 248 char const * zUuid = NULL; 224 cson_value * entry = NULL; 249 cson_value * entry = NULL; 225 Blob uuid = empty_blob; 250 Blob uuid = empty_blob;