Hello Magnolia Community,

I am new to Magnolia.  I have learned so much in the past weeks but I need some 
help regarding using Web Services to create nodes that will represent a page 
and the areas and components nested within it.  I have read the documentation 
at https://wiki.magnolia-cms.com/display/DEV/REST+webservices and I pretty much 
understood how to create an xml document that I can push to the repository 
(under Website workspace).  I was able to figure out that in order to create a 
node for a black page with a particular template, I can use the following xml...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<node>
  <type>mgnl:page</type>
  <name>My2ndExcentusPage</name>
  <path>/My2ndExcentusPage</path>
  <properties>
    <property>
      <multiple>false</multiple>
      <name>title</name>
      <type>String</type>
      <values>
        <value>My 2nd Excentus Page</value>
      </values>
    </property>
    <property>
      <multiple>false</multiple>
      <name>mgnl:template</name>
      <type>String</type>
      <values>
        <value>templating:pages/standardExcentusPageTemplateDefinition</value>
      </values>
    </property>
  </properties>
</node>

.... when I use it as a body in the webservice call to create a node, it works 
OK and it simply creates a blank page.  However what I really wanted is a 
complete page with all the nested components that I created.  I tried adding 
"children" elements for the component sub nodes but it does not render.  Please 
see the xml output of my entire page and if someone could provide me the 
correct xml format that I can use to push in the webservice call, I would 
really appreciate.  Any help or directions would be appreciated too!

<?xml version="1.0" encoding="UTF-8"?>
<sv:node sv:name="MyFirstExcentusPage" xmlns:sv="http://www.jcp.org/jcr/sv/1.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>mgnl:page</sv:value>
  </sv:property>
  <sv:property sv:name="mgnl:template" sv:type="String">
    <sv:value>templating:pages/standardExcentusPageTemplateDefinition</sv:value>
  </sv:property>
  <sv:property sv:name="title" sv:type="String">
    <sv:value>My First Excentus Page</sv:value>
  </sv:property>
  <sv:node sv:name="0">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>mgnl:component</sv:value>
    </sv:property>
    <sv:property sv:name="columns" sv:type="String">
      <sv:value>2</sv:value>
    </sv:property>
    <sv:property sv:name="mgnl:template" sv:type="String">
      <sv:value>templating:components/hbox</sv:value>
    </sv:property>
    <sv:node sv:name="main_1">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:area</sv:value>
      </sv:property>
      <sv:node sv:name="0">
        <sv:property sv:name="jcr:primaryType" sv:type="Name">
          <sv:value>mgnl:component</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:template" sv:type="String">
          <sv:value>templating:components/generic_form_panel</sv:value>
        </sv:property>
        <sv:property sv:name="title" sv:type="String">
          <sv:value>Add Member/User (Generic Form Panel)</sv:value>
        </sv:property>
        <sv:node sv:name="main">
          <sv:property sv:name="jcr:primaryType" sv:type="Name">
            <sv:value>mgnl:area</sv:value>
          </sv:property>
          <sv:node sv:name="firstname">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="label" sv:type="String">
              <sv:value>Firstname</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/generic_form_textfield</sv:value>
            </sv:property>
            <sv:property sv:name="name" sv:type="String">
              <sv:value>firstname</sv:value>
            </sv:property>
          </sv:node>
          <sv:node sv:name="lastname">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="label" sv:type="String">
              <sv:value>Lastname</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:activationStatus" sv:type="Boolean">
              <sv:value>true</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/generic_form_textfield</sv:value>
            </sv:property>
            <sv:property sv:name="name" sv:type="String">
              <sv:value>lastname</sv:value>
            </sv:property>
          </sv:node>
          <sv:node sv:name="street">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="label" sv:type="String">
              <sv:value>Street</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/generic_form_textfield</sv:value>
            </sv:property>
            <sv:property sv:name="name" sv:type="String">
              <sv:value>street</sv:value>
            </sv:property>
          </sv:node>
          <sv:node sv:name="city">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="label" sv:type="String">
              <sv:value>City</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/generic_form_textfield</sv:value>
            </sv:property>
            <sv:property sv:name="name" sv:type="String">
              <sv:value>city</sv:value>
            </sv:property>
          </sv:node>
          <sv:node sv:name="state">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="label" sv:type="String">
              <sv:value>State</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/generic_form_textfield</sv:value>
            </sv:property>
            <sv:property sv:name="name" sv:type="String">
              <sv:value>state</sv:value>
            </sv:property>
          </sv:node>
          <sv:node sv:name="zipcode">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="label" sv:type="String">
              <sv:value>Zipcode</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/generic_form_textfield</sv:value>
            </sv:property>
            <sv:property sv:name="name" sv:type="String">
              <sv:value>zipcode</sv:value>
            </sv:property>
          </sv:node>
          <sv:node sv:name="0">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              
<sv:value>templating:components/generic_form_submit_button</sv:value>
            </sv:property>
            <sv:property sv:name="text" sv:type="String">
              <sv:value>Save</sv:value>
            </sv:property>
          </sv:node>
        </sv:node>
      </sv:node>
    </sv:node>
    <sv:node sv:name="main_2">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>mgnl:area</sv:value>
      </sv:property>
      <sv:node sv:name="0">
        <sv:property sv:name="jcr:primaryType" sv:type="Name">
          <sv:value>mgnl:component</sv:value>
        </sv:property>
        <sv:property sv:name="mgnl:template" sv:type="String">
          <sv:value>templating:components/panel</sv:value>
        </sv:property>
        <sv:property sv:name="title" sv:type="String">
          <sv:value>Standard Panel</sv:value>
        </sv:property>
        <sv:node sv:name="main">
          <sv:property sv:name="jcr:primaryType" sv:type="Name">
            <sv:value>mgnl:area</sv:value>
          </sv:property>
          <sv:node sv:name="0">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/generic_plaintext</sv:value>
            </sv:property>
            <sv:property sv:name="text" sv:type="String">
              <sv:value>This is a standard panel that can hold plain text. This 
is a standard panel that can hold plain text. This is a standard panel that can 
hold plain text. This is a standard panel that can hold plain text. This is a 
standard panel that can hold plain text. This is a standard panel that can hold 
plain text.</sv:value>
            </sv:property>
          </sv:node>
          <sv:node sv:name="00">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
              <sv:value>mgnl:component</sv:value>
            </sv:property>
            <sv:property sv:name="mgnl:template" sv:type="String">
              <sv:value>templating:components/panel</sv:value>
            </sv:property>
            <sv:property sv:name="title" sv:type="String">
              <sv:value>Another Standard Panel inside another panel</sv:value>
            </sv:property>
            <sv:node sv:name="main">
              <sv:property sv:name="jcr:primaryType" sv:type="Name">
                <sv:value>mgnl:area</sv:value>
              </sv:property>
              <sv:node sv:name="0">
                <sv:property sv:name="jcr:primaryType" sv:type="Name">
                  <sv:value>mgnl:component</sv:value>
                </sv:property>
                <sv:property sv:name="mgnl:template" sv:type="String">
                  <sv:value>templating:components/generic_plaintext</sv:value>
                </sv:property>
                <sv:property sv:name="text" sv:type="String">
                  <sv:value>A Standard panel can hold a plain text content or 
it can also hold another standard panel, which can be nested in definitely! A 
Standard panel can hold a plain text content or it can also hold another 
standard panel, which can be nested in definitely! A Standard panel can hold a 
plain text content or it can also hold another standard panel, which can be 
nested in definitely! A Standard panel can hold a plain text content or it can 
also hold another standard panel, which can be nested in definitely!</sv:value>
                </sv:property>
              </sv:node>
            </sv:node>
          </sv:node>
        </sv:node>
      </sv:node>
    </sv:node>
  </sv:node>
</sv:node>



REGARDS,

DONATO :-)

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=7c777eac-21c3-402c-aaf3-a5788baecec6


----------------------------------------------------------------
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: <[email protected]>
----------------------------------------------------------------

Reply via email to