AnsweredAssumed Answered

Convert link text on actionlink

Question asked by billerby on Jun 22, 2010
Latest reply on Jun 22, 2010 by billerby
Background:

We have done some customisation for a customer that involved generating a unique id that we append at the end of "cm:name" for some our types. The requirement is that two nodes in the same folder should have the possibility to have the same name, since that is forbidden in Alfresco we implemented this solution and our goal is to hide the unique extension everywhere to the end user. We have managed to hide it in the navigation tree, by extending the NavigationPluginBean.

The real challenge seems to strip the id from the "browse spaces" view in browse.jsp. I have tried almost everything and are now seeking some advice.

What I have tried:

    * Override the a:actionLink trying to manipulate the value parameter passed in. This failed since the value still contained #{r.name} (and not the value returned from Node.getName() which is the one I want to manipulate).

    * Override BrowseBean.getNodes(), trying to loop through all nodes manipulating the name property. However the lightweight Node class have no visible way to manipulate the name. I can only do getName :(

    * Write a converter and nest it inside the actionLink-tag. This however fails since the actionLink implementation does not implement the ValueHolder interface. I even tried to implement this interface in my overridden version of the a:actionLink. I however never understod completely how to write the methods needed.

    * Nest a h:outputText inside the a:actionLink feeding this one with my converter. The value attribute is however mandatory in a:actionLink and the corresponding <a href> is closed before the </a:actionLink> (it is actually closed at the end of the opening actionlink-tag. :(

    * Tried to use the core jstl-taglib and the <c:set var="myNodeName" value=#{r.name}"/>, this seems like a bad ideas as my variable is stored in the pageContext and the jsf ones are stored in some other place (FacesContext?) Well it did not work anyway, my var was empty when I tried to use it.
I have not so many ideas left. Maybe writing a new tag? Overriding the RichList and at some point feed it with a overridden Node where I do the manipulation? Write a javascript onLoad method that manipulates the label of the href on the client side? Another option that I'm trying to avoid is of course to patch my Alfresco installation changing the visibility of the name field of the Node class…

Any help would be greatly appreciated.

Thanks
/Erik

Outcomes