[opencms-dev] Not able to publish resource publishManager.publishResource(cmsObject, resourceName); (Opencms 7.0.5)

Govind R rocks2984 at gmail.com
Thu Nov 27 10:46:36 CET 2008


Hello All

                   // Intializing opencms shell


 CmsShell cmsShell=new CmsShell ("-------\\deploy\\opencms.war\\WEB-INF");
              CmsObject  cmsObject = OpenCms.initCmsObject("Guest");
     CmsPublishManager publishManager = OpenCms.getPublishManager();
     cmsObject.loginUser("Admin","admin");

  cmsObject.getRequestContext().setCurrentProject(cmsObject.readProject("Offline"));
      publishManager.initialize(cmsObject);
      path = "/Myworkspace/";

                                // Creation and Publish Part of code

                               CmsResource createResource =
cmsObject.createResource("/Myworkspace/TestFolder",
CmsResourceTypeFolder.RESOURCE_TYPE_ID);
cmsObject.unlockResource("/Myworkspace/TestFolder");
boolean running = publishManager.isRunning();
publishManager.startPublishing();
System.out.println("running  publish "+running);
CmsPublishList cmsPublishList = new CmsPublishList();
CmsUUID publishResource = publishManager.publishResource(cmsObject,
resourceName);
System.out.println("after publish"+publishResource);


Is the the above code the correct way to for creation and publish of
resources.

Please help me,,

Regards
rocks2984
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20081127/4c4db53d/attachment.htm>


More information about the opencms-dev mailing list