Default dashboard
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2013 09:18 AM
Hi!
Using presets.xml I've changed the default content of the user's dashbard.
Now I have to change once again the default content, but I've seen that changing presets.xml doesn't work because the dashboard shows the __previous__ default content and not the new one.
Restarting the server doesn't work as well.
What I've to do in order to get the new default content?
Using presets.xml I've changed the default content of the user's dashbard.
Now I have to change once again the default content, but I've seen that changing presets.xml doesn't work because the dashboard shows the __previous__ default content and not the new one.
Restarting the server doesn't work as well.
What I've to do in order to get the new default content?
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2013 02:20 AM
The presets.xml is used to create a new dashboard page for each new user/site. Once that page has been created then changing the preset will not effect it - only pages that are subsequently created.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2013 02:28 AM
Yes, the presets.xml is only a template. Once the usre is created, it gets stored as Share configuration <strong>for that user</strong>. For existing users you would have to walk through all of that store, for each user, and change their config.
There are quite a few posts on the forum asking how to do it.
There are quite a few posts on the forum asking how to do it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2013 03:24 AM
Thanks, can you link the posts that you saw about this?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2013 08:31 AM
Hi Liuk88,
For the change in existing users.
You have to customize the user-dashboard-title component.
for that extend user-dashboard-title component and add user-dashboard-title.get.js to it.
with in that file write logic like below…
var userName=user.name;
var dashboardUrl = "user/"+userName+"/dashboard";
var myDashletUrl = "NEW DASHLET URL";
var siteDashletUrl = "/components/dashlets/my-sites";
var documentDashletUrl = "/components/dashlets/my-documents";
function main(){
var oldComponents = sitedata.findComponents("page", null,dashboardUrl, null);
for ( var i = 0; i < oldComponents.length; i++) {
var componentUrl = oldComponents.properties["url"].toLowerCase();
if((componentUrl==myDashletUrl)==false){
addBulletinDashlet();
}
if((componentUrl==documentDashletUrl)==false){
addDocumentDashlet();
}
if((componentUrl==siteDashletUrl)==false){
addSiteDashlet();
break;
}
}
}
function addBulletinDashlet(){
var bulletinComponent = sitedata.newComponent("page", "component-2-1", dashboardUrl);
bulletinComponent.properties.url = myDashletUrl;
bulletinComponent.save();
}
function addDocumentDashlet(){
var documentComponent = sitedata.newComponent("page", "component-2-2", dashboardUrl);
documentComponent.properties.url = documentDashletUrl;
documentComponent.save();
}
function addSiteDashlet(){
var siteComponent = sitedata.newComponent("page", "component-1-2", dashboardUrl);
siteComponent.properties.url = siteDashletUrl;
siteComponent.save();
}
main();
For the change in existing users.
You have to customize the user-dashboard-title component.
for that extend user-dashboard-title component and add user-dashboard-title.get.js to it.
with in that file write logic like below…
var userName=user.name;
var dashboardUrl = "user/"+userName+"/dashboard";
var myDashletUrl = "NEW DASHLET URL";
var siteDashletUrl = "/components/dashlets/my-sites";
var documentDashletUrl = "/components/dashlets/my-documents";
function main(){
var oldComponents = sitedata.findComponents("page", null,dashboardUrl, null);
for ( var i = 0; i < oldComponents.length; i++) {
var componentUrl = oldComponents.properties["url"].toLowerCase();
if((componentUrl==myDashletUrl)==false){
addBulletinDashlet();
}
if((componentUrl==documentDashletUrl)==false){
addDocumentDashlet();
}
if((componentUrl==siteDashletUrl)==false){
addSiteDashlet();
break;
}
}
}
function addBulletinDashlet(){
var bulletinComponent = sitedata.newComponent("page", "component-2-1", dashboardUrl);
bulletinComponent.properties.url = myDashletUrl;
bulletinComponent.save();
}
function addDocumentDashlet(){
var documentComponent = sitedata.newComponent("page", "component-2-2", dashboardUrl);
documentComponent.properties.url = documentDashletUrl;
documentComponent.save();
}
function addSiteDashlet(){
var siteComponent = sitedata.newComponent("page", "component-1-2", dashboardUrl);
siteComponent.properties.url = siteDashletUrl;
siteComponent.save();
}
main();
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2013 06:28 AM
Ok, i'll try this, thank you!
