switch (field.getKey()) { case NAME: pageUpdateBuilder.updateName(sPage.getName()); break; case DISPLAY_NAME: pageUpdateBuilder.updateDisplayName(sPage.getDisplayName()); break; case DESCRIPTION: pageUpdateBuilder.updateDescription(sPage.getDescription()); break; case CONTENT_NAME: pageUpdateBuilder.updateContentName(sPage.getContentName()); break; case CONTENT_TYPE: pageUpdateBuilder.updateContentType(sPage.getContentType()); break; case PROCESS_DEFINITION_ID: pageUpdateBuilder.updateProcessDefinitionId(sPage.getProcessDefinitionId()); break; default: pageUpdateBuilder.updateLastModificationDate(System.currentTimeMillis()); pageUpdateBuilder.updateLastUpdatedBy(userIdFromSession); updatedPage = pageService.updatePage(pageId, pageUpdateBuilder.done()); return convertToPage(updatedPage); } catch (final SObjectModificationException e) {
public void updatePageContent(final long pageId, final byte[] content) throws UpdateException, UpdatingWithInvalidPageTokenException, UpdatingWithInvalidPageZipContentException { final SPageUpdateBuilder pageUpdateBuilder = getPageUpdateBuilder(); pageUpdateBuilder.updateLastModificationDate(System.currentTimeMillis()); pageUpdateBuilder.updateLastUpdatedBy(userIdFromSession); try { final SPage page = pageService.getPage(pageId); pageService.updatePageContent(pageId, content, page.getContentName()); pageService.updatePage(pageId, pageUpdateBuilder.done()); } catch (final SInvalidPageTokenException e) { throw new UpdatingWithInvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw new UpdatingWithInvalidPageZipContentException(e.getMessage(), e); } catch (final SBonitaException sBonitaException) { throw new UpdateException(sBonitaException); } }
@Override public void updatePageContent(final long pageId, final byte[] content, final String contentName) throws SObjectModificationException, SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException { final SPageLogBuilder logBuilder = getPageLog(ActionType.UPDATED, "Update a page with name " + pageId); final Properties pageProperties = readPageZip(content, false); try { final SPageContent sPageContent = persistenceService.selectById(new SelectByIdDescriptor<>( SPageContent.class, pageId)); final SPageUpdateContentBuilder builder = BuilderFactory.get(SPageUpdateContentBuilderFactory.class) .createNewInstance(new EntityUpdateDescriptor()); builder.updateContent(content); recorder.recordUpdate(UpdateRecord.buildSetFields(sPageContent, builder.done()), PAGE); initiateLogBuilder(pageId, SQueriableLog.STATUS_OK, logBuilder, METHOD_UPDATE_PAGE); } catch (SRecorderException | SBonitaReadException re) { initiateLogBuilder(pageId, SQueriableLog.STATUS_FAIL, logBuilder, METHOD_UPDATE_PAGE); throw new SObjectModificationException(re); } final SPageUpdateBuilder pageBuilder = BuilderFactory.get(SPageUpdateBuilderFactory.class) .createNewInstance(new EntityUpdateDescriptor()); pageBuilder.updateContentName(contentName); pageBuilder.updateDescription(pageProperties.getProperty(PROPERTIES_DESCRIPTION)); pageBuilder.updateDisplayName(pageProperties.getProperty(PROPERTIES_DISPLAY_NAME)); pageBuilder.updateName(pageProperties.getProperty(PROPERTIES_NAME)); pageBuilder.updateContentType(pageProperties.getProperty(PROPERTIES_CONTENT_TYPE, SContentType.PAGE)); final SPage sPage = updatePage(pageId, pageBuilder.done()); for (final PageServiceListener pageServiceListener : pageServiceListeners) { pageServiceListener.pageUpdated(sPage, content); } }
@Override public void updatePageContent(final long pageId, final byte[] content, final String contentName) throws SObjectModificationException, SInvalidPageZipException, SInvalidPageTokenException, SObjectAlreadyExistsException { final SPageLogBuilder logBuilder = getPageLog(ActionType.UPDATED, "Update a page with name " + pageId); final Properties pageProperties = readPageZip(content, false); try { final SPageContent sPageContent = persistenceService.selectById(new SelectByIdDescriptor<>( SPageContent.class, pageId)); final SPageUpdateContentBuilder builder = BuilderFactory.get(SPageUpdateContentBuilderFactory.class) .createNewInstance(new EntityUpdateDescriptor()); builder.updateContent(content); recorder.recordUpdate(UpdateRecord.buildSetFields(sPageContent, builder.done()), PAGE); initiateLogBuilder(pageId, SQueriableLog.STATUS_OK, logBuilder, METHOD_UPDATE_PAGE); } catch (SRecorderException | SBonitaReadException re) { initiateLogBuilder(pageId, SQueriableLog.STATUS_FAIL, logBuilder, METHOD_UPDATE_PAGE); throw new SObjectModificationException(re); } final SPageUpdateBuilder pageBuilder = BuilderFactory.get(SPageUpdateBuilderFactory.class) .createNewInstance(new EntityUpdateDescriptor()); pageBuilder.updateContentName(contentName); pageBuilder.updateDescription(pageProperties.getProperty(PROPERTIES_DESCRIPTION)); pageBuilder.updateDisplayName(pageProperties.getProperty(PROPERTIES_DISPLAY_NAME)); pageBuilder.updateName(pageProperties.getProperty(PROPERTIES_NAME)); pageBuilder.updateContentType(pageProperties.getProperty(PROPERTIES_CONTENT_TYPE, SContentType.PAGE)); final SPage sPage = updatePage(pageId, pageBuilder.done()); for (final PageServiceListener pageServiceListener : pageServiceListeners) { pageServiceListener.pageUpdated(sPage, content); } }
public void updatePageContent(final long pageId, final byte[] content) throws UpdateException, UpdatingWithInvalidPageTokenException, UpdatingWithInvalidPageZipContentException { final SPageUpdateBuilder pageUpdateBuilder = getPageUpdateBuilder(); pageUpdateBuilder.updateLastModificationDate(System.currentTimeMillis()); pageUpdateBuilder.updateLastUpdatedBy(userIdFromSession); try { final SPage page = pageService.getPage(pageId); pageService.updatePageContent(pageId, content, page.getContentName()); pageService.updatePage(pageId, pageUpdateBuilder.done()); } catch (final SInvalidPageTokenException e) { throw new UpdatingWithInvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw new UpdatingWithInvalidPageZipContentException(e.getMessage(), e); } catch (final SBonitaException sBonitaException) { throw new UpdateException(sBonitaException); } }
switch (field.getKey()) { case NAME: pageUpdateBuilder.updateName(sPage.getName()); break; case DISPLAY_NAME: pageUpdateBuilder.updateDisplayName(sPage.getDisplayName()); break; case DESCRIPTION: pageUpdateBuilder.updateDescription(sPage.getDescription()); break; case CONTENT_NAME: pageUpdateBuilder.updateContentName(sPage.getContentName()); break; case CONTENT_TYPE: pageUpdateBuilder.updateContentType(sPage.getContentType()); break; case PROCESS_DEFINITION_ID: pageUpdateBuilder.updateProcessDefinitionId(sPage.getProcessDefinitionId()); break; default: pageUpdateBuilder.updateLastModificationDate(System.currentTimeMillis()); pageUpdateBuilder.updateLastUpdatedBy(userIdFromSession); updatedPage = pageService.updatePage(pageId, pageUpdateBuilder.done()); return convertToPage(updatedPage); } catch (final SObjectModificationException e) {