Matteo Pelucco ha scritto:
But how can I read config worskpace in order to obtain <js> content node or <css> content node starting only from a single info.magnolia.cms.beans.config.Paragraph object?

Solved for the moment with a xpath query:

        private static Content paragraph2Content(Paragraph paragraph){
                Content paragraphContent = null;
                
                // Query
        String repository = "config";
        String itemType = "mgnl:contentNode";
        String xpathQuery = "//modules/*/paragraphs/" + paragraph.getName();
        String queryType = "xpath";
        
Collection resultset = QueryUtil.query(repository, xpathQuery, queryType, itemType);

        if (resultset.size() == 1){
                // as expected, go on!
                Iterator i = resultset.iterator();
                        paragraphContent = (Content) i.next();
        }
        
        return paragraphContent;
        }



Matteo


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to