cancel
Showing results for 
Search instead for 
Did you mean: 

Replace Site Dashboard with User Dashboard?

systec
Champ in-the-making
Champ in-the-making
Hi

I'd like to 'hack' Alfresco Share so that the default page after login is the site homepage. However i'd like the dashboard in view to be the user dashboard and not the site dashboard. Although we have more than one site 99% of users only belong to a single site. We'd like them to go directly to their site but would still like to retain the benefit of individual dashboards. I'd like the URL to reflect the site name in some way for eg. "page/site/${site}/${user}/dashboard". (The user id in the URL is optional).

We've always only had one site so i've been able to get the user dashboard working where any site dashlets have had the site name simply hardcoded. With the introduction of another site i have been able to replace the hardcoding with a value from the users properties (in this case user.location). This works rather well in that two users can log onto the same application, and go to two different homepages with different themes - all driven by the user property.

However a few users will need to belong to both sites. The easy option seems to be to introduce the 'My Sites' dashlet to those few users. BTW, no users are allowed to customise their own dashboards at this stage. They're pretty much preset. The 'My Sites' dashlet could potentially resolve this issue if it wasn't for the user.location property being used in some of the templates. If i could go back to using the site name off the URL for any dashlets that require them then this solution would work. However i would need the homepage URL to include the site name but still use the user dashboard.

Does anyone know how the user dashboard is built up from user preferences and how i could go about replacing the site dashboard with a user dashboard?

Thanks
6 REPLIES 6

fpp
Champ in-the-making
Champ in-the-making
To manipulate the landing location of a user after the login have a look at site-index.jsp in the share directory.

If you want to change the user options with regards to the possibility of access / additional functions for multiple sites you might want to provide this option in the header similar to the admin features. For this you have to change some of the header files.

Otherwise maybe a custom dashlet based on my-sites without the option to create a new site might also help.

fpp

systec
Champ in-the-making
Champ in-the-making
Thanks for the reply. I have tinkered with the site-index.jsp to manipulate the landing page but that doesn't really meet my needs. I'm really looking for a way to have a user customisable dashboard at the site level. We only have a need for a single dashboard hence the site dashboard is not required.

Our site is very dumbed down - users do not have the ability to create sites etc. They have a default site where they simply manage documents. Only the administrator can customise dashboards for certain individuals. Currently we make use of the user dashboard and any 'site' dashlets on the user dashboard simply use the default site name in the webscripts to retrieve content from the site in the repository.

Share issues the following requests to retrieve the user and site dashboards -
http://localhost:8080/alfresco/s/remotestore/get/alfresco/site-data/pages/user/admin/dashboard.xml?s...
http://localhost:8080/alfresco/s/remotestore/get/alfresco/site-data/pages/site/mysite/dashboard.xml?...

I cant see how i can manipulate these through webscripts. Essentially i'd like make the landing page - http://localhost:8080/share/page/site/mysite/dashboard - but ensure that this page request triggers off the first request above i.e. retrieve and display the user dashboard rather than the site dashboard.

any ideas?

systec
Champ in-the-making
Champ in-the-making
I've managed to get something working but i'm not sure if there are any side-effects to this solution.

I've updated the web-framework-config-application.xml file in Share as follows -


<uri-templates>
   <!–<uri-template id="sitedashboardpage">/site/{site}/dashboard</uri-template>–>
   <uri-template id="sitepage">/site/{site}/{pageid}</uri-template>
   <uri-template id="sitedashboardpage">/site/{site}/user/{userid}/dashboard</uri-template>
   …
</uri-templates>

The site dashboard URL now retrieves the user dashboard. I'm not really sure how that works. I have updated site-index.jsp to use the new URL. I inject the site id from the User object stored in the session - we store the site id in the user properties. It seems to work but i'd like to get some clarity on how the user dashboard is retrieved.

fpp
Champ in-the-making
Champ in-the-making
Interesting approach - will try this as well.

What I suggested with changing the header / top menu was hiding the access to the site-dashboard,  create a standard dashboard in case someone enters the URL directly and having a home / user dashboard button on the top - back to the landing user dashboard.

fpp

zladuric
Champ on-the-rise
Champ on-the-rise
I don't know if this is can help, but maybe try the reverse approach?
Have the landing page be the user dashboard, but add a few user-family dashlets that will look at the first site the user belongs to (in case there are more) and get the links/whatever from the site?

That way users can customize the user page and the site page is locked.

systec
Champ in-the-making
Champ in-the-making
I think i've got a mix of both your suggestions. The landing page is the now user dashboard - it just happens to have the site name in the url which helps to render any site dashlets on the page.

If a request to the application root is requested then site-index.jsp will redirect the request to the 'default' site. The default site is managed in the user properties and is available in the session. If a user belongs to more than one site then those sites will appear in the 'My Sites' dashlet. I have modified the url's in this dashlet so they reflect the same format as the sitedashboardpage uri-template i.e. /site/{site}/user/{userid}/dashboard. Clicking on any of these site links will again take you to a user dashboard within the context of a site.

I've also modified the header so the user has no knowledge of multiple sites. The majority of users will only belong to one site; their default site.