diff --git a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java index 743184e29f..6f18fb00cb 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateFormWizard.java @@ -187,6 +187,14 @@ public class CreateFormWizard extends BaseWizardBean { return this.renderingEngineDescriptionAttribute; } + + public String getRenderingEngineLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.title)); + builder.append(""); + return builder.toString(); + } public String toString() { @@ -538,6 +546,18 @@ public class CreateFormWizard extends BaseWizardBean } return this.formDescriptionAttribute; } + + /** + * + * @return HTML code for the form label + */ + public String getFormLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.getFormTitle())); + builder.append(""); + return builder.toString(); + } /** * @@ -555,6 +575,24 @@ public class CreateFormWizard extends BaseWizardBean } /** + * + * @return Returns HTML code of the workflow label + */ + public String getWorkflowLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + + WorkflowDefinition wkDef = this.getDefaultWorkflowDefinition(); + if (wkDef != null) + { + builder.append(Utils.encode(wkDef.getTitle())); + } + + builder.append(""); + return builder.toString(); + } + + /** * @return Returns the output path for the rendition. */ public String getOutputPathPatternForRendition() diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java index 26a01dd8b6..82a9af2bbd 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java @@ -894,6 +894,14 @@ public class CreateWebContentWizard extends CreateContentWizard } return this.formDescriptionAttribute; } + + public String getFormLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.getFormInstanceData().getName())); + builder.append(""); + return builder.toString(); + } // ------------------------------------------------------------------------------ // Action event handlers diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java index df94156bed..c4cf8a5cba 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java @@ -1355,6 +1355,18 @@ public class CreateWebsiteWizard extends BaseWizardBean return this.websiteDescriptionAttribute; } + /** + * + * @return Returns HTML for website label + */ + public String getWebsiteLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.name)); + builder.append(""); + return builder.toString(); + } + /** * * @return Returns a HTML code for "description" attribute @@ -1455,6 +1467,14 @@ public class CreateWebsiteWizard extends BaseWizardBean } return this.formDescriptionAttribute; } + + public String getFormLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.getName())); + builder.append(""); + return builder.toString(); + } /** * @return Returns the workflow. @@ -1744,6 +1764,18 @@ public class CreateWebsiteWizard extends BaseWizardBean return this.workflowDescriptionAttribute; } + /** + * + * @return Returns HTML for the workflow label + */ + public String getWorkflowLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.title)); + builder.append(""); + return builder.toString(); + } + /** * * @return Returns HTML representation of the "description" attribute @@ -1799,6 +1831,14 @@ public class CreateWebsiteWizard extends BaseWizardBean return this.userDescriptionAttribute; } + public String getUserLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.name)); + builder.append(""); + return builder.toString(); + } + private String buildUserDescriptionAttribute() { FacesContext fc = FacesContext.getCurrentInstance(); diff --git a/source/java/org/alfresco/web/bean/wcm/DescriptionAttributeHelper.java b/source/java/org/alfresco/web/bean/wcm/DescriptionAttributeHelper.java index 5ea8e76022..1f4ce84033 100644 --- a/source/java/org/alfresco/web/bean/wcm/DescriptionAttributeHelper.java +++ b/source/java/org/alfresco/web/bean/wcm/DescriptionAttributeHelper.java @@ -3,6 +3,7 @@ package org.alfresco.web.bean.wcm; import javax.faces.context.FacesContext; import org.alfresco.web.app.Application; +import org.alfresco.web.ui.common.Utils; import org.apache.commons.lang.StringUtils; /** @@ -43,7 +44,8 @@ public class DescriptionAttributeHelper public static String getTableLine(FacesContext fc, String fieldName, String fieldValue) { StringBuilder line = new StringBuilder(128); - line.append(TRTD_BEGIN).append(Application.getMessage(fc, fieldName)).append(TD_TD).append(fieldValue).append(TDTR_END); + line.append(TRTD_BEGIN).append(Application.getMessage(fc, fieldName)). + append(TD_TD).append(Utils.encode(fieldValue)).append(TDTR_END); return line.toString(); } diff --git a/source/java/org/alfresco/web/forms/Rendition.java b/source/java/org/alfresco/web/forms/Rendition.java index 32f1d63a87..2d01f606dd 100644 --- a/source/java/org/alfresco/web/forms/Rendition.java +++ b/source/java/org/alfresco/web/forms/Rendition.java @@ -67,6 +67,9 @@ public interface Rendition /** the output stream for the rendition */ public OutputStream getOutputStream(); + /** the HTML label attribute for UI */ + public String getLabelAttribute(); + /** the HTML description attribute for UI */ public String getDescriptionAttribute(); diff --git a/source/java/org/alfresco/web/forms/RenditionImpl.java b/source/java/org/alfresco/web/forms/RenditionImpl.java index d3949a3289..c5aa6e7921 100644 --- a/source/java/org/alfresco/web/forms/RenditionImpl.java +++ b/source/java/org/alfresco/web/forms/RenditionImpl.java @@ -42,6 +42,7 @@ import org.alfresco.util.Pair; import org.alfresco.web.app.servlet.FacesHelper; import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.wcm.AVMUtil; +import org.alfresco.web.ui.common.Utils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -279,6 +280,14 @@ import org.xml.sax.SAXException; return this.descriptionAttribute; } + public String getLabelAttribute() + { + StringBuilder builder = new StringBuilder(""); + builder.append(Utils.encode(this.getName())); + builder.append(""); + return builder.toString(); + } + private String buildDescriptionAttribute() { int hashCode = hashCode(); diff --git a/source/java/org/alfresco/web/ui/common/component/UISelectList.java b/source/java/org/alfresco/web/ui/common/component/UISelectList.java index d63032817f..088f659661 100644 --- a/source/java/org/alfresco/web/ui/common/component/UISelectList.java +++ b/source/java/org/alfresco/web/ui/common/component/UISelectList.java @@ -67,6 +67,8 @@ public class UISelectList extends UIInput implements NamingContainer private int rowIndex = -1; private int itemCount; private String onchange = null; + private Boolean escapeItemLabel; + private Boolean escapeItemDescription; // ------------------------------------------------------------------------------ // Component Impl @@ -99,6 +101,8 @@ public class UISelectList extends UIInput implements NamingContainer this.activeSelect = (Boolean)values[2]; this.itemCount = (Integer)values[3]; this.onchange = (String)values[4]; + this.escapeItemLabel = (Boolean)values[5]; + this.escapeItemDescription = (Boolean)values[6]; } /** @@ -112,7 +116,9 @@ public class UISelectList extends UIInput implements NamingContainer this.multiSelect, this.activeSelect, this.itemCount, - this.onchange + this.onchange, + this.escapeItemLabel, + this.escapeItemDescription }; } @@ -326,6 +332,8 @@ public class UISelectList extends UIInput implements NamingContainer throws IOException { boolean activeSelect = isActiveSelect(); + boolean escapeLabel = getEscapeItemLabel(); + boolean escapeDescription = getEscapeItemDescription(); // begin the row, add tooltip if present String tooltip = item.getTooltip(); @@ -394,17 +402,32 @@ public class UISelectList extends UIInput implements NamingContainer } // label and description text + String label = item.getLabel(); String description = item.getDescription(); out.write("