diff --git a/config/alfresco/extension/web-client-config-custom.xml.sample b/config/alfresco/extension/web-client-config-custom.xml.sample index 9ce908883d..5a4f99358b 100644 --- a/config/alfresco/extension/web-client-config-custom.xml.sample +++ b/config/alfresco/extension/web-client-config-custom.xml.sample @@ -22,9 +22,9 @@ Italian Japanese Dutch - Portugese (Brazillian) + Portuguese (Brazilian) Russian - Finish + Finnish Turkish Simplified Chinese diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index aeebe538fb..96ad13489d 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -900,6 +900,12 @@ change_my_password_instructions=Enter your new password. old_password=Old Password new_password=New Password +# Workflow messages +manage_workitem=Manage WorkItem +manage_workitem_title=Manage WorkItem +manage_workitem_desc=This dialog allows the workitem to be managed +reassign=Reassign Task + # Admin Console messages title_admin_console=Administration Console admin_console=Administration Console diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index fa5eea4ae6..e34558df8e 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -5,6 +5,9 @@ + + + + + + + + + + diff --git a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java index f2a906d448..45c1c906a4 100644 --- a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java +++ b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java @@ -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; @@ -18,6 +19,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; /** @@ -102,6 +104,11 @@ public abstract class BaseDialogBean implements IDialogBean return outcome; } + + public List getAdditionalButtons() + { + return null; + } public String getCancelButtonLabel() { diff --git a/source/java/org/alfresco/web/bean/dialog/DialogManager.java b/source/java/org/alfresco/web/bean/dialog/DialogManager.java index a588eb5c77..c47c6d8c62 100644 --- a/source/java/org/alfresco/web/bean/dialog/DialogManager.java +++ b/source/java/org/alfresco/web/bean/dialog/DialogManager.java @@ -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 getAdditionalButtons() + { + List buttons = null; + + // get a list of buttons to display from the configuration + List cfgButtons = this.currentDialogConfig.getButtons(); + + // get a list of buttons added dynamically by the dialog + List dynButtons = this.currentDialog.getAdditionalButtons(); + + if (cfgButtons != null && dynButtons != null) + { + // combine the two lists + buttons = new ArrayList( + 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 * diff --git a/source/java/org/alfresco/web/bean/dialog/IDialogBean.java b/source/java/org/alfresco/web/bean/dialog/IDialogBean.java index 354129db01..fe2e9b59dc 100644 --- a/source/java/org/alfresco/web/bean/dialog/IDialogBean.java +++ b/source/java/org/alfresco/web/bean/dialog/IDialogBean.java @@ -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 getAdditionalButtons(); + /** * Returns the label to use for the cancel button * diff --git a/source/java/org/alfresco/web/bean/workflow/ManageWorkItemDialog.java b/source/java/org/alfresco/web/bean/workflow/ManageWorkItemDialog.java new file mode 100644 index 0000000000..a25eea0e9b --- /dev/null +++ b/source/java/org/alfresco/web/bean/workflow/ManageWorkItemDialog.java @@ -0,0 +1,67 @@ +package org.alfresco.web.bean.workflow; + +import java.util.ArrayList; +import java.util.List; + +import javax.faces.context.FacesContext; + +import org.alfresco.web.bean.dialog.BaseDialogBean; +import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Bean implementation for the "Manage WorkItem" dialog. + * + * @author gavinc + */ +public class ManageWorkItemDialog extends BaseDialogBean +{ + private static final Log logger = LogFactory.getLog(ManageWorkItemDialog.class); + + // ------------------------------------------------------------------------------ + // Dialog implementation + + @Override + protected String finishImpl(FacesContext context, String outcome) + throws Exception + { + return null; + } + + @Override + public List getAdditionalButtons() + { + List buttons = new ArrayList(1); + buttons.add(new DialogButtonConfig("reassign-button", + "Reassign", null, "#{ManageWorkItemDialog.reassign}", "false", null)); + + return buttons; + } + + // ------------------------------------------------------------------------------ + // Event handlers + + public void approve() + { + logger.info("approve button was pressed"); + } + + public void reject() + { + logger.info("reject button was pressed"); + } + + public void reassign() + { + logger.info("reassign button was pressed"); + } + + // ------------------------------------------------------------------------------ + // Bean Getters and Setters + + public boolean getApproveDisabled() + { + return true; + } +} diff --git a/source/java/org/alfresco/web/config/DialogsConfigElement.java b/source/java/org/alfresco/web/config/DialogsConfigElement.java index e9298ce86c..677440b564 100644 --- a/source/java/org/alfresco/web/config/DialogsConfigElement.java +++ b/source/java/org/alfresco/web/config/DialogsConfigElement.java @@ -131,12 +131,15 @@ public class DialogsConfigElement extends ConfigElementAdapter protected String description; protected String descriptionId; protected String errorMsgId = "error_dialog"; + protected boolean isOKButtonVisible = true; + protected List buttons; public DialogConfig(String name, String page, String bean, String actionsConfigId, String icon, String title, String titleId, String description, String descriptionId, - String errorMsgId) + String errorMsgId, boolean isOKButtonVisible, + List buttons) { // check the mandatory parameters are present ParameterCheck.mandatoryString("name", name); @@ -152,6 +155,8 @@ public class DialogsConfigElement extends ConfigElementAdapter this.titleId = titleId; this.description = description; this.descriptionId = descriptionId; + this.isOKButtonVisible = isOKButtonVisible; + this.buttons = buttons; if (errorMsgId != null && errorMsgId.length() > 0) { @@ -209,6 +214,16 @@ public class DialogsConfigElement extends ConfigElementAdapter return this.errorMsgId; } + public boolean isOKButtonVisible() + { + return this.isOKButtonVisible; + } + + public List getButtons() + { + return this.buttons; + } + /** * @see java.lang.Object#toString() */ @@ -225,7 +240,98 @@ public class DialogsConfigElement extends ConfigElementAdapter buffer.append(" titleId=").append(this.titleId); buffer.append(" description=").append(this.description); buffer.append(" descriptionId=").append(this.descriptionId); - buffer.append(" errorMsgId=").append(this.errorMsgId).append(")"); + buffer.append(" errorMsgId=").append(this.errorMsgId); + buffer.append(" isOKButtonVisible=").append(this.isOKButtonVisible); + buffer.append(" buttons=").append(this.buttons).append(")"); + return buffer.toString(); + } + } + + /** + * Inner class representing the configuration for an additional + * dialog button. + * + * @author gavinc + */ + public static class DialogButtonConfig + { + private String id; + private String label; + private String labelId; + private String action; + private String disabled; + private String onclick; + + public DialogButtonConfig(String id, String label, String labelId, + String action, String disabled, String onclick) + { + this.id = id; + this.label = label; + this.labelId = labelId; + this.action = action; + this.disabled = disabled; + this.onclick = onclick; + + if ((this.label == null || this.label.length() == 0) && + (this.labelId == null || this.labelId.length() == 0)) + { + throw new ConfigException("A dialog button needs to have a label or a label-id"); + } + + if (this.action == null || this.action.length() == 0) + { + throw new ConfigException("A dialog button requires an action"); + } + else if (this.action.startsWith("#{") == false) + { + throw new ConfigException("The action for a dialog button must be a method binding expression, '" + + this.action + "' is not!"); + } + } + + public String getAction() + { + return action; + } + + public String getDisabled() + { + return disabled; + } + + public String getId() + { + return id; + } + + public String getLabel() + { + return label; + } + + public String getLabelId() + { + return labelId; + } + + public String getOnclick() + { + return onclick; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + StringBuilder buffer = new StringBuilder(super.toString()); + buffer.append(" (id=").append(this.id); + buffer.append(" label=").append(this.label); + buffer.append(" label-id=").append(this.labelId); + buffer.append(" action=").append(this.action); + buffer.append(" disabled=").append(this.disabled); + buffer.append(" onclick=").append(this.onclick).append(")"); return buffer.toString(); } } diff --git a/source/java/org/alfresco/web/config/DialogsElementReader.java b/source/java/org/alfresco/web/config/DialogsElementReader.java index f0fc6f4949..7df5472757 100644 --- a/source/java/org/alfresco/web/config/DialogsElementReader.java +++ b/source/java/org/alfresco/web/config/DialogsElementReader.java @@ -16,11 +16,14 @@ */ package org.alfresco.web.config; +import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import org.alfresco.config.ConfigElement; import org.alfresco.config.ConfigException; import org.alfresco.config.xml.elementreader.ConfigElementReader; +import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig; import org.dom4j.Element; /** @@ -32,6 +35,8 @@ public class DialogsElementReader implements ConfigElementReader { public static final String ELEMENT_DIALOGS = "dialogs"; public static final String ELEMENT_DIALOG = "dialog"; + public static final String ELEMENT_BUTTONS = "buttons"; + public static final String ELEMENT_BUTTON = "button"; public static final String ATTR_NAME = "name"; public static final String ATTR_PAGE = "page"; public static final String ATTR_MANAGED_BEAN = "managed-bean"; @@ -42,10 +47,18 @@ public class DialogsElementReader implements ConfigElementReader public static final String ATTR_DESCRIPTION = "description"; public static final String ATTR_DESCRIPTION_ID = "description-id"; public static final String ATTR_ERROR_MSG_ID = "error-message-id"; + public static final String ATTR_SHOW_OK_BUTTON = "show-ok-button"; + public static final String ATTR_ID = "id"; + public static final String ATTR_LABEL = "label"; + public static final String ATTR_LABEL_ID = "label-id"; + public static final String ATTR_ACTION = "action"; + public static final String ATTR_DISABLED = "disabled"; + public static final String ATTR_ONCLICK = "onclick"; /** * @see org.alfresco.config.xml.elementreader.ConfigElementReader#parse(org.dom4j.Element) */ + @SuppressWarnings("unchecked") public ConfigElement parse(Element element) { DialogsConfigElement configElement = null; @@ -62,7 +75,7 @@ public class DialogsElementReader implements ConfigElementReader configElement = new DialogsConfigElement(); - // go through the items to show + // go through the dialogs Iterator items = element.elementIterator(ELEMENT_DIALOG); while (items.hasNext()) { @@ -78,10 +91,20 @@ public class DialogsElementReader implements ConfigElementReader String description = item.attributeValue(ATTR_DESCRIPTION); String descriptionId = item.attributeValue(ATTR_DESCRIPTION_ID); String errorMsgId = item.attributeValue(ATTR_ERROR_MSG_ID); + String showOK = item.attributeValue(ATTR_SHOW_OK_BUTTON); + + boolean isOKButtonVisible = true; + if (showOK != null) + { + isOKButtonVisible = Boolean.parseBoolean(showOK); + } + + // parse any buttons that may be present + List buttons = parseButtons(item); DialogsConfigElement.DialogConfig cfg = new DialogsConfigElement.DialogConfig( name, page, bean, actions, icon, title, titleId, description, - descriptionId, errorMsgId); + descriptionId, errorMsgId, isOKButtonVisible, buttons); configElement.addDialog(cfg); } @@ -90,4 +113,44 @@ public class DialogsElementReader implements ConfigElementReader return configElement; } + /** + * Retrieve the configuration for additional buttons. + * + * @param dialog The dialog XML element + * @return List of configured buttons + */ + @SuppressWarnings("unchecked") + protected List parseButtons(Element dialog) + { + List buttons = null; + + // iterate over any configured buttons + Element buttonsConfig = dialog.element(ELEMENT_BUTTONS); + if (buttonsConfig != null) + { + buttons = new ArrayList(4); + + Iterator children = buttonsConfig.elementIterator(ELEMENT_BUTTON); + while (children.hasNext()) + { + Element button = children.next(); + + String id = button.attributeValue(ATTR_ID); + String label = button.attributeValue(ATTR_LABEL); + String labelId = button.attributeValue(ATTR_LABEL_ID); + String action = button.attributeValue(ATTR_ACTION); + String disabled = button.attributeValue(ATTR_DISABLED); + String onclick = button.attributeValue(ATTR_ONCLICK); + + // create the button config object + DialogButtonConfig btnCfg = new DialogButtonConfig(id, label, + labelId, action, disabled, onclick); + + // add the button to the list + buttons.add(btnCfg); + } + } + + return buttons; + } } diff --git a/source/java/org/alfresco/web/ui/common/ComponentConstants.java b/source/java/org/alfresco/web/ui/common/ComponentConstants.java index 062a8afc89..6b3508a7ea 100644 --- a/source/java/org/alfresco/web/ui/common/ComponentConstants.java +++ b/source/java/org/alfresco/web/ui/common/ComponentConstants.java @@ -31,6 +31,7 @@ public final class ComponentConstants public static final String JAVAX_FACES_GRAPHIC = "javax.faces.Graphic"; public static final String JAVAX_FACES_PARAMETER = "javax.faces.Parameter"; public static final String JAVAX_FACES_MENU = "javax.faces.Menu"; + public static final String JAVAX_FACES_BUTTON = "javax.faces.Button"; /** * Private constructor diff --git a/source/java/org/alfresco/web/ui/repo/component/UIDialogButtons.java b/source/java/org/alfresco/web/ui/repo/component/UIDialogButtons.java new file mode 100644 index 0000000000..e9f19c9927 --- /dev/null +++ b/source/java/org/alfresco/web/ui/repo/component/UIDialogButtons.java @@ -0,0 +1,292 @@ +package org.alfresco.web.ui.repo.component; + +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import javax.faces.component.UICommand; +import javax.faces.component.UIComponent; +import javax.faces.component.UIOutput; +import javax.faces.component.html.HtmlCommandButton; +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; +import javax.faces.el.MethodBinding; +import javax.faces.el.ValueBinding; + +import org.alfresco.web.app.Application; +import org.alfresco.web.app.servlet.FacesHelper; +import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig; +import org.alfresco.web.ui.common.ComponentConstants; +import org.alfresco.web.ui.common.Utils; +import org.alfresco.web.ui.common.component.SelfRenderingComponent; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Component that displays the buttons for a dialog. + *

+ * The standard OK and Cancel buttons + * are always generated. Any additional buttons, either configured + * or generated dynamically by the dialog, are generated in between + * the standard buttons. + * + * @author gavinc + */ +public class UIDialogButtons extends SelfRenderingComponent +{ + protected static final String BINDING_EXPRESSION_START = "#{"; + + private static final Log logger = LogFactory.getLog(UIDialogButtons.class); + + @Override + public String getFamily() + { + return "org.alfresco.faces.DialogButtons"; + } + + @Override + public void encodeBegin(FacesContext context) throws IOException + { + if (!isRendered()) return; + + if (this.getChildCount() == 0) + { + // generate all the required buttons the first time + generateButtons(context); + } + + ResponseWriter out = context.getResponseWriter(); + out.write(""); + } + + @Override + public void encodeChildren(FacesContext context) throws IOException + { + if (!isRendered()) return; + + ResponseWriter out = context.getResponseWriter(); + + // render the buttons + for (Iterator i = getChildren().iterator(); i.hasNext(); /**/) + { + out.write(""); + } + } + + @Override + public void encodeEnd(FacesContext context) throws IOException + { + if (!isRendered()) return; + + ResponseWriter out = context.getResponseWriter(); + out.write("
"); + + UIComponent child = (UIComponent)i.next(); + Utils.encodeRecursive(context, child); + + out.write("
"); + } + + @Override + public boolean getRendersChildren() + { + return true; + } + + /** + * Generates the buttons for the dialog currently being shown. + * + * @param context Faces context + */ + @SuppressWarnings("unchecked") + protected void generateButtons(FacesContext context) + { + // generate the OK button, if necessary + if (Application.getDialogManager().isOKButtonVisible()) + { + UICommand okButton = (UICommand)context.getApplication(). + createComponent(HtmlCommandButton.COMPONENT_TYPE); + okButton.setRendererType(ComponentConstants.JAVAX_FACES_BUTTON); + FacesHelper.setupComponentId(context, okButton, "finish-button"); + + // create the binding for the finish button label + ValueBinding valueBinding = context.getApplication().createValueBinding( + "#{DialogManager.finishButtonLabel}"); + okButton.setValueBinding("value", valueBinding); + + // create the action binding + MethodBinding methodBinding = context.getApplication().createMethodBinding( + "#{DialogManager.finish}", null); + okButton.setAction(methodBinding); + + // create the binding for whether the button is disabled + valueBinding = context.getApplication().createValueBinding( + "#{DialogManager.finishButtonDisabled}"); + okButton.setValueBinding("disabled", valueBinding); + + // setup CSS class for button + String styleClass = (String)this.getAttributes().get("styleClass"); + if (styleClass != null) + { + okButton.getAttributes().put("styleClass", styleClass); + } + + // add the OK button + this.getChildren().add(okButton); + } + + // generate the additional buttons + generateAdditionalButtons(context); + + // generate the OK button + UICommand cancelButton = (UICommand)context.getApplication(). + createComponent(HtmlCommandButton.COMPONENT_TYPE); + cancelButton.setRendererType(ComponentConstants.JAVAX_FACES_BUTTON); + FacesHelper.setupComponentId(context, cancelButton, "cancel-button"); + + // create the binding for the cancel button label + ValueBinding valueBinding = context.getApplication().createValueBinding( + "#{DialogManager.cancelButtonLabel}"); + cancelButton.setValueBinding("value", valueBinding); + + // create the action binding + MethodBinding methodBinding = context.getApplication().createMethodBinding( + "#{DialogManager.cancel}", null); + cancelButton.setAction(methodBinding); + + // setup CSS class for button + String styleClass = (String)this.getAttributes().get("styleClass"); + if (styleClass != null) + { + cancelButton.getAttributes().put("styleClass", styleClass); + } + + // set the immediate flag to true + cancelButton.getAttributes().put("immediate", Boolean.TRUE); + + // add the Cancel button + this.getChildren().add(cancelButton); + } + + /** + * If there are any additional buttons to add as defined by the dialog + * configuration and the dialog at runtime they are generated in this + * method. + * + * @param context Faces context + */ + @SuppressWarnings("unchecked") + protected void generateAdditionalButtons(FacesContext context) + { + // get potential list of additional buttons + List buttons = Application.getDialogManager().getAdditionalButtons(); + + if (buttons != null && buttons.size() > 0) + { + if (logger.isDebugEnabled()) + logger.debug("Adding " + buttons.size() + " additional buttons: " + buttons); + + for (DialogButtonConfig buttonCfg : buttons) + { + UICommand button = (UICommand)context.getApplication(). + createComponent(HtmlCommandButton.COMPONENT_TYPE); + button.setRendererType(ComponentConstants.JAVAX_FACES_BUTTON); + FacesHelper.setupComponentId(context, button, buttonCfg.getId()); + + // setup the value of the button (the label) + String label = buttonCfg.getLabel(); + if (label != null) + { + // see if the label represents a value binding + if (label.startsWith(BINDING_EXPRESSION_START)) + { + ValueBinding binding = context.getApplication().createValueBinding(label); + button.setValueBinding("value", binding); + } + else + { + button.setValue(label); + } + } + else + { + // NOTE: the config checks that a label or a label id + // is present so we can assume there is an id + // if there isn't a label + String labelId = buttonCfg.getLabelId(); + label = Application.getMessage(context, labelId); + button.setValue(label); + } + + // setup the action binding, the config checks that an action + // is present so no need to check for NullPointer. It also checks + // it represents a method binding expression. + String action = buttonCfg.getAction(); + MethodBinding methodBinding = context.getApplication(). + createMethodBinding(action, null); + button.setAction(methodBinding); + + // setup the disabled attribute, check for null and + // binding expressions + String disabled = buttonCfg.getDisabled(); + if (disabled != null && disabled.length() > 0) + { + if (disabled.startsWith(BINDING_EXPRESSION_START)) + { + ValueBinding binding = context.getApplication(). + createValueBinding(disabled); + button.setValueBinding("disabled", binding); + } + else + { + button.getAttributes().put("disabled", + Boolean.parseBoolean(disabled)); + } + } + + // setup CSS class for the button + String styleClass = (String)this.getAttributes().get("styleClass"); + if (styleClass != null) + { + button.getAttributes().put("styleClass", styleClass); + } + + // setup the onclick handler for the button + String onclick = buttonCfg.getOnclick(); + if (onclick != null && onclick.length() > 0) + { + button.getAttributes().put("onclick", onclick); + } + + // add the button + this.getChildren().add(button); + + if (logger.isDebugEnabled()) + logger.debug("Added button with id of: " + button.getId()); + } + + // add a spacing row to separate the additional buttons from the Cancel button + addSpacingRow(context); + } + } + + /** + * Creates an output text component to represent a spacing row. + * + * @param context Faces context + */ + @SuppressWarnings("unchecked") + protected void addSpacingRow(FacesContext context) + { + UIOutput spacingRow = (UIOutput)context.getApplication().createComponent( + ComponentConstants.JAVAX_FACES_OUTPUT); + spacingRow.setRendererType(ComponentConstants.JAVAX_FACES_TEXT); + FacesHelper.setupComponentId(context, spacingRow, null); + spacingRow.setValue("

"); + spacingRow.getAttributes().put("escape", Boolean.FALSE); + this.getChildren().add(spacingRow); + } +} + + + diff --git a/source/java/org/alfresco/web/ui/repo/tag/DialogButtonsTag.java b/source/java/org/alfresco/web/ui/repo/tag/DialogButtonsTag.java new file mode 100644 index 0000000000..f499fd7c1f --- /dev/null +++ b/source/java/org/alfresco/web/ui/repo/tag/DialogButtonsTag.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.web.ui.repo.tag; + +import org.alfresco.web.ui.common.tag.HtmlComponentTag; + +/** + * Tag class that allows the UIDialogButtons component to be placed on a JSP. + * + * @author gavinc + */ +public class DialogButtonsTag extends HtmlComponentTag +{ + /** + * @see javax.faces.webapp.UIComponentTag#getComponentType() + */ + public String getComponentType() + { + return "org.alfresco.faces.DialogButtons"; + } + + /** + * @see javax.faces.webapp.UIComponentTag#getRendererType() + */ + public String getRendererType() + { + return null; + } +} diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 0ffa55a54e..66f69811e0 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -1687,6 +1687,42 @@ + + + The bean that backs up the Manage WorkItem Dialog + + ManageWorkItemDialog + org.alfresco.web.bean.workflow.ManageWorkItemDialog + session + + nodeService + #{NodeService} + + + fileFolderService + #{FileFolderService} + + + searchService + #{SearchService} + + + navigator + #{NavigationBean} + + + browseBean + #{BrowseBean} + + + dictionaryService + #{DictionaryService} + + + namespaceService + #{NamespaceService} + + diff --git a/source/web/WEB-INF/faces-config-repo.xml b/source/web/WEB-INF/faces-config-repo.xml index e4d3bd38ab..c7869359a3 100644 --- a/source/web/WEB-INF/faces-config-repo.xml +++ b/source/web/WEB-INF/faces-config-repo.xml @@ -129,6 +129,11 @@ org.alfresco.web.ui.repo.component.UINodeInfo + + org.alfresco.faces.DialogButtons + org.alfresco.web.ui.repo.component.UIDialogButtons + + diff --git a/source/web/WEB-INF/repo.tld b/source/web/WEB-INF/repo.tld index 02c03607b6..b3406812ba 100644 --- a/source/web/WEB-INF/repo.tld +++ b/source/web/WEB-INF/repo.tld @@ -1538,4 +1538,26 @@ + + dialogButtons + org.alfresco.web.ui.repo.tag.DialogButtonsTag + JSP + + + The dialogButtons component displays the buttons for a dialog. + + + + id + false + true + + + + styleClass + false + true + + + diff --git a/source/web/jsp/content/add-content-dialog.jsp b/source/web/jsp/content/add-content-dialog.jsp index b4d66e0ed9..70eaba69ce 100644 --- a/source/web/jsp/content/add-content-dialog.jsp +++ b/source/web/jsp/content/add-content-dialog.jsp @@ -111,7 +111,7 @@ if (dialog != null && dialog.getFileName() != null) - + <% if (fileUploaded) diff --git a/source/web/jsp/dialog/container.jsp b/source/web/jsp/dialog/container.jsp index a5dcd4cd25..0d9067e811 100644 --- a/source/web/jsp/dialog/container.jsp +++ b/source/web/jsp/dialog/container.jsp @@ -73,6 +73,11 @@
+ + + +   @@ -106,23 +111,7 @@ <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "blue", "#D3E6FE"); %> - - - - - - - -
- -
- -
+ <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "blue"); %> diff --git a/source/web/jsp/workflow/manage-workitem.jsp b/source/web/jsp/workflow/manage-workitem.jsp new file mode 100644 index 0000000000..b518813ad9 --- /dev/null +++ b/source/web/jsp/workflow/manage-workitem.jsp @@ -0,0 +1,28 @@ +<%-- + Copyright (C) 2005 Alfresco, Inc. + + Licensed under the Mozilla Public License version 1.1 + with a permitted attribution clause. You may obtain a + copy of the License at + + http://www.alfresco.org/legal/license.txt + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific + language governing permissions and limitations under the + License. +--%> +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + +<%-- + +--%> + + \ No newline at end of file