[Building Sakai] SAK-19035: SiteArchiver fails on role names with spaces
Duffy Gillman
duffy at rsmart.com
Tue Aug 24 11:12:35 PDT 2010
I've spent a great deal of time hunting down a bug that seemed to be a
problem with site import. During site import it seemed that content
resources were not being properly created. It turns out that the
problem originated in the site export process. Site export fails to
export full role data when it encounters a role name containing any
character which cannot be used in an XML tag name. This seems like a
good issue for the maintenance team, but I think some consensus on the
solution should be sought since it affects such a central function
within Sakai.
My proposal for a fix is to change the format of the site export. It
seems a poor choice to assume any role name can be used as a tag,
particularly if the role names are not subject to any sort of
validation or escaping. The current export attempts to create an XML
snippet like:
<roles>
<access>
...
</access>
<maintain>
...
</maintain>
</roles>
This is fine for the out-of-the-box role names. But we like to rename
the maintain role "Tech Support". The SiteArchiver throws a
DOMException since <Tech Support> is not a valid tag. As a result no
one shows us in the new maintain role "Tech Support".
BaseContentService actually uses the content of the role identified as
the maintain role to determine who can import content resources.
My preference for a fix is to change the export format to the following:
<roles>
<role name="access">
...
</role>
<role name="Tech Support">
...
</role>
</roles>
Additionally, the role name would be escaped to handle any characters
that need to be expressed as XML entities. This would mean "<" would
be "<" and "'" would be "'", etc.
The current export format specifies a version using the 'system'
attribute of the main document element <archive>. Currently that
'system' attribute is set to "Sakai 1.0". My proposal is that the new
format use "Sakai 2.0" such that the old processing can be left in
place to handle import of existing site archives.
Any concerns before I move on this?
-Duffy
More information about the sakai-dev
mailing list