This was a great way to bootstrap a proof-of-concept, but it's not
sustainable:
- "Create a site" is a single user action and should result in an atomic
operation. The domino line of client-side calls can be interrupted at
any point by network problems (or the user's impatience) and result in a
effectively corrupt site.
- Automated testing of site creation is impractical. (Not coincidently,
the main reason I ended up working from saved binary builds of K2 was
that site creation so often failed when I tried to build from source.)
- The implementation details of site roles and permissions (what they
are and how they're described, how they're mapped to and from
Jackrabbit-groups, what permissions they get) are mixed up with what
should be UX code ("create a site", "display member info"). Any changes
require editing multiple client-side JavaScript files. And our
requirements tell us that we _will_ need changes.
- Because of the split, the Jackrabbit groups created to hold site
memberships are not deleted when the site is deleted. Among other
things, this means that you'll get an error if you then try to create a
new site with the same ID. (Integration tests pointed this one out in a
hurry!)
Even restricted to the server-side, we see some non-DRY warning signs,
with the SiteService throwing away "roles" knowledge that the
SiteMembersServlet needs and the SiteMembersServlet effectively redoing
the work.
If no one has objections, I'd like to enter a JIRA to refactor and
consolidate this logic server-side. If the current SiteService owner is
OK with it, I'd be glad to attempt an patch myself.
(An obvious next step would be to relocate roles configuration to the
site template, but I think consolidation of the currently functionality
makes sense first.)
Best,
Ray
I thought that's what my previous message was for, but I could be wrong.
:) FWIW, though, I'd prefer to open a JIRA ticket before starting so
that the work can be tracked (or taken over) by other interested
parties. Hope that's OK....
Thanks,
Ray
=