public MustComplyWithModelListeners( long userId, ModelListenerException modelListenerException) { super( String.format( "Password must comply with model listeners: " + modelListenerException.getMessage()), PASSWORD_INVALID); this.userId = userId; this.modelListenerException = modelListenerException; }
@Override public void onBeforeRemove(Group group) throws ModelListenerException { try { _subscriptionLocalService.deleteSubscriptions( group.getCompanyId(), JournalArticle.class.getName(), group.getGroupId()); } catch (Exception e) { throw new ModelListenerException(e); } }
@Override public void onBeforeRemove(DDMStructure ddmStructure) throws ModelListenerException { try { _journalArticleLocalService.deleteArticles( ddmStructure.getGroupId(), DDMStructure.class.getName(), ddmStructure.getStructureId()); } catch (Exception e) { throw new ModelListenerException(e); } }
@Override public void onBeforeRemove(Layout layout) throws ModelListenerException { try { _journalArticleLocalService.deleteLayoutArticleReferences( layout.getGroupId(), layout.getUuid()); _journalContentSearchLocalService.deleteLayoutContentSearches( layout.getGroupId(), layout.isPrivateLayout(), layout.getLayoutId()); } catch (Exception e) { throw new ModelListenerException(e); } }
@Override public void onBeforeRemove(BackgroundTask backgroundTask) throws ModelListenerException { Map<String, Serializable> taskContextMap = backgroundTask.getTaskContextMap(); long exportImportConfigurationId = MapUtil.getLong( taskContextMap, "exportImportConfigurationId"); if (exportImportConfigurationId == 0) { return; } try { ExportImportConfiguration exportImportConfiguration = _exportImportConfigurationLocalService. fetchExportImportConfiguration(exportImportConfigurationId); if (exportImportConfiguration == null) { return; } if (exportImportConfiguration.getStatus() == WorkflowConstants.STATUS_DRAFT) { _exportImportConfigurationLocalService. deleteExportImportConfiguration(exportImportConfiguration); } } catch (Exception e) { throw new ModelListenerException( "Unable to delete the process configuration for background " + "task " + backgroundTask.getBackgroundTaskId(), e); } }