[opencms-dev] issue concerning deleting remains

bart vandendriessche bart at nascom.be
Wed Dec 29 13:44:42 CET 2004


Could anyone using opencms 5.0.1 be so kind as to tell me what is wrong 
with the following code. I've ran this as an Administrator and a 
Projectmanager, the results were the same.

    CmsJspActionElement cmsjsp = new CmsJspActionElement(pageContext, 
request, response);
    CmsObject cmso = cmsjsp.getCmsObject();

    try {
        
cmso.createResource("/","testpublish",CmsResource.C_TYPE_PLAIN_NAME);
        out.println("created");
        cmso.unlockResource("/testpublish");
        out.println("unlocked");
        cmso.publishResource("/testpublish");
        out.println("published");
        cmso.lockResource("/testpublish");
        out.println("locked");
        cmso.deleteResource("/testpublish");
        out.println("deleted");
        cmso.unlockResource("/testpublish");
        out.println("unlocked");
        cmso.publishResource("/testpublish");
        out.println("published");
    } catch ( Throwable t ) {
        out.println(t.getMessage());
        t.printStackTrace();
    }

Now anytime i run this code i get the following result:
    created
    unlocked
    published
    locked
    deleted
    com.opencms.core.CmsException: [com.opencms.file.mySql.CmsDbAccess] 
/testpublish

The point is that I don't seem to be able to delete a file from the 
offline project, and then publish this change, so the file is deleted 
from the online project.

-bart



More information about the opencms-dev mailing list