mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Big honkin' merge from head. Sheesh!
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2,6 +2,7 @@ package org.alfresco.web.bean.dialog;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
@@ -19,6 +20,7 @@ import org.alfresco.web.app.context.UIContextService;
|
||||
import org.alfresco.web.bean.BrowseBean;
|
||||
import org.alfresco.web.bean.NavigationBean;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
/**
|
||||
@@ -96,13 +98,18 @@ public abstract class BaseDialogBean implements IDialogBean
|
||||
|
||||
// rollback the transaction
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
||||
Utils.addErrorMessage(formatErrorMessage(e));
|
||||
Utils.addErrorMessage(formatErrorMessage(e), e);
|
||||
outcome = getErrorOutcome(e);
|
||||
}
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
public List<DialogButtonConfig> getAdditionalButtons()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCancelButtonLabel()
|
||||
{
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package org.alfresco.web.bean.dialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.component.UIComponent;
|
||||
@@ -9,6 +11,7 @@ import javax.faces.event.ActionEvent;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
|
||||
import org.alfresco.web.config.DialogsConfigElement.DialogConfig;
|
||||
import org.alfresco.web.ui.common.component.UIActionLink;
|
||||
|
||||
@@ -147,6 +150,17 @@ public class DialogManager
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the id of a configured action group representing the actions to
|
||||
* display for the dialog.
|
||||
*
|
||||
* @return The action group id
|
||||
*/
|
||||
public String getActions()
|
||||
{
|
||||
return this.currentDialogConfig.getActionsConfigId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the page the dialog will use
|
||||
*
|
||||
@@ -157,6 +171,51 @@ public class DialogManager
|
||||
return this.currentDialogConfig.getPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the current dialog's OK button is visible
|
||||
*
|
||||
* @return true if the OK button is visible, false if it's not
|
||||
*/
|
||||
public boolean isOKButtonVisible()
|
||||
{
|
||||
return this.currentDialogConfig.isOKButtonVisible();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of additional buttons to display in the dialog
|
||||
*
|
||||
* @return List of button configurations
|
||||
*/
|
||||
public List<DialogButtonConfig> getAdditionalButtons()
|
||||
{
|
||||
List<DialogButtonConfig> buttons = null;
|
||||
|
||||
// get a list of buttons to display from the configuration
|
||||
List<DialogButtonConfig> cfgButtons = this.currentDialogConfig.getButtons();
|
||||
|
||||
// get a list of buttons added dynamically by the dialog
|
||||
List<DialogButtonConfig> dynButtons = this.currentDialog.getAdditionalButtons();
|
||||
|
||||
if (cfgButtons != null && dynButtons != null)
|
||||
{
|
||||
// combine the two lists
|
||||
buttons = new ArrayList<DialogButtonConfig>(
|
||||
cfgButtons.size() + dynButtons.size());
|
||||
buttons.addAll(cfgButtons);
|
||||
buttons.addAll(dynButtons);
|
||||
}
|
||||
else if (cfgButtons != null && dynButtons == null)
|
||||
{
|
||||
buttons = cfgButtons;
|
||||
}
|
||||
else if (cfgButtons == null && dynButtons != null)
|
||||
{
|
||||
buttons = dynButtons;
|
||||
}
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label to use for the cancel button
|
||||
*
|
||||
|
@@ -1,7 +1,10 @@
|
||||
package org.alfresco.web.bean.dialog;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
|
||||
|
||||
/**
|
||||
* Interface that defines the contract for a dialog backing bean
|
||||
*
|
||||
@@ -30,6 +33,13 @@ public interface IDialogBean
|
||||
*/
|
||||
public String finish();
|
||||
|
||||
/**
|
||||
* Returns a list of additional buttons to display in the dialog.
|
||||
*
|
||||
* @return List of button configurations, null if there are no buttons
|
||||
*/
|
||||
public List<DialogButtonConfig> getAdditionalButtons();
|
||||
|
||||
/**
|
||||
* Returns the label to use for the cancel button
|
||||
*
|
||||
|
Reference in New Issue
Block a user