mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Morning merge.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2812 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package org.alfresco.web.bean.dialog;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.transaction.UserTransaction;
|
||||
@@ -25,6 +27,7 @@ import org.alfresco.web.ui.common.Utils;
|
||||
*/
|
||||
public abstract class BaseDialogBean implements IDialogBean
|
||||
{
|
||||
protected Map<String, String> parameters;
|
||||
protected boolean isFinished = false;
|
||||
|
||||
// services common to most dialogs
|
||||
@@ -36,11 +39,19 @@ public abstract class BaseDialogBean implements IDialogBean
|
||||
protected DictionaryService dictionaryService;
|
||||
protected NamespaceService namespaceService;
|
||||
|
||||
public void init()
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
// tell any beans to update themselves so the UI gets refreshed
|
||||
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
|
||||
|
||||
// store the parameters, create empty map if necessary
|
||||
this.parameters = parameters;
|
||||
|
||||
if (this.parameters == null)
|
||||
{
|
||||
this.parameters = new HashMap<String, String>();
|
||||
}
|
||||
|
||||
// reset the isFinished flag
|
||||
this.isFinished = false;
|
||||
}
|
||||
@@ -82,7 +93,7 @@ public abstract class BaseDialogBean implements IDialogBean
|
||||
// rollback the transaction
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
||||
Utils.addErrorMessage(formatErrorMessage(e));
|
||||
outcome = null;
|
||||
outcome = getErrorOutcome(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,11 +220,24 @@ public abstract class BaseDialogBean implements IDialogBean
|
||||
}
|
||||
|
||||
/**
|
||||
* The default message id to use in error messages
|
||||
*
|
||||
* @return The error message lookup id
|
||||
*/
|
||||
protected String getErrorMessageId()
|
||||
{
|
||||
return "error_generic";
|
||||
return Repository.ERROR_GENERIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* The outcome to return if the given exception occurs
|
||||
*
|
||||
* @param exception The exception that got thrown
|
||||
* @return The error outcome, null by default
|
||||
*/
|
||||
protected String getErrorOutcome(Throwable exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user