<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hello everyone,<BR>
 <BR>
I'm trying to toggle a switch within a file after I've published a file (during publication would also be okay) .  The file is an xml file, so I've figured that it would be basically be updating the xml value and then writing to the file.  So far, writing to the file has been troublesome, because I've tried doing it during the publish and I've tried immediately after the publish (using EVENT_PUBLISH_PROJECT).  btw, this is actually a follow up to the suggestion that Nacho provided about updating xml values (Thanks Nacho!).<BR>
 <BR>
Given the below code snippet, I've been having trouble when trying to lock the resource in preparation for the write command because during a "Publish Project" code sequence, the project is "Online"  (temporarily?) .  Locking a resource while the project is online throws an exception.  <BR>
 <BR>
CmsFile file = xmlDocument.getFile()<BR>
String filePath = cms.getSitePath(file);<BR>
cms.lockResource(filePath, CmsLock.TEMPORARY);     (PROBLEM!!)<BR>
file.setContents(xmlDocument.marshal());<BR>
cms.writeFile(file);<BR>
 <BR>
 <BR>
Anyway, if anyone has any advice, it'd be greatly appreciated.  Thanks so much!<BR>
 <BR>
Frank<BR><br /><hr />E-mail for the greater good. <a href='http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ GreaterGood' target='_new'>Join the i’m Initiative from Microsoft.</a></body>
</html>