Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2182

Unable to get Magnolia context

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an issue
    • Major
    • None
    • 3.5.8
    • None
    • None
    • Linux

    Description

      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

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              gjoseph Magnolia International
              ajit aji
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD