本文整理汇总了Java中framework.utils.Utilities.sendSuccessFlashMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Utilities.sendSuccessFlashMessage方法的具体用法?Java Utilities.sendSuccessFlashMessage怎么用?Java Utilities.sendSuccessFlashMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类framework.utils.Utilities
的用法示例。
在下文中一共展示了Utilities.sendSuccessFlashMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteWorkOrder
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete a work order.
*
* @param id
* the portfolio entry id
* @param workOrderId
* the work order id
*/
@With(CheckPortfolioEntryExists.class)
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_FINANCIAL_EDIT_DYNAMIC_PERMISSION)
public Result deleteWorkOrder(Long id, Long workOrderId) {
// get the work order
WorkOrder workOrder = WorkOrderDAO.getWorkOrderById(workOrderId);
// security: the portfolioEntry must be related to the object
if (!workOrder.portfolioEntry.id.equals(id)) {
return forbidden(views.html.error.access_forbidden.render(""));
}
// set the delete flag to true
workOrder.doDelete();
Utilities.sendSuccessFlashMessage(Msg.get("core.portfolio_entry_financial.work_order.deleted.successful"));
return redirect(controllers.core.routes.PortfolioEntryFinancialController.details(id));
}
示例2: delete
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete an actor.
*
* @param id
* the actor id
*/
@With(CheckActorExists.class)
@Dynamic(IMafConstants.ACTOR_DELETE_DYNAMIC_PERMISSION)
public Result delete(Long id) {
// get the actor
Actor actor = ActorDao.getActorById(id);
// delete the actor
actor.doDelete();
// success message
Utilities.sendSuccessFlashMessage(Msg.get("core.actor.delete.successful"));
return redirect(controllers.core.routes.SearchController.index());
}
示例3: deleteReportAttachment
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete an attachment of a report.
*
* @param id
* the portfolio entry id
* @param reportId
* the report id
* @param attachmentId
* the attachment id
*/
@With(CheckPortfolioEntryExists.class)
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_EDIT_DYNAMIC_PERMISSION)
public Result deleteReportAttachment(Long id, Long reportId, Long attachmentId) {
// get the report
PortfolioEntryReport report = PortfolioEntryReportDao.getPEReportById(reportId);
// get the attachment
Attachment attachment = Attachment.getAttachmentFromId(attachmentId);
// security: the report must be related to the attachment, and
// the portfolio entry to the report
if (!attachment.objectId.equals(reportId) || !report.portfolioEntry.id.equals(id)) {
return forbidden(views.html.error.access_forbidden.render(""));
}
// delete the attachment
FileAttachmentHelper.deleteFileAttachment(attachmentId, getAttachmentManagerPlugin(), getUserSessionManagerPlugin());
attachment.doDelete();
Utilities.sendSuccessFlashMessage(Msg.get("core.portfolio_entry.attachment.delete"));
return redirect(controllers.core.routes.PortfolioEntryStatusReportingController.viewReport(id, reportId));
}
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:37,代码来源:PortfolioEntryStatusReportingController.java
示例4: 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());
}
}
示例5: processManage
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Process the creation/update of a stakeholder.
*/
@With(CheckPortfolioEntryExists.class)
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_EDIT_DYNAMIC_PERMISSION)
public Result processManage() {
// bind the form
Form<StakeholderFormData> boundForm = formTemplate.bindFromRequest();
// get the portfolioEntry
Long id = Long.valueOf(request().body().asFormUrlEncoded().get("id")[0]);
PortfolioEntry portfolioEntry = PortfolioEntryDao.getPEById(id);
if (boundForm.hasErrors()) {
return ok(views.html.core.portfolioentrystakeholder.stakeholder_manage.render(portfolioEntry, boundForm));
}
StakeholderFormData stakeholderFormData = boundForm.get();
// check the unicity
Stakeholder stakeholderForUnicity = StakeholderDao.getStakeholderByActorAndTypeAndPE(stakeholderFormData.actor, stakeholderFormData.stakeholderType,
id);
if (stakeholderForUnicity != null && stakeholderForUnicity.id != stakeholderFormData.stakeholderId) {
boundForm.reject("stakeholderType", Msg.get("object.stakeholder.role.invalid"));
return ok(views.html.core.portfolioentrystakeholder.stakeholder_manage.render(portfolioEntry, boundForm));
}
// create case
if (stakeholderFormData.stakeholderId == null) {
Stakeholder stakeholder = new Stakeholder();
stakeholder.portfolioEntry = portfolioEntry;
stakeholderFormData.fill(stakeholder);
stakeholder.save();
Utilities.sendSuccessFlashMessage(Msg.get("core.portfolio_entry_stakeholder.add.successful"));
} else { // edit case
Stakeholder updStakeholder = StakeholderDao.getStakeholderById(stakeholderFormData.stakeholderId);
// security: the portfolioEntry must be related to the object
if (!updStakeholder.portfolioEntry.id.equals(id)) {
return forbidden(views.html.error.access_forbidden.render(""));
}
stakeholderFormData.fill(updStakeholder);
updStakeholder.update();
Utilities.sendSuccessFlashMessage(Msg.get("core.portfolio_entry_stakeholder.edit.successful"));
}
return redirect(controllers.core.routes.PortfolioEntryStakeholderController.index(stakeholderFormData.id));
}
示例6: processManageWorkOrder
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Save a work order.
*/
@With(CheckPortfolioEntryExists.class)
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_FINANCIAL_EDIT_DYNAMIC_PERMISSION)
public Result processManageWorkOrder() {
// bind the form
Form<WorkOrderFormData> boundForm = workOrderFormTemplate.bindFromRequest();
// get the portfolioEntry
Long id = Long.valueOf(boundForm.data().get("id"));
PortfolioEntry portfolioEntry = PortfolioEntryDao.getPEById(id);
boolean fromResource = Boolean.valueOf(boundForm.data().get("fromResource"));
// get the work order (only for edit case)
WorkOrder workOrder = null;
if (boundForm.data().get("workOrderId") != null) {
Long workOrderId = Long.valueOf(boundForm.data().get("workOrderId"));
workOrder = WorkOrderDAO.getWorkOrderById(workOrderId);
}
if (boundForm.hasErrors() || this.getCustomAttributeManagerService().validateValues(boundForm, WorkOrder.class)) {
return ok(views.html.core.portfolioentryfinancial.portfolio_entry_work_order_manage.render(portfolioEntry, fromResource, workOrder, boundForm));
}
WorkOrderFormData workOrderFormData = boundForm.get();
// if given, check the amount received (must be smaller than the amount)
if (workOrderFormData.amountReceived != null && workOrderFormData.amountReceived.doubleValue() > workOrderFormData.amount.doubleValue() + 0.01) {
boundForm.reject("amountReceived", Msg.get("object.work_order.amount_received.invalid"));
return ok(views.html.core.portfolioentryfinancial.portfolio_entry_work_order_manage.render(portfolioEntry, fromResource, workOrder, boundForm));
}
if (workOrderFormData.workOrderId == null) { // create case
workOrder = new WorkOrder();
workOrder.portfolioEntry = portfolioEntry;
workOrder.creationDate = new Date();
workOrderFormData.fill(workOrder);
workOrder.save();
Utilities.sendSuccessFlashMessage(Msg.get("core.portfolio_entry_financial.work_order.add.successful"));
} else { // edit case
workOrder = WorkOrderDAO.getWorkOrderById(workOrderFormData.workOrderId);
// security: the portfolioEntry must be related to the object
if (!workOrder.portfolioEntry.id.equals(id)) {
return forbidden(views.html.error.access_forbidden.render(""));
}
workOrderFormData.fill(workOrder);
workOrder.update();
Utilities.sendSuccessFlashMessage(Msg.get("core.portfolio_entry_financial.work_order.edit.successful"));
}
// save the custom attributes
this.getCustomAttributeManagerService().validateAndSaveValues(boundForm, WorkOrder.class, workOrder.id);
return redirect(controllers.core.routes.PortfolioEntryFinancialController.details(id));
}
示例7: savePermissions
import framework.utils.Utilities; //导入方法依赖的package包/类
public Result savePermissions() {
// bind the form
Form<KpiPermissionsFormData> boundForm = kpiPermissionsFormTemplate.bindFromRequest();
// get the KPI
Long kpiDefinitionId = Long.valueOf(boundForm.data().get("id"));
KpiDefinition kpiDefinition = KpiDefinition.getById(kpiDefinitionId);
Kpi kpi = new Kpi(kpiDefinition, getKpiService());
if (boundForm.hasErrors()) {
return ok(views.html.admin.kpi.editPermissions.render(kpiDefinition, kpi, boundForm, SystemPermission.getAllSelectableSystemPermissions()));
}
KpiPermissionsFormData kpiPermissionsFormData = boundForm.get();
kpiPermissionsFormData.fill(kpiDefinition);
kpiDefinition.update();
reloadKpiDefinition(kpiDefinition.uid);
Utilities.sendSuccessFlashMessage(Msg.get("admin.kpi.edit_permissions.successful"));
return redirect(controllers.admin.routes.KpiManagerController.view(kpiDefinition.id));
}
示例8: deleteScheduler
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete the scheduler of a KPI definition.
*
* @param kpiDefinitionId
* the KPI definition id
*/
public Result deleteScheduler(Long kpiDefinitionId) {
KpiDefinition kpiDefinition = KpiDefinition.getById(kpiDefinitionId);
kpiDefinition.schedulerFrequency = null;
kpiDefinition.schedulerRealTime = null;
kpiDefinition.schedulerStartTime = null;
kpiDefinition.save();
reloadKpiDefinition(kpiDefinition.uid);
Utilities.sendSuccessFlashMessage(Msg.get("admin.kpi.scheduler.delete"));
return redirect(controllers.admin.routes.KpiManagerController.view(kpiDefinitionId));
}
示例9: saveScheduler
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Process the edit form of the scheduler of a KPI definition.
*/
public Result saveScheduler() {
// bind the form
Form<KpiSchedulerFormData> boundForm = kpiSchedulerFormTemplate.bindFromRequest();
// get the KPI
Long kpiDefinitionId = Long.valueOf(boundForm.data().get("id"));
KpiDefinition kpiDefinition = KpiDefinition.getById(kpiDefinitionId);
Kpi kpi = new Kpi(kpiDefinition, getKpiService());
if (boundForm.hasErrors()) {
return ok(views.html.admin.kpi.editScheduler.render(kpiDefinition, kpi, boundForm));
}
KpiSchedulerFormData kpiSchedulerFormData = boundForm.get();
kpiSchedulerFormData.fill(kpiDefinition);
kpiDefinition.update();
reloadKpiDefinition(kpiDefinition.uid);
Utilities.sendSuccessFlashMessage(Msg.get("admin.kpi.editscheduler.successful"));
return redirect(controllers.admin.routes.KpiManagerController.view(kpiDefinition.id));
}
示例10: processManagePlanningPackageType
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Process the edit/create form of a planning package type.
*/
public Result processManagePlanningPackageType() {
// bind the form
Form<PortfolioEntryPlanningPackageTypeFormData> boundForm = packageTypeFormTemplate.bindFromRequest();
if (boundForm.hasErrors()) {
return ok(views.html.admin.config.datareference.planning_package.package_type_manage.render(boundForm,
Color.getColorsAsValueHolderCollection(getI18nMessagesPlugin())));
}
PortfolioEntryPlanningPackageTypeFormData planningPackageTypeFormData = boundForm.get();
PortfolioEntryPlanningPackageType packageType = null;
if (planningPackageTypeFormData.id == null) { // create case
packageType = new PortfolioEntryPlanningPackageType();
planningPackageTypeFormData.fill(packageType);
packageType.save();
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.package_type.add.successful"));
} else { // edit case
packageType = PortfolioEntryPlanningPackageDao.getPEPlanningPackageTypeById(planningPackageTypeFormData.id);
planningPackageTypeFormData.fill(packageType);
packageType.update();
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.package_type.edit.successful"));
}
planningPackageTypeFormData.name.persist(getI18nMessagesPlugin());
this.getTableProvider().flushFilterConfig();
return redirect(controllers.admin.routes.ConfigurationPlanningPackageController.list());
}
示例11: resetUserPasswordFromUid
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* The method to trigger a password reset for the specified uid.<br/>
* This sends an e-mail to the user with a validation key.
*
* @param uid
* a unique user id
* @param eraseCurrentPassword
* true if the current user password is cleared before sending
* the password reset message
* @throws Exception
* @throws AccountManagementException
*/
public void resetUserPasswordFromUid(String uid, boolean eraseCurrentPassword) throws Exception, AccountManagementException {
if (!getAccountManagerPlugin().isAuthenticationRepositoryMasterMode()) {
return;
}
IUserAccount userAccount = getAccountManagerPlugin().getUserAccountFromUid(uid);
if (userAccount == null || userAccount.isMarkedForDeletion() || !userAccount.isDisplayed()) {
throw new Exception("user not found");
}
resetUserPassword(userAccount, eraseCurrentPassword);
Utilities.sendSuccessFlashMessage(Msg.get("admin.user_manager.reset_password.success"));
}
示例12: deleteRule
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete a KPI color rule.
*
* @param kpiColorRuleId
* the KPI color rule id
*/
public Result deleteRule(Long kpiColorRuleId) {
KpiColorRule kpiColorRule = KpiColorRule.getById(kpiColorRuleId);
kpiColorRule.doDelete();
reloadKpiDefinition(kpiColorRule.kpiDefinition.uid);
Utilities.sendSuccessFlashMessage(Msg.get("admin.kpi.rule.delete"));
return redirect(controllers.admin.routes.KpiManagerController.view(kpiColorRule.kpiDefinition.id));
}
示例13: saveRequirementPriority
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Process the edit/create form of a requirement priority.
*/
public Result saveRequirementPriority() {
// bind the form
Form<RequirementPriorityFormData> boundForm = priorityFormTemplate.bindFromRequest();
if (boundForm.hasErrors()) {
return ok(views.html.admin.config.datareference.requirement.requirement_priority_manage.render(boundForm));
}
RequirementPriorityFormData priorityFormData = boundForm.get();
RequirementPriority priority = null;
if (priorityFormData.id == null) { // create case
priority = new RequirementPriority();
priorityFormData.fill(priority);
priority.save();
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.requirementpriority.add.successful"));
} else { // edit case
priority = RequirementDAO.getRequirementPriorityById(priorityFormData.id);
priorityFormData.fill(priority);
priority.update();
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.requirementpriority.edit.successful"));
}
priorityFormData.description.persist(getI18nMessagesPlugin());
priorityFormData.name.persist(getI18nMessagesPlugin());
this.getTableProvider().flushFilterConfig();
return redirect(controllers.admin.routes.ConfigurationRequirementController.list());
}
示例14: deleteRequirementPriority
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete a requirement priority.
*
* @param priorityId
* the requirement priority id
*/
public Result deleteRequirementPriority(Long priorityId) {
RequirementPriority priority = RequirementDAO.getRequirementPriorityById(priorityId);
priority.doDelete();
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.requirementpriority.delete.successful"));
this.getTableProvider().flushFilterConfig();
return redirect(controllers.admin.routes.ConfigurationRequirementController.list());
}
示例15: deleteTimesheetActivityType
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Delete a timesheet activity type.
*
* @param timesheetActivityTypeId
* the timesheet activity type id
*/
public Result deleteTimesheetActivityType(Long timesheetActivityTypeId) {
TimesheetActivityType timesheetActivityType = TimesheetDao.getTimesheetActivityTypeById(timesheetActivityTypeId);
timesheetActivityType.doDelete();
Utilities.sendSuccessFlashMessage(Msg.get("admin.configuration.reference_data.timesheetactivitytype.delete.successful"));
this.getTableProvider().flushFilterConfig();
return redirect(controllers.admin.routes.ConfigurationTimesheetActivityController.list());
}
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:20,代码来源:ConfigurationTimesheetActivityController.java