Home
The Toolkit for Online Communities
17719 Community Members, 0 members online, 2145 visitors today
Log In Register
OpenACS Home : Forums : .LRN Q&A : "Unarchives a community. ** not done yet **"

Forum .LRN Q&A: "Unarchives a community. ** not done yet **"

Icon of envelope Request notifications

Hi,

Anyone looked into this? Should'nt be that difficult to implement or am I missing something?

Collapse
Posted by Lars Pind on
I haven't actually implemented it, but I'm just now making archived communities available to students, so they can see their 'portfolio', so I happen to be operating around this code, and I can tell you, it'd be quite simple.
Collapse
Posted by Cato Kolås on
The comments from the code for the archive-function:

"Archives a community. This means that:

1. the community is marked as archived

2. the RemovePortlet callback is called for all users of
the community (both members and GAs) and all the applets.
This removes the comm's data from their workspaces

3. all users of the community have their "read" privs
revoked on the comm's portal so that only SWA's can view the archived community"

I guess its then enough to just mark the community as active again and then continue normaly to assign members to it?

The reason I'm asking about this is because it looks like someone already have done this for the unarchive-function, but decided not to actually execute the code, nor is there a url that invoke the function. I'm working on dotlrn-Head but it looks the same (codewise) in dotlrn-1.0.

Collapse
Posted by Cato Kolås on
The following code seems to work (notice the rel_segments_grant_permission as its also needed):

ad_proc -public unarchive {
    {-community_id:required}
} {
    Unarchives a community.
} {
  #error
  #ad_script_abort
  db_dml update_archive_p {}
  rel_segments_grant_permission -community_id $community_id
}

FYI: Just an addendum (found that some more code is need to complete it - I hope :)

dotlrn/tcl/community-procs.tcl:

ad_proc -public unarchive {
    {-community_id:required}
} {
  Unarchives a community.
} {
        db_dml update_archive_p {}

    rel_segments_grant_permission -community_id $community_id

    # Must also execute AddUserToCommunity
    foreach user [list_users $community_id] {
        set user_id [ns_set get $user user_id]
        applets_dispatch \
        -community_id $community_id \
        -op AddUserToCommunity \
        -list_args [list $community_id $user_id]
    }
}

Collapse
Posted by Bruce Spear on
I'm wondering what the status of unarchiving a community might be now, in the version 2.03 I have installed and would like to get some groups out of, and 2.1?  Does 2.1 have an easy way to do this important task?  Thanks!  Bruce