SPage insertPage(final SPage page, final byte[] content) throws SObjectAlreadyExistsException, SObjectCreationException { final SPageLogBuilder logBuilder = getPageLog(ActionType.CREATED, "Adding a new page with name " + page.getName()); try { final SPageWithContent pageContent = new SPageWithContentImpl(page, content); final SPage pageByName = checkIfPageAlreadyExists(page); if (null != pageByName) { initiateLogBuilder(page.getId(), SQueriableLog.STATUS_FAIL, logBuilder, METHOD_NAME_ADD_PAGE); throwAlreadyExistsException(pageByName.getName()); } recorder.recordInsert(new InsertRecord(pageContent), PAGE); page.setId(pageContent.getId()); notifyPageInsert(page, content); return page; } catch (final SObjectCreationException ce) { throw ce; } catch (SRecorderException | SBonitaReadException re) { throw new SObjectCreationException(re); } }
SPage insertPage(final SPage page, final byte[] content) throws SObjectAlreadyExistsException, SObjectCreationException { final SPageLogBuilder logBuilder = getPageLog(ActionType.CREATED, "Adding a new page with name " + page.getName()); try { final SPageWithContent pageContent = new SPageWithContentImpl(page, content); final SPage pageByName = checkIfPageAlreadyExists(page); if (null != pageByName) { initiateLogBuilder(page.getId(), SQueriableLog.STATUS_FAIL, logBuilder, METHOD_NAME_ADD_PAGE); throwAlreadyExistsException(pageByName.getName()); } recorder.recordInsert(new InsertRecord(pageContent), PAGE); page.setId(pageContent.getId()); notifyPageInsert(page, content); return page; } catch (final SObjectCreationException ce) { throw ce; } catch (SRecorderException | SBonitaReadException re) { throw new SObjectCreationException(re); } }