private void updateWorksheetTemplate() throws Exception {
logger.debug("IN");
byte[] content = getTemplateContent();
ObjTemplate objTemp = createNewTemplate(content);
ExecutionInstance executionInstance = getContext().getExecutionInstance( ExecutionInstance.class.getName() );
BIObject biobj = executionInstance.getBIObject();
UserProfile userProfile = (UserProfile) this.getUserProfile();
logger.info("User with unique identifier " + userProfile.getUserUniqueIdentifier() + ", id " + userProfile.getUserId()
+ ", name " + userProfile.getUserName() + " is updating document with id " + biobj.getId()
+ ", label " + biobj.getLabel() + ", name " + biobj.getName() + "; new template is:");
logger.info(new String(objTemp.getContent()));
objDao.modifyBIObject(biobj, objTemp);
logger.debug("Template of document with id " + biobj.getId() + ", label " + biobj.getLabel() + ", name " + biobj.getName() + " updated");
JSONObject response = new JSONObject();
response.put("text", "Operation succeded");
writeBackToClient( new JSONSuccess(response) );
logger.debug("OUT");
}