Unable to get Magnolia context
------------------------------

                 Key: MAGNOLIA-2182
                 URL: http://jira.magnolia.info/browse/MAGNOLIA-2182
             Project: Magnolia
          Issue Type: Bug
    Affects Versions: 3.5.8
         Environment: Linux
            Reporter: aji
            Assignee: Boris Kraft


 Hi All,

    Currently we are working  on magnolia integration with spring based web 
application.We are trying to render templates developed using magnolia in our 
application. Both magnolia and our application are running on the same tomcat 
server. The issue we are facing is getting MgnlContext from our application. Is 
there any document which explains clearly about  basic integration steps?

I am using below code for getting the context. Please help me with this.

if (MgnlContext.getInstance() == null) {
         MgnlContext.setInstance(new WebContextImpl());
         } 
Content pageContent = MgnlContext.getActivePage();
Collection children = pageContent.getChildren();
Iterator it = children.iterator();
        while(it.hasNext()) {
                Content child = (Content) it.next();
                %>
                <hr/>
                Handle:   <%=child.getHandle()%> <br/>
                Name:     <%=child.getName()%> <br/>
                Template: <%=child.getTemplate()%> <br/>
                UUDI:     <%=child.getUUID()%> <br/>
                Title:    <%=child.getTitle()%> <br/>
                Level:    <%=child.getLevel()%> <br/>
<%}%>
Above code is from 
http://wiki.magnolia.info/display/WIKI/Access+content+through+the+API

Thanks,
Ajit

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Reply via email to