[Building Sakai] Web service and Samigo (repost)

Earle Nietzel Earle.Nietzel at marist.edu
Mon Jul 12 08:47:55 PDT 2010


Just sending this again since I sent it on the holiday weekend!

Hi, 

I am trying to expose samlite via a web service but have run into an 
issue. I have combed over the code for half a day now and have not come up 
with a good solution so i need pick someone's brain. 

I have not located an api that allows you to import an assessment directly 
to a specific site in samigo, your location in sakai is managed via the 
servlets (tool placement id, url) and i can't duplicate that in a web 
service. 

Does anyone have any insight? 

Thanks for any help, 
Earle 

To help I am including the web service method as psuedo code: 
  

       public boolean createAssessment(String sessionid, String siteid, 
String siteproperty, String name, String description, String data) throws 
AxisFault { 

                Session session = establishSession(sessionid); 

                Site site = null; 

                if (siteproperty != null && siteproperty.length() > 0) { 
                        // find sakai site id using enterprise 
siteproperty=siteid 
                        site = findSite(siteproperty, siteid); 
                } else { 
                        try { 
                                // use siteid as the sakai site id 
                                site = SiteService.getSite(siteid); 
                        } catch (IdUnusedException ieu) { 
                                site = null; 
                        } 
                } 

                if (site != null) { 
                        //siteToolReference(site.getId(), "sakai.samigo"); 


                        SamLiteService samLiteService = (SamLiteService) 
ComponentManager.get(SamLiteService.class); 

                        QuestionGroup questionGroup = 
samLiteService.parse(name, description, data); 
                        Document document = 
samLiteService.createDocument(questionGroup); 

                        QTIService qtiService = new QTIService(); 
                        AssessmentFacade asessment = 
qtiService.createImportedAssessment(document, QTIVersion.VERSION_1_2, 
null, AssessmentTemplateFacade.DEFAULTTEMPLATE.toString()); 

 
//EventTrackingService.post(EventTrackingService.newEvent("sam.assessment.create", 
"assessmentId=" + assessment.getAssessmentId(), true)); 
                        return true; 
                } else { 
                        LOG.warn("WS SiteArchive.createAssessment(): Site 
not found - " + siteid); 
                        throw new AxisFault("WS 
SiteArchive.createAssessment(): Site not found - "+ siteid); 
                } 
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100712/aa00f50d/attachment.html 


More information about the sakai-dev mailing list