I have no experience with Alfresco, I do know how to program however, so no problem there.
I am trying to do a minor edit to the /share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js file to add a few menu elements to the share menu.
I want to list all the sites a user is a member of.
After doing some searching I came across the siteService object which can do what I want to achieve so I added the following to the generateAppItems function.
function generateAppItems(){ .....var sites = siteService.listUserSites(user.name);for(var i=0; i<sites.length; i++){var targetUrl ="/share/page/site/"+ sites[i].shortName+"/"+ dashboard; appItems.push({ id:"HEADER_SITE_"+ sites[i].shortName.toUpperCase(), name:"alfresco/menus/AlfMenuBarItem", config:{ id:"HEADER_SITE_"+ sites[i].shortName.toUpperCase(), label:(sites[i].title)? sites[i].title: sites[i].shortName, targetUrl: targetUrl}});} .....}
I try to get the sites the user is member of by using siteService.listUserSites(user.name). But now I get the following error
ReferenceError:"siteService" is not defined.
I have googled around but can't find anywhere how I should instantiate this elusive siteService object.