在 Sakai,我通过 url: 成功获得了 Assignemnt http://xxx/direct/assignment/ASSIGNMENTID.xml
。然而,在这个实体中,没有详细的上下文(我的意思是,老师的作业指导)。XML 中只有一个内容contentReference
元素。
<contentReference>/assignment/c/mercury/b0de53c7-09b6-4ba0-964b-cb0a9e5a028d</contentReference>
当我点击这个链接时,我得到了 404 错误:
尝试访问不存在的实体 (/assignment/c) 的实体 URL 路径 (/assignment/c/mercury/b0de53c7-09b6-4ba0-964b-cb0a9e5a028d)
我在 Sakai 实体上尝试了谷歌的 API 文档,但结果证明它已经过时了(在我的 Sakai 2.9.3 演示版本上,一些 url 是错误的)。然后我尝试深入研究 Sakai 的源代码。但是,我发现的只是 rsmart 服务器上的一个文件:
在其中我发现:
throw new IllegalArgumentException(
"Must include context and assignmentId in the path ("
+ view
+ "): e.g. /assignment/a/{context}/{assignmentId}");
我尝试在我的服务器上使用这个 URL 来获取详细的内容(尤其是老师的指导)。还有一个与上面内容相同的 404 错误。
最后,我发现/assignment/a/
可能是 的拼写错误/assignment/annc/{context}/{assignmentId}
。所以现在我发送了:
http://localhost:8080/direct/assignment/annc/mercury/403d28b4-e152-463d-a615-972db97d34d3.xml
弹出另一个错误:
HTTP 状态 500 - EntityEncodingException:无法处理此路径 (/assignment/annc/mercury/403d28b4-e152-463d-a615-972db97d34d3.xml) 用于实体 (/assignment/annc) 的前缀 (assignment) 的格式 xml 的输出请求,请求url(/assignment/annc/mercury/403d28b4-e152-463d-a615-972db97d34d3.xml):实体内部输出编码失败:/assignment/annc
关于通过 RESTful 获取教师教学数据的 url 有什么想法吗?谢谢。
作业的 XML 数据。
<assignment type='bean' size='29'>
<access type='bean' size='0'>
</access>
<attachments type='collection' size='1'>
<decoratedattachment type='bean' size='2'>
<name>LC Circuit (show name).png</name>
<url>http://localhost:8080/access/content/attachment/mercury/%E4%BD%9C%E4%B8%9A/a11ef34a-0578-433a-ba7e-9c3bad948bf5/1111.png</url>
</decoratedattachment>
</attachments>
<authorLastModified>admin</authorLastModified>
<authors type='collection' size='0'>
</authors>
<closeTime type='bean' size='2'>
<display>2014-9-12 下午5:00</display>
<time type='number'>1410512400000</time>
</closeTime>
<closeTimeString>2014-9-12 下午5:00</closeTimeString>
<content/>
<contentReference>/assignment/c/mercury/b0de53c7-09b6-4ba0-964b-cb0a9e5a028d</contentReference>
<context>mercury</context>
<creator>admin</creator>
<dropDeadTime type='bean' size='2'>
<display>2014-8-12 下午5:00</display>
<time type='number'>1407834000000</time>
</dropDeadTime>
<dropDeadTimeString>2014-8-12 下午5:00</dropDeadTimeString>
<dueTime type='bean' size='2'>
<display>2014-8-12 下午5:00</display>
<time type='number'>1407834000000</time>
</dueTime>
<dueTimeString>2014-8-12 下午5:00</dueTimeString>
<groups type='collection' size='0'>
</groups>
<id>403d28b4-e152-463d-a615-972db97d34d3</id>
<openTime type='bean' size='2'>
<display>2014-5-5 下午12:00</display>
<time type='number'>1399262400000</time>
</openTime>
<openTimeString>2014-5-5 下午12:00</openTimeString>
<position_order type='number'>0</position_order>
<section></section>
<status>开始</status>
<timeCreated type='bean' size='2'>
<display>2014-5-5 上午11:33</display>
<time type='number'>1399260782158</time>
</timeCreated>
<timeLastModified type='bean' size='2'>
<display>2014-5-6 上午8:46</display>
<time type='number'>1399337194163</time>
</timeLastModified>
<title>A test assign</title>
<draft type='boolean'>false</draft>
<entityReference>/assignment/403d28b4-e152-463d-a615-972db97d34d3</entityReference>
<entityURL>http://localhost:8080/direct/assignment/403d28b4-e152-463d-a615-972db97d34d3</entityURL>
<entityId>403d28b4-e152-463d-a615-972db97d34d3</entityId>
<entityTitle>A test assign</entityTitle>
</assignment>