Location of resource files to customise the share header

cancel
Showing results for 
Search instead for 
Did you mean: 
afielden
Active Member II

Location of resource files to customise the share header

I'm trying to add an item to the standard Alfresco share header. I'm following the guidelines here

https://community.alfresco.com/community/ecm/blog/2013/09/04/customizing-the-share-header-menu-part-... 

which admittedly is for version 4.2. I'm using 5.2 CE

Using the all-in-one archetype project, I created the following files, as it suggests in the instructions:-

src/main/resources/alfresco/web-extension/site-data/extensions/share-header.xml

src/main/resources/alfresco/web-extension/site-webscripts/com/example/header/share-header.get.js

The contents of these files are as per the tutorial in the above link. However I don't see the new menu item on the share header menu bar.

Am I placing these files in the correct place within the project structure?

Thanks.

6 Replies
krutik_jayswal
Senior Member II

Re: Location of resource files to customise the share header

Please verify that , inside the share-header.xml file,there is one attribute named as auto-deploy.If it is set to manual , you need to manually deploy the newly installed extension.

For manual deployment you can use below URL.You just need to select your module ==>Click and Add==>Click on Apply Changes.

http://localhost:8080/share/page/modules/deploy 

Other thing would be set auto-deply to true.

You can find more details on below link on auto-deply.

Auto-deploying modules | Alfresco Documentation 

afielden
Active Member II

Re: Location of resource files to customise the share header

Thanks for your reply. Yes the auto-deploy is set to true. But I don't think Alfresco has even picked up this module,  because I don't see it on the module deployment page. 

I also looked over the log files, and didn't see any problems related to this. Here's my share-header.xml -

...

extension>
  <modules>
  <module>
    <id>Add custom menu item to header</id>
    <version>1.0</version>
    <auto-deploy>true</auto-deploy>
    <customizations>
      <customization>
        <targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
        <sourcePackageRoot>com.example.header</sourcePackageRoot>
      </customization>
    </customizations>
  </module>
  </modules>
</extension>

...

krutik_jayswal
Senior Member II

Re: Location of resource files to customise the share header

can you please check, opening tag has missing bracket extension>.

I don't see any other issue in this.

afielden
Active Member II

Re: Location of resource files to customise the share header

Yes, sorry, that was a cut/paste error. The XML is well formed.

So you think this file is in the correct location, and Alfresco should be able to use it?

krutik_jayswal
Senior Member II

Re: Location of resource files to customise the share header

Yes, this xml file should get loaded, but there might be mistakes in other files.can you share all files and location?

afielden
Active Member II

Re: Location of resource files to customise the share header

Thanks. I'm actually trying a different approach now, by creating separate projects for my repo and share. Seems like this will be the better way of doing development anyway, because the all in one project takes ages to start up.

With separate projects, you can leave the repo running continuously, and just redeploy share when necessary.

Anyway, using this approach I've successfully defined and deployed my first menu item, and it works!

Thanks for your responses to my questions.