diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index 261aa65ce9..9e0b5b47ea 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -93,8 +93,7 @@ + title-id="manage_task_title" description-id="manage_task_desc" /> add_resource /images/icons/add_item.gif - #{DialogManager.bean.prepareForAdd} + #{Container.bean.prepareForAdd} remove /images/icons/remove_item.gif - #{DialogManager.bean.removePackageItem} + #{Container.bean.removePackageItem} #{actionContext.id} @@ -76,10 +76,6 @@ - - - - diff --git a/source/java/org/alfresco/web/app/AlfrescoVariableResolver.java b/source/java/org/alfresco/web/app/AlfrescoVariableResolver.java new file mode 100644 index 0000000000..fa506da653 --- /dev/null +++ b/source/java/org/alfresco/web/app/AlfrescoVariableResolver.java @@ -0,0 +1,143 @@ +package org.alfresco.web.app; + +import javax.faces.context.FacesContext; +import javax.faces.el.EvaluationException; +import javax.faces.el.VariableResolver; + +import org.alfresco.config.Config; +import org.alfresco.config.ConfigService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.web.jsf.DelegatingVariableResolver; + +/** + * JSF VariableResolver that first delegates to the Spring JSF variable + * resolver. The sole purpose of this variable resolver is to look out + * for the Container variable. If this variable is encountered + * the current viewId is examined. If the current viewId matches the + * configured dialog or wizard container the appropriate manager object is + * returned i.e. DialogManager or WizardManager. + * + *

Configure this resolver in your faces-config.xml file as follows: + * + *

+ * <application>
+ *   ...
+ *   <variable-resolver>org.alfresco.web.app.AlfrescoVariableResolver</variable-resolver>
+ * </application>
+ * + * @see org.alfresco.web.bean.dialog.DialogManager + * @see org.alfresco.web.bean.wizard.WizardManager + * @author gavinc + */ +public class AlfrescoVariableResolver extends DelegatingVariableResolver +{ + protected String dialogContainer = null; + protected String wizardContainer = null; + + private static final String CONTAINER = "Container"; + + private static final Log logger = LogFactory.getLog(AlfrescoVariableResolver.class); + + /** + * Creates a new VariableResolver. + * + * @param originalVariableResolver The original variable resolver + */ + public AlfrescoVariableResolver(VariableResolver originalVariableResolver) + { + super(originalVariableResolver); + } + + /** + * Resolves the variable with the given name. + *

+ * This implementation will first delegate to the Spring variable resolver. + * If the variable is not found by the Spring resolver and the variable name + * is Container the current viewId is examined. + * If the current viewId matches the configured dialog or wizard container + * the appropriate manager object is returned i.e. DialogManager or WizardManager. + * + * @param context FacesContext + * @param name The name of the variable to resolve + */ + public Object resolveVariable(FacesContext context, String name) + throws EvaluationException + { + Object variable = super.resolveVariable(context, name); + + if (variable == null) + { + // if the variable was not resolved see if the name is "Container" + if (name.equals(CONTAINER)) + { + // get the current view id and the configured dialog and wizard + // container pages + String viewId = context.getViewRoot().getViewId(); + String dialogContainer = getDialogContainer(context); + String wizardContainer = getWizardContainer(context); + + // see if we are currently in a wizard or a dialog + if (viewId.equals(dialogContainer)) + { + variable = Application.getDialogManager(); + } + else if (viewId.equals(wizardContainer)) + { + variable = Application.getWizardManager(); + } + + if (variable != null && logger.isDebugEnabled()) + { + logger.debug("Resolved 'Container' variable to: " + variable); + } + } + } + + return variable; + } + + /** + * Retrieves the configured dialog container page + * + * @param context FacesContext + * @return The container page + */ + protected String getDialogContainer(FacesContext context) + { + if (this.dialogContainer == null) + { + ConfigService configSvc = Application.getConfigService(context); + Config globalConfig = configSvc.getGlobalConfig(); + + if (globalConfig != null) + { + this.dialogContainer = globalConfig.getConfigElement("dialog-container").getValue(); + } + } + + return this.dialogContainer; + } + + /** + * Retrieves the configured wizard container page + * + * @param context FacesContext + * @return The container page + */ + protected String getWizardContainer(FacesContext context) + { + if (this.wizardContainer == null) + { + ConfigService configSvc = Application.getConfigService(context); + Config globalConfig = configSvc.getGlobalConfig(); + + if (globalConfig != null) + { + this.wizardContainer = globalConfig.getConfigElement("wizard-container").getValue(); + } + } + + return this.wizardContainer; + } +} diff --git a/source/web/WEB-INF/faces-config-app.xml b/source/web/WEB-INF/faces-config-app.xml index 3637d56faa..ea4a942c45 100644 --- a/source/web/WEB-INF/faces-config-app.xml +++ b/source/web/WEB-INF/faces-config-app.xml @@ -6,7 +6,7 @@ org.alfresco.web.app.AlfrescoNavigationHandler - org.springframework.web.jsf.DelegatingVariableResolver + org.alfresco.web.app.AlfrescoVariableResolver en diff --git a/source/web/images/filetypes/tif.gif b/source/web/images/filetypes/tif.gif new file mode 100644 index 0000000000..a19a44c3f9 Binary files /dev/null and b/source/web/images/filetypes/tif.gif differ diff --git a/source/web/images/filetypes/tiff.gif b/source/web/images/filetypes/tiff.gif new file mode 100644 index 0000000000..a19a44c3f9 Binary files /dev/null and b/source/web/images/filetypes/tiff.gif differ diff --git a/source/web/images/filetypes32/tif.gif b/source/web/images/filetypes32/tif.gif new file mode 100644 index 0000000000..1ca54b78ec Binary files /dev/null and b/source/web/images/filetypes32/tif.gif differ diff --git a/source/web/images/filetypes32/tiff.gif b/source/web/images/filetypes32/tiff.gif new file mode 100644 index 0000000000..1ca54b78ec Binary files /dev/null and b/source/web/images/filetypes32/tiff.gif differ diff --git a/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp b/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp index c72f8736bd..4e2b0af400 100644 --- a/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp +++ b/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp @@ -109,29 +109,13 @@ - <%-- TODO: need to drive this dynamically from the model - need support for #{CurrentContainer....} - --%> - - - - - - - <%-- TODO: need to drive this dynamically from the model - need support for #{CurrentContainer....} - --%> - - -