Hello,

I found a solution, I create component using Java model class, I can't use 
autogenration because created component values should be dynamic (related to 
page names).

this the function I use:
[code]  static Node newNode = null;
        static public void createComponent(Node parent, String name, String 
template, Map<String,Object> content) throws AccessDeniedException, 
PathNotFoundException, RepositoryException{
                newNode = NodeUtil.createPath(parent, name, "mgnl:component");
                if (template != null) {
            NodeTypes.Renderable.set(newNode, template);
        }
                log.debug("creating component"+ newNode.getPath());
                
        for (Entry<String, Object> property : content.entrySet()) {
                        PropertyUtil.setProperty(newNode, property.getKey(), 
property.getValue());
        }
        newNode.getSession().save();
        }[/code]

Thanks,
Redouane

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=3f997b62-2b55-42a9-a8bc-610529a1d7f1


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to