cancel
Showing results for 
Search instead for 
Did you mean: 

Extend Title/Header

tetsubo
Champ in-the-making
Champ in-the-making
Hi all!  Got a question/problem here, when trying to extend Alfresco Share (and btw the Surf Framework is a MESS with all the template, types, components, scripts etc.):

In Alfresco Share I want to add a button right near the "Repository"-Button in the header/title secton. Its function is pretty similar to that of "Repository": it should display the content of directories (lets say: "docs"), that every user has (User Homes/{user-name}/docs). I even would like to have that button open the Share Repository Browser only with a Filter to the directory "docs" for every user. Can you help me, please?
I don't even know where to start after I modify share-config-custom.xml..
9 REPLIES 9

ddraper
World-Class Innovator
World-Class Innovator
Little tip for you when posting on the forums… try not to insult the work done by the people you want to help you! 😉

Basically you want to add a new menu item into the header…. this can be done by extending the <header><app-items> configuration. You can find the default configuration for this in  the "share-config.xml" file. You just need to add a new <item> entry with a link to the page you want it to go to.

Regards,
Dave

tetsubo
Champ in-the-making
Champ in-the-making
You are right, ddraper, so please excuse me, alfresco devs! Smiley Happy I let my frustration go although I know that Surf Framework is "state-Of-The-Art".. I am tryin to get used to.

Now, about my issue again: I put the following row right behind the repository <item>:
<item type="link" id="docs">/docs</item>

Since I want my specific page to looks exactly like the "Repository"-page with applied filter, what should I do next?

rename and rewrite repository.xml in \pages and \template-instances? Do I have to touch any client-side web scripts? pretty confused.. :shock:

ddraper
World-Class Innovator
World-Class Innovator
If you want to just start by reproducing a the Repository page and then customizing it you should copy "WEB-INF/classes/alfresco/site-data/pages/repository.xml" and rename it to something else. This will give you another page that uses the underlying templates/regions/components/WebScripts. If you just want to change the root view of this custom repository view then I'd suggest creating an extension module that provides some custom configuration for that page to change the root node of the repository.

See this blog post for information on creating dynamic configuration in modules: http://blogs.alfresco.com/wp/ddraper/2012/05/01/dynamic-share-configuration-through-extension-module...

You can configure the repository root node using the following code:

 <config evaluator="string-compare" condition="RepositoryLibrary" replace="true"> 
      <visible>true</visible>
      <root-node> <!– Your node goes here –> </root-node>
</config>

There's a forum post discussing this here: https://forums.alfresco.com/en/viewtopic.php?f=13&t=36787

This should be enough information to get you going,

Regards,
Dave

p.s. I don't disagree that Surf configuration can be confusing - and it does take a little getting used to, but it is very powerful when you know how to make use of it - and we do try to help people out as much as possible!

tetsubo
Champ in-the-making
Champ in-the-making
Thx a ton, Dave!

Gonna try it out tomorrow. and You really do help "mortals" to get used to the new framework!

tetsubo
Champ in-the-making
Champ in-the-making
Ok, I created my own tempate type, template-instance.. but don't know how to limit the condition only on my custom Repository, without affecting the original Repository. Cause:

Code: Select all
    <config evaluator="string-compare" condition="RepositoryLibrary" replace="true">
          <visible>true</visible>
          <root-node> <!– Your node goes here –> </root-node>
    </config>

will rewrite the root-node in all cases. That means if I select "Repository" or "docs" link from the header it will redirect me to the same root-node. But I need a custom root-node ONLY for "docs".

Any tips, hints, ideas?

I thought of defining a new condition but have no idea how to do that (searching Google didn't really helped)..

tetsubo
Champ in-the-making
Champ in-the-making
oh and btw:

the path, that works in the node browser (/app:company_home/*[@cm:name= 'Company Homes']/cm:*/cmSmiley Very Happyocs) is sadly not working when set in the mentioned <root-node></root-node>..
HELP, please!

pmverma
Champ in-the-making
Champ in-the-making
tetsubo,

The path which you get from Node Browser has another format, I think which is not correct for setting to root node.

Why not you just look at default configuration at share-documentlibrary-config.xml, where you can find

" <root-node>alfresco://company/home</root-node>"

I think whit this way you can get what you like to have.

tetsubo
Champ in-the-making
Champ in-the-making
thank you, pmverma,

I tested that out and I got 2 problems with it:

1 - the "Repository" link in the header section should deliver the "real" Root node (alfresco://company/home), but my "Docs" link - the "Docs" filder within the ${user-name} directory (which is a subdirectory). So, we have 2 different root-nodes.

2 - How to set the dynamical part(${user-name} directory) in the path, what is the convention?

Can You help?

pmverma
Champ in-the-making
Champ in-the-making
Hi tetsubo,

I am also glad to know the your Q's answer for
2 - How to set the dynamical part(${user-name} directory) in the path, what is the convention?

I am not sure how to configure this. But i fully hope some professional will  help here.

All professional have a bit answers to some problem Smiley Happy

P. M. Verma