Long getPageIdOrNull(String form, long processDefinitionId) throws SBonitaReadException { SPage pageByName = pageService.getPageByNameAndProcessDefinitionId(form, processDefinitionId); if (pageByName == null) { pageByName = pageService.getPageByName(form); } return pageByName == null ? null : pageByName.getId(); }
private Long getLayoutId(final String layoutName, final String applicationToken, final ImportStatus importStatus) throws SBonitaReadException, ImportException { SPage layout = pageService.getPageByName(layoutName); if (layout == null) { return handleMissingLayout(layoutName, applicationToken, importStatus); } return layout.getId(); }
private Long getLayoutId(final String layoutName, final String applicationToken, final ImportStatus importStatus) throws SBonitaReadException, ImportException { SPage layout = pageService.getPageByName(layoutName); if (layout == null) { return handleMissingLayout(layoutName, applicationToken, importStatus); } return layout.getId(); }
Long getPageIdOrNull(String form, long processDefinitionId) throws SBonitaReadException { SPage pageByName = pageService.getPageByNameAndProcessDefinitionId(form, processDefinitionId); if (pageByName == null) { pageByName = pageService.getPageByName(form); } return pageByName == null ? null : pageByName.getId(); }
private Long getThemeId(final String themeName, final String applicationToken, final ImportStatus importStatus) throws SBonitaReadException, ImportException { SPage theme = pageService.getPageByName(themeName); if (theme == null) { return handleMissingTheme(themeName, applicationToken, importStatus); } return theme.getId(); }
private Long getThemeId(final String themeName, final String applicationToken, final ImportStatus importStatus) throws SBonitaReadException, ImportException { SPage theme = pageService.getPageByName(themeName); if (theme == null) { return handleMissingTheme(themeName, applicationToken, importStatus); } return theme.getId(); }
private Properties getProperties(final byte[] content, final boolean checkIfItAlreadyExists, final PageService pageService) throws SInvalidPageZipMissingIndexException, SInvalidPageZipMissingAPropertyException, SInvalidPageZipInconsistentException, SInvalidPageZipMissingPropertiesException, SInvalidPageTokenException, SBonitaReadException, AlreadyExistsException { final Properties properties = pageService.readPageZip(content); if (checkIfItAlreadyExists) { final String name = properties.getProperty(PageService.PROPERTIES_NAME); final SPage pageByName = pageService.getPageByName(name); if (pageByName != null) { throw new AlreadyExistsException("A page with name " + name + " already exists"); } } return properties; }
private Properties getProperties(final byte[] content, final boolean checkIfItAlreadyExists, final PageService pageService) throws SInvalidPageZipMissingIndexException, SInvalidPageZipMissingAPropertyException, SInvalidPageZipInconsistentException, SInvalidPageZipMissingPropertiesException, SInvalidPageTokenException, SBonitaReadException, AlreadyExistsException { final Properties properties = pageService.readPageZip(content); if (checkIfItAlreadyExists) { final String name = properties.getProperty(PageService.PROPERTIES_NAME); final SPage pageByName = pageService.getPageByName(name); if (pageByName != null) { throw new AlreadyExistsException("A page with name " + name + " already exists"); } } return properties; }
private Long getPageId(final String applicationToken, final String pageName) throws CreationException { try { SPage defaultLayout = pageService.getPageByName(pageName); if (defaultLayout == null) { throw new CreationException(String.format("Unable to created application with token '%s' because the page '%s' was not found.", applicationToken, pageName)); } return defaultLayout.getId(); } catch (SBonitaReadException e) { throw new CreationException(e); } }
private Long getPageId(final String applicationToken, final String pageName) throws CreationException { try { SPage defaultLayout = pageService.getPageByName(pageName); if (defaultLayout == null) { throw new CreationException(String.format("Unable to created application with token '%s' because the page '%s' was not found.", applicationToken, pageName)); } return defaultLayout.getId(); } catch (SBonitaReadException e) { throw new CreationException(e); } }
public Page getPageByName(final String name) throws PageNotFoundException { try { final SPage sPage = pageService.getPageByName(name); if (sPage == null) { throw new PageNotFoundException(name, PageAttribute.NAME); } return convertToPage(sPage); } catch (final SBonitaReadException e) { throw new PageNotFoundException(e); } }
public Page getPageByName(final String name) throws PageNotFoundException { try { final SPage sPage = pageService.getPageByName(name); if (sPage == null) { throw new PageNotFoundException(name, PageAttribute.NAME); } return convertToPage(sPage); } catch (final SBonitaReadException e) { throw new PageNotFoundException(e); } }
/** * @param applicationPageNode the XML node to convert to {@link SApplicationPage} * @param application the {@link SApplication} where the {@code SApplicationPage} will be attached * @return an ApplicationPageImportResult containing the converted {@code SApplicationPage} and an error (if any) */ public ApplicationPageImportResult toSApplicationPage(ApplicationPageNode applicationPageNode, SApplication application) throws SBonitaReadException, ImportException { String token = applicationPageNode.getToken(); importValidator.validate(token); long pageId = 0; ImportError importError = null; SPage page = pageService.getPageByName(applicationPageNode.getCustomPage()); if (page != null) { pageId = page.getId(); } else { importError = new ImportError(applicationPageNode.getCustomPage(), ImportError.Type.PAGE); } SApplicationPageBuilderFactory factory = BuilderFactory.get(SApplicationPageBuilderFactory.class); SApplicationPageBuilder builder = factory.createNewInstance(application.getId(), pageId, token); return new ApplicationPageImportResult(builder.done(), importError); }
/** * @param applicationPageNode the XML node to convert to {@link SApplicationPage} * @param application the {@link SApplication} where the {@code SApplicationPage} will be attached * @return an ApplicationPageImportResult containing the converted {@code SApplicationPage} and an error (if any) */ public ApplicationPageImportResult toSApplicationPage(ApplicationPageNode applicationPageNode, SApplication application) throws SBonitaReadException, ImportException { String token = applicationPageNode.getToken(); importValidator.validate(token); long pageId = 0; ImportError importError = null; SPage page = pageService.getPageByName(applicationPageNode.getCustomPage()); if (page != null) { pageId = page.getId(); } else { importError = new ImportError(applicationPageNode.getCustomPage(), ImportError.Type.PAGE); } SApplicationPageBuilderFactory factory = BuilderFactory.get(SApplicationPageBuilderFactory.class); SApplicationPageBuilder builder = factory.createNewInstance(application.getId(), pageId, token); return new ApplicationPageImportResult(builder.done(), importError); }