<div dir="ltr">Hi All,<div>I am trying to change a structure content in a container page via class.</div><div>I can change the Uri target to the new structured content path but the structured content's UUID does not change.</div>
<div><br></div><div>what is the proper way of doing such a thing?</div><div><br></div><div>this is currently my way:</div><div><br></div><div><div>CmsResource res = cmsObject.readResource(resourcePath); </div><div>CmsFile file = cmsObject.readFile(res);</div>
<div>CmsXmlContent xmlContent = CmsXmlContainerPageFactory.unmarshal(cmsObject, file); </div><div>List<I_CmsXmlContentValue> containers = xmlContent.getValues("Containers", locale);</div><div>for (I_CmsXmlContentValue container : containers) {</div>
<div><span class="" style="white-space:pre"> </span>I_CmsXmlContentValue containerType = xmlContent.getValue(container.getPath() + "/Type", locale);</div><div><span class="" style="white-space:pre"> </span>String containerTypeName = containerType.getStringValue(cmsObject);</div>
<div><span class="" style="white-space:pre"> </span>if (containerTypeName.equals("mycont")) {</div><div><span class="" style="white-space:pre"> </span>I_CmsXmlContentValue uri = xmlContent.getValue(container.getPath() + "/Elements/Uri", locale);</div>
<div><span class="" style="white-space:pre"> </span>uri.setStringValue(cmsObject, newResource.getRootPath());</div><div><span class="" style="white-space:pre"> </span>}</div><div>}</div></div><div><br></div><div>thank you</div>
</div>