Changeset 70 for trunk/src/rest_interface
- Timestamp:
- 06/26/09 13:29:12 (16 years ago)
- Location:
- trunk/src/rest_interface
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/rest_interface/rest-interface.lisp ¶
r28 r70 31 31 :*json-get-summary-prefix* 32 32 :*json-get-all-type-psis* 33 :*json-get-all-instance-psis* 33 34 :*json-get-topic-stub-prefix* 34 35 :*json-get-type-tmcl-prefix* -
TabularUnified trunk/src/rest_interface/set-up-json-interface.lisp ¶
r68 r70 15 15 (defparameter *json-get-summary-url* "/json/summary/?$") ;the url to get a summary of all topic stored in isidorus; you have to set the GET-parameter "start" for the start index of all topics within elephant and the GET-paramter "end" for the last index of the topic sequence -> http://localhost:8000/json/summary/?start=12&end=13 16 16 (defparameter *json-get-all-type-psis* "/json/tmcl/types/?$") ;returns a list of all psis that can be a type 17 (defparameter *json-get-all-instance-psis* "/json/tmcl/instances/?$") ;returns a list of all psis that belongs to a valid topic-instance 17 18 (defparameter *json-get-topic-stub-prefix* "/json/topicstubs/(.+)$") ;the json prefix for getting some topic stub information of a topic 18 19 (defparameter *json-get-type-tmcl-url* "/json/tmcl/type/?$") ;the json url for getting some tmcl information of a topic treated as a type … … 30 31 (json-get-summary-url *json-get-summary-url*) 31 32 (json-get-all-type-psis *json-get-all-type-psis*) 33 (json-get-all-instance-psis *json-get-all-instance-psis*) 32 34 (json-get-topic-stub-prefix *json-get-topic-stub-prefix*) 33 35 (json-get-type-tmcl-url *json-get-type-tmcl-url*) … … 85 87 hunchentoot:*dispatch-table*) 86 88 (push 89 (create-regex-dispatcher json-get-all-instance-psis #'return-all-tmcl-instances) 90 hunchentoot:*dispatch-table*) 91 (push 87 92 (create-regex-dispatcher json-get-type-tmcl-url #'(lambda(&optional param) 88 93 (declare (ignorable param)) … … 105 110 ;; ============================================================================= 106 111 (defun return-all-tmcl-types(&optional param) 107 "Returns all topic sthat are valid types -> so they have to be valid to the112 "Returns all topic-psi that are valid types -> so they have to be valid to the 108 113 topictype-constraint (if it exists) and the can't be abstract." 109 114 (declare (ignorable param)) … … 118 123 (setf (hunchentoot:content-type*) "text") 119 124 (format nil "Condition: \"~a\"" err))))) 125 126 (defun return-all-tmcl-instances(&optional param) 127 "Returns all topic-psis that are valid instances of any topic type. 128 The validity is only oriented on the typing of topics, e.g. 129 type-instance or supertype-subtype." 130 (declare (ignorable param)) 131 (handler-case (let ((topic-instances (json-tmcl::return-all-tmcl-instances))) 132 (setf (hunchentoot:content-type*) "application/json") ;RFC 4627 133 (json:encode-json-to-string 134 (map 'list #'(lambda(y) 135 (map 'list #'uri y)) 136 (map 'list #'psis topic-instances)))) 137 (condition (err) (progn 138 (setf (hunchentoot:return-code*) hunchentoot:+http-internal-server-error+) 139 (setf (hunchentoot:content-type*) "text") 140 (format nil "Condition: \"~a\"" err))))) 141 120 142 121 143 (defun return-topic-stub-of-psi(&optional psi)
Note: See TracChangeset
for help on using the changeset viewer.