diff --git a/source/java/org/alfresco/web/bean/ml/AddTranslationlDialog.java b/source/java/org/alfresco/web/bean/ml/AddTranslationDialog.java similarity index 80% rename from source/java/org/alfresco/web/bean/ml/AddTranslationlDialog.java rename to source/java/org/alfresco/web/bean/ml/AddTranslationDialog.java index befe60eb3f..2dddf6fab1 100644 --- a/source/java/org/alfresco/web/bean/ml/AddTranslationlDialog.java +++ b/source/java/org/alfresco/web/bean/ml/AddTranslationDialog.java @@ -31,17 +31,20 @@ import javax.faces.model.SelectItem; import org.alfresco.i18n.I18NUtil; import org.alfresco.service.cmr.ml.MultilingualContentService; +import org.alfresco.service.cmr.repository.ContentData; import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.web.app.servlet.DownloadContentServlet; import org.alfresco.web.bean.UserPreferencesBean; import org.alfresco.web.bean.content.AddContentDialog; import org.alfresco.web.bean.repository.Node; +import org.alfresco.web.ui.common.Utils; /** * Dialog bean to upload a new document and to add it to an existing MLContainer. * * @author yanipig */ -public class AddTranslationlDialog extends AddContentDialog +public class AddTranslationDialog extends AddContentDialog { private MultilingualContentService multilingualContentService; private UserPreferencesBean userPreferencesBean; @@ -78,12 +81,24 @@ public class AddTranslationlDialog extends AddContentDialog { // add the new file to the repository outcome = super.finishImpl(context, outcome); - + // add a new translation multilingualContentService.addTranslation(this.createdNode, this.mlTranslation, I18NUtil.parseLocale(this.language)); - - this.browseBean.setDocument(new Node(this.createdNode)); - + + // Get the content data of the translation + ContentData contentData = fileFolderService.getReader(this.createdNode).getContentData(); + + Node createdNode = new Node(this.createdNode); + + Map browseProp = createdNode.getProperties(); + browseProp.put("size", contentData.getSize()); + browseProp.put("mimetype", contentData.getMimetype()); + browseProp.put("cm:content", contentData); + browseProp.put("fileType32", Utils.getFileTypeImage(createdNode.getName(), false)); + browseProp.put("url", DownloadContentServlet.generateDownloadURL(this.createdNode, createdNode.getName())); + + this.browseBean.setDocument(createdNode); + return outcome; } diff --git a/source/java/org/alfresco/web/bean/ml/AddTranslationWithoutContentDialog.java b/source/java/org/alfresco/web/bean/ml/AddTranslationWithoutContentDialog.java index 36d8b06555..35fa820ab1 100644 --- a/source/java/org/alfresco/web/bean/ml/AddTranslationWithoutContentDialog.java +++ b/source/java/org/alfresco/web/bean/ml/AddTranslationWithoutContentDialog.java @@ -91,7 +91,7 @@ public class AddTranslationWithoutContentDialog extends BaseDialogBean nodeService.setProperty(newTranslation, ContentModel.PROP_AUTHOR, author); nodeService.setProperty(newTranslation, ContentModel.PROP_TITLE, title); - // Get the content data of the + // Get the content data of the new translation ContentData newTranslationContentData = fileFolderService.getReader(newTranslation).getContentData(); // set the current browse node diff --git a/source/java/org/alfresco/web/bean/ml/MakeMultilingualDialog.java b/source/java/org/alfresco/web/bean/ml/MakeMultilingualDialog.java index 9b86a10392..ddc96be379 100644 --- a/source/java/org/alfresco/web/bean/ml/MakeMultilingualDialog.java +++ b/source/java/org/alfresco/web/bean/ml/MakeMultilingualDialog.java @@ -159,7 +159,7 @@ public class MakeMultilingualDialog extends BaseDialogBean } else { - AddTranslationlDialog dialog = (AddTranslationlDialog) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "AddTranslationDialog"); + AddTranslationDialog dialog = (AddTranslationDialog) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "AddTranslationDialog"); dialog.start(null); return "addTranslation"; } diff --git a/source/java/org/alfresco/web/ui/common/component/UIOutputText.java b/source/java/org/alfresco/web/ui/common/component/UIOutputText.java index 3a0b1584b9..bad2ba2cbd 100644 --- a/source/java/org/alfresco/web/ui/common/component/UIOutputText.java +++ b/source/java/org/alfresco/web/ui/common/component/UIOutputText.java @@ -28,8 +28,10 @@ import java.io.IOException; import java.net.URLEncoder; import javax.faces.component.UIOutput; +import javax.faces.component.ValueHolder; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; +import javax.faces.convert.Converter; import javax.faces.el.ValueBinding; /** @@ -124,19 +126,48 @@ public class UIOutputText extends UIOutput return; } - ResponseWriter out = context.getResponseWriter(); - - String output = null; - - if (isEncodeForJavaScript()) + Object value = getValue(); + if (value != null) { - output = URLEncoder.encode((String)getValue(), "UTF-8").replace('+', ' '); + Converter converter = getConverter(); + if (converter != null) + { + value = converter.getAsString(context, this, value); + } + + ResponseWriter out = context.getResponseWriter(); + + if (isEncodeForJavaScript()) + { + out.write( URLEncoder.encode((String)getValue(), "UTF-8").replace('+', ' ') ); + } + else + { + String style = (String)getAttributes().get("style"); + String styleClass = (String)getAttributes().get("styleClass"); + if (style != null || styleClass != null) + { + out.write(""); + } + else + { + out.write(value.toString()); + } + } } - else - { - output = (String)getValue(); - } - - out.write(output); } } diff --git a/source/web/WEB-INF/alfresco.tld b/source/web/WEB-INF/alfresco.tld index dad214921f..fa121887dd 100644 --- a/source/web/WEB-INF/alfresco.tld +++ b/source/web/WEB-INF/alfresco.tld @@ -1808,6 +1808,18 @@ true true + + + styleClass + false + true + + + + style + false + true + encodeForJavaScript @@ -1978,195 +1990,8 @@ - - - outputTextExprEnable - org.apache.myfaces.taglib.html.HtmlOutputTextTag - JSP - - Renders the value of the associated UIOutput component. If this - element has an ID or CSS style properties, the text is wrapped in - a span element. - - Unless otherwise specified, all attributes accept static values - or EL expressions. - - - - - id - false - true - java.lang.String - - The developer-assigned ID of this component. The ID must be unique - within the scope of the tag's enclosing naming container (e.g. - h:form or f:subview). This value must be a static value. - - - - binding - false - false - java.lang.String - - Identifies a backing bean property (of type UIComponent or appropriate - subclass) to bind to this component instance. This value must be an - EL expression. - - - - rendered - false - false - java.lang.String - - A boolean value that indicates whether this component should be rendered. - Default value: true. - - - - value - false - false - java.lang.String - - The initial value of this component. This value is generally - set as a value-binding in the form #{myBean.myProperty}, where - myProperty can be any data-type of Java (also user-defined data-types), - if a converter for this data-type exists. - - Special cases: - - 1) f:selectItems - value needs to bind to a list (or an array) of javax.faces.model.SelectItem-instances - - 2) components implementing UISelectMany (e.g. h:selectManyCheckbox) - - value needs to bind to a list (or an array) of values, where the values need to be - of the same data-type as the choices of the associated f:selectItems-component - - 3) components implementing UIData (e.g. h:dataTable) - - value needs to bind to a list (or an array) of values, - which will be iterated over when the data-table is processed - - - - converter - false - false - java.lang.String - - An expression that specifies the Converter for this component. - If the value binding expression is a String, the String is used - as an ID to look up a Converter. If the value binding expression - is a Converter, uses that instance as the converter. - - The value can either be a static value (ID case only) or an EL expression. - - - - - dir - false - false - HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left). - - - lang - false - false - HTML: The base language of this document. - - - style - false - false - HTML: CSS styling instructions. - - - title - false - false - HTML: An advisory title for this element. Often used by the user agent as a tooltip. - - - styleClass - false - false - The CSS class for this element. Corresponds to the HTML 'class' attribute. - - - - onclick - false - false - HTML: Script to be invoked when the element is clicked. - - - ondblclick - false - false - HTML: Script to be invoked when the element is double-clicked. - - - onmousedown - false - false - HTML: Script to be invoked when the pointing device is pressed over this element. - - - onmouseup - false - false - HTML: Script to be invoked when the pointing device is released over this element. - - - onmouseover - false - false - HTML: Script to be invoked when the pointing device is moved into this element. - - - onmousemove - false - false - HTML: Script to be invoked when the pointing device is moved while it is in this element. - - - onmouseout - false - false - HTML: Script to be invoked when the pointing device is moves out of this element. - - - onkeypress - false - false - HTML: Script to be invoked when a key is pressed over this element. - - - onkeydown - false - false - HTML: Script to be invoked when a key is pressed down over this element. - - - onkeyup - false - false - HTML: Script to be invoked when a key is released over this element. - - - escape - false - false - - Indicates whether rendered markup should be escaped. - Default: true - - - - + graphicImageExprEnable org.apache.myfaces.taglib.html.HtmlGraphicImageTag diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 50f6771f36..2e005b9543 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -128,7 +128,7 @@ The bean that add a translation with a content AddTranslationDialog - org.alfresco.web.bean.ml.AddTranslationlDialog + org.alfresco.web.bean.ml.AddTranslationDialog session multilingualContentService diff --git a/source/web/jsp/ml/add-translation-dialog.jsp b/source/web/jsp/ml/add-translation-dialog.jsp index adec94d222..9786b4327e 100644 --- a/source/web/jsp/ml/add-translation-dialog.jsp +++ b/source/web/jsp/ml/add-translation-dialog.jsp @@ -33,11 +33,11 @@ <%@ page import="org.alfresco.web.app.Application" %> <%@ page import="org.alfresco.web.app.servlet.FacesHelper" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> -<%@ page import="org.alfresco.web.bean.ml.AddTranslationlDialog" %> +<%@ page import="org.alfresco.web.bean.ml.AddTranslationDialog" %> <% boolean fileUploaded = false; -AddTranslationlDialog dialog = (AddTranslationlDialog)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "AddTranslationDialog"); +AddTranslationDialog dialog = (AddTranslationDialog)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "AddTranslationDialog"); if (dialog != null && dialog.getFileName() != null) { diff --git a/source/web/jsp/ml/ml-container-details.jsp b/source/web/jsp/ml/ml-container-details.jsp index 08879ad059..9bbbd666b7 100644 --- a/source/web/jsp/ml/ml-container-details.jsp +++ b/source/web/jsp/ml/ml-container-details.jsp @@ -259,24 +259,24 @@ <%-- edition label --%> - + <%-- edition notes --%> - + <%-- edition author --%> - + <%-- edition date --%> - + - + @@ -290,11 +290,8 @@ rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10" initialSortColumn="versionName" initialSortDescending="true" style="padding-left:12px;padding-top:10px;"> - <%-- Icon details view mode --%> + <%-- Icon details view mode --%> - - - @@ -303,15 +300,15 @@ - + <%-- Versionned description --%> - + - + <%-- Versionned creation date --%> @@ -319,9 +316,9 @@ - + - + <%-- Versionned modified date --%> @@ -329,9 +326,9 @@ - + - + <%-- Versionned language --%> @@ -339,13 +336,13 @@ - + <%-- view actions --%> - +