mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Completion of dialog framework enabling all remaining pages in the web client to be converted.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6857 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1156,4 +1156,9 @@ public class DocumentDetailsBean extends BaseDetailsBean implements IDialogBean
|
||||
{
|
||||
baseDialogBean.restored();
|
||||
}
|
||||
|
||||
public Object getActionsContext()
|
||||
{
|
||||
return baseDialogBean.getActionsContext();
|
||||
}
|
||||
}
|
||||
|
@@ -657,4 +657,9 @@ public class SpaceDetailsBean extends BaseDetailsBean implements IDialogBean
|
||||
{
|
||||
baseDialogBean.restored();
|
||||
}
|
||||
|
||||
public Object getActionsContext()
|
||||
{
|
||||
return baseDialogBean.getActionsContext();
|
||||
}
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ import java.util.Map;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -146,6 +147,8 @@ public abstract class BaseDialogBean implements IDialogBean
|
||||
|
||||
public List<DialogButtonConfig> getAdditionalButtons()
|
||||
{
|
||||
// none by default, subclasses can override if necessary
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -166,18 +169,39 @@ public abstract class BaseDialogBean implements IDialogBean
|
||||
|
||||
public String getContainerTitle()
|
||||
{
|
||||
// nothing by default, subclasses can override if necessary
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getContainerSubTitle()
|
||||
{
|
||||
// nothing by default, subclasses can override if necessary
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getContainerDescription()
|
||||
{
|
||||
// nothing by default, subclasses can override if necessary
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object getActionsContext()
|
||||
{
|
||||
// return the current node as the context for actions be default
|
||||
// dialog implementations can override this method to return the
|
||||
// appropriate object for their use case
|
||||
|
||||
if (this.navigator == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("To use actions in the dialog the 'navigator' " +
|
||||
"property must be injected with an instance of NavigationBean!");
|
||||
}
|
||||
|
||||
return this.navigator.getCurrentNode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param browseBean The BrowseBean to set.
|
||||
|
@@ -269,10 +269,20 @@ public final class DialogManager
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the page the dialog will use
|
||||
*
|
||||
* @return The page
|
||||
*/
|
||||
public String getPage()
|
||||
{
|
||||
return this.currentDialogState.getConfig().getPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the id of a configured action group representing the actions to
|
||||
* display for the dialog.
|
||||
* display for the dialog
|
||||
*
|
||||
* @return The action group id
|
||||
*/
|
||||
@@ -282,13 +292,96 @@ public final class DialogManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the page the dialog will use
|
||||
* Returns the id of a configured action group representing the
|
||||
* 'more actions' to display for the dialog
|
||||
*
|
||||
* @return The page
|
||||
* @return The action group id
|
||||
*/
|
||||
public String getPage()
|
||||
public String getMoreActions()
|
||||
{
|
||||
return this.currentDialogState.getConfig().getPage();
|
||||
return this.currentDialogState.getConfig().getMoreActionsConfigId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the object to use as the context for the main and more
|
||||
* actions that may be configured by the dialog
|
||||
*
|
||||
* @return Object to use as the context for actions, the current
|
||||
* node by default
|
||||
*/
|
||||
public Object getActionsContext()
|
||||
{
|
||||
return this.currentDialogState.getDialog().getActionsContext();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label to use for the main actions when a menu is being used
|
||||
*
|
||||
* @return The actions menu label
|
||||
*/
|
||||
public String getActionsMenuLabel()
|
||||
{
|
||||
// try and get the label via a message bundle key
|
||||
String label = this.currentDialogState.getConfig().getActionsMenuLabelId();
|
||||
|
||||
if (label != null)
|
||||
{
|
||||
label = Application.getMessage(FacesContext.getCurrentInstance(), label);
|
||||
}
|
||||
else
|
||||
{
|
||||
// try and get the description from the configuration
|
||||
label = this.currentDialogState.getConfig().getActionsMenuLabel();
|
||||
}
|
||||
|
||||
// if the label is still null use the default of 'Create'
|
||||
if (label == null)
|
||||
{
|
||||
label = Application.getMessage(FacesContext.getCurrentInstance(), "create_options");
|
||||
}
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label to use for the more actions menu
|
||||
*
|
||||
* @return The more actions menu label
|
||||
*/
|
||||
public String getMoreActionsMenuLabel()
|
||||
{
|
||||
// try and get the label via a message bundle key
|
||||
String label = this.currentDialogState.getConfig().getMoreActionsMenuLabelId();
|
||||
|
||||
if (label != null)
|
||||
{
|
||||
label = Application.getMessage(FacesContext.getCurrentInstance(), label);
|
||||
}
|
||||
else
|
||||
{
|
||||
// try and get the description from the configuration
|
||||
label = this.currentDialogState.getConfig().getMoreActionsMenuLabel();
|
||||
}
|
||||
|
||||
// if the label is still null use the default of 'More Actions'
|
||||
if (label == null)
|
||||
{
|
||||
label = Application.getMessage(FacesContext.getCurrentInstance(), "more_actions");
|
||||
}
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the main actions should be rendered as a
|
||||
* menu
|
||||
*
|
||||
* @return true to render the main set of actions as a menu, false
|
||||
* to render them as a horizontal list
|
||||
*/
|
||||
public boolean getActionsAsMenu()
|
||||
{
|
||||
return this.currentDialogState.getConfig().getActionsAsMenu();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -303,7 +396,7 @@ public final class DialogManager
|
||||
|
||||
/**
|
||||
* Determines whether the current dialog should display the next
|
||||
* and previous buttons in the header area.
|
||||
* and previous buttons in the header area
|
||||
*
|
||||
* @return true if navigation support is enabled
|
||||
*/
|
||||
@@ -314,7 +407,7 @@ public final class DialogManager
|
||||
|
||||
/**
|
||||
* Determines whether the current dialog should display the list
|
||||
* of views in the header area.
|
||||
* of views in the header area
|
||||
*
|
||||
* @return true if change view support is enabled
|
||||
*/
|
||||
@@ -325,7 +418,7 @@ public final class DialogManager
|
||||
|
||||
/**
|
||||
* Determines whether the current dialog should display the list
|
||||
* of filters in the header area.
|
||||
* of filters in the header area
|
||||
*
|
||||
* @return true if filter support is enabled
|
||||
*/
|
||||
|
@@ -116,4 +116,12 @@ public interface IDialogBean
|
||||
* @return The title or null if the title is to be acquired via configuration
|
||||
*/
|
||||
public String getContainerDescription();
|
||||
|
||||
/**
|
||||
* Returns the object to use as the context for the main and more
|
||||
* actions that may be configured by the dialog
|
||||
*
|
||||
* @return Object to use as the context for actions
|
||||
*/
|
||||
public Object getActionsContext();
|
||||
}
|
||||
|
Reference in New Issue
Block a user