How to read the current Document opened in Hippo cms

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to read the current Document opened in Hippo cms

sammy
In hippo CMS, I want to display a button in the workflow bar(where we see Publication,edit buttons) based on some properties of the document(or node) opened.

How to read the current node proogramatically ?

I got this far -


 protected void onModelChanged() {
        super.onModelChanged();
        try {
        System.out.println("on model changed called !");
            WorkflowManager manager = ((UserSession) org.apache.wicket.Session.get()).getWorkflowManager();
            WorkflowDescriptor workflowDescriptor = (WorkflowDescriptor) getDefaultModelObject();
            if (workflowDescriptor != null) {
                Workflow workflow = manager.getWorkflow(workflowDescriptor);

I reach workflow. Now how to get the node(document opened)
Sameera Thangudu
130 W 42nd Street | New York, NY 10036
sthangudu@northps.com | www.northps.com | WE LEAD WITH EXPERIENCE.