@Override
public void doSave() throws EJbsObject {
logger.debug("Saving data...");
try {
CmsNewsEntriesRemote newsEntries = (CmsNewsEntriesRemote)ClientTools.getRemoteBean(CmsNewsEntriesRemote.class);
super.doSave();
if (this.getDlgState() == DlgState.dsInsert) {
logger.debug("Adding new entity " + this.getCmsNewsEntry().getId() + ".");
newsEntries.createDataset(this.getCmsNewsEntry(), ClientGlobals.getUser(), ClientGlobals.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
logger.debug("Saving existing entity " + this.getCmsNewsEntry().getId() + ".");
newsEntries.updateDataset(this.getCmsNewsEntry(), ClientGlobals.getUser());
}
logger.debug("Entity saved.");
} catch (NamingException e) {
logger.error("Error saving news-entry.",e);
JbsOptionPane.showErrorDialog(this, JbsL10N.getString("Generic.saveErrorMessage"));