Monday, June 21, 2010

Recreate User Community Layout

This is a simple DB update...

Replace ValidPLID with a valid layout plid from layout table..


update layout set typesettings = (select typesettings from layout where plid = ValidPLID ) where groupid in (
select groupid from group_ where name in (select concat('',userid) from user_ )
) and privatelayout = 0 and friendlyurl like '/home';

update layout set typesettings = (select typesettings from layout where plid = ValidPLID
 ) where groupid in (
select groupid from group_ where name in (select concat('',userid) from user_ )
) and privatelayout = 1 and friendlyurl like '/home';


Incase if you have dead portlets visible on user public or private pages just delete records from resource_ table.


delete from resource_ where resourceid in (
select r.resourceid from resource_  r , (select concat (plid, '%') p from layout where friendlyurl like '/home' and groupid in (
select groupid from group_ where name in ( select concat('',userid) from user_) ) )  t
where r.primkey like p );