cancel
Showing results for 
Search instead for 
Did you mean: 

[solved] how to add a jsp page into Alfresco Explorer?

ethan
Champ in-the-making
Champ in-the-making
Hi Smiley Happy

I would like to create an action for a specific space type which open a jsp page inside the alfresco explorer ui and use an external ajax library to display pie charts and other statistics about the space.
I know some basics about creation of an action but I'm not used to Spring.

To be more precise, I would like the same behaviour that the showDetails action, but without all the panels (like the action menu on the right or the rss feed panel…) I don't know if I have to use dialogs or if I could use the href attribute of the action, and how to pass to the jsp page the noderef of the space?

Thanks for the help Smiley Happy
Regards.
2 REPLIES 2

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
steps:
define action
put action where you need it
define dialog


1:define action
<action id="actionname">
            <label-id>label</label-id>
<evaluator>see what eveluators are if you do not want this for all nodes, but for selected only.
            </evaluator>
            <image>/images/icons/image.png
            </image>
            <action-listener>#{BrowseBean.setupContentAction}//this makes current node
            </action-listener>
            <action>dialog:DIALOG_NAME</action>
            <params>
               <param name="id">#{actionContext.id}</param>//YOU COPY PASTE THIS PART
            </params>
         </action>


JUST FOR REFERENCE{FROM BrowseBean}
public void setupSpaceAction(ActionEvent event)
   {
      UIActionLink link = (UIActionLink)event.getComponent();
      Map<String, String> params = link.getParameterMap();
      String id = params.get("id");
      setupSpaceAction(id, true);
   }

2Smiley Tongueut action where you want it

put action on documents in browser.
   <action-group id="document_browse_menu">
            <action idref="actionname" />
</action-group>
3:define dialog:
<dialog name="send_via_email" page="/jsp/extension/yourjsp.jsp"
            managed-bean="yourDialogBean" icon="/images/icons/icon.png"
            title-id="title" description-id="_description"
            show-ok-button="false" error-message-id="empty_message" />
4:create jsp:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a"%>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r"%>

<%@page import="org.alfresco.web.app.servlet.FacesHelper"%>
<%@page import="javax.faces.context.FacesContext"%>
<%@page import="org.alfresco.docassistent.ZohoDialogBean"%><f:loadBundle
   basename="alfresco.extension.webclientlogin" var="customMsg" />

<f:loadBundle basename="alfresco.messages.webclient" var="msg" />


<f:verbatim>
   <script type="text/javascript"
      src="<%=request.getContextPath()%>/scripts/validation.js"> </script>

   <script type="text/javascript">
var finishButtonPressed = false;
window.onload = pageLoaded;

function pageLoaded()
{
  document.getElementById("wizard:next-button").disabled = true;
    document.getElementById("wizard:back-button").disabled= true;
    document.getElementById("wizard:cancel-button").disabled=true;
    document.getElementById("dialog:finish-button").value = 'Ok';
checkButtonState();
}
function checkButtonState()
{
}
</script>
   <h:form>
      <h:outputText value="#{msg.create_space_step1_title}"></h:outputText>


   </h:form>

</f:verbatim>

if this was not helpful then nothing is Smiley Happy

ethan
Champ in-the-making
Champ in-the-making
Thank you for your help Smiley Happy
I didn't know I could hide the Dialog buttons like that Smiley Happy

I tried to make the action working with a space so I used setupSpaceAction() instead of setupContentAction(). I would like to display the name of my space inside the jsp page. I used #{DialogManager.bean.name} but it does not display anything. I tried to use the #{NavigationBean.nodeproperties.name} but it displayed the parent space name.

I would like to get the space name when I click on the action (the one near the blue arrow on the right) in this view :
[img]http://img543.imageshack.us/img543/638/spaceaction.th.jpg[/img]

I know that if I put the action in the more actions menu of my space, the #{navigationBean.nodeproperties.name} will work but it would be better if the display of the space name worked wherever the action is Smiley Happy

Thank you for your time Smiley Happy

edit: Ok I found the solution. I added the browseBean as a parameter to my dialog java class and used :


public String getName(){
   return this.browseBean.getSpaceAction().getName();
}

problem solved Smiley Very Happy