SoftChalk Devel Notes - 2010

Feb. 15, 2010

Updated lbgateway to Sakai 2.6.1. This was largely a matter of moving direct service dependencies out of the project.xml maven file and replace them with a dependency on the new K1 kernel JAR. All compiles and seems to work.

Updated SoftChalk.com to Sakai 2.6.1.

Added new check for support for SCORM.

Mar. 10, 2010

The update to Sakai 2.6.1 on softchalk.com had some problems, it turns out. Errors are reported accessing existing content. Likely, there are database changes to the content hosting tables.

Also, Jeff has requested some new additions to lbgateway. He's sending a more complete spec, but at a minimum they are:

1. Add URL to content listings.
2. Add a flag to all content indicating if it was generated by SoftChalk. This involves testing the index.html file for a SoftChalk creation string.
3. Add additional version information calls to lbgateway for: service, product, etc.

There is now a release 2.6.2.

It looks like the problem is a change in the Course Management service that introduces support for defining what the current term is, instead of algorithmically figuring it out. While the API didn't change, a small database change was made. Dropping the course management database tables will cause them to be rebuilt, but if there are references into the CM tables from courses (likely), then they will need to be dropped as well.

I found a query that will update the right table. It's:

	alter table CM_ACADEMIC_SESSION_T add column IS_CURRENT big default 0 not null;
	update CM_ACADEMIC_SESSION_T set IS_CURRENT=1 where ENTERPRISE_ID="sometitle";

Logged into mysql and checked the table definition of CM_ACADEMIC_SESSION_T and it includes the IS_CURRENT field.

Jun. 11, 2010

There are some problems with SoftChalk that need to be fixed for Sakai integration:

1. issue with space in names for replace and delete.
2. delete / replace doesn't work.
3. identify presence of softchalk.xml file to identify kind of object present.

The theory is that there is a problem with identifiers.

I have verified that CHS folder identifiers must end with a "/".
A replace operation consists of a delete plus and add.

Delete expects a content id that consists of a path starting with the site's root collection to the collection that contains the unzipped object. It should NOT have a trailing slash, since it is added by the delete operaiton.

Downloaded SoftChalk 6.0. Installed a key provided by Jeff Kahn.
Created a very simple lesson called "simple" with two pages.
Added it to GEO-319.
Added a third page. Saved and published to the same location.
Unable to launch from short cut. Opened "simple" folder and launched from index.html.
All three pages are there.
This says that basic replace function is working.
Hmm. Tried to launch from short cut. Works now. Might have been a timing problem.
So the replace worked completely in this simple test case.

Attempted to create a new lesson with a space in the name: "my lesson". The system correctly warned me about using spaces in the name and forced me to use the name "my-lesson" instead. Published it to local sakai. LessonBuilder hangs. On Sakai, the lesson is there, full expanded, but the short cut is not in place.

Terminated Softchalk via Task Manager.

Tried again, starting from scratch.
Created the lesson and saved it as "my-lesson".
Attempted to publish it to Sakai.
Hangs.

Shut down Sakai. Added some printf code to help me trace Zip.add() functionality.
Restarted Sakai. Started up SoftChalk.
Created "my-lesson2" with only one page.
Published it to Sakai - no hang.
Added a second page. Replaced with no error.

Hmm.

Refresh of site collection structure doesn't work well. It will allow an upload, but won't show it afterwards in the file structure.
This makes it hard to replace a lesson. The lessons show up in Sakai. Furthermore, the url:

http://localhost:8080/lbgateway/getItemsAndFolders?folderId=%2Fgroup%2F6db1b7f2-3051-43f3-9f3f-874ceafb1dff%2FLessons%2F

correctly returns the folders in Lessons showing both my-lessons2 and test-3.

Very strange.

June 24, 2010 - Meeting in Richmond

In preparation to design support for Sakai Gradebook support:

1. Evaluate the features of Sakai Gradebook2.
2. Evaluate the possibility of setting up GB2 to run standalone.
3. Detail scoring information
4. How would we add metadata for K12 educational curriculum codes?

July 19, 2010

Grabbed a copy of gradebook2 in case I want to do some analysis work on the road.

Sue indicates that the replace bug is still present. The problem might be related to folder names with a space in it, rather than a SoftChalk lesson name. This needs testing.

Created a folder called "SC Lessons" in BIO-111 on my laptop in Sakai 2.6.2.
Started up LessonBuilder 6.0 (updated to the latest version).
Loaded "my-lesson". It loaded without problem.
Added a new page to it. Attempted a replace operation. Seems to run too fast, box says it uploaded ok, but when I check, the new content is not in the uploaded content. I don't see any replace operation in catalina.out.

It looks like the replace operation is not be submitted. I'm going to modify the debug display code a bit to focus on the requests.
The following trace results:

**** LBG: Request is http://localhost:8080/lbgateway/getCourses ? null

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=/group/89f527e0-3edb-4b80-80c8-e8a3d354fc03/

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=%2Fgroup%2F89f527e0-3edb-4b80-80c8-e8a3d354fc03%2FOCW%2F

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=/group/0a949e9c-df18-492b-a07e-1e23bb90f1d5/

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=%2Fgroup%2F0a949e9c-df18-492b-a07e-1e23bb90f1d5%2FSC+Lessons%2F

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=/group/6db1b7f2-3051-43f3-9f3f-874ceafb1dff/

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=%2Fgroup%2F6db1b7f2-3051-43f3-9f3f-874ceafb1dff%2FLessons%2F

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=%2Fgroup%2F0a949e9c-df18-492b-a07e-1e23bb90f1d5%2FSC+Lessons%2F

**** LBG: Request is http://localhost:8080/lbgateway/getItemsAndFolders ? folder
Id=%2Fgroup%2F0a949e9c-df18-492b-a07e-1e23bb90f1d5%2FSC+Lessons%2Fmy-lesson%2F

Note that there is no replace request issued at all. I have communicated this to Jeff Kahn. For now, it doesn't look like the bug is in my code.

Nov. 5, 2010

Indiana is complaining of a replace problem. They download a lesson from Sakai, edit it, and attempt to put it back. Initial evidence suggests that the problem may be in delete. It's been hard to get a handle on what actually goes on in lbgateway once it is installed in a customer site. As such, I'm going to add some ability to trace requests, data produced, errors encountered, etc.

1. Add a trace flag to login.
2. Add method String getExceptionResult (Exception ex, String msg)
3. Add method void trace(String msg).
4. Add a request to "getTrace".
5. Add getExceptionResult() and trace() methods to code.

I'm going to eliminate the debug flag, since it will be included in the trace functionality.
Currently, the debug flag is only used in LessonBuilderServlert.handleRequest() method, thus easily removed.

Completed coding. Initial results from getTrace are:

	null
	**** LBG Session started for admin at Fri Nov 05 13:01:22 EDT 2010
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><user>admin</user><sessionId>71a6a8ef-1880-46af-a930-cb4684a8fcf9</sessionId></response>

	**** LBG Request: http://localhost:8083/lbgateway/getCourses ? null
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP></response>

	**** LBG Request: http://localhost:8083/lbgateway/getTrace ? null

After some fixes:

	**** LBG Session started for admin at Fri Nov 05 13:22:07 EDT 2010
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><user>admin</user><sessionId>fdd8c783-08b8-4038-a1c0-d3aaf9ec69d4</sessionId></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourses ? null
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getTrace ? null

Final tweaks:

	**** LBG Session started for admin at Fri Nov 05 13:39:10 EDT 2010
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><user>admin</user><sessionId>d20c59b6-d6c9-4ba0-baff-2ff4ae24e970</sessionId></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourses ? (no parameters)
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><course><courseid>99763293-fe02-4bd5-a2a5-938ed24b937d</courseid><coursetitle>SMPL101+Spring+2010</coursetitle><contentid>/group/99763293-fe02-4bd5-a2a5-938ed24b937d/</contentid><instructor>admin</instructor></course></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourseTOC ? courseId=99763293-fe02-4bd5-a2a5-938ed24b937d
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><coursetoc><folders/></coursetoc></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getTrace ? (no parameters)

I think I'll exclude requests for the trace in the trace.

A stack trace with exception information:

	**** LBG Session started for admin at Fri Nov 05 14:43:33 EDT 2010
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><user>admin</user><sessionId>f3c640ba-2da0-4e96-b7df-dc7722bab252</sessionId></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourses ? (no parameters)
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><course><courseid>99763293-fe02-4bd5-a2a5-938ed24b937d</courseid><coursetitle>SMPL101+Spring+2010</coursetitle><contentid>/group/99763293-fe02-4bd5-a2a5-938ed24b937d/</contentid><instructor>admin</instructor></course></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourseTOC ? courseId=99763293-fe02-4bd5-a2a5-938ed24b937d
	  -- Root Id is: /group/99763293-fe02-4bd5-a2a5-938ed24b937d/
	
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><coursetoc><folders/></coursetoc></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourseTOC ? courseId=99763293-fe02-4bd5-a2a5-938ed24b937d
	  -- Root Id is: /group/99763293-fe02-4bd5-a2a5-938ed24b937d/
	
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><coursetoc><folders/></coursetoc></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourseTOC ? courseId=foobar
	  -- Root Id is: /group/foobar/
	
	  -- Exception encountered: null
		org.sakaiproject.content.impl.BaseContentService.getCollection(BaseContentService.java:2182)
		org.sakaiproject.content.cover.ContentHostingService.getCollection(ContentHostingService.java:141)
		com.softchalk.lessonbuilder.servlet.LBGSite.listFolders(LBGSite.java:178)
		com.softchalk.lessonbuilder.servlet.LBGSite.addFolders(LBGSite.java:168)
		com.softchalk.lessonbuilder.servlet.LBGSite.getCourseTOC(LBGSite.java:148)
		com.softchalk.lessonbuilder.servlet.LessonBuilderServlet.handleRequest(LessonBuilderServlet.java:258)
		com.softchalk.lessonbuilder.servlet.LessonBuilderServlet.doGet(LessonBuilderServlet.java:152)
		javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
		javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
		org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
		org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
		org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
		org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
		org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
		org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
		org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
		org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
		org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)
		org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
		org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1293)
		java.lang.Thread.run(Thread.java:595)
	
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><error>UnknownIdError</error><callerIP>127.0.0.1</callerIP></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getTrace ? (no parameters)

An alternative approach:

	**** LBG Session started for admin at Fri Nov 05 14:54:34 EDT 2010
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><user>admin</user><sessionId>dc4069f8-bd05-45b2-9e0b-a92a0e6d18f0</sessionId></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourseTOC ? courseId=foobar
	  -- Root Id is: /group/foobar/
	
	  -- Exception: null
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><error>UnknownIdError</error><callerIP>127.0.0.1</callerIP></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getTrace ? (no parameters)

Now with limited stack trace info:

	**** LBG Session started for admin at Fri Nov 05 15:10:11 EDT 2010
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><callerIP>127.0.0.1</callerIP><user>admin</user><sessionId>39512f7c-16c3-4677-b343-bf3bc627a637</sessionId></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getCourseTOC ? courseId=foobar
	  -- Root Id is: /group/foobar/
	
	  -- Exception encountered: (no message)
	  -- Caused  by: (no cause)
		org.sakaiproject.content.impl.BaseContentService.getCollection(BaseContentService.java:2182)
		org.sakaiproject.content.cover.ContentHostingService.getCollection(ContentHostingService.java:141)
		com.softchalk.lessonbuilder.servlet.LBGSite.listFolders(LBGSite.java:178)
		com.softchalk.lessonbuilder.servlet.LBGSite.addFolders(LBGSite.java:168)
		com.softchalk.lessonbuilder.servlet.LBGSite.getCourseTOC(LBGSite.java:148)
		com.softchalk.lessonbuilder.servlet.LessonBuilderServlet.handleRequest(LessonBuilderServlet.java:258)
		com.softchalk.lessonbuilder.servlet.LessonBuilderServlet.doGet(LessonBuilderServlet.java:152)
		javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
		javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
		org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	
	**** LBG Response: <?xml version="1.0" encoding="UTF-8"?>
	<response><error>UnknownIdError</error><callerIP>127.0.0.1</callerIP></response>
	
	**** LBG Request: http://localhost:8083/lbgateway/getTrace ? (no parameters)

Moved the display of trace information into a form that returns text/text instead of XML. This is much easier to read, though FireFox wants to save it out as a file. Just select browse, then FireFox, and it will open in the browser.A

Nov. 10, 2010

Spent a couple of days writing a pretty printer for the XML response strings. This will help ease the analysis of results.