AnsweredAssumed Answered

Share Header customization and adding a new page

Question asked by michaelp on Aug 13, 2014
Latest reply on Aug 22, 2014 by oleh
Hello dear developers,

On the share header we want to remove and add elements. I removed the "My Files" element and added a "My Sites" element modifying share-header.lib.js. The new "My Sites" element should show the user all sites on which the user is a member. For this I copied the site-finder folder from site-webscripts/org/alfresco/components and renamed it to "my-sites" including all child files and the content of them (because I want the page to look exactly like the site-finder page but without the search elements). Then I removed the search text box and the button from the html.ftl file. The problem nos is that the new "page" Is not recognized from Share?!

Here some examples:

The json array for the shwown toolbar elements:
function generateAppItems() {
   var appItems = [
         id: "HEADER_HOME",
         name: "alfresco/menus/AlfMenuBarItem",
         config: {
            id: "HEADER_HOME",
            label: "",
            targetUrl: "user/" + encodeURIComponent( + "/dashboard"
//      {
//         id: "HEADER_MY_FILES",
//         name: "alfresco/menus/AlfMenuBarItem",
//         config: {
//            id: "HEADER_MY_FILES",
//            label: "",
//            targetUrl: "context/mine/myfiles"
//         }
//      },
          id: "HEADER_MY_SITES",
          name: "alfresco/menus/AlfMenuBarItem",
          config: {
             id: "HEADER_MY_SITES",
             label: "My Sites",
             targetUrl: "my-sites"

And the "my-sites.get.desc.xml"
  <shortname>My Sites</shortname>
  <description>My Sites Toolbar Element</description>

Everytime I click on the new "My Sites" element on the toolbar I get an error:

SEVERE: Servlet.service() for servlet [Spring Surf Dispatcher Servlet] in context with path [/share] threw exception [Could not resolve view with name 'my-sites' in servlet with name 'Spring Surf Dispatcher Servlet'] with root cause
javax.servlet.ServletException: Could not resolve view with name 'my-sites' in servlet with name 'Spring Surf Dispatcher Servlet'

Can anyone tell me what I am doing wrong? Or am I on the wrong way?

Many thanks for every answer!