cancel
Showing results for 
Search instead for 
Did you mean: 

How to find out the action performed when clicking an space

fstnboy
Champ on-the-rise
Champ on-the-rise
Hi all,

I want to find out where is defined which action/event is executed when a specific space is clicked. The enterprise gave me a semi-developed Alfresco version. There is a space that when it is clicked a browser is launched to show a .jsp page. What I want to do is leave the space as a space conteining 2 different .jsp contents. How can I change this??

Thanks in advance.
9 REPLIES 9

zaizi
Champ in-the-making
Champ in-the-making
You might find the wiki info on how to implement custom actions http://wiki.alfresco.com/wiki/Custom_Action_UI useful.

A more detailed tutorial http://www.ecmarchitect.com/images/articles/alfresco-actions/actions-article.pdf

fstnboy
Champ on-the-rise
Champ on-the-rise
Hi zaizi

I had already found the wiki, had read the pdf article, but nothing at all…. The aspect is defined, but i can´t find the action related to it in web-client-config-custom.xml… it may be that i haven´t got the last code version. I don´t know….

What i have discovered is that the .jsp page displayed use a .ftl template, does it help somehow???

Thanks for the answer

zaizi
Champ in-the-making
Champ in-the-making
Can you provide more details or may be screen shot?

fstnboy
Champ on-the-rise
Champ on-the-rise
The supposed aspect related to the space is this:


<type name="ajd:espaciodiccionario">
         <title>Espacio para el diccionario legal</title>
         <parent>ajd:procedimientos</parent>
                    En este espacio NO se podrán crear expedientes por eso se comenta el aspecto–>
               <!–
               <mandatory-aspects>
           <aspect>ajd:contenedorajd</aspect>
         </mandatory-aspects>
               –>
            </type>

I can´t find any reference to the aspect in the web-client-config-custom.xml, where, i guess, the actions are related to the aspects, i can´t neither find a reference to the .jsp page displayed when the space is clicked. This page, as shown below, uses a .ftl template (i don´t know if this can help):


<f:view>
      <form name="categoriasAJD">
         <r:template template="alfresco/templates/legislacion.ftl"/>
      </form>
</f:view>

Templates code is the following:


<#list classification.getAllCategoryNodes("cm:generalclassifiable") as category>
<#if (category.name)= "Enlaces">
   <#assign cont=0>
   <#assign contDicc=0>
   <#assign contLey=0>
   <#list category.immediateSubCategories as enlaces>
      <#if (enlaces.name)="Legislacion">
         <#list enlaces.immediateSubCategories as leyes>
            <#if contLey=0>
            <!–<tr><td colspan="2"><b>Legislación</b></td></tr>–>
            </#if>
            <input type="hidden" id="leg_ajdurl_${cont}" name="leg_ajdurl_${cont}" value="${leyes.properties.description}-_*_-${leyes.name}"/>
            <#assign cont = cont+1>
            <#assign contLey = contLey+1>
         </#list>
      </#if>
      <#if (enlaces.name)="Diccionario">
         <#list enlaces.immediateSubCategories as diccionarios>
            <#if contDicc=0>
            <!–<tr><td colspan="2"><b>Diccionarios</b></td></tr>–>
            </#if>
            <input type="hidden" id="dicc_ajdurl_${cont}" name="dicc_ajdurl_${cont}" value="${diccionarios.properties.description}-_*_-${diccionarios.name}"/>                  
            <#assign contDicc = contDicc+1>
            <#assign cont = cont+1>
         </#list>
      </#if>
   </#list>
</#if>
</#list>


I can´t have a screen shot because i haven´t (can´t) deployed yet the alfresco version of the code i´ve been given. I´m working from a remote workstation not having connection to the database, i have tried to deploy it from a empty "alfresco" called database but it does not work, it tells me that the stored content can not be found.

Which other files can I check???

fstnboy
Champ on-the-rise
Champ on-the-rise
Any idea??

fstnboy
Champ on-the-rise
Champ on-the-rise
I have realised I hadn´t post the model registering xml file. Here it is:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<!– Core and miscellaneous bean definitions –>
<beans>   
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/libertyModel.xml</value>
                <value>alfresco/extension/libertyAJDmodel.xml</value>
            </list>
        </property>
    </bean>
</beans> 

As you can see there is no reference to the class that implements the action. Is there any other way to implement custom actions? Or is this the only one?

fstnboy
Champ on-the-rise
Champ on-the-rise
I have found it….

It is in 'alfresco\WebContent\jsp\browse\browse.jsp'.


<a:stringEqualsEvaluator value="#{NavigationBean.currentNode.type.localName}" condition="espaciodiccionario" id="str_dicc">
   <a:stringEqualsEvaluator value="#{NavigationBean.currentNode.type.namespaceURI}" condition="http://www.libertyseguros.es/model/content/ajd/1.0">
      <a:outputText value="<script>window.open('/alfresco/faces/jsp/libertyajdext/legislacion.jsp');</script>" id="items-txt1"/>
   </a:stringEqualsEvaluator>
</a:stringEqualsEvaluator>

I´m quite new to .jsp and Alfresco and still don´t understand how it opens a new window when the specified space is clicked. May it be because whenever a space is clicked 'browse.jsp' is launched?? Just to know it…

zaizi
Champ in-the-making
Champ in-the-making
Alfresco uses JSF for the web client. Specifically MyFaces (http://myfaces.apache.org/). JSF uses JSP for display, normally.

In your case,
<a:outputText value="<script>window.open('/alfresco/faces/jsp/libertyajdext/legislacion.jsp');</script>" id="items-txt1"/>


adds java script to the link if the content/space being rendered is of type "http://www.libertyseguros.es/model/content/ajd/1.0". This java script function opens the jsp in a new window.

This is quite useful and will you an insight into how JSF works: http://www.ibm.com/developerworks/library/j-jsf2/

fstnboy
Champ on-the-rise
Champ on-the-rise
Thanks Zaizi!!! You have always shown interest in helping!