[Building Sakai] Web service file attachment

Kabelo Letsoalo kabelo at opencollab.co.za
Wed Mar 5 06:57:34 PST 2014


Hi all

Submitting an assignment with attachment via web service.
When doing this via the web UI the url for the attachment ends with
siteId/Assignments/randomString/file.txt

When using web service the attachment url does not have the
siteId/Assignments prefix. Url only contains randomString/file.txt

How I add Attachment:

ResourcePropertiesEdit resourcePropertiesEdit =
contentHostingService.newResourceProperties();
resourcePropertiesEdit.addProperty(resourcePropertiesEdit.PROP_DISPLAY_NAME,
attachmentName);
ContentResource file =
contentHostingService.addAttachmentResource(attachmentName,
attachmentMimeType, content, resourcePropertiesEdit);
Reference ref = entityManager.newReference(file.getReference());
assignmentSubmissionEdit.addSubmittedAttachment(ref);

What's the fix for this?

Appreciate any the help. Thanks.

-- 

------------------------------
See OpenCollab email disclaimer at 
http://www.opencollab.co.za/email-disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140305/870288bf/attachment.html 


More information about the sakai-dev mailing list