本文整理汇总了Java中framework.utils.Utilities.sendErrorFlashMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Utilities.sendErrorFlashMessage方法的具体用法?Java Utilities.sendErrorFlashMessage怎么用?Java Utilities.sendErrorFlashMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类framework.utils.Utilities
的用法示例。
在下文中一共展示了Utilities.sendErrorFlashMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteStatusType
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete a life cycle milestone instance status type.
*
* @param statusTypeId
* the status type id
*/
public Result deleteStatusType(Long statusTypeId) {
LifeCycleMilestoneInstanceStatusType statusType = LifeCycleMilestoneDao.getLCMilestoneInstanceStatusTypeById(statusTypeId);
if ((statusType.lifeCycleMilestoneInstances != null && statusType.lifeCycleMilestoneInstances.size() > 0)
|| (statusType.lifeCycleMilestones != null && statusType.lifeCycleMilestones.size() > 0)) {
Utilities.sendErrorFlashMessage(Msg.get("admin.configuration.reference_data.life_cycle_milestone_instance_status_type.delete.error"));
} else {
statusType.doDelete();
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.life_cycle_milestone_instance_status_type.delete.successful"));
this.getTableProvider().flushFilterConfig();
}
return redirect(controllers.admin.routes.ConfigurationGovernanceController.list());
}
示例2: deleteMilestone
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete a life cycle milestone.
*
* @param milestoneId
* the milestone id (set 0 for create case)
*/
public Result deleteMilestone(Long milestoneId) {
LifeCycleMilestone milestone = LifeCycleMilestoneDao.getLCMilestoneById(milestoneId);
if ((milestone.lifeCycleMilestoneInstances != null && milestone.lifeCycleMilestoneInstances.size() > 0)
|| (milestone.startLifeCyclePhases != null && milestone.startLifeCyclePhases.size() > 0)
|| (milestone.endLifeCyclePhases != null && milestone.endLifeCyclePhases.size() > 0)) {
Utilities.sendErrorFlashMessage(Msg.get("admin.configuration.reference_data.life_cycle_milestone.delete.error"));
} else {
milestone.doDelete();
// remove the planned date
LifeCyclePlanningDao.getPlannedLCMilestoneInstanceAsListByLCMilestone(milestone.id).forEach(PlannedLifeCycleMilestoneInstance::doDelete);
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.life_cycle_milestone.delete.successful"));
this.getTableProvider().flushFilterConfig();
}
return redirect(controllers.admin.routes.ConfigurationGovernanceController.viewLifeCycleProcess(milestone.lifeCycleProcess.id));
}
示例3: displayUser
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Display the user associated with the specified user id.
*
* @param uid
* a unique user id
*/
public Result displayUser(String uid) {
IUserAccount userAccount = null;
try {
userAccount = getAccountManagerPlugin().getUserAccountFromUid(uid);
// Do not display the users marked for deletion
if (userAccount == null || userAccount.isMarkedForDeletion() || !userAccount.isDisplayed()) {
Utilities.sendErrorFlashMessage(Msg.get("admin.user_manager.unknown_user"));
return displayUserSearchForm();
}
} catch (AccountManagementException e) {
return ControllersUtils.logAndReturnUnexpectedError(e, log, getConfiguration(), getI18nMessagesPlugin());
}
return ok(views.html.admin.usermanager.usermanager_display.render(getAccountManagerPlugin().isAuthenticationRepositoryMasterMode(), userAccount));
}
示例4: create
import framework.utils.Utilities; //导入方法依赖的package包/类
@Restrict({ @Group(IMafConstants.PORTFOLIO_ENTRY_SUBMISSION_PERMISSION), @Group(IMafConstants.RELEASE_SUBMISSION_PERMISSION) })
public Result create(boolean isRelease) {
try {
if (isRelease && !securityService.restrict(IMafConstants.RELEASE_SUBMISSION_PERMISSION)) {
return forbidden(views.html.error.access_forbidden.render(""));
}
if (!isRelease && !securityService.restrict(IMafConstants.PORTFOLIO_ENTRY_SUBMISSION_PERMISSION)) {
return forbidden(views.html.error.access_forbidden.render(""));
}
} catch (Exception e) {
return ControllersUtils.logAndReturnUnexpectedError(e, log, getConfiguration(), getMessagesPlugin());
}
if (!getLicensesManagementService().canCreatePortfolioEntry()) {
Utilities.sendErrorFlashMessage(Msg.get("licenses_management.cannot_create_portfolio_entry"));
}
Actor actor = ActorDao.getActorByUidOrCreateDefaultActor(this.getAccountManagerPlugin(), getUserSessionManagerPlugin().getUserSessionId(ctx()));
Form<PortfolioEntryCreateFormData> filledForm = portfolioEntryCreateFormTemplate.fill(new PortfolioEntryCreateFormData(isRelease, actor.id));
return ok(views.html.core.portfolioentry.portfolio_entry_create.render(filledForm, isRelease));
}
示例5: registerPlugin
import framework.utils.Utilities; //导入方法依赖的package包/类
@Restrict({ @Group(IMafConstants.ADMIN_PLUGIN_MANAGER_PERMISSION) })
public Result registerPlugin() {
Form<PluginRegistrationFormObject> boundForm = registrationFormTemplate.bindFromRequest();
if (boundForm.hasErrors()) {
return ok(views.html.admin.plugin.pluginmanager_registration_form.render(boundForm));
}
// Create the configuration record
PluginRegistrationFormObject pluginRegistrationFormObject = boundForm.get();
try {
getPluginManagerService().registerPlugin(pluginRegistrationFormObject.name, pluginRegistrationFormObject.identifier);
Utilities.sendSuccessFlashMessage(Msg.get("admin.plugin_manager.configuration.new.success", pluginRegistrationFormObject.name));
} catch (PluginException e) {
Utilities.sendErrorFlashMessage(Msg.get("admin.plugin_manager.configuration.new.error", pluginRegistrationFormObject.name));
log.error("Failed to register manually the plugin in the manager controller", e);
}
return redirect(routes.PluginManagerController.index());
}
示例6: unregisterPlugin
import framework.utils.Utilities; //导入方法依赖的package包/类
@Restrict({ @Group(IMafConstants.ADMIN_PLUGIN_MANAGER_PERMISSION) })
public Result unregisterPlugin(Long pluginConfigurationId) {
IPluginInfo pluginInfo = getPluginManagerService().getRegisteredPluginDescriptors().get(pluginConfigurationId);
if (pluginInfo == null) {
Utilities.sendErrorFlashMessage(Msg.get("admin.plugin_manager.configuration.view.not_exists", pluginConfigurationId));
return redirect(routes.PluginManagerController.index());
}
if (!pluginInfo.getDescriptor().autoRegister()) {
String pluginConfigurationName = pluginInfo.getPluginConfigurationName();
try {
getPluginManagerService().unregisterPlugin(pluginConfigurationId);
Utilities.sendSuccessFlashMessage(Msg.get("admin.plugin_manager.configuration.delete.success", pluginConfigurationName));
} catch (Exception e) {
Utilities.sendErrorFlashMessage(Msg.get("admin.plugin_manager.configuration.delete.error", pluginConfigurationName));
log.error("Fail to unregister a plugin configuration manually", e);
}
}
return redirect(routes.PluginManagerController.index());
}
示例7: startPlugin
import framework.utils.Utilities; //导入方法依赖的package包/类
@Restrict({ @Group(IMafConstants.ADMIN_PLUGIN_MANAGER_PERMISSION) })
public Result startPlugin(Long pluginConfigurationId) {
IPluginInfo pluginInfo = getPluginManagerService().getRegisteredPluginDescriptors().get(pluginConfigurationId);
if (pluginInfo == null) {
return badRequest();
}
if (!pluginInfo.getDescriptor().autoRegister()) {
String pluginConfigurationName = pluginInfo.getPluginConfigurationName();
try {
getPluginManagerService().startPlugin(pluginConfigurationId);
Utilities.sendSuccessFlashMessage(
Msg.get("admin.plugin_manager.configuration.view.panel.admin.start.success", Msg.get(pluginConfigurationName)));
} catch (PluginException e) {
log.error("Exception while attempting to start the plugin " + pluginConfigurationId, e);
Utilities.sendErrorFlashMessage(Msg.get("admin.plugin_manager.configuration.view.panel.admin.start.error", Msg.get(pluginConfigurationName)));
}
}
return redirect(routes.PluginManagerController.pluginConfigurationDetails(pluginConfigurationId));
}
示例8: exportConfiguration
import framework.utils.Utilities; //导入方法依赖的package包/类
@Restrict({ @Group(IMafConstants.ADMIN_PLUGIN_MANAGER_PERMISSION) })
public Result exportConfiguration(Long pluginConfigurationId) {
if (log.isDebugEnabled()) {
log.debug("Export of the configuration blocks for the plugin " + pluginConfigurationId);
}
response().setContentType("application/xml");
response().setHeader("Content-disposition", "attachment; filename=export.xml");
try {
String configuration = getPluginManagerService().exportPluginConfiguration(pluginConfigurationId);
if (log.isDebugEnabled()) {
log.debug("Found the configuration " + configuration);
}
return ok(configuration);
} catch (PluginException e) {
Utilities.sendErrorFlashMessage(Msg.get("admin.plugin_manager.configuration_block.export.error"));
return redirect(routes.PluginManagerController.pluginConfigurationDetails(pluginConfigurationId));
}
}
示例9: displayApiRegistrationUpdateForm
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Display the form to "edit" an API registration. Edit means changing the
* the authorizations. The application name cannot be changed after the
* registration is completed.
*
* @param applicationName
* the name of the application
*/
@Restrict({ @Group(IMafConstants.API_MANAGER_PERMISSION) })
public Result displayApiRegistrationUpdateForm(String applicationName) {
try {
IApiApplicationConfiguration appConfig = getApiSignatureService().getApplicationConfigurationFromApplicationName(applicationName);
ApiRegistrationObject apiRegistrationObject = new ApiRegistrationObject(appConfig);
Form<ApiRegistrationObject> loadedForm = apiRegistrationForm.fill(apiRegistrationObject);
return ok(views.html.admin.api.edit.render(loadedForm, applicationName));
} catch (Exception e) {
log.error("Error while displaying the application update form", e);
Utilities.sendErrorFlashMessage(Msg.get("admin.api_manager.unknown.application.message", applicationName));
return redirect(controllers.admin.routes.ApiManagerController.index());
}
}
示例10: editBasicData
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Display the form to edit the user basic data.
*
* @param uid
* a unique user id
*/
public Result editBasicData(String uid) {
try {
IUserAccount account = getAccountManagerPlugin().getUserAccountFromUid(uid);
if (account == null || account.isMarkedForDeletion() || !account.isDisplayed()) {
Utilities.sendErrorFlashMessage(Msg.get("admin.user_manager.unknown_user"));
return displayUserSearchForm();
}
Form<UserAccountFormData> userAccountFormLoaded = basicDataUpdateForm.fill(new UserAccountFormData(account));
return ok(views.html.admin.usermanager.usermanager_editbasicdata.render(userAccountFormLoaded));
} catch (Exception e) {
return ControllersUtils.logAndReturnUnexpectedError(e, log, getConfiguration(), getI18nMessagesPlugin());
}
}
示例11: editUserAccountType
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Display the form to edit the user account type.
*
* @param uid
* a unique user id
*/
public Result editUserAccountType(String uid) {
try {
IUserAccount account = getAccountManagerPlugin().getUserAccountFromUid(uid);
if (account == null || account.isMarkedForDeletion() || !account.isDisplayed()) {
Utilities.sendErrorFlashMessage(Msg.get("admin.user_manager.unknown_user"));
return displayUserSearchForm();
}
Form<UserAccountFormData> userAccountFormLoaded = changeAccountTypeForm.fill(new UserAccountFormData(account));
return ok(views.html.admin.usermanager.usermanager_editaccounttype.render(IUserAccount.AccountType.getValueHolder(), userAccountFormLoaded));
} catch (Exception e) {
return ControllersUtils.logAndReturnUnexpectedError(e, log, getConfiguration(), getI18nMessagesPlugin());
}
}
示例12: createActorFromUser
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Create a actor from the user data.
*/
public Result createActorFromUser() {
// get the uid
DynamicForm requestData = Form.form().bindFromRequest();
String uid = requestData.get("uid");
Actor actor = ActorDao.getActorByUid(uid);
if (actor != null) {
return redirect(controllers.admin.routes.UserManager.displayUser(uid));
}
try {
IUserAccount account = getAccountManagerPlugin().getUserAccountFromUid(uid);
if (account == null || account.isMarkedForDeletion() || !account.isDisplayed()) {
Utilities.sendErrorFlashMessage(Msg.get("admin.user_manager.unknown_user"));
return displayUserSearchForm();
}
Actor newActor = new Actor();
newActor.firstName = account.getFirstName();
newActor.isActive = true;
newActor.lastName = account.getLastName();
newActor.mail = account.getMail();
newActor.uid = uid;
newActor.save();
Utilities.sendSuccessFlashMessage(Msg.get("admin.user_manager.create.actor.create.successful"));
return redirect(controllers.admin.routes.UserManager.displayUser(uid));
} catch (Exception e) {
return ControllersUtils.logAndReturnUnexpectedError(e, log, getConfiguration(), getI18nMessagesPlugin());
}
}
示例13: editAuditable
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Display the edition form for the Auditable associated with the specified
* objectClass.
*
* @param objectClass
* an Auditable objectClass
*/
public Result editAuditable(String objectClass) {
try {
Auditable auditable = getAuditLoggerService().getAuditableFromObjectClass(objectClass);
if (auditable != null) {
Form<Auditable> loadedForm = auditableForm.fill(auditable);
return ok(views.html.admin.audit.auditable_form.render(loadedForm));
} else {
Utilities.sendErrorFlashMessage(Msg.get("admin.auditable.manage.not_found"));
return redirect(routes.AuditableController.listAuditable());
}
} catch (Exception e) {
return ControllersUtils.logAndReturnUnexpectedError(e, log, getConfiguration(), getMessagesPlugin());
}
}
示例14: pluginDefinitionDetails
import framework.utils.Utilities; //导入方法依赖的package包/类
@Restrict({ @Group(IMafConstants.ADMIN_PLUGIN_MANAGER_PERMISSION) })
public Result pluginDefinitionDetails(String pluginDefinitionIdentifier) {
IPluginDescriptor pluginDescriptor = getPluginManagerService().getPluginDescriptor(pluginDefinitionIdentifier);
if (pluginDescriptor == null) {
Utilities.sendErrorFlashMessage(Msg.get("admin.plugin_manager.definition.view.not_exists", pluginDefinitionIdentifier));
return redirect(routes.PluginManagerController.registration());
}
return ok(views.html.admin.plugin.pluginmanager_definition_details.render(pluginDescriptor,
getPluginManagerService().isPluginAvailable(pluginDescriptor.getIdentifier())));
}
示例15: pluginConfigurationDetails
import framework.utils.Utilities; //导入方法依赖的package包/类
@Restrict({ @Group(IMafConstants.ADMIN_PLUGIN_MANAGER_PERMISSION) })
public Result pluginConfigurationDetails(Long pluginConfigurationId) {
IPluginInfo pluginInfo = getPluginManagerService().getRegisteredPluginDescriptors().get(pluginConfigurationId);
if (pluginInfo == null) {
Utilities.sendErrorFlashMessage(Msg.get("admin.plugin_manager.configuration.view.not_exists", pluginConfigurationId));
return redirect(routes.PluginManagerController.index());
}
// Plugin configuration block
List<PluginConfigurationBlockObject> configurationBlocks = new ArrayList<PluginConfigurationBlockObject>();
if (pluginInfo.getDescriptor().getConfigurationBlockDescriptors() != null) {
for (IPluginConfigurationBlockDescriptor pluginConfigurationBlockDescriptor : pluginInfo.getDescriptor().getConfigurationBlockDescriptors()
.values()) {
configurationBlocks.add(new PluginConfigurationBlockObject(pluginConfigurationBlockDescriptor, pluginConfigurationId));
}
}
// Plugin logs
String uid = getUserSessionManagerPlugin().getUserSessionId(ctx());
FilterConfig<PluginLog> filterConfig = pluginLogsFilterConfig.getCurrent(uid, request());
ExpressionList<PluginLog> pluginLogExpressionList = filterConfig
.updateWithSearchExpression(PluginLog.getAllPluginLogsForPluginConfigurationId(pluginConfigurationId));
filterConfig.updateWithSortExpression(pluginLogExpressionList);
Pagination<PluginLog> pluginLogsPagination = new Pagination<PluginLog>(this.getPreferencManagerPlugin(), pluginLogExpressionList);
pluginLogsPagination.setCurrentPage(filterConfig.getCurrentPage());
Table<PluginLog> pluginLogsTable = pluginLogsTableTemplate.fill(pluginLogsPagination.getListOfObjects(), filterConfig.getColumnsToHide());
return ok(views.html.admin.plugin.pluginmanager_configuration_details.render(pluginInfo.getPluginConfigurationName(), pluginConfigurationId,
pluginInfo, configurationBlocksTableTemplate.fill(configurationBlocks), pluginLogsPagination, pluginLogsTable, filterConfig));
}