History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SAK-12868
Type: Task Task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Denny
Reporter: Denny
Votes: 1
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
Sakai

Template Functionality for Sites

Created: 29-Jan-2008 19:07   Updated: 23-Oct-2008 05:49
Component/s: Worksite Setup
Affects Version/s: 2.4.x
Fix Version/s: 2.6.0-alpha-01

Time Tracking:
Not Specified

File Attachments: 1. Text File SAK-12868-use-role-in-template.patch (1 kb)
2. Text File template-patch-all-v3-1-sakai.patch (22 kb)


2.4.x Status: None
2.5.x Status: None
2.6.x Status: None



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Denny - 24-Feb-2008 18:29
Some of local customizations need to be removed.

Zhen Qian - 09-Apr-2008 13:32
Patch has been applied in r45301, with some small modifications. Thanks, Denny.

I didn't change the Announcement and Resources module for coping contents. Maybe the individual module need to come up with its own policy.

- Zhen

Zhen Qian - 11-Apr-2008 08:48
A couple of changes have been checked in according to user feedback. In as 45338:

1. templates are grouped by site types; User uses checkbox to select "use template" for site creation or not;

2. since all ids of the special sites in OOTB Sakai start with "!", we will mark the template site starting with the "!", too. So it will be like "!template.engin", for example

3. Depending on whether there is any template site defined in the system, different instructions will be shown on the site creation page:

   a) if there is no template site at all, show the original text "Choose the type of site you want to create. Only instructors can create official course websites. Instructors and students can create project websites. NOTE: Students, if you do not see a tab for your course, contact your instructor for information about when your official course website will be available."
   b) otherwise, show "You can create a new project site in one of two ways. A <b>Build-Your-Own project site</b> (for experienced users) lets you choose individual site tools and functions. A <b>Template-based site</b> (recommended for new users) comes pre-loaded with essential tools and functions. Please note, you can add or remove tools from either type of project site, once created."

4. Bypass the security checking when copying contents from various tools in the template site;

5. Show tool title in the site creation confirmation page.

- Zhen

Denny - 10-Jun-2008 20:28
I did some testing the trunk.

There are some problems if template site id starting with the "!", e.g. "!template.graduate". The behaviours of special sites are different compared to normal sites.

1. When I create the template site following the instruction in http://confluence.sakaiproject.org/confluence/display/WSSI/Home, the realms for the template site (/site/!template.graduate) is not created. I can work around this by open realm "!site.template" and save as "/site/!template.graduate".

2. The content of resources is different to normal sites.

3. After I add normal user as a participant with 'maintain' role, the template site is not listed in the site list.

Due to this issues, I think it would be better change the SITE_TEMPLATE_PREFIX to just "template" without "!".

Kind regards,

Denny

Zhen Qian - 17-Jun-2008 12:34
Done. In r47588.

The prefix is now "template"

- Zhen

Zhen Qian - 22-Aug-2008 20:32
The current implementation searches all sites in the system in order to find the matching template site. This causes performance problem when dealing with large number of sites in production system.

Now the suggested way for config template sites is:

1) add "site.templates" configuration variable into sakai.properties. Put the template site ids as the value, separated by comma, e.g. "site.templates=template.course,template.project"
2) in admin Sites tool, create the tempates with the above ids for various site types.

User logs into MyWorkspace and sees the templates as choices for site creation.

- Zhen

Zhen Qian - 22-Aug-2008 20:36
Fixed in r51287.

Now the template ids are read from sakai.properties file, in order to avoid the performance problem of iterating the whole sites list for template sites.

Thanks,

- Zhen

Denny - 24-Aug-2008 17:38 - edited
Do we need to restart the tomcat when a new template site created and sakai.properties file is updated?

Alternatively, add a new method in site service that can search for sites based on site Id with wildcard (e.g. contain "template" -> "%template%" in SQL where clause). This method would be useful for tool "Site" in "Administrative Workspace".

Cheers,

Denny

Matthew Jones - 25-Aug-2008 11:32
Yes, to read the properties would require a restart. Although I think in the config editor for 2.6 they plan to to be able to push changed properties across all nodes in a cluster and re-read them. Though I'm not sure if many people will actively use that. It would be nice I think if it has static properties and dynamically configurable properties, I haven't looked this much at it.

But this particular change was only done because it was the fastest solution we could come up with the fix this problem. On a instance with over 10,000 sites this look up took over 2 minutes to execute on each new site.

If some query could be optimized for much faster site lookups, or some other method could be used for defining what the templates are, that would be pretty useful too, but it seemed like any kind of solution like that would take longer than to implement. ;) It doesn't even look from an auto.ddl startup that the TITLE field in SAKAI_SITE is indexed, so that wouldn't help things, but I think this could be greatly improved.

This could also be configured on a special worksite like SAK-7209 is for dynamic configurability. Maybe combine all of the site-manage configurations into one site-manage configuration site?


Denny - 07-Sep-2008 19:08
When creating a new site using a template site, the roles that are available in the template site should be used in the joinable drop-down list in "Site Access" page.

Denny - 07-Sep-2008 19:10
Hi Zhen, could you apply the patch "SAK-12868-use-role-in-template.patch"?


Zhen Qian - 09-Sep-2008 07:21
Patch applied in r52016.

Thanks,

- Zhen