AnsweredAssumed Answered

show child association properties in property page

Question asked by alex.lu on May 5, 2011
Latest reply on May 6, 2011 by alex.lu
Hello all,

There are a few posts relating showing properties of a child node in parent node's property page. But no one seemed to have made any progress. I've made some progress but still need some help.

so in web-client-config-custom.xml, I defined

   <config evaluator="node-type" condition="eum:recipientsspace">
        <property-sheet>
            <separator name="eventSep" display-label="Recipients" component-generator="HeaderSeparatorGenerator" />
            <show-child-association name="cm:contains" component-generator="RecipientsListGenerator" />
        </property-sheet>
    </config>

I also declared the generator in faces-config-custom.xml and I extended the jsf component from UIChildAssociationEditor.

public class UIRecipientsList extends UIChildAssociationEditor {


    @Override
    protected void populateAssocationMaps(Node node, NodeService nodeService) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    protected void renderReadOnlyAssociations(FacesContext context, ResponseWriter responseWriter, NodeService nodeService) throws IOException {

        TemplateService templateService = (TemplateService) FacesContextUtils.getRequiredWebApplicationContext(context).getBean("templateService");

        Map<String, Object> model = new HashMap<String, Object>();
        model.put("test", "test1");
        templateService.processTemplate("com/dods/alfresco/web/ui/repo/component/UIRecipientsPickerTest.ftl",
            model, responseWriter);
    }

    @Override
    protected void renderExistingAssociations(FacesContext context, ResponseWriter responseWriter, NodeService nodeService, boolean b) throws IOException {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    protected void removeTarget(Node node, String s) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    protected void addTarget(Node node, String[] strings) {
        //To change body of implemented methods use File | Settings | File Templates.
    }
   
    @Override
    public void encodeBegin(FacesContext context) {
       
    }
   
    @Override
    public void decode(FacesContext context) {
       
    }
}

I managed to show "test1" (that i declared) in the property page. Look at the screenshot https://docs.google.com/leaf?id=0B_-CypINafm6ZjFiMTY1YTItOTc1NC00NjIzLTlkNTctZDc0ODU1ZGEyNjUz&hl=en_GB&authkey=COmW8qcN

How do I go and get the child associations from here?

Hope someone can help. Thanks lots.

Outcomes