cancel
Showing results for 
Search instead for 
Did you mean: 

Missing title component in user dashboards

loftux
Star Contributor
Star Contributor
I have an install of 4.0.e where the title component (user-dashboard-title) in user dashboards has started to disappear. Since the blue bar with the customise dashboard button is missing, this is a real annoying issue for end users.
I connect this being an issue in the underlying surf framework and the combination with SSO Kerberos used. I also noticed that webscripts refresh fails and modules deployment. Both goes to a blank page. So my 2c is that also user dashboard changes when saved goes wrong.

Anyone else seen this?

I've managed to reset user dashboard with a little script so that it gets recreated from scratch. But since refresh webscripts is not working, to clear the surf cache seem to require restart of tomcat. This reset of dashboard helps for a while but the issue seem to reappear.
3 REPLIES 3

kbonnet
Champ in-the-making
Champ in-the-making
Yes, I'm seeing this. For some users. We're not using kerberos. And i'm still able to reset webscripts. I cant see where this behaviour is coming from. How did you reset this user dashboard?

Koen

loftux
Star Contributor
Star Contributor
I created some scripts that can be run using the Javascript Console (http://code.google.com/p/share-extras/wiki/JavascriptConsole).

First thing I tried was to delete the users  dashboard, thus reset it and get all components recreated. But that error kept reappearing.
var userid = "pelof";

var searchobj = {
  query:'PATH:"/app:company_home/st:sites/cm:surf-config/cm:components/*" AND @cm\:name:"*'+userid+'*"',
  language: 'fts-alfresco'
};

var nodes = search.query(searchobj);

for(i=0, ii=nodes.length;i<ii;i++){
  //use only the dashboard ones
  if(nodes[i].name.indexOf('dashboard')>-1){
    print(nodes[i].name);
    nodes[i].remove();
  }
}
print('***')
searchobj.query = 'PATH:"/app:company_home/st:sites/cm:surf-config/cm:pages/cm:user/cm:'+userid+'/*"';
nodes = search.query(searchobj);
for(i=0, ii=nodes.length;i<ii;i++){
  //use only the dashboard ones
  if(nodes[i].name.indexOf('dashboard')>-1){
    print(nodes[i].name);
    nodes[i].remove();
  }
}
I then went on to actually create the missing component file, and this helped. Note that you may have to refresh webscripts to reset cache for this to take effect.

var users = search.luceneSearch("workspace://SpacesStore", "TYPE:\"cm:person\"");
for(i=0,ii=users.length;i<ii;i++){
  var userid = users[i].properties["cm:userName"];
  var dashboard = companyhome.childByNamePath('/Sites/surf-config/pages/user/' + userid + '/dashboard.xml');
  if(dashboard){
   var title =companyhome.childByNamePath('/Sites/surf-config/components/page.title.user~'+userid+'~dashboard.xml');
    if(title){
      print('Exists for ' +userid);
    }else{
      var componentfolder =companyhome.childByNamePath('/Sites/surf-config/components');
      var newtitle = componentfolder.createFile('page.title.user~'+userid+'~dashboard.xml');
      var content = '<?xml version="1.0" encoding="UTF-8"?>\n\n';
      content += '<component>\n';
      content += '<guid>page.title.user~' + userid + '~dashboard</guid>\n';
      content += '<scope>page</scope>\n';
      content += '<region-id>title</region-id>\n';
      content += '<source-id>user/'+ userid +'/dashboard</source-id>\n';
      content += '<url>/components/title/user-dashboard-title</url>\n';
      content += '</component>\n';
      newtitle.properties.content.content = content;
      newtitle.properties.content.encoding = 'UTF-8';
      newtitle.setOwner(userid);
      newtitle.save();
      print('Created new title component for ' +userid);
      }
  }else{
    print("User has no dashboard " + userid);
  }
}
This was seen with 4.0.e, we have since upgraded to 4.2.a. But the upgrade didn't resolve the issue for users that had the title component missing, so I had to run the above script. After 4.2.a upgrade, the issue hasn't re-appeared.

kbonnet
Champ in-the-making
Champ in-the-making
Thanks Big Time, Peter. I'm going to try these scripts. And i'll suggest to upgrade to 4.2a shortly. Thanks a lot.