<div>Hello All<span class="Apple-tab-span" style="white-space:pre"> </span> </div><div><br></div><div> // Intializing opencms shell </div><div><br></div><div> CmsShell cmsShell=new CmsShell ("-------\\deploy\\opencms.war\\WEB-INF");</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-style-span" style="font-weight: bold;"> CmsObject cmsObject = OpenCms.initCmsObject("Guest");</span></div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-style-span" style="font-weight: bold;"> CmsPublishManager publishManager = OpenCms.getPublishManager();</span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span> cmsObject.loginUser("Admin","admin");</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> cmsObject.getRequestContext().setCurrentProject(cmsObject.readProject("Offline"));</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> publishManager.initialize(cmsObject);</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> path = "/Myworkspace/";</div><div><br></div><div> // Creation and Publish Part of code</div><div><br></div>
<div><div> CmsResource createResource = cmsObject.createResource("/Myworkspace/TestFolder", CmsResourceTypeFolder.RESOURCE_TYPE_ID);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-style-span" style="font-weight: bold;">cmsObject.unlockResource("/Myworkspace/TestFolder");</span></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>boolean running = publishManager.isRunning();</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>publishManager.startPublishing();</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>System.out.println("running publish "+running);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>CmsPublishList cmsPublishList = new CmsPublishList();</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-style-span" style="font-weight: bold;">CmsUUID publishResource = publishManager.publishResource(cmsObject, resourceName);</span></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>System.out.println("after publish"+publishResource);</div><div><br></div><div><br></div><div>Is the the above code the correct way to for creation and publish of resources.</div>
<div><br></div><div>Please help me,,</div><div><br></div><div>Regards</div><div>rocks2984</div></div>