AnsweredAssumed Answered

How to get the Id of node from its path ?

Question asked by bretzel on Nov 16, 2006
Latest reply on Nov 16, 2006 by kevinr
I don't know if it's possible but I'd like to return the Id of a node from its path (e.g. Company Home > foo > bar). Does somebody know how can I navigate thru the nodes ? Thanks

package org.alfresco.web.bean.dashboard;

import org.alfresco.web.bean.NavigationBean;

/**
* Backing bean for the Announcements Dashlet page.
*
* @author BretZel
*/
public class AnnouncementsBean
{
    private NavigationBean navigationBean;
   
       
    /**
     * @param navigationBean The navigationBean to set.
     */
    public void setNavigationBean(NavigationBean navigationBean)
    {
        this.navigationBean = navigationBean;
    }

    public String browsePendingAnnouncements()
    {
        this.navigationBean.setCurrentNodeId(getSpaceId());
        return "browse";
    }
   
     public String createAnnouncement()
    {
        this.navigationBean.setCurrentNodeId(getSpaceId());
        return "wizard:createContent";
    }
   
    private String getSpaceId()
    {
        //return "a608b5a2-6b17-11db-9dfa-d14aa8ccb797";
       return this.navigationBean.getCompanyHomeNode().????????????????.getId();
    }
}

Outcomes