AnsweredAssumed Answered

How can i use the node name in a custom java class

Question asked by biram on Apr 29, 2008
I have been working on alfresco since 2006 and i have developped a solution based on it. I have developped many custom actions on nodes but my problem is to get a node name without using a constant value in my java class.  When two users connect at the same time to the application, they see the same value even if they are on different node. Here is my code wher i declare the constant value in order to get the node name:


import org.alfresco.service.namespace.QName;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.web.bean.repository.Node;

public class ShowActPanels implements ActionEvaluator{
public  static String numac ;

private String[] tab ;

public  QName MY_TYPE = QName.createQName("cont.model", "act");

   public boolean evaluate(Node node) {
      boolean res = false;
        if(node.getType().isMatch(MY_TYPE) ){
            res = true;
            String var = node.getName();
           tab = var.split("_") ;
           numac = tab[2];

        }
        return res;

   }
}

this is how we got the node name in the constant value numac

Please help me to get tne node name without using a constant value

Outcomes